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
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-DA1PHaHi.mjs";import{t as n}from"./dry-run-qsnRlRk6.mjs";import{a as r,i,t as a}from"./context-BGm5_wTT.mjs";import{t as o}from"./local-B3zt9PXR.mjs";import{t as s}from"./output-hFMAotFl.mjs";import{t as c}from"./progress-DE_G09u2.mjs";import{t as l}from"./run-CXWkMU3x.mjs";import"./telemetry-COlodX5Z.mjs";import{i as u,o as d,r as f,t as p}from"./body-parser-HN91kAf0.mjs";import{n as m}from"./input-validation-D7z60HJH.mjs";import{a as h,i as g,n as _}from"./prompt-D274Im1O.mjs";var v={method:`GET`,path:t=>e`/accounts/${t.account_id}/workers/observability/agents/traces/${t.traceId}/events`,query:[`from`,`to`,`per_page`,`cursor`],errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,429:`TooManyRequestsError`,500:`InternalServerError`,504:`GatewayTimeoutError`}};function ee(e){return e.usage(`$0 o11y agents traces events <traceId>
|
|
3
|
+
|
|
4
|
+
Returns a page of authorized canonical otel events for a Trace containing named Agent activity, using the existing events-query flow. Searches the full 7-day retention unless from or to narrow it. Events are ordered by event timestamp and ID, newest first. Continue with result_info.cursors.after; one page is not a complete span tree.`).positional(`trace-id`,{type:`string`,description:`Trace ID: 32 hexadecimal characters, matched case-insensitively.`,demandOption:!0}).option(`from`,{type:`number`,description:`Optional. Narrows the search, which by default covers the full 7-day retention, so any retained Trace ID can be fetched without a window. Start as Unix epoch milliseconds; the effective value is in result_info.from.`}).option(`to`,{type:`number`,description:`Optional. Narrows the search; end as Unix epoch milliseconds. Defaults to now.`}).option(`per-page`,{type:`number`,description:`Maximum items to return per page. Defaults to 100.`}).option(`cursor`,{type:`string`,description:`Opaque cursor from result_info.cursors.after in the previous response. Send it with the same filters; its window replaces from and to.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const te={command:`events <traceId>`,describe:`List Agent Trace events`,builder:ee,handler:async e=>l({command:`o11y agents traces events`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let i={from:e.from,to:e.to,per_page:e[`per-page`],cursor:e.cursor};if(e.dryRun){let t=await r();n({command:`cf o11y agents traces events`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/observability/agents/traces/${e[`trace-id`]==null?`<trace-id>`:encodeURIComponent(String(e[`trace-id`]))}/events`,pathParams:{"trace-id":String(e[`trace-id`]??``)},query:i,bodyKind:`none`});return}let l=await t(e),u=e.local?o:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(v,{account_id:u,traceId:e[`trace-id`],...i}));s(d,{successLabel:`Loaded`})})};var y={method:`GET`,path:t=>e`/accounts/${t.account_id}/workers/observability/agents/traces/${t.traceId}`,query:[`from`,`to`],errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,429:`TooManyRequestsError`,500:`InternalServerError`,504:`GatewayTimeoutError`}};function b(e){return e.usage(`$0 o11y agents traces get <traceId>
|
|
5
|
+
|
|
6
|
+
Returns the summary of one Trace containing named Agent activity, with the same fields as the Trace list. Searches the full 7-day retention unless from or to narrow it. List the Trace's events with /agents/traces/{traceId}/events.`).positional(`trace-id`,{type:`string`,description:`Trace ID: 32 hexadecimal characters, matched case-insensitively.`,demandOption:!0}).option(`from`,{type:`number`,description:`Optional. Narrows the search, which by default covers the full 7-day retention, so any retained Trace ID can be fetched without a window. Start as Unix epoch milliseconds; the effective value is in result_info.from.`}).option(`to`,{type:`number`,description:`Optional. Narrows the search; end as Unix epoch milliseconds. Defaults to now.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`get <traceId>`,describe:`Get an Agent Trace`,builder:b,handler:async e=>l({command:`o11y agents traces get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let i={from:e.from,to:e.to};if(e.dryRun){let t=await r();n({command:`cf o11y agents traces get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/observability/agents/traces/${e[`trace-id`]==null?`<trace-id>`:encodeURIComponent(String(e[`trace-id`]))}`,pathParams:{"trace-id":String(e[`trace-id`]??``)},query:i,bodyKind:`none`});return}let l=await t(e),u=e.local?o:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(y,{account_id:u,traceId:e[`trace-id`],...i}));s(d,{successLabel:`Loaded`})})};var re={method:`GET`,path:t=>e`/accounts/${t.account_id}/workers/observability/agents/traces`,query:[`service`,`agent`,`from`,`to`,`per_page`,`cursor`],errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,429:`TooManyRequestsError`,500:`InternalServerError`,504:`GatewayTimeoutError`}};function ie(e){return e.usage(`$0 o11y agents traces list
|
|
7
|
+
|
|
8
|
+
Lists Traces with a named Agent invocation in the window, ordered by lastActivityMs, newest first, including work without a Conversation ID. The window defaults to the last 24 hours. Summaries include the Agent names and Conversation IDs seen, authorized Trace duration, chat input/output/total tokens, models, providers, LLM/tool call counts and span-error counts within the effective window.`).option(`service`,{type:`string`,description:`Only include work in which an Agent of this Worker service took part.`}).option(`agent`,{type:`string`,description:`Only include work in which an Agent with this gen_ai.agent.name took part. With service, both must match the same Agent.`}).option(`from`,{type:`number`,description:`Start of the search window, as Unix epoch milliseconds. Defaults to 24 hours before to. Clamped to the 7-day retention boundary; the effective value is in result_info.from.`}).option(`to`,{type:`number`,description:`End of the search window, as Unix epoch milliseconds. Defaults to now.`}).option(`per-page`,{type:`number`,description:`Maximum items to return per page. Defaults to 20.`}).option(`cursor`,{type:`string`,description:`Opaque cursor from result_info.cursors.after in the previous response. Send it with the same filters; its window replaces from and to.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ae={command:`list`,describe:`List Agent Traces`,builder:ie,handler:async e=>l({command:`o11y agents traces list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let i={service:e.service,agent:e.agent,from:e.from,to:e.to,per_page:e[`per-page`],cursor:e.cursor};if(e.dryRun){let e=await r();n({command:`cf o11y agents traces list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/agents/traces`,pathParams:{},query:i,bodyKind:`none`});return}let l=await t(e),u=e.local?o:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(re,{account_id:u,...i}));s(d,{successLabel:`Loaded`})})},oe={command:`traces`,describe:`Operations for agents.traces`,builder:e=>e.command(te).command(ne).command(ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},se={command:`agents`,describe:`Operations for agents`,builder:e=>e.command(oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var x={method:`POST`,path:t=>e`/accounts/${t.account_id}/workers/observability/destinations`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,500:`InternalServerError`}};function ce(e){return e.usage(`$0 o11y destinations create
|
|
9
|
+
|
|
10
|
+
Create a new Workers Observability Telemetry Destination.`).option(`configuration-headers`,{type:`string`,description:`The configuration.headers field. Provide as a JSON object or @path/to/file.json. Shape: {"<key>": string}.`}).option(`configuration-logpush-dataset`,{type:`string`,description:`The configuration.logpushDataset field`,choices:[`opentelemetry-traces`,`opentelemetry-logs`,`opentelemetry-metrics`]}).coerce(`configuration-logpush-dataset`,e=>m(e,`configuration-logpush-dataset`,`text`)).option(`configuration-type`,{type:`string`,description:`The configuration.type field`,choices:[`logpush`]}).coerce(`configuration-type`,e=>m(e,`configuration-type`,`text`)).option(`configuration-url`,{type:`string`,description:`The configuration.url field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`name`,{type:`string`,description:`The name field`}).option(`skip-preflight-check`,{type:`boolean`,description:`The skipPreflightCheck field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const le={command:`create`,describe:`Create Destination`,builder:ce,handler:async e=>l({command:`o11y destinations create`,classification:{safeFlags:[`configuration-logpush-dataset`,`configuration-type`,`enabled`,`skip-preflight-check`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf o11y destinations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/observability/destinations`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({configuration:{headers:u(e[`configuration-headers`],`configuration-headers`,!0),logpushDataset:e[`configuration-logpush-dataset`],type:e[`configuration-type`],url:m(e[`configuration-url`],`configuration-url`,`text`)},enabled:e.enabled,name:m(e.name,`name`,`text`),skipPreflightCheck:e[`skip-preflight-check`]},[[`configuration`,`headers`]]):f(e.body,[{path:[`configuration`,`headers`],flag:`configuration-headers`}])});return}let i=e.body===void 0?void 0:f(e.body,[{path:[`configuration`,`headers`],flag:`configuration-headers`}]),l=await t(e),d=e.local?o:await a();if(e.accountId=d,e.body!==void 0){let e=i,t=await c(`Creating`,async()=>l.send(x,{body:e,account_id:d}));s(t,{successLabel:`Created`});return}if(e[`configuration-headers`]===void 0)throw Error(`--configuration-headers is required (or pass --body with this field set).`);if(e[`configuration-logpush-dataset`]===void 0&&(e[`configuration-logpush-dataset`]=await g(`configuration-logpush-dataset`,`The configuration.logpushDataset field`,[`opentelemetry-traces`,`opentelemetry-logs`,`opentelemetry-metrics`])),e[`configuration-type`]===void 0&&(e[`configuration-type`]=await g(`configuration-type`,`The configuration.type field`,[`logpush`])),e[`configuration-url`]===void 0&&(e[`configuration-url`]=await h(`configuration-url`,`The configuration.url field`)),e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);e.name===void 0&&(e.name=await h(`name`,`The name field`));let _=p({configuration:{headers:u(e[`configuration-headers`],`configuration-headers`,!0),logpushDataset:e[`configuration-logpush-dataset`],type:e[`configuration-type`],url:m(e[`configuration-url`],`configuration-url`,`text`)},enabled:e.enabled,name:m(e.name,`name`,`text`),skipPreflightCheck:e[`skip-preflight-check`]},[[`configuration`,`headers`]]),v=await c(`Creating`,async()=>l.send(x,{body:_,account_id:d}));s(v,{successLabel:`Created`})})};var ue={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/workers/observability/destinations/${t.slug}`,errors:{401:`UnauthorizedError`,404:`NotFoundError`,409:`ConflictError`,500:`InternalServerError`}};function de(e){return e.usage(`$0 o11y destinations delete <slug>
|
|
11
|
+
|
|
12
|
+
Delete a Workers Observability Telemetry Destination.`).positional(`slug`,{type:`string`,description:`Slug`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const fe={command:`delete <slug>`,describe:`Delete Destination`,builder:de,handler:async e=>l({command:`o11y destinations delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf o11y destinations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/observability/destinations/${e.slug==null?`<slug>`:encodeURIComponent(String(e.slug))}`,pathParams:{slug:String(e.slug??``)},bodyKind:`none`});return}let i=await t(e),l=e.local?o:await a();if(e.accountId=l,!await _({force:!!e.force}))return;let u=await c(`Deleting`,async()=>i.send(ue,{account_id:l,slug:e.slug}));s(u,{successLabel:`Deleted`})})};var pe={method:`GET`,path:t=>e`/accounts/${t.account_id}/workers/observability/destinations`,query:[`page`,`perPage`,`order`,`orderBy`],errors:{401:`UnauthorizedError`,404:`NotFoundError`,500:`InternalServerError`}};function me(e){return e.usage(`$0 o11y destinations list
|
|
13
|
+
|
|
14
|
+
List your Workers Observability Telemetry Destinations.`).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`PerPage`}).option(`order`,{type:`string`,description:`Order`,choices:[`asc`,`desc`]}).option(`order-by`,{type:`string`,description:`OrderBy`,choices:[`created`,`updated`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const he={command:`list`,describe:`Get Destinations`,builder:me,handler:async e=>l({command:`o11y destinations list`,classification:{safeFlags:[`order`,`order-by`,`dry-run`]}},e,async()=>{let i={page:e.page,perPage:e[`per-page`],order:e.order,orderBy:e[`order-by`]};if(e.dryRun){let e=await r();n({command:`cf o11y destinations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/destinations`,pathParams:{},query:i,bodyKind:`none`});return}let l=await t(e),u=e.local?o:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(pe,{account_id:u,...i}));s(d,{successLabel:`Loaded`})})};var S={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/workers/observability/destinations/${t.slug}`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,404:`NotFoundError`,409:`ConflictError`,500:`InternalServerError`}};function ge(e){return e.usage(`$0 o11y destinations update <slug>
|
|
15
|
+
|
|
16
|
+
Update an existing Workers Observability Telemetry Destination.`).positional(`slug`,{type:`string`,description:`Slug`,demandOption:!0}).option(`configuration-headers`,{type:`string`,description:`The configuration.headers field. Provide as a JSON object or @path/to/file.json. Shape: {"<key>": (string | null)}.`}).option(`configuration-replace-headers`,{type:`boolean`,description:`The configuration.replaceHeaders field`}).option(`configuration-type`,{type:`string`,description:`The configuration.type field`,choices:[`logpush`]}).coerce(`configuration-type`,e=>m(e,`configuration-type`,`text`)).option(`configuration-url`,{type:`string`,description:`The configuration.url field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{let t=[`configuration-headers`,`configuration-replace-headers`,`configuration-type`,`configuration-url`].some(t=>e[t]!==void 0);if(!e.body&&t){let t=[`configuration-headers`,`configuration-type`,`configuration-url`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --configuration-* flag is set`)}return!0})}const C={command:`update <slug>`,describe:`Update Destination`,builder:ge,handler:async e=>l({command:`o11y destinations update`,classification:{safeFlags:[`configuration-replace-headers`,`configuration-type`,`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf o11y destinations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/observability/destinations/${e.slug==null?`<slug>`:encodeURIComponent(String(e.slug))}`,pathParams:{slug:String(e.slug??``)},bodyKind:`json`,body:e.body===void 0?p({configuration:{headers:u(e[`configuration-headers`],`configuration-headers`),replaceHeaders:e[`configuration-replace-headers`],type:e[`configuration-type`],url:m(e[`configuration-url`],`configuration-url`,`text`)},enabled:e.enabled},[[`configuration`,`headers`]]):f(e.body)});return}let i=e.body===void 0?void 0:f(e.body),l=await t(e),d=e.local?o:await a();if(e.accountId=d,e.body!==void 0){let t=i,n=await c(`Updating`,async()=>l.send(S,{body:t,account_id:d,slug:e.slug}));s(n,{successLabel:`Updated`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let h=p({configuration:{headers:u(e[`configuration-headers`],`configuration-headers`),replaceHeaders:e[`configuration-replace-headers`],type:e[`configuration-type`],url:m(e[`configuration-url`],`configuration-url`,`text`)},enabled:e.enabled},[[`configuration`,`headers`]]),g=await c(`Updating`,async()=>l.send(S,{body:h,account_id:d,slug:e.slug}));s(g,{successLabel:`Updated`})})},w={command:`destinations`,describe:`Operations for destinations`,builder:e=>e.command(le).command(fe).command(he).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var T={method:`POST`,path:t=>e`/accounts/${t.account_id}/workers/observability/issues/groups/${t.groupId}/members`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,409:`ConflictError`,500:`InternalServerError`}};function E(e){return e.usage(`$0 o11y issues add <groupId>
|
|
17
|
+
|
|
18
|
+
Add one or more ungrouped issues to an existing issue group.`).positional(`group-id`,{type:`string`,description:`GroupId`,demandOption:!0}).option(`issue-ids`,{type:`string`,array:!0,description:`The issueIds field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const D={command:`add <groupId>`,describe:`Add issue group members`,builder:E,handler:async e=>l({command:`o11y issues add`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf o11y issues add`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/observability/issues/groups/${e[`group-id`]==null?`<group-id>`:encodeURIComponent(String(e[`group-id`]))}/members`,pathParams:{"group-id":String(e[`group-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({issueIds:e[`issue-ids`]}):f(e.body)});return}let i=e.body===void 0?void 0:f(e.body),l=await t(e),u=e.local?o:await a();if(e.accountId=u,e.body!==void 0){let t=i,n=await c(`Creating`,async()=>l.send(T,{body:t,account_id:u,groupId:e[`group-id`]}));s(n,{successLabel:`Created`});return}if(e[`issue-ids`]===void 0)throw Error(`--issue-ids is required (or pass --body with this field set).`);let d=p({issueIds:e[`issue-ids`]}),m=await c(`Creating`,async()=>l.send(T,{body:d,account_id:u,groupId:e[`group-id`]}));s(m,{successLabel:`Created`})})};var O={method:`POST`,path:t=>e`/accounts/${t.account_id}/workers/observability/issues/automations`,body:`json`,errors:{401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,500:`InternalServerError`}};function k(e){return e.usage(`$0 o11y issues automations create
|
|
19
|
+
|
|
20
|
+
Create an account or service issue automation.`).option(`after-inactivity-seconds`,{type:`number`,description:`The afterInactivitySeconds field`}).option(`after-occurrences`,{type:`number`,description:`The afterOccurrences field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`name`,{type:`string`,description:`The name field`}).option(`policy-id`,{type:`string`,description:`The policyId field`}).option(`service`,{type:`string`,description:`The service field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const A={command:`create`,describe:`Create an issue automation`,builder:k,handler:async e=>l({command:`o11y issues automations create`,classification:{safeFlags:[`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf o11y issues automations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/observability/issues/automations`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({afterInactivitySeconds:e[`after-inactivity-seconds`],afterOccurrences:e[`after-occurrences`],enabled:e.enabled,name:m(e.name,`name`,`text`),policyId:m(e[`policy-id`],`policy-id`,`text`),service:m(e.service,`service`,`text`)}):f(e.body)});return}let i=e.body===void 0?void 0:f(e.body),l=await t(e),u=e.local?o:await a();if(e.accountId=u,e.body!==void 0){let e=i,t=await c(`Creating`,async()=>l.send(O,{body:e,account_id:u}));s(t,{successLabel:`Created`});return}e[`policy-id`]===void 0&&(e[`policy-id`]=await h(`policy-id`,`The policyId field`));let d=p({afterInactivitySeconds:e[`after-inactivity-seconds`],afterOccurrences:e[`after-occurrences`],enabled:e.enabled,name:m(e.name,`name`,`text`),policyId:m(e[`policy-id`],`policy-id`,`text`),service:m(e.service,`service`,`text`)}),g=await c(`Creating`,async()=>l.send(O,{body:d,account_id:u}));s(g,{successLabel:`Created`})})};var j={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/workers/observability/issues/automations/${t.automationId}`,errors:{401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,500:`InternalServerError`}};function M(e){return e.usage(`$0 o11y issues automations delete <automationId>
|
|
21
|
+
|
|
22
|
+
Delete an issue automation while preserving its historical runs.`).positional(`automation-id`,{type:`string`,description:`AutomationId`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const N={command:`delete <automationId>`,describe:`Delete an issue automation`,builder:M,handler:async e=>l({command:`o11y issues automations delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf o11y issues automations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/observability/issues/automations/${e[`automation-id`]==null?`<automation-id>`:encodeURIComponent(String(e[`automation-id`]))}`,pathParams:{"automation-id":String(e[`automation-id`]??``)},bodyKind:`none`});return}let i=await t(e),l=e.local?o:await a();if(e.accountId=l,!await _({force:!!e.force}))return;let u=await c(`Deleting`,async()=>i.send(j,{account_id:l,automationId:e[`automation-id`]}));s(u,{successLabel:`Deleted`})})};var P={method:`GET`,path:t=>e`/accounts/${t.account_id}/workers/observability/issues/automations/${t.automationId}`,errors:{401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,500:`InternalServerError`}};function F(e){return e.usage(`$0 o11y issues automations get <automationId>
|
|
23
|
+
|
|
24
|
+
Retrieve an issue automation.`).positional(`automation-id`,{type:`string`,description:`AutomationId`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`get <automationId>`,describe:`Get an issue automation`,builder:F,handler:async e=>l({command:`o11y issues automations get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf o11y issues automations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/observability/issues/automations/${e[`automation-id`]==null?`<automation-id>`:encodeURIComponent(String(e[`automation-id`]))}`,pathParams:{"automation-id":String(e[`automation-id`]??``)},bodyKind:`none`});return}let i=await t(e),l=e.local?o:await a();e.accountId=l;let u=await c(`Loading`,async()=>i.send(P,{account_id:l,automationId:e[`automation-id`]}));s(u,{successLabel:`Loaded`})})};var L={method:`GET`,path:t=>e`/accounts/${t.account_id}/workers/observability/issues/automations`,query:[`service`],errors:{401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,500:`InternalServerError`}};function _e(e){return e.usage(`$0 o11y issues automations list
|
|
25
|
+
|
|
26
|
+
List account and service issue automations.`).option(`service`,{type:`string`,description:`Service`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ve={command:`list`,describe:`List issue automations`,builder:_e,handler:async e=>l({command:`o11y issues automations list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let i={service:e.service};if(e.dryRun){let e=await r();n({command:`cf o11y issues automations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/issues/automations`,pathParams:{},query:i,bodyKind:`none`});return}let l=await t(e),u=e.local?o:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(L,{account_id:u,...i}));s(d,{successLabel:`Loaded`})})};var R={method:`PUT`,path:t=>e`/accounts/${t.account_id}/workers/observability/issues/automations/${t.automationId}`,body:`json`,errors:{401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,500:`InternalServerError`}};function ye(e){return e.usage(`$0 o11y issues automations update <automationId>
|
|
27
|
+
|
|
28
|
+
Replace an issue automation configuration.`).positional(`automation-id`,{type:`string`,description:`AutomationId`,demandOption:!0}).option(`after-inactivity-seconds`,{type:`number`,description:`The afterInactivitySeconds field`}).option(`after-occurrences`,{type:`number`,description:`The afterOccurrences field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`name`,{type:`string`,description:`The name field`}).option(`policy-id`,{type:`string`,description:`The policyId field`}).option(`service`,{type:`string`,description:`The service field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const be={command:`update <automationId>`,describe:`Update an issue automation`,builder:ye,handler:async e=>l({command:`o11y issues automations update`,classification:{safeFlags:[`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf o11y issues automations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/observability/issues/automations/${e[`automation-id`]==null?`<automation-id>`:encodeURIComponent(String(e[`automation-id`]))}`,pathParams:{"automation-id":String(e[`automation-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({afterInactivitySeconds:e[`after-inactivity-seconds`],afterOccurrences:e[`after-occurrences`],enabled:e.enabled,name:m(e.name,`name`,`text`),policyId:m(e[`policy-id`],`policy-id`,`text`),service:m(e.service,`service`,`text`)}):f(e.body)});return}let i=e.body===void 0?void 0:f(e.body),l=await t(e),u=e.local?o:await a();if(e.accountId=u,e.body!==void 0){let t=i,n=await c(`Updating`,async()=>l.send(R,{body:t,account_id:u,automationId:e[`automation-id`]}));s(n,{successLabel:`Updated`});return}e[`policy-id`]===void 0&&(e[`policy-id`]=await h(`policy-id`,`The policyId field`));let d=p({afterInactivitySeconds:e[`after-inactivity-seconds`],afterOccurrences:e[`after-occurrences`],enabled:e.enabled,name:m(e.name,`name`,`text`),policyId:m(e[`policy-id`],`policy-id`,`text`),service:m(e.service,`service`,`text`)}),g=await c(`Updating`,async()=>l.send(R,{body:d,account_id:u,automationId:e[`automation-id`]}));s(g,{successLabel:`Updated`})})},xe={command:`automations`,describe:`Operations for issues.automations`,builder:e=>e.command(A).command(N).command(I).command(ve).command(be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Se={method:`GET`,path:t=>e`/accounts/${t.account_id}/workers/observability/issues/${t.issueId}`,errors:{401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,500:`InternalServerError`}};function Ce(e){return e.usage(`$0 o11y issues get <issueId>
|
|
29
|
+
|
|
30
|
+
Retrieve an issue.`).positional(`issue-id`,{type:`string`,description:`IssueId`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const we={command:`get <issueId>`,describe:`Get an issue`,builder:Ce,handler:async e=>l({command:`o11y issues get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf o11y issues get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/observability/issues/${e[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(e[`issue-id`]))}`,pathParams:{"issue-id":String(e[`issue-id`]??``)},bodyKind:`none`});return}let i=await t(e),l=e.local?o:await a();e.accountId=l;let u=await c(`Loading`,async()=>i.send(Se,{account_id:l,issueId:e[`issue-id`]}));s(u,{successLabel:`Loaded`})})};var z={method:`POST`,path:t=>e`/accounts/${t.account_id}/workers/observability/issues/groups`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,409:`ConflictError`,500:`InternalServerError`}};function Te(e){return e.usage(`$0 o11y issues group
|
|
31
|
+
|
|
32
|
+
Group two or more issues under a new customer-defined identity.`).option(`issue-ids`,{type:`string`,array:!0,description:`The issueIds field`}).option(`title`,{type:`string`,description:`The title field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ee={command:`group`,describe:`Create an issue group`,builder:Te,handler:async e=>l({command:`o11y issues group`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf o11y issues group`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/observability/issues/groups`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({issueIds:e[`issue-ids`],title:m(e.title,`title`,`text`)}):f(e.body)});return}let i=e.body===void 0?void 0:f(e.body),l=await t(e),u=e.local?o:await a();if(e.accountId=u,e.body!==void 0){let e=i,t=await c(`Creating`,async()=>l.send(z,{body:e,account_id:u}));s(t,{successLabel:`Created`});return}if(e[`issue-ids`]===void 0)throw Error(`--issue-ids is required (or pass --body with this field set).`);e.title===void 0&&(e.title=await h(`title`,`The title field`));let d=p({issueIds:e[`issue-ids`],title:m(e.title,`title`,`text`)}),g=await c(`Creating`,async()=>l.send(z,{body:d,account_id:u}));s(g,{successLabel:`Created`})})};var De={method:`GET`,path:t=>e`/accounts/${t.account_id}/workers/observability/issues`,query:[`page`,`perPage`,`order`,`orderBy`,`search`,`service`,`type`,`status`],errors:{401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,500:`InternalServerError`}};function Oe(e){return e.usage(`$0 o11y issues list
|
|
33
|
+
|
|
34
|
+
List detected issues.`).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`PerPage`}).option(`order`,{type:`string`,description:`Order`,choices:[`asc`,`desc`]}).option(`order-by`,{type:`string`,description:`OrderBy`,choices:[`id`,`service`,`title`,`type`,`status`,`statusUpdated`,`count`,`firstObserved`,`lastObserved`,`created`,`updated`]}).option(`search`,{type:`string`,description:`Search`}).option(`service`,{type:`string`,description:`Service`}).option(`type`,{type:`string`,description:`Type`}).option(`status`,{type:`string`,description:`Status`,choices:[`active`,`resolved`,`ignored`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ke={command:`list`,describe:`List detected issues`,builder:Oe,handler:async e=>l({command:`o11y issues list`,classification:{safeFlags:[`order`,`order-by`,`status`,`dry-run`]}},e,async()=>{let i={page:e.page,perPage:e[`per-page`],order:e.order,orderBy:e[`order-by`],search:e.search,service:e.service,type:e.type,status:e.status};if(e.dryRun){let e=await r();n({command:`cf o11y issues list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/issues`,pathParams:{},query:i,bodyKind:`none`});return}let l=await t(e),u=e.local?o:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(De,{account_id:u,...i}));s(d,{successLabel:`Loaded`})})};var B={method:`POST`,path:t=>e`/accounts/${t.account_id}/workers/observability/issues/${t.issueId}/notification-runs`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,500:`InternalServerError`}};function Ae(e){return e.usage(`$0 o11y issues notify <issueId>
|
|
35
|
+
|
|
36
|
+
Send the issue to one ANS policy, or every matching Real-Time Issue policy when no policy ID is provided.`).positional(`issue-id`,{type:`string`,description:`IssueId`,demandOption:!0}).option(`policy-id`,{type:`string`,description:`The policyId field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const je={command:`notify <issueId>`,describe:`Notify about an issue`,builder:Ae,handler:async e=>l({command:`o11y issues notify`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf o11y issues notify`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/observability/issues/${e[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(e[`issue-id`]))}/notification-runs`,pathParams:{"issue-id":String(e[`issue-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({policyId:m(e[`policy-id`],`policy-id`,`text`)}):f(e.body)});return}let i=e.body===void 0?void 0:f(e.body),l=await t(e),u=e.local?o:await a();if(e.accountId=u,e.body!==void 0){let t=i,n=await c(`Creating`,async()=>l.send(B,{body:t,account_id:u,issueId:e[`issue-id`]}));s(n,{successLabel:`Created`});return}let d=p({policyId:m(e[`policy-id`],`policy-id`,`text`)}),h=await c(`Creating`,async()=>l.send(B,{body:d,account_id:u,issueId:e[`issue-id`]}));s(h,{successLabel:`Created`})})};var Me={method:`GET`,path:t=>e`/accounts/${t.account_id}/workers/observability/issues/${t.issueId}/occurrences`,query:[`cursor`,`per_page`],errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,429:`TooManyRequestsError`,500:`InternalServerError`,504:`GatewayTimeoutError`}};function Ne(e){return e.usage(`$0 o11y issues occurrences <issueId>
|
|
37
|
+
|
|
38
|
+
List the retained error occurrences grouped into an issue, newest first.`).positional(`issue-id`,{type:`string`,description:`Issue ID returned by the issues API.`,demandOption:!0}).option(`cursor`,{type:`string`,description:`Opaque cursor returned in result_info.cursors.after.`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Pe={command:`occurrences <issueId>`,describe:`List issue occurrences`,builder:Ne,handler:async e=>l({command:`o11y issues occurrences`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let i={cursor:e.cursor,per_page:e[`per-page`]};if(e.dryRun){let t=await r();n({command:`cf o11y issues occurrences`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/observability/issues/${e[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(e[`issue-id`]))}/occurrences`,pathParams:{"issue-id":String(e[`issue-id`]??``)},query:i,bodyKind:`none`});return}let l=await t(e),u=e.local?o:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(Me,{account_id:u,issueId:e[`issue-id`],...i}));s(d,{successLabel:`Loaded`})})};var Fe={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/workers/observability/issues/groups/${t.groupId}/members/${t.issueId}`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,409:`ConflictError`,500:`InternalServerError`}};function Ie(e){return e.usage(`$0 o11y issues remove <issueId>
|
|
39
|
+
|
|
40
|
+
Remove an issue from a group, dissolving the group when fewer than two members remain.`).positional(`issue-id`,{type:`string`,description:`IssueId`,demandOption:!0}).option(`group-id`,{type:`string`,description:`GroupId`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Le={command:`remove <issueId>`,describe:`Remove an issue group member`,builder:Ie,handler:async e=>l({command:`o11y issues remove`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf o11y issues remove`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/observability/issues/groups/${e[`group-id`]==null?`<group-id>`:encodeURIComponent(String(e[`group-id`]))}/members/${e[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(e[`issue-id`]))}`,pathParams:{"group-id":String(e[`group-id`]??``),"issue-id":String(e[`issue-id`]??``)},bodyKind:`none`});return}let i=await t(e),l=e.local?o:await a();if(e.accountId=l,!await _({force:!!e.force}))return;let u=await c(`Deleting`,async()=>i.send(Fe,{account_id:l,groupId:e[`group-id`],issueId:e[`issue-id`]}));s(u,{successLabel:`Deleted`})})};var Re={method:`GET`,path:t=>e`/accounts/${t.account_id}/workers/observability/issues/summary`,query:[`service`],errors:{401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,500:`InternalServerError`}};function ze(e){return e.usage(`$0 o11y issues summary
|
|
41
|
+
|
|
42
|
+
Retrieve aggregate issue counts for the account.`).option(`service`,{type:`string`,description:`Service`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Be={command:`summary`,describe:`Summarize detected issues`,builder:ze,handler:async e=>l({command:`o11y issues summary`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let i={service:e.service};if(e.dryRun){let e=await r();n({command:`cf o11y issues summary`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/issues/summary`,pathParams:{},query:i,bodyKind:`none`});return}let l=await t(e),u=e.local?o:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(Re,{account_id:u,...i}));s(d,{successLabel:`Loaded`})})};var Ve={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/workers/observability/issues/groups/${t.groupId}`,errors:{401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,500:`InternalServerError`}};function He(e){return e.usage(`$0 o11y issues ungroup <groupId>
|
|
43
|
+
|
|
44
|
+
Dissolve an issue group and restore its members as standalone issues.`).positional(`group-id`,{type:`string`,description:`GroupId`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ue={command:`ungroup <groupId>`,describe:`Dissolve an issue group`,builder:He,handler:async e=>l({command:`o11y issues ungroup`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf o11y issues ungroup`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/observability/issues/groups/${e[`group-id`]==null?`<group-id>`:encodeURIComponent(String(e[`group-id`]))}`,pathParams:{"group-id":String(e[`group-id`]??``)},bodyKind:`none`});return}let i=await t(e),l=e.local?o:await a();if(e.accountId=l,!await _({force:!!e.force}))return;let u=await c(`Deleting`,async()=>i.send(Ve,{account_id:l,groupId:e[`group-id`]}));s(u,{successLabel:`Deleted`})})};var V={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/workers/observability/issues/${t.issueId}`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,500:`InternalServerError`}};function We(e){return e.usage(`$0 o11y issues update <issueId>
|
|
45
|
+
|
|
46
|
+
Modify an issue status or group title.`).positional(`issue-id`,{type:`string`,description:`IssueId`,demandOption:!0}).option(`status`,{type:`string`,description:`The status field`,choices:[`active`,`resolved`,`ignored`]}).coerce(`status`,e=>m(e,`status`,`text`)).option(`title`,{type:`string`,description:`The title field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Modify an issue status or group title.`})}const Ge={command:`update <issueId>`,describe:`Modify an issue`,builder:We,handler:async e=>l({command:`o11y issues update`,classification:{safeFlags:[`status`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf o11y issues update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/observability/issues/${e[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(e[`issue-id`]))}`,pathParams:{"issue-id":String(e[`issue-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({status:e.status,title:m(e.title,`title`,`text`)}):f(e.body)});return}let i=e.body===void 0?void 0:f(e.body),l=await t(e),u=e.local?o:await a();if(e.accountId=u,e.body!==void 0){let t=i,n=await c(`Updating`,async()=>l.send(V,{body:t,account_id:u,issueId:e[`issue-id`]}));s(n,{successLabel:`Updated`});return}let d=p({status:e.status,title:m(e.title,`title`,`text`)}),h=await c(`Updating`,async()=>l.send(V,{body:d,account_id:u,issueId:e[`issue-id`]}));s(h,{successLabel:`Updated`})})},Ke={command:`issues`,describe:`Operations for issues`,builder:e=>e.command(D).command(we).command(Ee).command(ke).command(je).command(Pe).command(Le).command(Be).command(Ue).command(Ge).command(xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var qe={method:`GET`,path:t=>e`/accounts/${t.account_id}/workers/observability/metricsexport`,errors:{401:`UnauthorizedError`,500:`InternalServerError`}};function Je(e){return e.usage(`$0 o11y metrics-export list
|
|
47
|
+
|
|
48
|
+
List resources configured for Workers Observability metrics export.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ye={command:`list`,describe:`List Metrics Exports`,builder:Je,handler:async e=>l({command:`o11y metrics-export list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();n({command:`cf o11y metrics-export list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/metricsexport`,pathParams:{},bodyKind:`none`});return}let i=await t(e),l=e.local?o:await a();e.accountId=l;let u=await c(`Loading`,async()=>i.send(qe,{account_id:l}));s(u,{successLabel:`Loaded`})})};var H={method:`POST`,path:t=>e`/accounts/${t.account_id}/workers/observability/metricsexport`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,500:`InternalServerError`}};function Xe(e){return e.usage(`$0 o11y metrics-export upsert
|
|
49
|
+
|
|
50
|
+
Create or replace resources configured for Workers Observability metrics export.`).option(`requester-requester-id`,{type:`string`,description:`The requester.requesterId field`}).option(`requester-requester-type`,{type:`string`,description:`The requester.requesterType field`,choices:[`workers`]}).coerce(`requester-requester-type`,e=>m(e,`requester-requester-type`,`text`)).option(`resources`,{type:`string`,description:`The resources field. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"destinations": [string], "resourceId": string, "resourceType": "workers" | "d1" | "r2" | ...more}].`}).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 Ze={command:`upsert`,describe:`Upsert Metrics Exports`,builder:Xe,handler:async e=>l({command:`o11y metrics-export upsert`,classification:{safeFlags:[`requester-requester-type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf o11y metrics-export upsert`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/observability/metricsexport`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({requester:{requesterId:m(e[`requester-requester-id`],`requester-requester-id`,`text`),requesterType:e[`requester-requester-type`]},resources:d(e.resources,`resources`)}):f(e.body)});return}let i=e.body===void 0?void 0:f(e.body),l=await t(e),u=e.local?o:await a();if(e.accountId=u,e.body!==void 0){let e=i,t=await c(`Creating`,async()=>l.send(H,{body:e,account_id:u}));s(t,{successLabel:`Created`});return}if(e[`requester-requester-id`]===void 0&&(e[`requester-requester-id`]=await h(`requester-requester-id`,`The requester.requesterId field`)),e[`requester-requester-type`]===void 0&&(e[`requester-requester-type`]=await g(`requester-requester-type`,`The requester.requesterType field`,[`workers`])),e.resources===void 0)throw Error(`--resources is required (or pass --body with this field set).`);let _=p({requester:{requesterId:m(e[`requester-requester-id`],`requester-requester-id`,`text`),requesterType:e[`requester-requester-type`]},resources:d(e.resources,`resources`)}),v=await c(`Creating`,async()=>l.send(H,{body:_,account_id:u}));s(v,{successLabel:`Created`})})},Qe={command:`metrics-export`,describe:`Operations for metrics-export`,builder:e=>e.command(Ye).command(Ze).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var U={method:`POST`,path:t=>e`/accounts/${t.account_id}/workers/observability/queries`,body:`json`,errors:{401:`UnauthorizedError`,409:`ConflictError`,500:`InternalServerError`}};function $e(e){return e.usage(`$0 o11y queries create
|
|
51
|
+
|
|
52
|
+
Persist query for later use.`).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`Query name`}).option(`parameters-calculations`,{type:`string`,description:`Create Calculations to compute as part of the query. Provide as a JSON array of objects or @path/to/file.json. Shape: [({"operator": "count" | "COUNT", "alias"?: string, "key"?: string, "keyType"?: "string" | "number" | "boolean"} | ...more)]. ? marks optional keys.`}).option(`parameters-datasets`,{type:`string`,array:!0,description:`Set the Datasets to query. Leave it empty to query all the datasets.`}).option(`parameters-filter-combination`,{type:`string`,description:`Set a Flag to describe how to combine the filters on the query.`,choices:[`and`,`or`,`AND`,`OR`]}).coerce(`parameters-filter-combination`,e=>m(e,`parameters-filter-combination`,`text`)).option(`parameters-filters`,{type:`string`,description:`Configure the Filters to apply to the query. Supports nested groups via kind: 'group'. Provide as a JSON array of objects or @path/to/file.json. Shape: [({"filterCombination": "and" | "or" | "AND" | ...more, "filters": [{...}], "kind": "group"} | ...more)].`}).option(`parameters-group-bys`,{type:`string`,description:`Define how to group the results of the query. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"type": "string" | "number" | "boolean", "value": string}].`}).option(`parameters-havings`,{type:`string`,description:`Configure the Having clauses that filter on calculations in the query result. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"key": string, "operation": "eq" | "neq" | "gt" | ...more, "value": number}].`}).option(`parameters-limit`,{type:`number`,description:`Set a limit on the number of results / records returned by the query`}).option(`parameters-needle-is-regex`,{type:`boolean`,description:`The parameters.needle.isRegex field`}).option(`parameters-needle-match-case`,{type:`boolean`,description:`The parameters.needle.matchCase field`}).option(`parameters-order-by-order`,{type:`string`,description:`Set the order of the results`,choices:[`asc`,`desc`]}).coerce(`parameters-order-by-order`,e=>m(e,`parameters-order-by-order`,`text`)).option(`parameters-order-by-value`,{type:`string`,description:`Configure which Calculation to order the results by.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Specify the new contents of the query.`}).check(e=>{let t=[`parameters-order-by-order`,`parameters-order-by-value`].some(t=>e[t]!==void 0);if(!e.body&&t){let t=[`parameters-order-by-value`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --parameters-order-by-* flag is set`)}return!0})}const et={command:`create`,describe:`Save query`,builder:$e,handler:async e=>l({command:`o11y queries create`,classification:{safeFlags:[`parameters-filter-combination`,`parameters-needle-is-regex`,`parameters-needle-match-case`,`parameters-order-by-order`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf o11y queries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/observability/queries`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({description:m(e.description,`description`,`text`),name:m(e.name,`name`,`text`),parameters:{calculations:d(e[`parameters-calculations`],`parameters-calculations`),datasets:e[`parameters-datasets`],filterCombination:e[`parameters-filter-combination`],filters:d(e[`parameters-filters`],`parameters-filters`),groupBys:d(e[`parameters-group-bys`],`parameters-group-bys`),havings:d(e[`parameters-havings`],`parameters-havings`),limit:e[`parameters-limit`],needle:{isRegex:e[`parameters-needle-is-regex`],matchCase:e[`parameters-needle-match-case`]},orderBy:{order:e[`parameters-order-by-order`],value:m(e[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}}):f(e.body)});return}let i=e.body===void 0?void 0:f(e.body),l=await t(e),u=e.local?o:await a();if(e.accountId=u,e.body!==void 0){let e=i,t=await c(`Creating`,async()=>l.send(U,{body:e,account_id:u}));s(t,{successLabel:`Created`});return}e.description===void 0&&(e.description=await h(`description`,`The description field`)),e.name===void 0&&(e.name=await h(`name`,`Query name`));let g=p({description:m(e.description,`description`,`text`),name:m(e.name,`name`,`text`),parameters:{calculations:d(e[`parameters-calculations`],`parameters-calculations`),datasets:e[`parameters-datasets`],filterCombination:e[`parameters-filter-combination`],filters:d(e[`parameters-filters`],`parameters-filters`),groupBys:d(e[`parameters-group-bys`],`parameters-group-bys`),havings:d(e[`parameters-havings`],`parameters-havings`),limit:e[`parameters-limit`],needle:{isRegex:e[`parameters-needle-is-regex`],matchCase:e[`parameters-needle-match-case`]},orderBy:{order:e[`parameters-order-by-order`],value:m(e[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}}),_=await c(`Creating`,async()=>l.send(U,{body:g,account_id:u}));s(_,{successLabel:`Created`})})};var tt={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/workers/observability/queries/${t.queryId}`,errors:{401:`UnauthorizedError`,404:`NotFoundError`,500:`InternalServerError`}};function nt(e){return e.usage(`$0 o11y queries delete <queryId>
|
|
53
|
+
|
|
54
|
+
Delete a saved query.`).positional(`query-id`,{type:`string`,description:`QueryId`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const rt={command:`delete <queryId>`,describe:`Delete query`,builder:nt,handler:async e=>l({command:`o11y queries delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf o11y queries delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/observability/queries/${e[`query-id`]==null?`<query-id>`:encodeURIComponent(String(e[`query-id`]))}`,pathParams:{"query-id":String(e[`query-id`]??``)},bodyKind:`none`});return}let i=await t(e),l=e.local?o:await a();if(e.accountId=l,!await _({force:!!e.force}))return;let u=await c(`Deleting`,async()=>i.send(tt,{account_id:l,queryId:e[`query-id`]}));s(u,{successLabel:`Deleted`})})};var W={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/workers/observability/queries/${t.queryId}`,body:`json`,errors:{401:`UnauthorizedError`,404:`NotFoundError`,500:`InternalServerError`}};function it(e){return e.usage(`$0 o11y queries edit <queryId>
|
|
55
|
+
|
|
56
|
+
Update saved query.`).positional(`query-id`,{type:`string`,description:`QueryId`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`Query name`}).option(`parameters-calculations`,{type:`string`,description:`Create Calculations to compute as part of the query. Provide as a JSON array of objects or @path/to/file.json. Shape: [({"operator": "count" | "COUNT", "alias"?: string, "key"?: string, "keyType"?: "string" | "number" | "boolean"} | ...more)]. ? marks optional keys.`}).option(`parameters-datasets`,{type:`string`,array:!0,description:`Set the Datasets to query. Leave it empty to query all the datasets.`}).option(`parameters-filter-combination`,{type:`string`,description:`Set a Flag to describe how to combine the filters on the query.`,choices:[`and`,`or`,`AND`,`OR`]}).coerce(`parameters-filter-combination`,e=>m(e,`parameters-filter-combination`,`text`)).option(`parameters-filters`,{type:`string`,description:`Configure the Filters to apply to the query. Supports nested groups via kind: 'group'. Provide as a JSON array of objects or @path/to/file.json. Shape: [({"filterCombination": "and" | "or" | "AND" | ...more, "filters": [{...}], "kind": "group"} | ...more)].`}).option(`parameters-group-bys`,{type:`string`,description:`Define how to group the results of the query. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"type": "string" | "number" | "boolean", "value": string}].`}).option(`parameters-havings`,{type:`string`,description:`Configure the Having clauses that filter on calculations in the query result. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"key": string, "operation": "eq" | "neq" | "gt" | ...more, "value": number}].`}).option(`parameters-limit`,{type:`number`,description:`Set a limit on the number of results / records returned by the query`}).option(`parameters-needle-is-regex`,{type:`boolean`,description:`The parameters.needle.isRegex field`}).option(`parameters-needle-match-case`,{type:`boolean`,description:`The parameters.needle.matchCase field`}).option(`parameters-order-by-order`,{type:`string`,description:`Set the order of the results`,choices:[`asc`,`desc`]}).coerce(`parameters-order-by-order`,e=>m(e,`parameters-order-by-order`,`text`)).option(`parameters-order-by-value`,{type:`string`,description:`Configure which Calculation to order the results by.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Specify the new contents of the query.`}).check(e=>{let t=[`parameters-order-by-order`,`parameters-order-by-value`].some(t=>e[t]!==void 0);if(!e.body&&t){let t=[`parameters-order-by-value`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --parameters-order-by-* flag is set`)}return!0})}const at={command:`edit <queryId>`,describe:`Update query`,builder:it,handler:async e=>l({command:`o11y queries edit`,classification:{safeFlags:[`parameters-filter-combination`,`parameters-needle-is-regex`,`parameters-needle-match-case`,`parameters-order-by-order`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf o11y queries edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/observability/queries/${e[`query-id`]==null?`<query-id>`:encodeURIComponent(String(e[`query-id`]))}`,pathParams:{"query-id":String(e[`query-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({description:m(e.description,`description`,`text`),name:m(e.name,`name`,`text`),parameters:{calculations:d(e[`parameters-calculations`],`parameters-calculations`),datasets:e[`parameters-datasets`],filterCombination:e[`parameters-filter-combination`],filters:d(e[`parameters-filters`],`parameters-filters`),groupBys:d(e[`parameters-group-bys`],`parameters-group-bys`),havings:d(e[`parameters-havings`],`parameters-havings`),limit:e[`parameters-limit`],needle:{isRegex:e[`parameters-needle-is-regex`],matchCase:e[`parameters-needle-match-case`]},orderBy:{order:e[`parameters-order-by-order`],value:m(e[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}}):f(e.body)});return}let i=e.body===void 0?void 0:f(e.body),l=await t(e),u=e.local?o:await a();if(e.accountId=u,e.body!==void 0){let t=i,n=await c(`Updating`,async()=>l.send(W,{body:t,account_id:u,queryId:e[`query-id`]}));s(n,{successLabel:`Updated`});return}e.description===void 0&&(e.description=await h(`description`,`The description field`)),e.name===void 0&&(e.name=await h(`name`,`Query name`));let g=p({description:m(e.description,`description`,`text`),name:m(e.name,`name`,`text`),parameters:{calculations:d(e[`parameters-calculations`],`parameters-calculations`),datasets:e[`parameters-datasets`],filterCombination:e[`parameters-filter-combination`],filters:d(e[`parameters-filters`],`parameters-filters`),groupBys:d(e[`parameters-group-bys`],`parameters-group-bys`),havings:d(e[`parameters-havings`],`parameters-havings`),limit:e[`parameters-limit`],needle:{isRegex:e[`parameters-needle-is-regex`],matchCase:e[`parameters-needle-match-case`]},orderBy:{order:e[`parameters-order-by-order`],value:m(e[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}}),_=await c(`Updating`,async()=>l.send(W,{body:g,account_id:u,queryId:e[`query-id`]}));s(_,{successLabel:`Updated`})})};var ot={method:`GET`,path:t=>e`/accounts/${t.account_id}/workers/observability/queries/${t.queryId}`,errors:{401:`UnauthorizedError`,404:`NotFoundError`,500:`InternalServerError`}};function st(e){return e.usage(`$0 o11y queries get <queryId>
|
|
57
|
+
|
|
58
|
+
Retrieve a saved query.`).positional(`query-id`,{type:`string`,description:`QueryId`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ct={command:`get <queryId>`,describe:`Get query`,builder:st,handler:async e=>l({command:`o11y queries get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf o11y queries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/observability/queries/${e[`query-id`]==null?`<query-id>`:encodeURIComponent(String(e[`query-id`]))}`,pathParams:{"query-id":String(e[`query-id`]??``)},bodyKind:`none`});return}let i=await t(e),l=e.local?o:await a();e.accountId=l;let u=await c(`Loading`,async()=>i.send(ot,{account_id:l,queryId:e[`query-id`]}));s(u,{successLabel:`Loaded`})})};var lt={method:`GET`,path:t=>e`/accounts/${t.account_id}/workers/observability/queries`,query:[`page`,`perPage`,`order`,`orderBy`],errors:{401:`UnauthorizedError`,404:`NotFoundError`,500:`InternalServerError`}};function ut(e){return e.usage(`$0 o11y queries list
|
|
59
|
+
|
|
60
|
+
List saved queries.`).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`PerPage`}).option(`order`,{type:`string`,description:`Order`,choices:[`asc`,`desc`]}).option(`order-by`,{type:`string`,description:`OrderBy`,choices:[`created`,`updated`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const dt={command:`list`,describe:`List queries`,builder:ut,handler:async e=>l({command:`o11y queries list`,classification:{safeFlags:[`order`,`order-by`,`dry-run`]}},e,async()=>{let i={page:e.page,perPage:e[`per-page`],order:e.order,orderBy:e[`order-by`]};if(e.dryRun){let e=await r();n({command:`cf o11y queries list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/queries`,pathParams:{},query:i,bodyKind:`none`});return}let l=await t(e),u=e.local?o:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(lt,{account_id:u,...i}));s(d,{successLabel:`Loaded`})})},ft={command:`queries`,describe:`Operations for queries`,builder:e=>e.command(et).command(rt).command(at).command(ct).command(dt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var G={method:`POST`,path:t=>e`/accounts/${t.account_id}/workers/observability/shared/query`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,429:`TooManyRequestsError`,500:`InternalServerError`}};function pt(e){return e.usage(`$0 o11y shared-queries create
|
|
61
|
+
|
|
62
|
+
Shared queries store the results of a previously run query, allowing you to share the results with others.`).option(`chart`,{type:`boolean`,description:`When true, includes time-series data in the response.`}).option(`chart-type`,{type:`string`,description:`Controls the SQL shape and response payload for the 'calculations' view. Omitted or 'timeseries_and_aggregate': current behaviour — both the time-series and aggregate queries. 'timeseries': time-series only. 'aggregate': aggregate only. 'distribution': a bucketed 2D histogram (time × value buckets) returned in 'distribution' instead of 'calculations'. 'distribution' is not compatible with 'compare' — combining them returns a 400.`,choices:[`timeseries_and_aggregate`,`timeseries`,`aggregate`,`distribution`]}).coerce(`chart-type`,e=>m(e,`chart-type`,`text`)).option(`compare`,{type:`boolean`,description:`When true, includes a comparison dataset from the previous time period of equal length.`}).option(`distribution-scale`,{type:`string`,description:`Value-axis bucketing for chartType 'distribution'. Omitted or 'log': geometric buckets, best for heavy-tailed latency. 'linear': fixed-width buckets, clearer for narrow or additive ranges. Ignored for other chartTypes. The response echoes the scheme used in distribution.bucketMode.`,choices:[`log`,`linear`]}).coerce(`distribution-scale`,e=>m(e,`distribution-scale`,`text`)).option(`preview`,{type:`boolean`,description:`When true, executes the query without persisting the results. Useful for validation or previewing.`,default:!1}).option(`granularity`,{type:`number`,description:`Number of time-series buckets. Only used when view is 'calculations'. Omit to let the system auto-detect an appropriate granularity.`}).option(`ignore-series`,{type:`boolean`,description:`When true, omits time-series data from the response and returns only aggregated values. Reduces response size when series are not needed.`,default:!1}).option(`limit`,{type:`number`,description:`Maximum number of events to return when view is 'events'. Also controls the number of group-by rows when view is 'calculations'.`,default:50}).option(`offset`,{type:`string`,description:`Cursor for pagination in event, trace, invocation, and agent views. Pass the $metadata.id of the last event, the trace cursor, or AgentRun.id to fetch the next page.`}).option(`offset-by`,{type:`number`,description:`Numeric offset for paginating grouped/pattern results (top-N lists). Use together with limit. Not used by cursor-based pagination.`}).option(`offset-direction`,{type:`string`,description:`Pagination direction: 'next' for forward, 'prev' for backward.`}).option(`parameters-calculations`,{type:`string`,description:`Aggregation calculations to compute (e.g. count, avg, p99). Each calculation produces aggregate values and optional time-series data. Provide as a JSON array of objects or @path/to/file.json. Shape: [({"operator": "count" | "COUNT", "alias"?: string, "key"?: string, "keyType"?: "string" | "number" | "boolean"} | ...more)]. ? marks optional keys.`}).option(`parameters-datasets`,{type:`string`,array:!0,description:`Datasets to query. Leave empty to query all available datasets.`}).option(`parameters-filter-combination`,{type:`string`,description:`Logical operator for combining top-level filters: 'and' (all must match) or 'or' (any must match). Defaults to 'and'.`,choices:[`and`,`or`,`AND`,`OR`]}).coerce(`parameters-filter-combination`,e=>m(e,`parameters-filter-combination`,`text`)).option(`parameters-filters`,{type:`string`,description:`Filters to narrow query results. Use the keys and values endpoints to discover available fields before building filters. Supports nested groups via kind: 'group'. Maximum nesting depth is 4. Provide as a JSON array of objects or @path/to/file.json. Shape: [({"filterCombination": "and" | "or" | "AND" | ...more, "filters": [{...}], "kind": "group"} | ...more)].`}).option(`parameters-group-bys`,{type:`string`,description:`Fields to group calculation results by. Only applicable when the query view is 'calculations'. Produces per-group aggregate values. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"type": "string" | "number" | "boolean", "value": string}].`}).option(`parameters-havings`,{type:`string`,description:`Post-aggregation filters applied to calculation results. Use to filter groups after aggregation (e.g. only groups where count > 100). Provide as a JSON array of objects or @path/to/file.json. Shape: [{"key": string, "operation": "eq" | "neq" | "gt" | ...more, "value": number}].`}).option(`parameters-limit`,{type:`number`,description:`Maximum number of group-by rows to return in calculation results. A value of 10 is a sensible default for most use cases.`}).option(`parameters-needle-is-regex`,{type:`boolean`,description:`When true, treats the value as a regular expression (RE2 syntax).`}).option(`parameters-needle-match-case`,{type:`boolean`,description:`When true, performs a case-sensitive search. Defaults to case-insensitive.`}).option(`parameters-order-by-order`,{type:`string`,description:`Sort direction: 'asc' for ascending, 'desc' for descending.`,choices:[`asc`,`desc`]}).coerce(`parameters-order-by-order`,e=>m(e,`parameters-order-by-order`,`text`)).option(`parameters-order-by-value`,{type:`string`,description:`Alias of the calculation to order results by. Must match the alias (or operator) of a calculation in the query.`}).option(`query-id`,{type:`string`,description:`Identifier for the query. When parameters are omitted, this ID is used to load a previously saved query's parameters. When providing parameters inline, pass any identifier (e.g. an ad-hoc ID).`}).option(`timeframe-from`,{type:`number`,description:`Start timestamp for the query timeframe. Unix timestamp in milliseconds`}).option(`timeframe-to`,{type:`number`,description:`End timestamp for the query timeframe. Unix timestamp in milliseconds`}).option(`view`,{type:`string`,description:`Controls the shape of the response. 'events': individual log lines matching the query. 'calculations': aggregated metrics (count, avg, p99, etc.) with optional group-by breakdowns and time-series. 'invocations': events grouped by request ID. 'traces': distributed trace summaries. 'agents': agent-specific trace summaries.`,choices:[`traces`,`events`,`calculations`,`invocations`,`requests`,`agents`],default:`calculations`}).coerce(`view`,e=>m(e,`view`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Create a sharable link to a query result.`}).check(e=>{let t=[`parameters-order-by-order`,`parameters-order-by-value`].some(t=>e[t]!==void 0);if(!e.body&&t){let t=[`parameters-order-by-value`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --parameters-order-by-* flag is set`)}return!0})}const mt={command:`create`,describe:`Create a sharable link to a query result`,builder:pt,handler:async e=>l({command:`o11y shared-queries create`,classification:{safeFlags:[`chart`,`chart-type`,`compare`,`distribution-scale`,`preview`,`ignore-series`,`parameters-filter-combination`,`parameters-needle-is-regex`,`parameters-needle-match-case`,`parameters-order-by-order`,`view`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf o11y shared-queries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/observability/shared/query`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({chart:e.chart,chartType:e[`chart-type`],compare:e.compare,distributionScale:e[`distribution-scale`],dry:e.preview,granularity:e.granularity,ignoreSeries:e[`ignore-series`],limit:e.limit,offset:m(e.offset,`offset`,`text`),offsetBy:e[`offset-by`],offsetDirection:m(e[`offset-direction`],`offset-direction`,`text`),parameters:{calculations:d(e[`parameters-calculations`],`parameters-calculations`),datasets:e[`parameters-datasets`],filterCombination:e[`parameters-filter-combination`],filters:d(e[`parameters-filters`],`parameters-filters`),groupBys:d(e[`parameters-group-bys`],`parameters-group-bys`),havings:d(e[`parameters-havings`],`parameters-havings`),limit:e[`parameters-limit`],needle:{isRegex:e[`parameters-needle-is-regex`],matchCase:e[`parameters-needle-match-case`]},orderBy:{order:e[`parameters-order-by-order`],value:m(e[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:m(e[`query-id`],`query-id`,`text`),timeframe:{from:e[`timeframe-from`],to:e[`timeframe-to`]},view:e.view}):f(e.body)});return}let i=e.body===void 0?void 0:f(e.body),l=await t(e),u=e.local?o:await a();if(e.accountId=u,e.body!==void 0){let e=i,t=await c(`Creating`,async()=>l.send(G,{body:e,account_id:u}));s(t,{successLabel:`Created`});return}if(e[`query-id`]===void 0&&(e[`query-id`]=await h(`query-id`,`Identifier for the query. When parameters are omitted, this ID is used to load a previously saved query's parameters. When providing parameters inline, pass any identifier (e.g. an ad-hoc ID).`)),e[`timeframe-from`]===void 0)throw Error(`--timeframe-from is required (or pass --body with this field set).`);if(e[`timeframe-to`]===void 0)throw Error(`--timeframe-to is required (or pass --body with this field set).`);let g=p({chart:e.chart,chartType:e[`chart-type`],compare:e.compare,distributionScale:e[`distribution-scale`],dry:e.preview,granularity:e.granularity,ignoreSeries:e[`ignore-series`],limit:e.limit,offset:m(e.offset,`offset`,`text`),offsetBy:e[`offset-by`],offsetDirection:m(e[`offset-direction`],`offset-direction`,`text`),parameters:{calculations:d(e[`parameters-calculations`],`parameters-calculations`),datasets:e[`parameters-datasets`],filterCombination:e[`parameters-filter-combination`],filters:d(e[`parameters-filters`],`parameters-filters`),groupBys:d(e[`parameters-group-bys`],`parameters-group-bys`),havings:d(e[`parameters-havings`],`parameters-havings`),limit:e[`parameters-limit`],needle:{isRegex:e[`parameters-needle-is-regex`],matchCase:e[`parameters-needle-match-case`]},orderBy:{order:e[`parameters-order-by-order`],value:m(e[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:m(e[`query-id`],`query-id`,`text`),timeframe:{from:e[`timeframe-from`],to:e[`timeframe-to`]},view:e.view}),_=await c(`Creating`,async()=>l.send(G,{body:g,account_id:u}));s(_,{successLabel:`Created`})})};var ht={method:`GET`,path:t=>e`/accounts/${t.account_id}/workers/observability/shared/query/${t.id}`,query:[`view`],errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,500:`InternalServerError`}};function gt(e){return e.usage(`$0 o11y shared-queries get <id>
|
|
63
|
+
|
|
64
|
+
Shared queries store the results of a previously run query, allowing you to share the results with others.`).positional(`id`,{type:`string`,description:`Specify the ID of the shared query.`,demandOption:!0}).option(`view`,{type:`string`,description:`Select the view of the query result to return, defaults to events.`,choices:[`events`,`invocations`,`calculations`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _t={command:`get <id>`,describe:`View a query that has been shared`,builder:gt,handler:async e=>l({command:`o11y shared-queries get`,classification:{safeFlags:[`view`,`dry-run`]}},e,async()=>{let i={view:e.view};if(e.dryRun){let t=await r();n({command:`cf o11y shared-queries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/observability/shared/query/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{id:String(e.id??``)},query:i,bodyKind:`none`});return}let l=await t(e),u=e.local?o:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(ht,{account_id:u,id:e.id,...i}));s(d,{successLabel:`Loaded`})})},vt={command:`shared-queries`,describe:`Operations for shared-queries`,builder:e=>e.command(mt).command(_t).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var K={method:`POST`,path:t=>e`/accounts/${t.account_id}/workers/observability/telemetry/live-tail/heartbeat`,body:`json`,errors:{401:`UnauthorizedError`,500:`InternalServerError`}};function yt(e){return e.usage(`$0 o11y telemetry heartbeat
|
|
65
|
+
|
|
66
|
+
Notify live tail that user is still eligible to receive live events.`).option(`script-id`,{type:`string`,description:`The scriptId field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Keep your live tail connection alive.`})}const bt={command:`heartbeat`,describe:`Live tail heartbeat`,builder:yt,handler:async e=>l({command:`o11y telemetry heartbeat`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf o11y telemetry heartbeat`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/observability/telemetry/live-tail/heartbeat`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({scriptId:m(e[`script-id`],`script-id`,`text`)}):f(e.body)});return}let i=e.body===void 0?void 0:f(e.body),l=await t(e),u=e.local?o:await a();if(e.accountId=u,e.body!==void 0){let e=i,t=await c(`Creating`,async()=>l.send(K,{body:e,account_id:u}));s(t,{successLabel:`Created`});return}let d=p({scriptId:m(e[`script-id`],`script-id`,`text`)}),h=await c(`Creating`,async()=>l.send(K,{body:d,account_id:u}));s(h,{successLabel:`Created`})})};var q={method:`POST`,path:t=>e`/accounts/${t.account_id}/workers/observability/telemetry/keys`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,429:`TooManyRequestsError`,500:`InternalServerError`,504:`GatewayTimeoutError`}};function xt(e){return e.usage(`$0 o11y telemetry keys
|
|
67
|
+
|
|
68
|
+
List all the keys in your telemetry events.`).option(`datasets`,{type:`string`,array:!0,description:`Leave this empty to use the default datasets`}).option(`filters`,{type:`string`,description:`Apply filters to narrow key discovery. Supports nested groups via kind: 'group'. Maximum nesting depth is 4. Provide as a JSON array of objects or @path/to/file.json. Shape: [({"filterCombination": "and" | "or" | "AND" | ...more, "filters": [{...}], "kind": "group"} | ...more)].`}).option(`from`,{type:`number`,description:`The from field`}).option(`key-needle-is-regex`,{type:`boolean`,description:`When true, treats the value as a regular expression (RE2 syntax).`}).option(`key-needle-match-case`,{type:`boolean`,description:`When true, performs a case-sensitive search. Defaults to case-insensitive.`}).option(`limit`,{type:`number`,description:`Advanced usage: set limit=1000+ to retrieve comprehensive key options without needing additional filtering.`}).option(`needle-is-regex`,{type:`boolean`,description:`When true, treats the value as a regular expression (RE2 syntax).`}).option(`needle-match-case`,{type:`boolean`,description:`When true, performs a case-sensitive search. Defaults to case-insensitive.`}).option(`to`,{type:`number`,description:`The to field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Find keys in your telemetry events matching a specific filter or needle.`})}const St={command:`keys`,describe:`List keys`,builder:xt,handler:async e=>l({command:`o11y telemetry keys`,classification:{safeFlags:[`key-needle-is-regex`,`key-needle-match-case`,`needle-is-regex`,`needle-match-case`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf o11y telemetry keys`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/observability/telemetry/keys`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({datasets:e.datasets,filters:d(e.filters,`filters`),from:e.from,keyNeedle:{isRegex:e[`key-needle-is-regex`],matchCase:e[`key-needle-match-case`]},limit:e.limit,needle:{isRegex:e[`needle-is-regex`],matchCase:e[`needle-match-case`]},to:e.to}):f(e.body)});return}let i=e.body===void 0?void 0:f(e.body),l=await t(e),u=e.local?o:await a();if(e.accountId=u,e.body!==void 0){let e=i,t=await c(`Creating`,async()=>l.send(q,{body:e,account_id:u}));s(t,{successLabel:`Created`});return}let m=p({datasets:e.datasets,filters:d(e.filters,`filters`),from:e.from,keyNeedle:{isRegex:e[`key-needle-is-regex`],matchCase:e[`key-needle-match-case`]},limit:e.limit,needle:{isRegex:e[`needle-is-regex`],matchCase:e[`needle-match-case`]},to:e.to}),h=await c(`Creating`,async()=>l.send(q,{body:m,account_id:u}));s(h,{successLabel:`Created`})})};var J={method:`POST`,path:t=>e`/accounts/${t.account_id}/workers/observability/telemetry/live-tail`,body:`json`,errors:{401:`UnauthorizedError`,403:`ForbiddenError`,500:`InternalServerError`}};function Ct(e){return e.usage(`$0 o11y telemetry live-tail
|
|
69
|
+
|
|
70
|
+
Prepare websocket server for live tail.`).option(`filter-combination`,{type:`string`,description:`Set a flag to describe how to combine the filters on the query.`,choices:[`and`,`or`,`AND`,`OR`],default:`and`}).coerce(`filter-combination`,e=>m(e,`filter-combination`,`text`)).option(`filters`,{type:`string`,description:`Apply filters to the query. Supports nested groups via kind: 'group'. Provide as a JSON array of objects or @path/to/file.json. Shape: [({"filterCombination": "and" | "or" | "AND" | ...more, "filters": [{...}], "kind": "group"} | ...more)].`}).option(`script-id`,{type:`string`,description:`The scriptId field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Create websocket server for live tail.`})}const wt={command:`live-tail`,describe:`Prepare live tail`,builder:Ct,handler:async e=>l({command:`o11y telemetry live-tail`,classification:{safeFlags:[`filter-combination`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf o11y telemetry live-tail`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/observability/telemetry/live-tail`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({filterCombination:e[`filter-combination`],filters:d(e.filters,`filters`),scriptId:m(e[`script-id`],`script-id`,`text`)}):f(e.body)});return}let i=e.body===void 0?void 0:f(e.body),l=await t(e),u=e.local?o:await a();if(e.accountId=u,e.body!==void 0){let e=i,t=await c(`Creating`,async()=>l.send(J,{body:e,account_id:u}));s(t,{successLabel:`Created`});return}let h=p({filterCombination:e[`filter-combination`],filters:d(e.filters,`filters`),scriptId:m(e[`script-id`],`script-id`,`text`)}),g=await c(`Creating`,async()=>l.send(J,{body:h,account_id:u}));s(g,{successLabel:`Created`})})};var Y={method:`POST`,path:t=>e`/accounts/${t.account_id}/workers/observability/telemetry/query`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,429:`TooManyRequestsError`,500:`InternalServerError`,504:`GatewayTimeoutError`}};function Tt(e){return e.usage(`$0 o11y telemetry query
|
|
71
|
+
|
|
72
|
+
Run a temporary or saved query.`).option(`chart`,{type:`boolean`,description:`When true, includes time-series data in the response.`}).option(`chart-type`,{type:`string`,description:`Controls the SQL shape and response payload for the 'calculations' view. Omitted or 'timeseries_and_aggregate': current behaviour — both the time-series and aggregate queries. 'timeseries': time-series only. 'aggregate': aggregate only. 'distribution': a bucketed 2D histogram (time × value buckets) returned in 'distribution' instead of 'calculations'. 'distribution' is not compatible with 'compare' — combining them returns a 400.`,choices:[`timeseries_and_aggregate`,`timeseries`,`aggregate`,`distribution`]}).coerce(`chart-type`,e=>m(e,`chart-type`,`text`)).option(`compare`,{type:`boolean`,description:`When true, includes a comparison dataset from the previous time period of equal length.`}).option(`distribution-scale`,{type:`string`,description:`Value-axis bucketing for chartType 'distribution'. Omitted or 'log': geometric buckets, best for heavy-tailed latency. 'linear': fixed-width buckets, clearer for narrow or additive ranges. Ignored for other chartTypes. The response echoes the scheme used in distribution.bucketMode.`,choices:[`log`,`linear`]}).coerce(`distribution-scale`,e=>m(e,`distribution-scale`,`text`)).option(`preview`,{type:`boolean`,description:`When true, executes the query without persisting the results. Useful for validation or previewing.`,default:!1}).option(`granularity`,{type:`number`,description:`Number of time-series buckets. Only used when view is 'calculations'. Omit to let the system auto-detect an appropriate granularity.`}).option(`ignore-series`,{type:`boolean`,description:`When true, omits time-series data from the response and returns only aggregated values. Reduces response size when series are not needed.`,default:!1}).option(`limit`,{type:`number`,description:`Maximum number of events to return when view is 'events'. Also controls the number of group-by rows when view is 'calculations'.`,default:50}).option(`offset`,{type:`string`,description:`Cursor for pagination in event, trace, invocation, and agent views. Pass the $metadata.id of the last event, the trace cursor, or AgentRun.id to fetch the next page.`}).option(`offset-by`,{type:`number`,description:`Numeric offset for paginating grouped/pattern results (top-N lists). Use together with limit. Not used by cursor-based pagination.`}).option(`offset-direction`,{type:`string`,description:`Pagination direction: 'next' for forward, 'prev' for backward.`}).option(`parameters-calculations`,{type:`string`,description:`Aggregation calculations to compute (e.g. count, avg, p99). Each calculation produces aggregate values and optional time-series data. Provide as a JSON array of objects or @path/to/file.json. Shape: [({"operator": "count" | "COUNT", "alias"?: string, "key"?: string, "keyType"?: "string" | "number" | "boolean"} | ...more)]. ? marks optional keys.`}).option(`parameters-datasets`,{type:`string`,array:!0,description:`Datasets to query. Leave empty to query all available datasets.`}).option(`parameters-filter-combination`,{type:`string`,description:`Logical operator for combining top-level filters: 'and' (all must match) or 'or' (any must match). Defaults to 'and'.`,choices:[`and`,`or`,`AND`,`OR`]}).coerce(`parameters-filter-combination`,e=>m(e,`parameters-filter-combination`,`text`)).option(`parameters-filters`,{type:`string`,description:`Filters to narrow query results. Use the keys and values endpoints to discover available fields before building filters. Supports nested groups via kind: 'group'. Maximum nesting depth is 4. Provide as a JSON array of objects or @path/to/file.json. Shape: [({"filterCombination": "and" | "or" | "AND" | ...more, "filters": [{...}], "kind": "group"} | ...more)].`}).option(`parameters-group-bys`,{type:`string`,description:`Fields to group calculation results by. Only applicable when the query view is 'calculations'. Produces per-group aggregate values. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"type": "string" | "number" | "boolean", "value": string}].`}).option(`parameters-havings`,{type:`string`,description:`Post-aggregation filters applied to calculation results. Use to filter groups after aggregation (e.g. only groups where count > 100). Provide as a JSON array of objects or @path/to/file.json. Shape: [{"key": string, "operation": "eq" | "neq" | "gt" | ...more, "value": number}].`}).option(`parameters-limit`,{type:`number`,description:`Maximum number of group-by rows to return in calculation results. A value of 10 is a sensible default for most use cases.`}).option(`parameters-needle-is-regex`,{type:`boolean`,description:`When true, treats the value as a regular expression (RE2 syntax).`}).option(`parameters-needle-match-case`,{type:`boolean`,description:`When true, performs a case-sensitive search. Defaults to case-insensitive.`}).option(`parameters-order-by-order`,{type:`string`,description:`Sort direction: 'asc' for ascending, 'desc' for descending.`,choices:[`asc`,`desc`]}).coerce(`parameters-order-by-order`,e=>m(e,`parameters-order-by-order`,`text`)).option(`parameters-order-by-value`,{type:`string`,description:`Alias of the calculation to order results by. Must match the alias (or operator) of a calculation in the query.`}).option(`query-id`,{type:`string`,description:`Identifier for the query. When parameters are omitted, this ID is used to load a previously saved query's parameters. When providing parameters inline, pass any identifier (e.g. an ad-hoc ID).`}).option(`timeframe-from`,{type:`number`,description:`Start timestamp for the query timeframe. Unix timestamp in milliseconds`}).option(`timeframe-to`,{type:`number`,description:`End timestamp for the query timeframe. Unix timestamp in milliseconds`}).option(`view`,{type:`string`,description:`Controls the shape of the response. 'events': individual log lines matching the query. 'calculations': aggregated metrics (count, avg, p99, etc.) with optional group-by breakdowns and time-series. 'invocations': events grouped by request ID. 'traces': distributed trace summaries. 'agents': agent-specific trace summaries.`,choices:[`traces`,`events`,`calculations`,`invocations`,`requests`,`agents`],default:`calculations`}).coerce(`view`,e=>m(e,`view`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Query your observability events, requests, and traces to build visualizations and identify insights.`}).check(e=>{let t=[`parameters-order-by-order`,`parameters-order-by-value`].some(t=>e[t]!==void 0);if(!e.body&&t){let t=[`parameters-order-by-value`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --parameters-order-by-* flag is set`)}return!0})}const Et={command:`query`,describe:`Run a query`,builder:Tt,handler:async e=>l({command:`o11y telemetry query`,classification:{safeFlags:[`chart`,`chart-type`,`compare`,`distribution-scale`,`preview`,`ignore-series`,`parameters-filter-combination`,`parameters-needle-is-regex`,`parameters-needle-match-case`,`parameters-order-by-order`,`view`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf o11y telemetry query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/observability/telemetry/query`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({chart:e.chart,chartType:e[`chart-type`],compare:e.compare,distributionScale:e[`distribution-scale`],dry:e.preview,granularity:e.granularity,ignoreSeries:e[`ignore-series`],limit:e.limit,offset:m(e.offset,`offset`,`text`),offsetBy:e[`offset-by`],offsetDirection:m(e[`offset-direction`],`offset-direction`,`text`),parameters:{calculations:d(e[`parameters-calculations`],`parameters-calculations`),datasets:e[`parameters-datasets`],filterCombination:e[`parameters-filter-combination`],filters:d(e[`parameters-filters`],`parameters-filters`),groupBys:d(e[`parameters-group-bys`],`parameters-group-bys`),havings:d(e[`parameters-havings`],`parameters-havings`),limit:e[`parameters-limit`],needle:{isRegex:e[`parameters-needle-is-regex`],matchCase:e[`parameters-needle-match-case`]},orderBy:{order:e[`parameters-order-by-order`],value:m(e[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:m(e[`query-id`],`query-id`,`text`),timeframe:{from:e[`timeframe-from`],to:e[`timeframe-to`]},view:e.view}):f(e.body)});return}let i=e.body===void 0?void 0:f(e.body),l=await t(e),u=e.local?o:await a();if(e.accountId=u,e.body!==void 0){let e=i,t=await c(`Loading`,async()=>l.send(Y,{body:e,account_id:u}));s(t,{successLabel:`Loaded`});return}if(e[`query-id`]===void 0&&(e[`query-id`]=await h(`query-id`,`Identifier for the query. When parameters are omitted, this ID is used to load a previously saved query's parameters. When providing parameters inline, pass any identifier (e.g. an ad-hoc ID).`)),e[`timeframe-from`]===void 0)throw Error(`--timeframe-from is required (or pass --body with this field set).`);if(e[`timeframe-to`]===void 0)throw Error(`--timeframe-to is required (or pass --body with this field set).`);let g=p({chart:e.chart,chartType:e[`chart-type`],compare:e.compare,distributionScale:e[`distribution-scale`],dry:e.preview,granularity:e.granularity,ignoreSeries:e[`ignore-series`],limit:e.limit,offset:m(e.offset,`offset`,`text`),offsetBy:e[`offset-by`],offsetDirection:m(e[`offset-direction`],`offset-direction`,`text`),parameters:{calculations:d(e[`parameters-calculations`],`parameters-calculations`),datasets:e[`parameters-datasets`],filterCombination:e[`parameters-filter-combination`],filters:d(e[`parameters-filters`],`parameters-filters`),groupBys:d(e[`parameters-group-bys`],`parameters-group-bys`),havings:d(e[`parameters-havings`],`parameters-havings`),limit:e[`parameters-limit`],needle:{isRegex:e[`parameters-needle-is-regex`],matchCase:e[`parameters-needle-match-case`]},orderBy:{order:e[`parameters-order-by-order`],value:m(e[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:m(e[`query-id`],`query-id`,`text`),timeframe:{from:e[`timeframe-from`],to:e[`timeframe-to`]},view:e.view}),_=await c(`Loading`,async()=>l.send(Y,{body:g,account_id:u}));s(_,{successLabel:`Loaded`})})};var X={method:`POST`,path:t=>e`/accounts/${t.account_id}/workers/observability/telemetry/values`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,429:`TooManyRequestsError`,500:`InternalServerError`,504:`GatewayTimeoutError`}};function Dt(e){return e.usage(`$0 o11y telemetry values
|
|
73
|
+
|
|
74
|
+
List unique values found in your events.`).option(`datasets`,{type:`string`,array:!0,description:`Leave this empty to use the default datasets`}).option(`filters`,{type:`string`,description:`Apply filters before listing values. Supports nested groups via kind: 'group'. Maximum nesting depth is 4. Provide as a JSON array of objects or @path/to/file.json. Shape: [({"filterCombination": "and" | "or" | "AND" | ...more, "filters": [{...}], "kind": "group"} | ...more)].`}).option(`key`,{type:`string`,description:`The key field`}).option(`limit`,{type:`number`,description:`The limit field`,default:50}).option(`needle-is-regex`,{type:`boolean`,description:`When true, treats the value as a regular expression (RE2 syntax).`}).option(`needle-match-case`,{type:`boolean`,description:`When true, performs a case-sensitive search. Defaults to case-insensitive.`}).option(`timeframe-from`,{type:`number`,description:`The timeframe.from field`}).option(`timeframe-to`,{type:`number`,description:`The timeframe.to field`}).option(`type`,{type:`string`,description:`The type field`,choices:[`string`,`boolean`,`number`]}).coerce(`type`,e=>m(e,`type`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Retrieve values from your telemetry events.`})}const Ot={command:`values`,describe:`List values`,builder:Dt,handler:async e=>l({command:`o11y telemetry values`,classification:{safeFlags:[`needle-is-regex`,`needle-match-case`,`type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf o11y telemetry values`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/observability/telemetry/values`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({datasets:e.datasets,filters:d(e.filters,`filters`),key:m(e.key,`key`,`text`),limit:e.limit,needle:{isRegex:e[`needle-is-regex`],matchCase:e[`needle-match-case`]},timeframe:{from:e[`timeframe-from`],to:e[`timeframe-to`]},type:e.type}):f(e.body)});return}let i=e.body===void 0?void 0:f(e.body),l=await t(e),u=e.local?o:await a();if(e.accountId=u,e.body!==void 0){let e=i,t=await c(`Creating`,async()=>l.send(X,{body:e,account_id:u}));s(t,{successLabel:`Created`});return}if(e.datasets===void 0)throw Error(`--datasets is required (or pass --body with this field set).`);if(e.key===void 0&&(e.key=await h(`key`,`The key field`)),e[`timeframe-from`]===void 0)throw Error(`--timeframe-from is required (or pass --body with this field set).`);if(e[`timeframe-to`]===void 0)throw Error(`--timeframe-to is required (or pass --body with this field set).`);e.type===void 0&&(e.type=await g(`type`,`The type field`,[`string`,`boolean`,`number`]));let _=p({datasets:e.datasets,filters:d(e.filters,`filters`),key:m(e.key,`key`,`text`),limit:e.limit,needle:{isRegex:e[`needle-is-regex`],matchCase:e[`needle-match-case`]},timeframe:{from:e[`timeframe-from`],to:e[`timeframe-to`]},type:e.type}),v=await c(`Creating`,async()=>l.send(X,{body:_,account_id:u}));s(v,{successLabel:`Created`})})},kt={command:`telemetry`,describe:`Operations for telemetry`,builder:e=>e.command(bt).command(St).command(wt).command(Et).command(Ot).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var At={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/observability/tracing/rules`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,500:`InternalServerError`}};function jt(e){return e.usage(`$0 o11y tracing rules delete
|
|
75
|
+
|
|
76
|
+
Delete every sampling override from a zone's managed Cloudflare Traces ruleset.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Mt={command:`delete`,describe:`Delete zone trace rules`,builder:jt,handler:async e=>l({command:`o11y tracing rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){n({command:`cf o11y tracing rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/observability/tracing/rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await t(e),a=await i({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=a,!await _({force:!!e.force}))return;let o=await c(`Deleting`,async()=>r.send(At,{zone_id:a}));s(o,{successLabel:`Deleted`})})};var Nt={method:`GET`,path:t=>e`/zones/${t.zone_id}/observability/tracing/rules`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,500:`InternalServerError`}};function Pt(e){return e.usage(`$0 o11y tracing rules get
|
|
77
|
+
|
|
78
|
+
Retrieve the ordered sampling overrides for a zone's managed Cloudflare Traces ruleset.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ft={command:`get`,describe:`View zone trace rules`,builder:Pt,handler:async e=>l({command:`o11y tracing rules get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){n({command:`cf o11y tracing rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/observability/tracing/rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await t(e),a=await i({zone:e.zone},r,{quiet:e.quiet});e.zoneId=a;let o=await c(`Loading`,async()=>r.send(Nt,{zone_id:a}));s(o,{successLabel:`Loaded`})})};var Z={method:`PUT`,path:t=>e`/zones/${t.zone_id}/observability/tracing/rules`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,500:`InternalServerError`}};function It(e){return e.usage(`$0 o11y tracing rules update
|
|
79
|
+
|
|
80
|
+
Replace all sampling overrides in a zone's managed Cloudflare Traces ruleset. Rules are evaluated in the supplied order.`).option(`rules`,{type:`string`,description:`Trace rules in evaluation order. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"action": "set_trace_settings", "action_parameters": {...}, "description": string, "enabled": boolean, "expression": string}].`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Replace the ordered trace rules`})}const Lt={command:`update`,describe:`Replace zone trace rules`,builder:It,handler:async e=>l({command:`o11y tracing rules update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){n({command:`cf o11y tracing rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/observability/tracing/rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({rules:d(e.rules,`rules`)}):f(e.body)});return}let r=e.body===void 0?void 0:f(e.body),a=await t(e),o=await i({zone:e.zone},a,{quiet:e.quiet});if(e.zoneId=o,e.body!==void 0){let e=r,t=await c(`Updating`,async()=>a.send(Z,{body:e,zone_id:o}));s(t,{successLabel:`Updated`});return}if(e.rules===void 0)throw Error(`--rules is required (or pass --body with this field set).`);let l=p({rules:d(e.rules,`rules`)}),u=await c(`Updating`,async()=>a.send(Z,{body:l,zone_id:o}));s(u,{successLabel:`Updated`})})},Rt={command:`rules`,describe:`Operations for tracing.rules`,builder:e=>e.command(Mt).command(Ft).command(Lt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var zt={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/observability/tracing/settings`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,500:`InternalServerError`}};function Bt(e){return e.usage(`$0 o11y tracing settings delete
|
|
81
|
+
|
|
82
|
+
Reset the zone-level Cloudflare Traces settings to their defaults while preserving the sampling rules.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Vt={command:`delete`,describe:`Reset zone tracing settings`,builder:Bt,handler:async e=>l({command:`o11y tracing settings delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){n({command:`cf o11y tracing settings delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/observability/tracing/settings`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await t(e),a=await i({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=a,!await _({force:!!e.force}))return;let o=await c(`Deleting`,async()=>r.send(zt,{zone_id:a}));s(o,{successLabel:`Deleted`})})};var Q={method:`GET`,path:t=>e`/zones/${t.zone_id}/observability/tracing/settings`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,500:`InternalServerError`}};function Ht(e){return e.usage(`$0 o11y tracing settings get
|
|
83
|
+
|
|
84
|
+
Retrieve the zone-level Cloudflare Traces settings.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ut={command:`get`,describe:`View zone tracing settings`,builder:Ht,handler:async e=>l({command:`o11y tracing settings get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){n({command:`cf o11y tracing settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/observability/tracing/settings`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await t(e),a=await i({zone:e.zone},r,{quiet:e.quiet});e.zoneId=a;let o=await c(`Loading`,async()=>r.send(Q,{zone_id:a}));s(o,{successLabel:`Loaded`})})};var $={method:`PATCH`,path:t=>e`/zones/${t.zone_id}/observability/tracing/settings`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,500:`InternalServerError`}};function Wt(e){return e.usage(`$0 o11y tracing settings update
|
|
85
|
+
|
|
86
|
+
Update the zone-level Cloudflare Traces settings.`).option(`destinations`,{type:`string`,array:!0,description:`Up to 100 OpenTelemetry destination identifiers that receive traces.`}).option(`enabled`,{type:`boolean`,description:`Whether Cloudflare Traces is enabled for the zone.`}).option(`forward-context`,{type:`boolean`,description:`Whether trace context is sent externally or across a zone boundary.`}).option(`persist`,{type:`boolean`,description:`Whether traces are persisted in Cloudflare.`}).option(`propagation-policy`,{type:`string`,description:`When inbound trace context may be continued. Authenticated propagation is not supported yet.`,choices:[`accept`,`authenticated`,`reject`]}).coerce(`propagation-policy`,e=>m(e,`propagation-policy`,`text`)).option(`sampling-ratio`,{type:`number`,description:`The ratio of requests sampled for tracing, from 0 to 1.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update zone tracing settings`})}const Gt={command:`update`,describe:`Update zone tracing settings`,builder:Wt,handler:async e=>l({command:`o11y tracing settings update`,classification:{safeFlags:[`enabled`,`forward-context`,`persist`,`propagation-policy`,`dry-run`]}},e,async()=>{if(e.dryRun){n({command:`cf o11y tracing settings update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/observability/tracing/settings`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({destinations:e.destinations,enabled:e.enabled,forward_context:e[`forward-context`],persist:e.persist,propagation_policy:e[`propagation-policy`],sampling_ratio:e[`sampling-ratio`]}):f(e.body)});return}let r=e.body===void 0?void 0:f(e.body),a=await t(e),o=await i({zone:e.zone},a,{quiet:e.quiet});if(e.zoneId=o,e.body!==void 0){let e=r,t=await c(`Updating`,async()=>a.send($,{body:e,zone_id:o}));s(t,{successLabel:`Updated`});return}let l=p({destinations:e.destinations,enabled:e.enabled,forward_context:e[`forward-context`],persist:e.persist,propagation_policy:e[`propagation-policy`],sampling_ratio:e[`sampling-ratio`]}),u=await c(`Updating`,async()=>a.send($,{body:l,zone_id:o}));s(u,{successLabel:`Updated`})})},Kt={command:`settings`,describe:`Operations for tracing.settings`,builder:e=>e.command(Vt).command(Ut).command(Gt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},qt={command:`tracing`,describe:`Operations for tracing`,builder:e=>e.command(Rt).command(Kt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Jt={method:`GET`,path:t=>e`/accounts/${t.account_id}/workers/observability/usage`,query:[`from`,`to`,`tz`],errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,429:`TooManyRequestsError`,500:`InternalServerError`,504:`GatewayTimeoutError`}};function Yt(e){return e.usage(`$0 o11y usage
|
|
87
|
+
|
|
88
|
+
Event counts and sizes broken down by dataset and service, bucketed by day, for up to 90 days. The top-level events field is the sum of all breakdown counts.`).option(`from`,{type:`string`,description:`Unix timestamp in milliseconds for the start of the range.`,demandOption:!0}).option(`to`,{type:`string`,description:`Unix timestamp in milliseconds for the end of the range.`,demandOption:!0}).option(`tz`,{type:`string`,description:`IANA timezone used to align daily bins to local midnight (e.g. 'America/Chicago'). Defaults to UTC.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Xt={command:`usage`,describe:`Get event count`,builder:Yt,handler:async e=>l({command:`o11y usage`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let i={from:e.from,to:e.to,tz:e.tz};if(e.dryRun){let e=await r();n({command:`cf o11y usage`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/usage`,pathParams:{},query:i,bodyKind:`none`});return}let l=await t(e),u=e.local?o:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(Jt,{account_id:u,...i}));s(d,{successLabel:`Loaded`})})},Zt={command:`o11y`,describe:`o11y`,builder:e=>e.command(Xt).command(se).command(w).command(Ke).command(Qe).command(ft).command(vt).command(kt).command(qt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Zt as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{c as e,i as t,l as n,o as r}from"./log-Brx-wjJW.mjs";import{n as i,o as a,r as o,s}from"./cf-DmvZ2L51.mjs";import{n as c,t as l}from"./version-CcuBNjqg.mjs";import{t as u}from"./args-BAOHroBC.mjs";import{t as d}from"./cli-exit-CstFZ1eJ.mjs";import{n as f}from"./context-BGm5_wTT.mjs";import{i as p}from"./dialog-CD94-Kzw.mjs";import{t as m}from"./errors-C_bGcR0X.mjs";import{n as h}from"./interactive-wQM7Blhm.mjs";import{t as g}from"./session-COdP8BXD.mjs";import{n as _,t as v}from"./project-settings-D_S-UC8I.mjs";import{n as y}from"./blocks-C3Im7AT0.mjs";import{r as b}from"./theme-BGHWSKCw.mjs";import{relative as x}from"node:path";function S(e,n={}){let{cwd:r=process.cwd(),output:i=process.stderr}=n,a=n.columns??(i.columns||80),o=_(r),s=o?x(r,o):v,c=`To use this account automatically in future, configure accountId in ${s}:`,l=/* @__PURE__ */ new Set([`accountId`,s]),u=y(c,Math.max(20,a-3)).map(e=>e.split(` `).map(e=>{let t=e.replace(/:$/,``);return l.has(t)?`${b.code(t)}${e.slice(t.length)}`:e}).join(` `));t.info(u.join(`
|
|
3
|
+
`),{output:i});let d=`accountId: ${b.jsonString(JSON.stringify(e))},`,f=o?[d]:[`import { defineConfig } from "cf/config";`,``,`export default defineConfig({`,` ${d}`,`});`],p=` `.repeat(3);i.write(`\n${f.map(e=>e&&p+e).join(`
|
|
4
|
+
`)}\n\n`),t.info(`Alternatively, set the ${b.code(`CLOUDFLARE_ACCOUNT_ID`)} environment variable.`,{output:i}),i.write(`
|
|
5
|
+
`)}const C={debug:(...e)=>{process.env.DEBUG&&console.error(...e)},info:(...e)=>console.error(...e),log:(...e)=>console.error(...e),warn:(...e)=>console.error(...e),error:(...e)=>console.error(...e)};var w=class extends Error{};async function T(t){if(h())throw new w;g(c);let r=await e({message:p(t),output:process.stderr});if(n(r)||typeof r!=`string`)throw new d(130,{cancelled:!0});return r}async function E(e,t){if(h())throw new w;g(c);let i=await r({message:e,output:process.stderr,options:t.choices.map(({title:e,value:t})=>({label:e,value:t}))});if(n(i)||typeof i!=`string`)throw new d(130,{cancelled:!0});return u()||S(i),i}const D=i({logger:C,userAgent:l,prompt:T,select:E,isNoDefaultValueProvidedError:e=>e instanceof w});let O=!1;function k(e,t){O=e,D.setTemporaryAllowed(e,t)}function A(){return O}async function j(e){if(!A())throw Error(`Temporary accounts require --temporary-account.`);try{let t=await D.requireAuth({compliance_region:e?.complianceRegion??await f(e)}),{apiToken:n}=D.requireApiToken();return{accountId:t,apiToken:n}}catch(e){throw e instanceof Error&&(e.message=e.message.replaceAll(/--temporary(?!-account)/g,`--temporary-account`)),e}}async function M(e,t){try{return await D.getOrSelectAccountId({account_id:e,compliance_region:t?.complianceRegion??await f(t)})}catch(e){throw e instanceof Error&&!(`reason`in e)&&`telemetryMessage`in e&&e.telemetryMessage===`cfetch auth login required`&&h()&&D.getAPIToken()===void 0?new m(e.message,{cause:e}):e}}function N(){return D.getActiveAccountId({})}async function P(){return D.fetchAllAccounts({compliance_region:await f()},{throwOnEmpty:!1})}async function F(e){if(e?.scopes&&!s(e.scopes))throw Error(`One or more of the requested scopes are not valid cf OAuth scopes.`);return D.login({compliance_region:await f()},{browser:e?.browser??!0,device:e?.device??!0,...e?.scopes&&{scopes:e.scopes},...e?.profile&&{profile:e.profile}})}function I(e){return D.logout(e)}function L(e){D.setProfile(e)}function R(e){a(e,{logger:C,getCredentialStore:()=>D.getCredentialStore()})}function z(){return D.getActiveProfile()}function B(){return o({logger:C})}function V(e,t=process.cwd()){let n=B().resolve({profile:e,cwd:t});return L(n),n}function H(){return D.getOAuthTokenFromLocalState()}function U(){return D.readAuthCredentials()?.oauth_token!==void 0}function W(){return D.readAuthCredentials()}function G(){return D.getCredentialStore().path()}export{k as _,M as a,U as c,I as d,W as f,L as g,R as h,G as i,A as l,V as m,N as n,B as o,j as p,z as r,H as s,P as t,F as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
export{n as getActiveAccountId,a as getOrSelectAccountId,l as isTemporaryAccountRequested,p as requireTemporaryAccount,m as resolveProfile,_ as setTemporaryAccountRequested}from"./oauth-
|
|
2
|
+
export{n as getActiveAccountId,a as getOrSelectAccountId,l as isTemporaryAccountRequested,p as requireTemporaryAccount,m as resolveProfile,_ as setTemporaryAccountRequested}from"./oauth-BgDZMd72.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-DA1PHaHi.mjs";import{t as n}from"./dry-run-qsnRlRk6.mjs";import{a as r,t as i}from"./context-BGm5_wTT.mjs";import{t as a}from"./local-B3zt9PXR.mjs";import{t as o}from"./output-hFMAotFl.mjs";import{t as s}from"./progress-DE_G09u2.mjs";import{t as c}from"./run-CXWkMU3x.mjs";import"./telemetry-COlodX5Z.mjs";var l={method:`GET`,path:t=>e`/accounts/${t.account_id}/observability/usage/limit`,errors:{401:`UnauthorizedError`,403:`ForbiddenError`,429:`TooManyRequestsError`,500:`InternalServerError`}};function u(e){return e.usage(`$0 observability usage-limit get
|
|
3
3
|
|
|
4
|
-
Whether Workers Observability is keeping fewer of the account's events, usually because it passed its daily limit, and what that limit is. Daily limits reset at 00:00 UTC; paid accounts are brought back in stages over the following hours.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`get`,describe:`Get usage limit status`,builder:u,handler:async e=>c({command:`observability usage-limit get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();
|
|
4
|
+
Whether Workers Observability is keeping fewer of the account's events, usually because it passed its daily limit, and what that limit is. Daily limits reset at 00:00 UTC; paid accounts are brought back in stages over the following hours.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`get`,describe:`Get usage limit status`,builder:u,handler:async e=>c({command:`observability usage-limit get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();n({command:`cf observability usage-limit get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/observability/usage/limit`,pathParams:{},bodyKind:`none`});return}let c=await t(e),u=e.local?a:await i();e.accountId=u;let d=await s(`Loading`,async()=>c.send(l,{account_id:u}));o(d,{successLabel:`Loaded`})})},f={command:`usage-limit`,describe:`Operations for usage-limit`,builder:e=>e.command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},p={command:`observability`,describe:`observability`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-DA1PHaHi.mjs";import{i as n}from"./context-BGm5_wTT.mjs";import{t as r}from"./dry-run-qsnRlRk6.mjs";import{t as i}from"./output-hFMAotFl.mjs";import{t as a}from"./progress-DE_G09u2.mjs";import{t as o}from"./run-CXWkMU3x.mjs";import"./telemetry-COlodX5Z.mjs";import{n as s}from"./prompt-D274Im1O.mjs";var c={method:`PUT`,path:t=>e`/zones/${t.zone_id}/settings/ohttp-gateway`,errors:{400:`BadRequestError`,403:`ForbiddenError`,500:`InternalServerError`}};function l(e){return e.usage(`$0 ohttp-gateway enablement create
|
|
3
|
+
|
|
4
|
+
Idempotently enables OHTTP Gateway for the zone. Requires product subscription to call.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`create`,describe:`Enable OHTTP Gateway`,builder:l,handler:async e=>o({command:`ohttp-gateway enablement create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){r({command:`cf ohttp-gateway enablement create`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/ohttp-gateway`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});e.zoneId=s;let l=await a(`Updating`,async()=>o.send(c,{zone_id:s}));i(l,{successLabel:`Updated`})})};var d={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/settings/ohttp-gateway`,errors:{400:`BadRequestError`,403:`ForbiddenError`,500:`InternalServerError`}};function f(e){return e.usage(`$0 ohttp-gateway enablement delete
|
|
5
|
+
|
|
6
|
+
Idempotently disables Oblivious HTTP Gateway for the zone. Requires product subscription to call.`).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 p={command:`delete`,describe:`Disable OHTTP Gateway`,builder:f,handler:async e=>o({command:`ohttp-gateway enablement delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){r({command:`cf ohttp-gateway enablement delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/ohttp-gateway`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(e),c=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=c,!await s({force:!!e.force,message:`This operation disables OHTTP Gateway for the zone.`}))return;let l=await a(`Deleting`,async()=>o.send(d,{zone_id:c}));i(l,{successLabel:`Deleted`})})};var m={method:`GET`,path:t=>e`/zones/${t.zone_id}/settings/ohttp-gateway`,errors:{400:`BadRequestError`,403:`ForbiddenError`,500:`InternalServerError`}};function h(e){return e.usage(`$0 ohttp-gateway enablement get
|
|
7
|
+
|
|
8
|
+
Returns the state of Oblivious HTTP enablement for the zone. Requires product subscription to call.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get`,describe:`Get OHTTP Gateway enablement`,builder:h,handler:async e=>o({command:`ohttp-gateway enablement get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){r({command:`cf ohttp-gateway enablement get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/ohttp-gateway`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});e.zoneId=s;let c=await a(`Loading`,async()=>o.send(m,{zone_id:s}));i(c,{successLabel:`Loaded`})})},_={command:`enablement`,describe:`Operations for enablement`,builder:e=>e.command(u).command(p).command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},v={command:`ohttp-gateway`,describe:`ohttp-gateway`,builder:e=>e.command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{v as default};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{i as e,n as t}from"./auth-DA1PHaHi.mjs";import{t as n}from"./path-DRw6Y-nd.mjs";import{t as r}from"./dry-run-qsnRlRk6.mjs";import{t as i}from"./output-hFMAotFl.mjs";import{t as a}from"./progress-DE_G09u2.mjs";import"./telemetry-COlodX5Z.mjs";import{t as o}from"./run-CXWkMU3x.mjs";import"./api-Dnt6lRJG.mjs";import{o as s,r as c,t as l}from"./body-parser-HN91kAf0.mjs";import{n as u}from"./input-validation-D7z60HJH.mjs";import{a as d,i as f,n as p}from"./prompt-D274Im1O.mjs";function m(e){return e.usage("$0 organizations accounts list\n\nRetrieve the accounts immediately attached to a specific organization. Accounts attached to sub-organizations are not included. Use `page_token` and `page_size` for cursor pagination. The default response uses Account fields; `Accept: application/json; legacy=true` requests the LegacyAccount representation.").option(`organization-id`,{type:`string`,description:`The ID of the organization to retrieve a list of accounts for.`,demandOption:!0}).option(`account-pubname`,{type:`string`,description:`(case-sensitive) Filter the list of accounts to where the account_pubname is equal to
|
|
3
|
+
a particular string.`}).option(`account-pubname-starts-with`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname starts with
|
|
4
|
+
a particular string.`}).option(`account-pubname-ends-with`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname ends with
|
|
5
|
+
a particular string.`}).option(`account-pubname-contains`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname contains
|
|
6
|
+
a particular string.`}).option(`name`,{type:`string`,description:"(case-sensitive) Filter the list of accounts to where the name is equal to a\nparticular string. At most one of `name`, `name.startsWith`, `name.endsWith`,\nor `name.contains` may be supplied per request."}).option(`name-starts-with`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the name starts with a
|
|
7
|
+
particular string.`}).option(`name-ends-with`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the name ends with a particular
|
|
8
|
+
string.`}).option(`name-contains`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the name contains a particular
|
|
9
|
+
string.`}).option(`status`,{type:`string`,description:"Filter accounts by lifecycle status. Defaults to `active`.",choices:[`active`,`deleted`]}).option(`order-by`,{type:`string`,description:"Field to order results by. Currently supported values: `account_name`.",choices:[`account_name`]}).option(`direction`,{type:`string`,description:"Sort direction for the order_by field. Valid values: `asc`, `desc`.\nDefaults to `asc` when order_by is specified.",choices:[`asc`,`desc`]}).option(`include-tags`,{type:`boolean`,description:`Include Account tags from the resource tag mirror. Omit this parameter to preserve the existing Account response shape.`}).option(`include-total`,{type:`boolean`,description:`Whether to calculate and return the exact result_info.total_size for cursor
|
|
10
|
+
pagination. Defaults to true. When false, total_size is omitted. page_size and
|
|
11
|
+
include_total may change between pages; next_page_token remains the authoritative
|
|
12
|
+
continuation signal.`}).option(`page-token`,{type:`string`,description:`An opaque token returned from the last list response that when
|
|
13
|
+
provided will retrieve the next page.
|
|
14
|
+
|
|
15
|
+
Parameters used to filter the retrieved list must remain in subsequent
|
|
16
|
+
requests with a page token.`}).option(`page-size`,{type:`number`,description:`The amount of items to return. Defaults to 10.`}).option(`accept`,{type:`string`,description:"Request `application/json; legacy=true` for the LegacyAccount representation."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`list`,describe:`List organization accounts`,builder:m,handler:async n=>o({command:`organizations accounts list`,classification:{safeFlags:[`status`,`order-by`,`direction`,`include-tags`,`include-total`,`dry-run`]}},n,async()=>{let o={account_pubname:n[`account-pubname`],"account_pubname.startsWith":n[`account-pubname-starts-with`],"account_pubname.endsWith":n[`account-pubname-ends-with`],"account_pubname.contains":n[`account-pubname-contains`],name:n.name,"name.startsWith":n[`name-starts-with`],"name.endsWith":n[`name-ends-with`],"name.contains":n[`name-contains`],status:n.status,order_by:n[`order-by`],direction:n.direction,include_tags:n[`include-tags`],include_total:n[`include-total`],page_token:n[`page-token`],page_size:n[`page-size`]},s={};if(n.accept!==void 0&&(s.Accept=String(n.accept)),n.dryRun){r({command:`cf organizations accounts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${n[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(n[`organization-id`]))}/accounts`,pathParams:{"organization-id":String(n[`organization-id`]??``)},query:o,bodyKind:`none`});return}let c=await t(n),l=await a(`Loading`,async()=>e(c,`GET`,`/organizations/${encodeURIComponent(String(n[`organization-id`]))}/accounts`,{query:o,headers:Object.keys(s).length>0?s:void 0}));i(l,{successLabel:`Loaded`})})},g={command:`accounts`,describe:`Accounts that belong to an organization`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var _={method:`GET`,path:e=>n`/organizations/${e.organization_id}/billable/usage`,query:[`from`,`to`]};function ee(e){return e.usage("$0 organizations billing usage get <organization-id>\n\nReturns cost and usage data for all accounts within an organization, aligned with the [FinOps FOCUS v1.3](https://focus.finops.org/focus-specification/v1-3/) Cost and Usage dataset specification. Each record represents one billable metric for one account on one day. This includes all metered usage, including usage that falls within free-tier allowances and may result in zero cost. The response includes usage for every account belonging to the specified organization. **Note:** This endpoint serves `usage` records only; cost and pricing fields are absent from responses. Rated costs are available per account via `POST /accounts/{account_id}/billable/usage` 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. An organization with no accounts, or an organization ID that does not exist, returns a successful response with an empty result set rather than an error.").positional(`organization-id`,{type:`string`,description:`Identifies the Cloudflare organization.`,demandOption:!0}).option(`from`,{type:`string`,description:"Start date for the usage query (ISO 8601). Required if `to` is set. When omitted along with `to`, defaults to the start of the current month. Filters by charge period (when consumption happened), not billing period. The maximum date range is 31 days."}).option(`to`,{type:`string`,description:"End date for the usage query (ISO 8601). Required if `from` is set. When omitted along with `from`, defaults to today. Filters by charge period (when consumption happened), not billing period. The maximum date range is 31 days."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const te={command:`get <organization-id>`,describe:`Get Organization Usage (Version 2, Alpha, Restricted)`,builder:ee,handler:async e=>o({command:`organizations billing usage get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={from:e.from,to:e.to};if(e.dryRun){r({command:`cf organizations billing usage get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/billable/usage`,pathParams:{"organization-id":String(e[`organization-id`]??``)},query:n,bodyKind:`none`});return}let o=await t(e),s=await a(`Loading`,async()=>o.send(_,{organization_id:e[`organization-id`],...n}));i(s,{successLabel:`Loaded`})})},ne={command:`usage`,describe:`Operations for billing.usage`,builder:e=>e.command(te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},v={command:`billing`,describe:`Operations for billing`,builder:e=>e.command(ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var y={method:`POST`,path:()=>`/organizations`,body:`json`};function b(e){return e.usage(`$0 organizations create
|
|
17
|
+
|
|
18
|
+
Create a new organization for a user. Sub-organization creation availability depends on the organization's capabilities. The optional \`profile\` object accepts partial profile details; its individual fields are not required. Organization names are limited to 65 UTF-8 bytes. Each profile field is limited to 1,000 UTF-8 bytes, and a non-empty business email must be valid. At least one of business name, address, phone, or email must be non-empty to persist a profile.`).option(`name`,{type:`string`,description:`The Organization name, limited to 65 UTF-8 bytes.`}).option(`parent-id`,{type:`string`,description:`Organization ID`}).option(`profile-business-address`,{type:`string`,description:`The profile.business_address field`}).option(`profile-business-email`,{type:`string`,description:`The profile.business_email field`}).option(`profile-business-name`,{type:`string`,description:`The profile.business_name field`}).option(`profile-business-phone`,{type:`string`,description:`The profile.business_phone field`}).option(`profile-external-metadata`,{type:`string`,description:`The profile.external_metadata field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`create`,describe:`Create organization`,builder:b,handler:async e=>o({command:`organizations create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){r({command:`cf organizations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/organizations`,pathParams:{},bodyKind:`json`,body:e.body===void 0?l({name:u(e.name,`name`,`text`),parent:{id:u(e[`parent-id`],`parent-id`,`text`)},profile:{business_address:u(e[`profile-business-address`],`profile-business-address`,`text`),business_email:u(e[`profile-business-email`],`profile-business-email`,`text`),business_name:u(e[`profile-business-name`],`profile-business-name`,`text`),business_phone:u(e[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:u(e[`profile-external-metadata`],`profile-external-metadata`,`text`)}}):c(e.body)});return}let n=e.body===void 0?void 0:c(e.body),o=await t(e);if(e.body!==void 0){let e=n,t=await a(`Creating`,async()=>o.send(y,{body:e}));i(t,{successLabel:`Created`});return}e.name===void 0&&(e.name=await d(`name`,`The Organization name, limited to 65 UTF-8 bytes.`));let s=l({name:u(e.name,`name`,`text`),parent:{id:u(e[`parent-id`],`parent-id`,`text`)},profile:{business_address:u(e[`profile-business-address`],`profile-business-address`,`text`),business_email:u(e[`profile-business-email`],`profile-business-email`,`text`),business_name:u(e[`profile-business-name`],`profile-business-name`,`text`),business_phone:u(e[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:u(e[`profile-external-metadata`],`profile-external-metadata`,`text`)}}),f=await a(`Creating`,async()=>o.send(y,{body:s}));i(f,{successLabel:`Created`})})};var S={method:`DELETE`,path:e=>n`/organizations/${e.organization_id}`};function C(e){return e.usage(`$0 organizations delete <organization-id>
|
|
19
|
+
|
|
20
|
+
Delete an organization. It must not contain active sub-organizations or accounts. A root organization must also have no active managed users. Sub-organization deletion availability depends on the organization's capabilities. **Access Control:** Root deletion is restricted to enterprise organizations.`).positional(`organization-id`,{type:`string`,description:`The ID of the organization to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const w={command:`delete <organization-id>`,describe:`Delete organization`,builder:C,handler:async e=>o({command:`organizations delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){r({command:`cf organizations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`none`});return}let n=await t(e);if(!await p({force:!!e.force,message:`Delete this empty organization? This action cannot be undone.`}))return;let o=await a(`Deleting`,async()=>n.send(S,{organization_id:e[`organization-id`]}));i(o,{successLabel:`Deleted`})})};var T={method:`GET`,path:e=>n`/organizations/${e.organization_id}`};function E(e){return e.usage(`$0 organizations get <organization-id>
|
|
21
|
+
|
|
22
|
+
Retrieve the details of a certain organization.`).positional(`organization-id`,{type:`string`,description:`The ID of the organization to retrieve.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <organization-id>`,describe:`Get organization`,builder:E,handler:async e=>o({command:`organizations get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){r({command:`cf organizations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`none`});return}let n=await t(e),o=await a(`Loading`,async()=>n.send(T,{organization_id:e[`organization-id`]}));i(o,{successLabel:`Loaded`})})};var O={method:`PUT`,path:e=>n`/organizations/${e.organization_id}/invites/${e.member_code}`,body:`json`};function k(e){return e.usage(`$0 organizations invites update <member-code>
|
|
23
|
+
|
|
24
|
+
Accept or reject an invitation to a specific organization. The credential must belong to the invited user. No additional API token permission is required.`).positional(`member-code`,{type:`string`,description:`The invitation code to accept or reject.`,demandOption:!0}).option(`organization-id`,{type:`string`,description:`The ID of the organization associated with the invitation.`,demandOption:!0}).option(`status`,{type:`string`,description:`The status field`,choices:[`accept`,`reject`]}).coerce(`status`,e=>u(e,`status`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"The invitation action. Use `accept` to join the organization or `reject` to decline the invitation."})}const A={command:`update <member-code>`,describe:`Handle organization invite`,builder:k,handler:async e=>o({command:`organizations invites update`,classification:{safeFlags:[`status`,`dry-run`]}},e,async()=>{if(e.dryRun){r({command:`cf organizations invites update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/invites/${e[`member-code`]==null?`<member-code>`:encodeURIComponent(String(e[`member-code`]))}`,pathParams:{"organization-id":String(e[`organization-id`]??``),"member-code":String(e[`member-code`]??``)},bodyKind:`json`,body:e.body===void 0?l({status:e.status}):c(e.body)});return}let n=e.body===void 0?void 0:c(e.body),o=await t(e);if(e.body!==void 0){let t=n,r=await a(`Updating`,async()=>o.send(O,{body:t,organization_id:e[`organization-id`],member_code:e[`member-code`]}));i(r,{successLabel:`Updated`});return}e.status===void 0&&(e.status=await f(`status`,`The status field`,[`accept`,`reject`]));let s=l({status:e.status}),u=await a(`Updating`,async()=>o.send(O,{body:s,organization_id:e[`organization-id`],member_code:e[`member-code`]}));i(u,{successLabel:`Updated`})})},j={command:`invites`,describe:`Invitations to join an organization`,builder:e=>e.command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var M={method:`GET`,path:()=>`/organizations`,query:[`id`,`name`,`name.startsWith`,`name.endsWith`,`name.contains`,`containing.account`,`containing.user`,`containing.organization`,`parent.id`,`member.email`,`order_by`,`direction`,`page_token`,`page_size`],joined:[`name`,`name.startsWith`,`name.endsWith`,`name.contains`,`containing.account`,`containing.user`,`containing.organization`,`parent.id`,`order_by`,`direction`,`page_token`,`page_size`]};function N(e){return e.usage("$0 organizations list\n\nRetrieve a list of organizations a particular user has access to. At most one of `containing.account`, `containing.user`, or `containing.organization` may be provided.").option(`id`,{type:`string`,array:!0,description:`Only return organizations with the specified IDs (ex. id=foo&id=bar). Send multiple elements
|
|
25
|
+
by repeating the query value.`}).option(`name`,{type:`string`,description:`(case-sensitive) Filter the list of organizations to where the name is equal to a
|
|
26
|
+
particular string.`}).option(`name-starts-with`,{type:`string`,description:`(case-insensitive) Filter the list of organizations to where the name starts with a
|
|
27
|
+
particular string.`}).option(`name-ends-with`,{type:`string`,description:`(case-insensitive) Filter the list of organizations to where the name ends with a particular
|
|
28
|
+
string.`}).option(`name-contains`,{type:`string`,description:`(case-insensitive) Filter the list of organizations to where the name contains a particular
|
|
29
|
+
string.`}).option(`containing-account`,{type:`string`,description:`Filter the list of organizations to the ones that contain this particular
|
|
30
|
+
account.`}).option(`containing-user`,{type:`string`,description:`Filter the list of organizations to the ones that contain this particular
|
|
31
|
+
user.
|
|
32
|
+
|
|
33
|
+
IMPORTANT: Just because an organization "contains" a user is not a
|
|
34
|
+
representation of any authorization or privilege to manage any resources
|
|
35
|
+
therein. An organization "containing" a user simply means the user is managed by
|
|
36
|
+
that organization.`}).option(`containing-organization`,{type:`string`,description:`Filter the list of organizations to the ones that contain this particular
|
|
37
|
+
organization.`}).option(`parent-id`,{type:`string`,description:`Filter the list of organizations to the ones that are a sub-organization
|
|
38
|
+
of the specified organization.
|
|
39
|
+
|
|
40
|
+
"null" is a valid value to provide for this parameter. It means "where
|
|
41
|
+
an organization has no parent (i.e. it is a 'root' organization)."`}).option(`member-email`,{type:`string`,description:`Filter organizations to those where the given user, by email, is an active member of
|
|
42
|
+
that exact organization. This does not include hierarchy-derived access.`}).option(`order-by`,{type:`string`,description:"Field to order results by. Currently supported values: `name`.\nWhen not specified, results are ordered by hierarchy.",choices:[`name`]}).option(`direction`,{type:`string`,description:"Sort direction for the `order_by` field. Defaults to `asc` when `order_by` is\nspecified.",choices:[`asc`,`desc`]}).option(`page-token`,{type:`string`,description:`An opaque token returned from the last list response that when
|
|
43
|
+
provided will retrieve the next page.
|
|
44
|
+
|
|
45
|
+
Parameters used to filter the retrieved list must remain in subsequent
|
|
46
|
+
requests with a page token.`}).option(`page-size`,{type:`number`,description:`The amount of items to return. Defaults to 10.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`list`,describe:`List organizations the user has access to`,builder:N,handler:async e=>o({command:`organizations list`,classification:{safeFlags:[`order-by`,`direction`,`dry-run`]}},e,async()=>{let n={id:e.id,name:e.name,"name.startsWith":e[`name-starts-with`],"name.endsWith":e[`name-ends-with`],"name.contains":e[`name-contains`],"containing.account":e[`containing-account`],"containing.user":e[`containing-user`],"containing.organization":e[`containing-organization`],"parent.id":e[`parent-id`],"member.email":e[`member-email`],order_by:e[`order-by`],direction:e.direction,page_token:e[`page-token`],page_size:e[`page-size`]};if(e.dryRun){r({command:`cf organizations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations`,pathParams:{},query:n,bodyKind:`none`});return}let o=await t(e),s=await a(`Loading`,async()=>o.send(M,n));i(s,{successLabel:`Loaded`})})};var F={method:`GET`,path:e=>n`/organizations/${e.organization_id}/logs/audit`,query:/* @__PURE__ */ `action_result,action_type,actor_context,actor_email,actor_id,actor_ip_address,actor_token_id,actor_token_name,actor_type,id,raw_cf_ray_id,raw_method,raw_status_code,raw_uri,resource_id,resource_product,resource_type,resource_scope,action_result.not,action_type.not,actor_context.not,actor_email.not,actor_id.not,actor_ip_address.not,actor_token_id.not,actor_token_name.not,actor_type.not,id.not,raw_cf_ray_id.not,raw_method.not,raw_status_code.not,raw_uri.not,resource_id.not,resource_product.not,resource_type.not,resource_scope.not,since,before,direction,limit,cursor`.split(`,`)};function I(e){return e.usage(`$0 organizations logs audit get <organization-id>
|
|
47
|
+
|
|
48
|
+
Gets a list of audit logs for an organization.`).positional(`organization-id`,{type:`string`,description:`The unique id that identifies the organization.`,demandOption:!0}).option(`action-result`,{type:`string`,array:!0,description:`Filters by whether the action was successful or not.`}).option(`action-type`,{type:`string`,array:!0,description:`Filters by the action type.`}).option(`actor-context`,{type:`string`,array:!0,description:"Filters by the actor context.\n- `api`: The action was performed through the API. The specific credential type was not recorded.\n- `api_key`: The action was authenticated with a Cloudflare Global API Key.\n- `api_token`: The action was authenticated with an API token.\n- `dash`: The action was performed through the Cloudflare dashboard.\n- `oauth`: The action was authenticated with an OAuth token.\n- `origin_ca_key`: The action was authenticated with an Origin CA key."}).option(`actor-email`,{type:`string`,array:!0,description:`Filters by the actor's email address.`}).option(`actor-id`,{type:`string`,array:!0,description:`Filters by the actor's user ID.`}).option(`actor-ip-address`,{type:`string`,array:!0,description:`The IP address where the action was initiated.`}).option(`actor-token-id`,{type:`string`,array:!0,description:`Filters by the API token ID when the actor context is an api_token or oauth.`}).option(`actor-token-name`,{type:`string`,array:!0,description:`Filters by the API token name when the actor context is an api_token or oauth.`}).option(`actor-type`,{type:`string`,array:!0,description:`Filters by the actor type.`}).option(`id`,{type:`string`,array:!0,description:`Finds a specific log by its ID.`}).option(`raw-cf-ray-id`,{type:`string`,array:!0,description:`Filters by the response CF Ray ID.`}).option(`raw-method`,{type:`string`,array:!0,description:`The HTTP method for the API call.`}).option(`raw-status-code`,{type:`string`,array:!0,description:`The response status code that was returned.`}).option(`raw-uri`,{type:`string`,array:!0,description:`Filters by the request URI.`}).option(`resource-id`,{type:`string`,array:!0,description:`Filters by the resource ID.`}).option(`resource-product`,{type:`string`,array:!0,description:`Filters audit logs by the Cloudflare product associated with the changed resource.`}).option(`resource-type`,{type:`string`,array:!0,description:`Filters audit logs based on the unique type of resource changed by the action.`}).option(`resource-scope`,{type:`string`,array:!0,description:`Filters by the resource scope, specifying whether the resource is associated with an organization.`}).option(`action-result-not`,{type:`string`,array:!0,description:`Filters out audit logs by whether the action was successful or not.`}).option(`action-type-not`,{type:`string`,array:!0,description:`Filters out audit logs by the action type.`}).option(`actor-context-not`,{type:`string`,array:!0,description:"Filters out audit logs by the actor context.\n- `api`: The action was performed through the API. The specific credential type was not recorded.\n- `api_key`: The action was authenticated with a Cloudflare Global API Key.\n- `api_token`: The action was authenticated with an API token.\n- `dash`: The action was performed through the Cloudflare dashboard.\n- `oauth`: The action was authenticated with an OAuth token.\n- `origin_ca_key`: The action was authenticated with an Origin CA key."}).option(`actor-email-not`,{type:`string`,array:!0,description:`Filters out audit logs by the actor's email address.`}).option(`actor-id-not`,{type:`string`,array:!0,description:`Filters out audit logs by the actor's user ID.`}).option(`actor-ip-address-not`,{type:`string`,array:!0,description:`Filters out audit logs IP address where the action was initiated.`}).option(`actor-token-id-not`,{type:`string`,array:!0,description:`Filters out audit logs by the API token ID when the actor context is an api_token or oauth.`}).option(`actor-token-name-not`,{type:`string`,array:!0,description:`Filters out audit logs by the API token name when the actor context is an api_token or oauth.`}).option(`actor-type-not`,{type:`string`,array:!0,description:`Filters out audit logs by the actor type.`}).option(`id-not`,{type:`string`,array:!0,description:`Filters out audit logs by their IDs.`}).option(`raw-cf-ray-id-not`,{type:`string`,array:!0,description:`Filters out audit logs by the response CF Ray ID.`}).option(`raw-method-not`,{type:`string`,array:!0,description:`Filters out audit logs by the HTTP method for the API call.`}).option(`raw-status-code-not`,{type:`string`,array:!0,description:`Filters out audit logs by the response status code that was returned.`}).option(`raw-uri-not`,{type:`string`,array:!0,description:`Filters out audit logs by the request URI.`}).option(`resource-id-not`,{type:`string`,array:!0,description:`Filters out audit logs by the resource ID.`}).option(`resource-product-not`,{type:`string`,array:!0,description:`Filters out audit logs by the Cloudflare product associated with the changed resource.`}).option(`resource-type-not`,{type:`string`,array:!0,description:`Filters out audit logs based on the unique type of resource changed by the action.`}).option(`resource-scope-not`,{type:`string`,array:!0,description:`Filters out audit logs by the resource scope, specifying whether the resource is associated with an organization.`}).option(`since`,{type:`string`,description:`Limits the returned results to logs newer than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`before`,{type:`string`,description:`Limits the returned results to logs older than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`direction`,{type:`string`,description:`Sets sorting order.`,choices:[`desc`,`asc`]}).option(`limit`,{type:`number`,description:`The number limits the objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit.`}).option(`cursor`,{type:`string`,description:`The cursor is an opaque token used to paginate through large sets of records. It indicates the position from which to continue when requesting the next set of records. A valid cursor value can be obtained from the cursor object in the result_info structure of a previous response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`get <organization-id>`,describe:`Get organization audit logs (Version 2)`,builder:I,handler:async e=>o({command:`organizations logs audit get`,classification:{safeFlags:[`direction`,`dry-run`]}},e,async()=>{let n={action_result:e[`action-result`],action_type:e[`action-type`],actor_context:e[`actor-context`],actor_email:e[`actor-email`],actor_id:e[`actor-id`],actor_ip_address:e[`actor-ip-address`],actor_token_id:e[`actor-token-id`],actor_token_name:e[`actor-token-name`],actor_type:e[`actor-type`],id:e.id,raw_cf_ray_id:e[`raw-cf-ray-id`],raw_method:e[`raw-method`],raw_status_code:e[`raw-status-code`],raw_uri:e[`raw-uri`],resource_id:e[`resource-id`],resource_product:e[`resource-product`],resource_type:e[`resource-type`],resource_scope:e[`resource-scope`],"action_result.not":e[`action-result-not`],"action_type.not":e[`action-type-not`],"actor_context.not":e[`actor-context-not`],"actor_email.not":e[`actor-email-not`],"actor_id.not":e[`actor-id-not`],"actor_ip_address.not":e[`actor-ip-address-not`],"actor_token_id.not":e[`actor-token-id-not`],"actor_token_name.not":e[`actor-token-name-not`],"actor_type.not":e[`actor-type-not`],"id.not":e[`id-not`],"raw_cf_ray_id.not":e[`raw-cf-ray-id-not`],"raw_method.not":e[`raw-method-not`],"raw_status_code.not":e[`raw-status-code-not`],"raw_uri.not":e[`raw-uri-not`],"resource_id.not":e[`resource-id-not`],"resource_product.not":e[`resource-product-not`],"resource_type.not":e[`resource-type-not`],"resource_scope.not":e[`resource-scope-not`],since:e.since,before:e.before,direction:e.direction,limit:e.limit,cursor:e.cursor};if(e.dryRun){r({command:`cf organizations logs audit get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/logs/audit`,pathParams:{"organization-id":String(e[`organization-id`]??``)},query:n,bodyKind:`none`});return}let o=await t(e),s=await a(`Loading`,async()=>o.send(F,{organization_id:e[`organization-id`],...n}));i(s,{successLabel:`Loaded`})})};var R={method:`GET`,path:e=>n`/organizations/${e.organization_id}/logs/audit/${e.id}/history`,query:[`action_time`,`since`,`before`,`direction`,`limit`,`cursor`],errors:{404:`NotFoundError`}};function z(e){return e.usage("$0 organizations logs audit history <id>\n\nReturns the chronological change history for the resource identified by the given organization-scoped audit log entry. The endpoint first locates the source audit log entry by `id` (using `action_time` to narrow the lookup window), derives identifying filters from that entry, and then returns matching audit logs within the `since`/`before` window. The `result_info.history_status` field indicates the quality of the resource identification used: - `exact`: Resource was identified by the resource URI. - `approximate`: Resource was identified without the resource URI. - `unavailable`: The source audit log entry did not contain enough information to identify the resource; an empty result is returned.").positional(`id`,{type:`string`,description:`The ID of the audit log to fetch resource history for.`,demandOption:!0}).option(`organization-id`,{type:`string`,description:`The unique ID that identifies the organization.`,demandOption:!0}).option(`action-time`,{type:`string`,description:"RFC3339 timestamp of the source audit log entry's action time. Used to narrow the source-entry lookup window. Provide the `action.time` value from the audit log identified by `id`.",demandOption:!0}).option(`since`,{type:`string`,description:`Limits the returned results to logs newer than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`before`,{type:`string`,description:`Limits the returned results to logs older than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`direction`,{type:`string`,description:`Sets sorting order.`,choices:[`desc`,`asc`]}).option(`limit`,{type:`number`,description:`The number limits the objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit.`}).option(`cursor`,{type:`string`,description:`The cursor is an opaque token used to paginate through large sets of records. It indicates the position from which to continue when requesting the next set of records. A valid cursor value can be obtained from the cursor object in the result_info structure of a previous response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`history <id>`,describe:`Get resource change history from an organization audit log entry (Version 2)`,builder:z,handler:async e=>o({command:`organizations logs audit history`,classification:{safeFlags:[`direction`,`dry-run`]}},e,async()=>{let n={action_time:e[`action-time`],since:e.since,before:e.before,direction:e.direction,limit:e.limit,cursor:e.cursor};if(e.dryRun){r({command:`cf organizations logs audit history`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/logs/audit/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/history`,pathParams:{"organization-id":String(e[`organization-id`]??``),id:String(e.id??``)},query:n,bodyKind:`none`});return}let o=await t(e),s=await a(`Loading`,async()=>o.send(R,{organization_id:e[`organization-id`],id:e.id,...n}));i(s,{successLabel:`Loaded`})})},V={command:`audit`,describe:`Operations for logs.audit`,builder:e=>e.command(L).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},H={command:`logs`,describe:`Operations for logs`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var U={method:`POST`,path:e=>n`/organizations/${e.organization_id}/members:batchCreate`,body:`json`};function W(e){return e.usage(`$0 organizations members batch create <organization-id>
|
|
49
|
+
|
|
50
|
+
Batch create multiple memberships that grant access to a specific Organization.`).positional(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`members`,{type:`string`,description:`Omitted or null members are treated as an empty batch. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"user": {...}}].`}).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 G={command:`create <organization-id>`,describe:`Batch create organization members`,builder:W,handler:async e=>o({command:`organizations members batch create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){r({command:`cf organizations members batch create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/members:batchCreate`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({members:s(e.members,`members`)}):c(e.body)});return}let n=e.body===void 0?void 0:c(e.body),o=await t(e);if(e.body!==void 0){let t=n,r=await a(`Creating`,async()=>o.send(U,{body:t,organization_id:e[`organization-id`]}));i(r,{successLabel:`Created`});return}let u=l({members:s(e.members,`members`)}),d=await a(`Creating`,async()=>o.send(U,{body:u,organization_id:e[`organization-id`]}));i(d,{successLabel:`Created`})})},re={command:`batch`,describe:`Add members to an organization in bulk`,builder:e=>e.command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var K={method:`POST`,path:e=>n`/organizations/${e.organization_id}/members`,body:`json`};function q(e){return e.usage(`$0 organizations members create <organization-id>
|
|
51
|
+
|
|
52
|
+
Create a membership that grants access to a specific Organization.`).positional(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`member-user-email`,{type:`string`,description:`The member.user.email field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const J={command:`create <organization-id>`,describe:`Create organization member`,builder:q,handler:async e=>o({command:`organizations members create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){r({command:`cf organizations members create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/members`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({member:{user:{email:u(e[`member-user-email`],`member-user-email`,`text`)}}}):c(e.body)});return}let n=e.body===void 0?void 0:c(e.body),o=await t(e);if(e.body!==void 0){let t=n,r=await a(`Creating`,async()=>o.send(K,{body:t,organization_id:e[`organization-id`]}));i(r,{successLabel:`Created`});return}e[`member-user-email`]===void 0&&(e[`member-user-email`]=await d(`member-user-email`,`The member.user.email field`));let s=l({member:{user:{email:u(e[`member-user-email`],`member-user-email`,`text`)}}}),f=await a(`Creating`,async()=>o.send(K,{body:s,organization_id:e[`organization-id`]}));i(f,{successLabel:`Created`})})};var Y={method:`DELETE`,path:e=>n`/organizations/${e.organization_id}/members/${e.member_id}`};function X(e){return e.usage(`$0 organizations members delete <member-id>
|
|
53
|
+
|
|
54
|
+
Delete a membership to a particular Organization.`).positional(`member-id`,{type:`string`,description:`Organization Member ID`,demandOption:!0}).option(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ie={command:`delete <member-id>`,describe:`Delete organization member`,builder:X,handler:async e=>o({command:`organizations members delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){r({command:`cf organizations members delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/members/${e[`member-id`]==null?`<member-id>`:encodeURIComponent(String(e[`member-id`]))}`,pathParams:{"organization-id":String(e[`organization-id`]??``),"member-id":String(e[`member-id`]??``)},bodyKind:`none`});return}let n=await t(e);if(!await p({force:!!e.force,message:`Delete this organization membership? The member will lose access to this organization and its sub-organizations.`}))return;let o=await a(`Deleting`,async()=>n.send(Y,{organization_id:e[`organization-id`],member_id:e[`member-id`]}));i(o,{successLabel:`Deleted`})})};var ae={method:`GET`,path:e=>n`/organizations/${e.organization_id}/members/${e.member_id}`};function oe(e){return e.usage(`$0 organizations members get <member-id>
|
|
55
|
+
|
|
56
|
+
Retrieve a single membership from an Organization.`).positional(`member-id`,{type:`string`,description:`Organization Member ID`,demandOption:!0}).option(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const se={command:`get <member-id>`,describe:`Get organization member`,builder:oe,handler:async e=>o({command:`organizations members get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){r({command:`cf organizations members get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/members/${e[`member-id`]==null?`<member-id>`:encodeURIComponent(String(e[`member-id`]))}`,pathParams:{"organization-id":String(e[`organization-id`]??``),"member-id":String(e[`member-id`]??``)},bodyKind:`none`});return}let n=await t(e),o=await a(`Loading`,async()=>n.send(ae,{organization_id:e[`organization-id`],member_id:e[`member-id`]}));i(o,{successLabel:`Loaded`})})};var ce={method:`GET`,path:e=>n`/organizations/${e.organization_id}/members`,query:[`status`,`user.email`,`user.email.contains`,`user.email.startsWith`,`user.email.endsWith`,`page_token`,`page_size`],joined:[`user.email`,`user.email.contains`,`user.email.startsWith`,`user.email.endsWith`,`page_token`,`page_size`]};function le(e){return e.usage(`$0 organizations members list
|
|
57
|
+
|
|
58
|
+
List memberships for an Organization.`).option(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`status`,{type:`string`,array:!0,description:"Filter the list of memberships by membership status. Defaults to `active`, `pending`, and `rejected`; pass `canceled` explicitly to include canceled memberships."}).option(`user-email`,{type:`string`,description:`Filter the list of memberships for a specific email.`}).option(`user-email-contains`,{type:`string`,description:`Filter the list of memberships for a specific email that contains a substring.`}).option(`user-email-starts-with`,{type:`string`,description:`Filter the list of memberships for a specific email that starts with a substring.`}).option(`user-email-ends-with`,{type:`string`,description:`Filter the list of memberships for a specific email that ends with a substring.`}).option(`page-token`,{type:`string`,description:`An opaque token returned from the last list response that when
|
|
59
|
+
provided will retrieve the next page.
|
|
60
|
+
|
|
61
|
+
Parameters used to filter the retrieved list must remain in subsequent
|
|
62
|
+
requests with a page token.`}).option(`page-size`,{type:`number`,description:`The amount of items to return. Defaults to 10.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ue={command:`list`,describe:`List organization members`,builder:le,handler:async e=>o({command:`organizations members list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={status:e.status,"user.email":e[`user-email`],"user.email.contains":e[`user-email-contains`],"user.email.startsWith":e[`user-email-starts-with`],"user.email.endsWith":e[`user-email-ends-with`],page_token:e[`page-token`],page_size:e[`page-size`]};if(e.dryRun){r({command:`cf organizations members list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/members`,pathParams:{"organization-id":String(e[`organization-id`]??``)},query:n,bodyKind:`none`});return}let o=await t(e),s=await a(`Loading`,async()=>o.send(ce,{organization_id:e[`organization-id`],...n}));i(s,{successLabel:`Loaded`})})},de={command:`members`,describe:`Members of an organization`,builder:e=>e.command(J).command(ie).command(se).command(ue).command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var fe={method:`GET`,path:e=>n`/organizations/${e.organization_id}/profile`};function pe(e){return e.usage(`$0 organizations profile get <organization-id>
|
|
63
|
+
|
|
64
|
+
Retrieves the business profile (name, email, phone, address, and external metadata) associated with this organization's customer record. Profiles can be shared across accounts and organizations. Only available to members of the organization.`).positional(`organization-id`,{type:`string`,description:`The ID of the organization to retrieve a profile for.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`get <organization-id>`,describe:`Get organization profile`,builder:pe,handler:async e=>o({command:`organizations profile get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){r({command:`cf organizations profile get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/profile`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`none`});return}let n=await t(e),o=await a(`Loading`,async()=>n.send(fe,{organization_id:e[`organization-id`]}));i(o,{successLabel:`Loaded`})})};var Z={method:`PUT`,path:e=>n`/organizations/${e.organization_id}/profile`,body:`json`,response:!1};function Q(e){return e.usage(`$0 organizations profile update <organization-id>
|
|
65
|
+
|
|
66
|
+
Partially updates the business profile (name, email, phone, address, and external metadata) associated with this organization's customer record, creating the profile if it does not exist. Changes apply to every account and organization sharing that profile. Omitted, empty, or null fields are left unchanged. Each profile field is limited to 1,000 UTF-8 bytes. Only available to members of the organization.`).positional(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`business-address`,{type:`string`,description:`The business_address field`}).option(`business-email`,{type:`string`,description:`The business_email field`}).option(`business-name`,{type:`string`,description:`The business_name field`}).option(`business-phone`,{type:`string`,description:`The business_phone field`}).option(`external-metadata`,{type:`string`,description:`The external_metadata field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Partial business profile update. Omitted, empty, or null fields remain unchanged. At least one of business name, address, phone, or email must be non-empty.`})}const he={command:`update <organization-id>`,describe:`Modify organization profile.`,builder:Q,handler:async e=>o({command:`organizations profile update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){r({command:`cf organizations profile update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/profile`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({business_address:u(e[`business-address`],`business-address`,`text`),business_email:u(e[`business-email`],`business-email`,`text`),business_name:u(e[`business-name`],`business-name`,`text`),business_phone:u(e[`business-phone`],`business-phone`,`text`),external_metadata:u(e[`external-metadata`],`external-metadata`,`text`)}):c(e.body)});return}let n=e.body===void 0?void 0:c(e.body),o=await t(e);if(e.body!==void 0){let t=n,r=await a(`Updating`,async()=>o.send(Z,{body:t,organization_id:e[`organization-id`]}));i(r,{successLabel:`Updated`});return}let s=l({business_address:u(e[`business-address`],`business-address`,`text`),business_email:u(e[`business-email`],`business-email`,`text`),business_name:u(e[`business-name`],`business-name`,`text`),business_phone:u(e[`business-phone`],`business-phone`,`text`),external_metadata:u(e[`external-metadata`],`external-metadata`,`text`)}),d=await a(`Updating`,async()=>o.send(Z,{body:s,organization_id:e[`organization-id`]}));i(d,{successLabel:`Updated`})})},ge={command:`profile`,describe:`View and update the public profile information for an organization`,builder:e=>e.command(me).command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var _e={method:`GET`,path:e=>n`/organizations/${e.organization_id}/shares`,query:[`status`,`order`,`direction`,`page`,`per_page`]};function ve(e){return e.usage(`$0 organizations shares list
|
|
67
|
+
|
|
68
|
+
Lists all organization shares.`).option(`organization-id`,{type:`string`,description:`Organization identifier.`,demandOption:!0}).option(`status`,{type:`string`,description:`Filter shares by status.`,choices:[`active`,`deleting`,`deleted`]}).option(`order`,{type:`string`,description:`Order shares by values in the given field.`,choices:[`name`,`created`]}).option(`direction`,{type:`string`,description:`Direction to sort objects.`,choices:[`asc`,`desc`]}).option(`page`,{type:`number`,description:"Page number. Defaults to `1` when omitted."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when omitted."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ye={command:`list`,describe:`List organization shares`,builder:ve,handler:async e=>o({command:`organizations shares list`,classification:{safeFlags:[`status`,`order`,`direction`,`dry-run`]}},e,async()=>{let n={status:e.status,order:e.order,direction:e.direction,page:e.page,per_page:e[`per-page`]};if(e.dryRun){r({command:`cf organizations shares list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/shares`,pathParams:{"organization-id":String(e[`organization-id`]??``)},query:n,bodyKind:`none`});return}let o=await t(e),s=await a(`Loading`,async()=>o.send(_e,{organization_id:e[`organization-id`],...n}));i(s,{successLabel:`Loaded`})})},be={command:`shares`,describe:`Shares across the organization`,builder:e=>e.command(ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var $={method:`PUT`,path:e=>n`/organizations/${e.organization_id}`,body:`json`};function xe(e){return e.usage(`$0 organizations update <organization-id>
|
|
69
|
+
|
|
70
|
+
Update an organization's name. Supplying \`parent_id\` verifies the current parent; this endpoint cannot move an organization. Organization names are limited to 65 UTF-8 bytes.`).positional(`organization-id`,{type:`string`,description:`The ID of the organization to modify.`,demandOption:!0}).option(`name`,{type:`string`,description:`The Organization name, limited to 65 UTF-8 bytes. An omitted, empty, or unchanged value is a no-op.`}).option(`parent-id`,{type:`string`,description:`The current parent Organization ID. A different value is rejected; this endpoint cannot move an Organization.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The Organization fields to update or verify.`})}const Se={command:`update <organization-id>`,describe:`Update organization`,builder:xe,handler:async e=>o({command:`organizations update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){r({command:`cf organizations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({name:u(e.name,`name`,`text`),parent_id:u(e[`parent-id`],`parent-id`,`text`)}):c(e.body)});return}let n=e.body===void 0?void 0:c(e.body),o=await t(e);if(e.body!==void 0){let t=n,r=await a(`Updating`,async()=>o.send($,{body:t,organization_id:e[`organization-id`]}));i(r,{successLabel:`Updated`});return}let s=l({name:u(e.name,`name`,`text`),parent_id:u(e[`parent-id`],`parent-id`,`text`)}),d=await a(`Updating`,async()=>o.send($,{body:s,organization_id:e[`organization-id`]}));i(d,{successLabel:`Updated`})})},Ce={command:`organizations`,describe:`Multi-user organizations that group accounts, members, and shared settings under a single entity`,builder:e=>e.command(x).command(w).command(D).command(P).command(Se).command(g).command(v).command(j).command(H).command(de).command(ge).command(be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ce as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./args-BAOHroBC.mjs";import{n as t}from"./interactive-wQM7Blhm.mjs";import{r as n,t as r}from"./theme-BGHWSKCw.mjs";import{n as i}from"./api-Dnt6lRJG.mjs";function a(e){return typeof e==`object`&&e&&`result`in e&&Array.isArray(e.result)&&`result_info`in e?{payload:e.result,resultInfo:e.result_info}:{payload:e,resultInfo:i(e)}}function o(t){process.stderr.isTTY&&!e()&&process.stderr.write(`${n.success(`✓`)} ${t}\n`)}function s(t,n={}){if(n.quiet)return;let{payload:r,resultInfo:i}=a(t);!e()&&typeof i==`object`&&i&&Object.keys(i).length>0&&process.stderr.write(`result_info: ${JSON.stringify(i)}\n`),r==null?n.successLabel&&o(n.successLabel):console.log(c(r))}function c(e){let i=JSON.stringify(e,null,2);return t(process.stdout)||!r()||i.length>5e4?i:i.replace(/"((?:[^"\\]|\\.)*)":/g,(e,t)=>`${n.jsonKey(`"${t}"`)}:`).replace(/: "((?:[^"\\]|\\.)*)"/g,(e,t)=>`: ${n.jsonString(`"${t}"`)}`).replace(/: (-?\d+\.?\d*)/g,(e,t)=>`: ${n.jsonNumber(t)}`).replace(/: (true|false)/g,(e,t)=>`: ${n.jsonBoolean(t)}`).replace(/: (null)/g,(e,t)=>`: ${n.muted(t)}`)}export{o as n,s as t};
|