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,52 @@
|
|
|
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{o as n,r,t as i}from"./body-parser-HN91kAf0.mjs";import{a,t as o}from"./context-BGm5_wTT.mjs";import{t as s}from"./dry-run-qsnRlRk6.mjs";import{n as c}from"./input-validation-D7z60HJH.mjs";import{t as l}from"./local-B3zt9PXR.mjs";import{t as u}from"./run-CXWkMU3x.mjs";import{t as d}from"./output-hFMAotFl.mjs";import{t as f}from"./progress-DE_G09u2.mjs";import{a as p,i as m,n as h}from"./prompt-D274Im1O.mjs";import"./telemetry-COlodX5Z.mjs";var g={method:`POST`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/consumers`,body:`json`};function _(e){return e.usage(`$0 queues consumers create <queue-id>
|
|
3
|
+
|
|
4
|
+
Creates a consumer for a Queue.`).positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dead-letter-queue`,{type:`string`,description:`The dead_letter_queue field`}).option(`script-name`,{type:`string`,description:`Name of a Worker`}).option(`settings-batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`settings-max-concurrency`,{type:`number`,description:"Maximum number of concurrent consumers that may consume from this Queue. Set to `null` to automatically opt in to the platform's maximum (recommended)."}).option(`settings-max-retries`,{type:`number`,description:`The maximum number of retries`}).option(`settings-max-wait-time-ms`,{type:`number`,description:`The number of milliseconds to wait for a batch to fill up before attempting to deliver it`}).option(`settings-retry-delay`,{type:`number`,description:`The number of seconds to delay before making the message available for another attempt.`}).option(`settings-visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).option(`type`,{type:`string`,description:`The type field`,choices:[`worker`,`http_pull`]}).coerce(`type`,e=>c(e,`type`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating or updating a consumer`}).conflicts(`script-name`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-concurrency`,[`settings-visibility-timeout-ms`]).implies(`settings-max-concurrency`,[`script-name`]).conflicts(`settings-max-wait-time-ms`,[`settings-visibility-timeout-ms`]).implies(`settings-max-wait-time-ms`,[`script-name`]).conflicts(`settings-visibility-timeout-ms`,[`script-name`,`settings-max-concurrency`,`settings-max-wait-time-ms`])}const v={command:`create <queue-id>`,describe:`Create a Queue Consumer`,builder:_,handler:async e=>u({command:`queues consumers create`,classification:{safeFlags:[`type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf queues consumers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/consumers`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({dead_letter_queue:c(e[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:c(e[`script-name`],`script-name`,`text`),settings:{batch_size:e[`settings-batch-size`],max_concurrency:e[`settings-max-concurrency`],max_retries:e[`settings-max-retries`],max_wait_time_ms:e[`settings-max-wait-time-ms`],retry_delay:e[`settings-retry-delay`],visibility_timeout_ms:e[`settings-visibility-timeout-ms`]},type:e.type}):r(e.body)});return}let n=e.body===void 0?void 0:r(e.body),u=await t(e),h=e.local?l:await o();if(e.accountId=h,e.body!==void 0){let t=n,r=await f(`Creating`,async()=>u.send(g,{body:t,account_id:h,queue_id:e[`queue-id`]}));d(r,{successLabel:`Created`});return}e.type===void 0&&(e.type=await m(`type`,`The type field`,[`worker`,`http_pull`])),e.type===`worker`&&e[`script-name`]===void 0&&(e[`script-name`]=await p(`script-name`,`Name of a Worker`,{question:`Enter value for --script-name`}));let _=i({dead_letter_queue:c(e[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:c(e[`script-name`],`script-name`,`text`),settings:{batch_size:e[`settings-batch-size`],max_concurrency:e[`settings-max-concurrency`],max_retries:e[`settings-max-retries`],max_wait_time_ms:e[`settings-max-wait-time-ms`],retry_delay:e[`settings-retry-delay`],visibility_timeout_ms:e[`settings-visibility-timeout-ms`]},type:e.type}),v=await f(`Creating`,async()=>u.send(g,{body:_,account_id:h,queue_id:e[`queue-id`]}));d(v,{successLabel:`Created`})})};var ee={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/consumers/${t.consumer_id}`};function te(e){return e.usage(`$0 queues consumers delete <consumer-id>
|
|
5
|
+
|
|
6
|
+
Deletes a consumer from a Queue.`).positional(`consumer-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={command:`delete <consumer-id>`,describe:`Delete Queue Consumer`,builder:te,handler:async e=>u({command:`queues consumers delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf queues consumers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/consumers/${e[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(e[`consumer-id`]))}`,pathParams:{"queue-id":String(e[`queue-id`]??``),"consumer-id":String(e[`consumer-id`]??``)},bodyKind:`none`});return}let n=await t(e),r=e.local?l:await o();if(e.accountId=r,!await h({force:!!e.force}))return;let i=await f(`Deleting`,async()=>n.send(ee,{account_id:r,queue_id:e[`queue-id`],consumer_id:e[`consumer-id`]}));d(i,{successLabel:`Deleted`})})};var b={method:`GET`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/consumers/${t.consumer_id}`};function x(e){return e.usage(`$0 queues consumers get <consumer-id>
|
|
7
|
+
|
|
8
|
+
Returns a Queue consumer by identifier.`).positional(`consumer-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get <consumer-id>`,describe:`Get Queue Consumer`,builder:x,handler:async e=>u({command:`queues consumers get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf queues consumers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/consumers/${e[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(e[`consumer-id`]))}`,pathParams:{"queue-id":String(e[`queue-id`]??``),"consumer-id":String(e[`consumer-id`]??``)},bodyKind:`none`});return}let n=await t(e),r=e.local?l:await o();e.accountId=r;let i=await f(`Loading`,async()=>n.send(b,{account_id:r,queue_id:e[`queue-id`],consumer_id:e[`consumer-id`]}));d(i,{successLabel:`Loaded`})})};var ne={method:`GET`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/consumers`};function re(e){return e.usage(`$0 queues consumers list
|
|
9
|
+
|
|
10
|
+
Returns the consumers configured for a Queue.`).option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`list`,describe:`List Queue Consumers`,builder:re,handler:async e=>u({command:`queues consumers list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf queues consumers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/consumers`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`none`});return}let n=await t(e),r=e.local?l:await o();e.accountId=r;let i=await f(`Loading`,async()=>n.send(ne,{account_id:r,queue_id:e[`queue-id`]}));d(i,{successLabel:`Loaded`})})};var C={method:`PUT`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/consumers/${t.consumer_id}`,body:`json`};function ae(e){return e.usage(`$0 queues consumers update <consumer-id>
|
|
11
|
+
|
|
12
|
+
Replaces a Queue consumer, or creates it if it does not exist.`).positional(`consumer-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dead-letter-queue`,{type:`string`,description:`The dead_letter_queue field`}).option(`script-name`,{type:`string`,description:`Name of a Worker`}).option(`settings-batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`settings-max-concurrency`,{type:`number`,description:"Maximum number of concurrent consumers that may consume from this Queue. Set to `null` to automatically opt in to the platform's maximum (recommended)."}).option(`settings-max-retries`,{type:`number`,description:`The maximum number of retries`}).option(`settings-max-wait-time-ms`,{type:`number`,description:`The number of milliseconds to wait for a batch to fill up before attempting to deliver it`}).option(`settings-retry-delay`,{type:`number`,description:`The number of seconds to delay before making the message available for another attempt.`}).option(`settings-visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).option(`type`,{type:`string`,description:`The type field`,choices:[`worker`,`http_pull`]}).coerce(`type`,e=>c(e,`type`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating or updating a consumer`}).conflicts(`script-name`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-concurrency`,[`settings-visibility-timeout-ms`]).implies(`settings-max-concurrency`,[`script-name`]).conflicts(`settings-max-wait-time-ms`,[`settings-visibility-timeout-ms`]).implies(`settings-max-wait-time-ms`,[`script-name`]).conflicts(`settings-visibility-timeout-ms`,[`script-name`,`settings-max-concurrency`,`settings-max-wait-time-ms`])}const oe={command:`update <consumer-id>`,describe:`Update Queue Consumer`,builder:ae,handler:async e=>u({command:`queues consumers update`,classification:{safeFlags:[`type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf queues consumers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/consumers/${e[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(e[`consumer-id`]))}`,pathParams:{"queue-id":String(e[`queue-id`]??``),"consumer-id":String(e[`consumer-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({dead_letter_queue:c(e[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:c(e[`script-name`],`script-name`,`text`),settings:{batch_size:e[`settings-batch-size`],max_concurrency:e[`settings-max-concurrency`],max_retries:e[`settings-max-retries`],max_wait_time_ms:e[`settings-max-wait-time-ms`],retry_delay:e[`settings-retry-delay`],visibility_timeout_ms:e[`settings-visibility-timeout-ms`]},type:e.type}):r(e.body)});return}let n=e.body===void 0?void 0:r(e.body),u=await t(e),h=e.local?l:await o();if(e.accountId=h,e.body!==void 0){let t=n,r=await f(`Updating`,async()=>u.send(C,{body:t,account_id:h,queue_id:e[`queue-id`],consumer_id:e[`consumer-id`]}));d(r,{successLabel:`Updated`});return}e.type===void 0&&(e.type=await m(`type`,`The type field`,[`worker`,`http_pull`])),e.type===`worker`&&e[`script-name`]===void 0&&(e[`script-name`]=await p(`script-name`,`Name of a Worker`,{question:`Enter value for --script-name`}));let g=i({dead_letter_queue:c(e[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:c(e[`script-name`],`script-name`,`text`),settings:{batch_size:e[`settings-batch-size`],max_concurrency:e[`settings-max-concurrency`],max_retries:e[`settings-max-retries`],max_wait_time_ms:e[`settings-max-wait-time-ms`],retry_delay:e[`settings-retry-delay`],visibility_timeout_ms:e[`settings-visibility-timeout-ms`]},type:e.type}),_=await f(`Updating`,async()=>u.send(C,{body:g,account_id:h,queue_id:e[`queue-id`],consumer_id:e[`consumer-id`]}));d(_,{successLabel:`Updated`})})},se={command:`consumers`,describe:`Workers that automatically receive and process messages from a queue`,builder:e=>e.command(v).command(y).command(S).command(ie).command(oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var w={method:`POST`,path:t=>e`/accounts/${t.account_id}/queues`,body:`json`};function ce(e){return e.usage(`$0 queues create
|
|
13
|
+
|
|
14
|
+
Creates a Queue in the account.`).option(`jurisdiction`,{type:`string`,description:`The jurisdiction field`,choices:[`eu`,`us`,`fedramp`]}).coerce(`jurisdiction`,e=>c(e,`jurisdiction`,`text`)).option(`queue-name`,{type:`string`,description:`The queue_name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const T={command:`create`,describe:`Create Queue`,builder:ce,handler:async e=>u({command:`queues create`,classification:{safeFlags:[`jurisdiction`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf queues create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues`,pathParams:{},bodyKind:`json`,body:e.body===void 0?i({jurisdiction:e.jurisdiction,queue_name:c(e[`queue-name`],`queue-name`,`text`)}):r(e.body)});return}let n=e.body===void 0?void 0:r(e.body),u=await t(e),m=e.local?l:await o();if(e.accountId=m,e.body!==void 0){let e=n,t=await f(`Creating`,async()=>u.send(w,{body:e,account_id:m}));d(t,{successLabel:`Created`});return}e[`queue-name`]===void 0&&(e[`queue-name`]=await p(`queue-name`,`The queue_name field`));let h=i({jurisdiction:e.jurisdiction,queue_name:c(e[`queue-name`],`queue-name`,`text`)}),g=await f(`Creating`,async()=>u.send(w,{body:h,account_id:m}));d(g,{successLabel:`Created`})})};var E={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}`};function D(e){return e.usage(`$0 queues delete <queue-id>
|
|
15
|
+
|
|
16
|
+
Deletes a Queue.`).positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const O={command:`delete <queue-id>`,describe:`Delete Queue`,builder:D,handler:async e=>u({command:`queues delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf queues delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`none`});return}let n=await t(e),r=e.local?l:await o();if(e.accountId=r,!await h({force:!!e.force}))return;let i=await f(`Deleting`,async()=>n.send(E,{account_id:r,queue_id:e[`queue-id`]}));d(i,{successLabel:`Deleted`})})};var k={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}`,body:`json`};function A(e){return e.usage(`$0 queues edit <queue-id>
|
|
17
|
+
|
|
18
|
+
Updates part of a Queue's configuration.`).positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`jurisdiction`,{type:`string`,description:`The jurisdiction field`,choices:[`eu`,`us`,`fedramp`]}).coerce(`jurisdiction`,e=>c(e,`jurisdiction`,`text`)).option(`queue-name`,{type:`string`,description:`The queue_name field`}).option(`settings-delivery-delay`,{type:`number`,description:`Number of seconds to delay delivery of all messages to consumers.`}).option(`settings-delivery-paused`,{type:`boolean`,description:`Indicates if message delivery to consumers is currently paused.`}).option(`settings-message-retention-period`,{type:`number`,description:`Number of seconds after which an unconsumed message will be delayed.`}).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:`edit <queue-id>`,describe:`Update Queue`,builder:A,handler:async e=>u({command:`queues edit`,classification:{safeFlags:[`jurisdiction`,`settings-delivery-paused`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf queues edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({jurisdiction:e.jurisdiction,queue_name:c(e[`queue-name`],`queue-name`,`text`),settings:{delivery_delay:e[`settings-delivery-delay`],delivery_paused:e[`settings-delivery-paused`],message_retention_period:e[`settings-message-retention-period`]}}):r(e.body)});return}let n=e.body===void 0?void 0:r(e.body),u=await t(e),p=e.local?l:await o();if(e.accountId=p,e.body!==void 0){let t=n,r=await f(`Updating`,async()=>u.send(k,{body:t,account_id:p,queue_id:e[`queue-id`]}));d(r,{successLabel:`Updated`});return}let m=i({jurisdiction:e.jurisdiction,queue_name:c(e[`queue-name`],`queue-name`,`text`),settings:{delivery_delay:e[`settings-delivery-delay`],delivery_paused:e[`settings-delivery-paused`],message_retention_period:e[`settings-message-retention-period`]}}),h=await f(`Updating`,async()=>u.send(k,{body:m,account_id:p,queue_id:e[`queue-id`]}));d(h,{successLabel:`Updated`})})};var M={method:`GET`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}`};function N(e){return e.usage(`$0 queues get <queue-id>
|
|
19
|
+
|
|
20
|
+
Returns details about a specific Queue.`).positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get <queue-id>`,describe:`Get Queue`,builder:N,handler:async e=>u({command:`queues get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf queues get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`none`});return}let n=await t(e),r=e.local?l:await o();e.accountId=r;let i=await f(`Loading`,async()=>n.send(M,{account_id:r,queue_id:e[`queue-id`]}));d(i,{successLabel:`Loaded`})})};var F={method:`GET`,path:t=>e`/accounts/${t.account_id}/queues`};function I(e){return e.usage(`$0 queues list
|
|
21
|
+
|
|
22
|
+
Returns the queues owned by an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`list`,describe:`List Queues`,builder:I,handler:async e=>u({command:`queues list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await a();s({command:`cf queues list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/queues`,pathParams:{},bodyKind:`none`});return}let n=await t(e),r=e.local?l:await o();e.accountId=r;let i=await f(`Loading`,async()=>n.send(F,{account_id:r}));d(i,{successLabel:`Loaded`})})};var R={method:`POST`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/messages/ack`,body:`json`};function z(e){return e.usage(`$0 queues messages ack <queue-id>
|
|
23
|
+
|
|
24
|
+
Acknowledges successfully processed Queue messages and retries messages that were not processed successfully.`).positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`acks`,{type:`string`,description:`The acks field. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"lease_id"?: string}]. ? marks optional keys.`}).option(`retries`,{type:`string`,description:`The retries field. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"delay_seconds"?: number, "lease_id"?: string}]. ? marks optional keys.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`ack <queue-id>`,describe:`Acknowledge + Retry Queue Messages`,builder:z,handler:async e=>u({command:`queues messages ack`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf queues messages ack`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/messages/ack`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({acks:n(e.acks,`acks`),retries:n(e.retries,`retries`)}):r(e.body)});return}let c=e.body===void 0?void 0:r(e.body),u=await t(e),p=e.local?l:await o();if(e.accountId=p,e.body!==void 0){let t=c,n=await f(`Creating`,async()=>u.send(R,{body:t,account_id:p,queue_id:e[`queue-id`]}));d(n,{successLabel:`Created`});return}let m=i({acks:n(e.acks,`acks`),retries:n(e.retries,`retries`)}),h=await f(`Creating`,async()=>u.send(R,{body:m,account_id:p,queue_id:e[`queue-id`]}));d(h,{successLabel:`Created`})})};var V={method:`POST`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/messages/batch`,body:`json`};function H(e){return e.usage(`$0 queues messages bulk-push
|
|
25
|
+
|
|
26
|
+
Pushes a batch of messages to a Queue.`).option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`delay-seconds`,{type:`number`,description:`The number of seconds to wait for attempting to deliver this batch to consumers`}).option(`messages`,{type:`string`,description:`The messages field. Provide as a JSON array of objects or @path/to/file.json. Shape: [({"delay_seconds"?: number} & ({"body"?: string, "content_type"?: "text"} | {"body"?: {...}, "content_type"?: "json"}))]. ? marks optional keys.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const U={command:`bulk-push`,describe:`Push Message Batch`,builder:H,handler:async e=>u({command:`queues messages bulk-push`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf queues messages bulk-push`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/messages/batch`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({delay_seconds:e[`delay-seconds`],messages:n(e.messages,`messages`)}):r(e.body)});return}let c=e.body===void 0?void 0:r(e.body),u=await t(e),p=e.local?l:await o();if(e.accountId=p,e.body!==void 0){let t=c,n=await f(`Creating`,async()=>u.send(V,{body:t,account_id:p,queue_id:e[`queue-id`]}));d(n,{successLabel:`Created`});return}let m=i({delay_seconds:e[`delay-seconds`],messages:n(e.messages,`messages`)}),h=await f(`Creating`,async()=>u.send(V,{body:m,account_id:p,queue_id:e[`queue-id`]}));d(h,{successLabel:`Created`})})};var W={method:`POST`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/messages/extend`,body:`json`};function G(e){return e.usage(`$0 queues messages extend-leases <queue-id>
|
|
27
|
+
|
|
28
|
+
Extends message leases without incrementing the messages' \`attempts\` counters. Each message receives a new lease identifier.`).positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`extend`,{type:`string`,description:`The extend field. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"lease_id"?: string}]. ? marks optional keys.`}).option(`visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).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:`extend-leases <queue-id>`,describe:`Extend Message Leases`,builder:G,handler:async e=>u({command:`queues messages extend-leases`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf queues messages extend-leases`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/messages/extend`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({extend:n(e.extend,`extend`),visibility_timeout_ms:e[`visibility-timeout-ms`]}):r(e.body)});return}let c=e.body===void 0?void 0:r(e.body),u=await t(e),p=e.local?l:await o();if(e.accountId=p,e.body!==void 0){let t=c,n=await f(`Creating`,async()=>u.send(W,{body:t,account_id:p,queue_id:e[`queue-id`]}));d(n,{successLabel:`Created`});return}let m=i({extend:n(e.extend,`extend`),visibility_timeout_ms:e[`visibility-timeout-ms`]}),h=await f(`Creating`,async()=>u.send(W,{body:m,account_id:p,queue_id:e[`queue-id`]}));d(h,{successLabel:`Created`})})};var K={method:`POST`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/messages/peek`,body:`json`};function ue(e){return e.usage(`$0 queues messages peek <queue-id>
|
|
29
|
+
|
|
30
|
+
Peek messages from a Queue without leasing them. Each message includes a ref that can be passed to the purge endpoint, and remains available for subsequent peek or pull operations until it is purged.`).positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const de={command:`peek <queue-id>`,describe:`Peek Queue Messages`,builder:ue,handler:async e=>u({command:`queues messages peek`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf queues messages peek`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/messages/peek`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({batch_size:e[`batch-size`]}):r(e.body)});return}let n=e.body===void 0?void 0:r(e.body),c=await t(e),u=e.local?l:await o();if(e.accountId=u,e.body!==void 0){let t=n,r=await f(`Creating`,async()=>c.send(K,{body:t,account_id:u,queue_id:e[`queue-id`]}));d(r,{successLabel:`Created`});return}let p=i({batch_size:e[`batch-size`]}),m=await f(`Creating`,async()=>c.send(K,{body:p,account_id:u,queue_id:e[`queue-id`]}));d(m,{successLabel:`Created`})})};var q={method:`POST`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/messages/pull`,body:`json`};function fe(e){return e.usage(`$0 queues messages pull <queue-id>
|
|
31
|
+
|
|
32
|
+
Pulls a batch of messages from a Queue for an HTTP pull consumer.`).positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).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 pe={command:`pull <queue-id>`,describe:`Pull Queue Messages`,builder:fe,handler:async e=>u({command:`queues messages pull`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf queues messages pull`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/messages/pull`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({batch_size:e[`batch-size`],visibility_timeout_ms:e[`visibility-timeout-ms`]}):r(e.body)});return}let n=e.body===void 0?void 0:r(e.body),c=await t(e),u=e.local?l:await o();if(e.accountId=u,e.body!==void 0){let t=n,r=await f(`Creating`,async()=>c.send(q,{body:t,account_id:u,queue_id:e[`queue-id`]}));d(r,{successLabel:`Created`});return}let p=i({batch_size:e[`batch-size`],visibility_timeout_ms:e[`visibility-timeout-ms`]}),m=await f(`Creating`,async()=>c.send(q,{body:p,account_id:u,queue_id:e[`queue-id`]}));d(m,{successLabel:`Created`})})};var J={method:`POST`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/messages/purge`,body:`json`};function me(e){return e.usage(`$0 queues messages purge <queue-id>
|
|
33
|
+
|
|
34
|
+
Delete messages from a Queue by using refs returned by the peek endpoint. Purging messages does not count as delivery and does not affect metrics.`).positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`refs`,{type:`string`,description:`The refs field. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"ref": string}].`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const he={command:`purge <queue-id>`,describe:`Purge Peeked Queue Messages`,builder:me,handler:async e=>u({command:`queues messages purge`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf queues messages purge`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/messages/purge`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({refs:n(e.refs,`refs`)}):r(e.body)});return}let c=e.body===void 0?void 0:r(e.body),u=await t(e),p=e.local?l:await o();if(e.accountId=p,!await h({force:!!e.force,message:`This operation permanently deletes the selected messages from the Queue.`}))return;if(e.body!==void 0){let t=c,n=await f(`Processing`,async()=>u.send(J,{body:t,account_id:p,queue_id:e[`queue-id`]}));d(n,{successLabel:`Done`});return}if(e.refs===void 0)throw Error(`--refs is required (or pass --body with this field set).`);let m=i({refs:n(e.refs,`refs`)}),g=await f(`Processing`,async()=>u.send(J,{body:m,account_id:p,queue_id:e[`queue-id`]}));d(g,{successLabel:`Done`})})};var Y={method:`POST`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/messages`,body:`json`};function ge(e){return e.usage(`$0 queues messages push <queue-id>
|
|
35
|
+
|
|
36
|
+
Pushes a message to a Queue.`).positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`delay-seconds`,{type:`number`,description:`The number of seconds to wait for attempting to deliver this message to consumers`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _e={command:`push <queue-id>`,describe:`Push Message`,builder:ge,handler:async e=>u({command:`queues messages push`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf queues messages push`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/messages`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({delay_seconds:e[`delay-seconds`]}):r(e.body)});return}let n=e.body===void 0?void 0:r(e.body),c=await t(e),u=e.local?l:await o();if(e.accountId=u,e.body!==void 0){let t=n,r=await f(`Creating`,async()=>c.send(Y,{body:t,account_id:u,queue_id:e[`queue-id`]}));d(r,{successLabel:`Created`});return}let p=i({delay_seconds:e[`delay-seconds`]}),m=await f(`Creating`,async()=>c.send(Y,{body:p,account_id:u,queue_id:e[`queue-id`]}));d(m,{successLabel:`Created`})})},ve={command:`messages`,describe:`Push messages to a queue and pull or acknowledge them from consumers`,builder:e=>e.command(B).command(U).command(le).command(de).command(pe).command(he).command(_e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var ye={method:`GET`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/metrics`};function be(e){return e.usage(`$0 queues metrics get <queue-id>
|
|
37
|
+
|
|
38
|
+
Returns best-effort metrics for a Queue. Values may be approximate due to the distributed nature of Queues.`).positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xe={command:`get <queue-id>`,describe:`Get Queue Metrics`,builder:be,handler:async e=>u({command:`queues metrics get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf queues metrics get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/metrics`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`none`});return}let n=await t(e),r=e.local?l:await o();e.accountId=r;let i=await f(`Loading`,async()=>n.send(ye,{account_id:r,queue_id:e[`queue-id`]}));d(i,{successLabel:`Loaded`})})},Se={command:`metrics`,describe:`Operations for metrics`,builder:e=>e.command(xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var X={method:`POST`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/purge`,body:`json`};function Ce(e){return e.usage(`$0 queues purge start <queue-id>
|
|
39
|
+
|
|
40
|
+
Starts a purge that deletes all messages from a Queue.`).positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`delete-messages-permanently`,{type:`boolean`,description:`Confirms that all messages will be permanently deleted.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const we={command:`start <queue-id>`,describe:`Purge Queue`,builder:Ce,handler:async e=>u({command:`queues purge start`,classification:{safeFlags:[`delete-messages-permanently`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf queues purge start`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/purge`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({delete_messages_permanently:e[`delete-messages-permanently`]}):r(e.body)});return}let n=e.body===void 0?void 0:r(e.body),c=await t(e),u=e.local?l:await o();if(e.accountId=u,!await h({force:!!e.force,message:`This operation drops every message in the queue.`}))return;if(e.body!==void 0){let t=n,r=await f(`Processing`,async()=>c.send(X,{body:t,account_id:u,queue_id:e[`queue-id`]}));d(r,{successLabel:`Done`});return}let p=i({delete_messages_permanently:e[`delete-messages-permanently`]}),m=await f(`Processing`,async()=>c.send(X,{body:p,account_id:u,queue_id:e[`queue-id`]}));d(m,{successLabel:`Done`})})};var Te={method:`GET`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/purge`};function Ee(e){return e.usage(`$0 queues purge status <queue-id>
|
|
41
|
+
|
|
42
|
+
Returns the status of a Queue purge operation.`).positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const De={command:`status <queue-id>`,describe:`Get Queue Purge Status`,builder:Ee,handler:async e=>u({command:`queues purge status`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf queues purge status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/purge`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`none`});return}let n=await t(e),r=e.local?l:await o();e.accountId=r;let i=await f(`Loading`,async()=>n.send(Te,{account_id:r,queue_id:e[`queue-id`]}));d(i,{successLabel:`Loaded`})})},Oe={command:`purge`,describe:`Remove all pending messages from a queue`,builder:e=>e.command(we).command(De).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Z={method:`POST`,path:t=>e`/accounts/${t.account_id}/event_subscriptions/subscriptions`,body:`json`,errors:{400:`BadRequestError`,404:`NotFoundError`,405:`MethodNotAllowedError`}};function ke(e){return e.usage(`$0 queues subscriptions create
|
|
43
|
+
|
|
44
|
+
Creates an event subscription for a Queue.`).option(`destination-queue-id`,{type:`string`,description:`ID of the target queue`}).option(`destination-type`,{type:`string`,description:`Type of destination`,choices:[`queues.queue`]}).coerce(`destination-type`,e=>c(e,`destination-type`,`text`)).option(`enabled`,{type:`boolean`,description:`Whether the subscription is active`}).option(`events`,{type:`string`,array:!0,description:`List of event types this subscription handles`}).option(`name`,{type:`string`,description:`Name of the subscription`}).option(`source-type`,{type:`string`,description:`Type of source`,choices:[`images`,`kv`,`r2`,`superSlurper`,`vectorize`,`workersAi.model`,`workersBuilds.worker`,`workers.script`,`workflows.workflow`]}).coerce(`source-type`,e=>c(e,`source-type`,`text`)).option(`source-model-name`,{type:`string`,description:`Name of the Workers AI model`}).option(`source-worker-name`,{type:`string`,description:`Name of the worker`}).option(`source-script-tag`,{type:`string`,description:`Tag of the Worker script`}).option(`source-workflow-name`,{type:`string`,description:`Name of the workflow`}).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=[`destination-queue-id`,`destination-type`].some(t=>e[t]!==void 0);if(!e.body&&t){let t=[`destination-queue-id`,`destination-type`].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 --destination-* flag is set`)}return!0})}const Ae={command:`create`,describe:`Create Event Subscription`,builder:ke,handler:async e=>u({command:`queues subscriptions create`,classification:{safeFlags:[`destination-type`,`enabled`,`source-type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf queues subscriptions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/event_subscriptions/subscriptions`,pathParams:{},bodyKind:`json`,body:e.body===void 0?i({destination:{queue_id:c(e[`destination-queue-id`],`destination-queue-id`,`text`),type:e[`destination-type`]},enabled:e.enabled,events:e.events,name:c(e.name,`name`,`text`),source:{type:e[`source-type`],model_name:c(e[`source-model-name`],`source-model-name`,`text`),worker_name:c(e[`source-worker-name`],`source-worker-name`,`text`),script_tag:c(e[`source-script-tag`],`source-script-tag`,`text`),workflow_name:c(e[`source-workflow-name`],`source-workflow-name`,`text`)}}):r(e.body)});return}let n=e.body===void 0?void 0:r(e.body),u=await t(e),p=e.local?l:await o();if(e.accountId=p,e.body!==void 0){let e=n,t=await f(`Creating`,async()=>u.send(Z,{body:e,account_id:p}));d(t,{successLabel:`Created`});return}let m=i({destination:{queue_id:c(e[`destination-queue-id`],`destination-queue-id`,`text`),type:e[`destination-type`]},enabled:e.enabled,events:e.events,name:c(e.name,`name`,`text`),source:{type:e[`source-type`],model_name:c(e[`source-model-name`],`source-model-name`,`text`),worker_name:c(e[`source-worker-name`],`source-worker-name`,`text`),script_tag:c(e[`source-script-tag`],`source-script-tag`,`text`),workflow_name:c(e[`source-workflow-name`],`source-workflow-name`,`text`)}}),h=await f(`Creating`,async()=>u.send(Z,{body:m,account_id:p}));d(h,{successLabel:`Created`})})};var je={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/event_subscriptions/subscriptions/${t.subscription_id}`};function Me(e){return e.usage(`$0 queues subscriptions delete <subscription-id>
|
|
45
|
+
|
|
46
|
+
Deletes an existing Queue event subscription.`).positional(`subscription-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ne={command:`delete <subscription-id>`,describe:`Delete Event Subscription`,builder:Me,handler:async e=>u({command:`queues subscriptions delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf queues subscriptions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/event_subscriptions/subscriptions/${e[`subscription-id`]==null?`<subscription-id>`:encodeURIComponent(String(e[`subscription-id`]))}`,pathParams:{"subscription-id":String(e[`subscription-id`]??``)},bodyKind:`none`});return}let n=await t(e),r=e.local?l:await o();if(e.accountId=r,!await h({force:!!e.force}))return;let i=await f(`Deleting`,async()=>n.send(je,{account_id:r,subscription_id:e[`subscription-id`]}));d(i,{successLabel:`Deleted`})})};var Q={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/event_subscriptions/subscriptions/${t.subscription_id}`,body:`json`,errors:{400:`BadRequestError`,404:`NotFoundError`}};function Pe(e){return e.usage(`$0 queues subscriptions edit <subscription-id>
|
|
47
|
+
|
|
48
|
+
Updates an existing Queue event subscription.`).positional(`subscription-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`destination-queue-id`,{type:`string`,description:`ID of the target queue`}).option(`destination-type`,{type:`string`,description:`Type of destination`,choices:[`queues.queue`]}).coerce(`destination-type`,e=>c(e,`destination-type`,`text`)).option(`enabled`,{type:`boolean`,description:`Whether the subscription is active`}).option(`events`,{type:`string`,array:!0,description:`List of event types this subscription handles`}).option(`name`,{type:`string`,description:`Name of the subscription`}).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=[`destination-queue-id`,`destination-type`].some(t=>e[t]!==void 0);if(!e.body&&t){let t=[`destination-queue-id`,`destination-type`].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 --destination-* flag is set`)}return!0})}const $={command:`edit <subscription-id>`,describe:`Update Event Subscription`,builder:Pe,handler:async e=>u({command:`queues subscriptions edit`,classification:{safeFlags:[`destination-type`,`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf queues subscriptions edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/event_subscriptions/subscriptions/${e[`subscription-id`]==null?`<subscription-id>`:encodeURIComponent(String(e[`subscription-id`]))}`,pathParams:{"subscription-id":String(e[`subscription-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({destination:{queue_id:c(e[`destination-queue-id`],`destination-queue-id`,`text`),type:e[`destination-type`]},enabled:e.enabled,events:e.events,name:c(e.name,`name`,`text`)}):r(e.body)});return}let n=e.body===void 0?void 0:r(e.body),u=await t(e),p=e.local?l:await o();if(e.accountId=p,e.body!==void 0){let t=n,r=await f(`Updating`,async()=>u.send(Q,{body:t,account_id:p,subscription_id:e[`subscription-id`]}));d(r,{successLabel:`Updated`});return}let m=i({destination:{queue_id:c(e[`destination-queue-id`],`destination-queue-id`,`text`),type:e[`destination-type`]},enabled:e.enabled,events:e.events,name:c(e.name,`name`,`text`)}),h=await f(`Updating`,async()=>u.send(Q,{body:m,account_id:p,subscription_id:e[`subscription-id`]}));d(h,{successLabel:`Updated`})})};var Fe={method:`GET`,path:t=>e`/accounts/${t.account_id}/event_subscriptions/subscriptions/${t.subscription_id}`,errors:{404:`NotFoundError`}};function Ie(e){return e.usage(`$0 queues subscriptions get <subscription-id>
|
|
49
|
+
|
|
50
|
+
Returns an existing Queue event subscription.`).positional(`subscription-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Le={command:`get <subscription-id>`,describe:`Get Event Subscription`,builder:Ie,handler:async e=>u({command:`queues subscriptions get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf queues subscriptions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/event_subscriptions/subscriptions/${e[`subscription-id`]==null?`<subscription-id>`:encodeURIComponent(String(e[`subscription-id`]))}`,pathParams:{"subscription-id":String(e[`subscription-id`]??``)},bodyKind:`none`});return}let n=await t(e),r=e.local?l:await o();e.accountId=r;let i=await f(`Loading`,async()=>n.send(Fe,{account_id:r,subscription_id:e[`subscription-id`]}));d(i,{successLabel:`Loaded`})})};var Re={method:`GET`,path:t=>e`/accounts/${t.account_id}/event_subscriptions/subscriptions`,query:[`page`,`per_page`,`order`,`direction`]};function ze(e){return e.usage(`$0 queues subscriptions list
|
|
51
|
+
|
|
52
|
+
Returns a paginated list of Queue event subscriptions with optional sorting and filtering.`).option(`page`,{type:`number`,description:`Page number for pagination`}).option(`per-page`,{type:`number`,description:`Number of items per page`}).option(`order`,{type:`string`,description:`Field to sort by`,choices:[`created_at`,`name`,`enabled`,`source`]}).option(`direction`,{type:`string`,description:`Sort direction`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Be={command:`list`,describe:`List Event Subscriptions`,builder:ze,handler:async e=>u({command:`queues subscriptions list`,classification:{safeFlags:[`order`,`direction`,`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction};if(e.dryRun){let e=await a();s({command:`cf queues subscriptions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/event_subscriptions/subscriptions`,pathParams:{},query:n,bodyKind:`none`});return}let r=await t(e),i=e.local?l:await o();e.accountId=i;let c=await f(`Loading`,async()=>r.send(Re,{account_id:i,...n}));d(c,{successLabel:`Loaded`})})},Ve={command:`subscriptions`,describe:`Manage queue subscriptions for event-driven message routing`,builder:e=>e.command(Ae).command(Ne).command($).command(Le).command(Be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},He={command:`queues`,describe:`Reliable message queuing between Workers — produce, consume, and batch-process messages at scale`,builder:e=>e.command(T).command(O).command(j).command(P).command(L).command(se).command(ve).command(Se).command(Oe).command(Ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{He as default};
|
|
@@ -0,0 +1,112 @@
|
|
|
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"./local-B3zt9PXR.mjs";import{a,t as o}from"./context-BGm5_wTT.mjs";import{t as s}from"./output-hFMAotFl.mjs";import{t as c}from"./progress-DE_G09u2.mjs";import{a as l,i as u,n as d}from"./prompt-D274Im1O.mjs";import{t as f}from"./run-CXWkMU3x.mjs";import"./telemetry-COlodX5Z.mjs";import{c as p,o as m,r as h,t as g}from"./body-parser-HN91kAf0.mjs";import{n as _,t as v}from"./input-validation-D7z60HJH.mjs";import"./api-Dnt6lRJG.mjs";import{n as y,t as b}from"./raw-fetch-DhlyWQtk.mjs";import{t as x}from"./body-unions-D9OSaf4M.mjs";function ee(e){return e.usage(`$0 r2 buckets cors delete <bucket-name>
|
|
3
|
+
|
|
4
|
+
Delete the CORS policy for a bucket.`).positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).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 te={command:`delete <bucket-name>`,describe:`Delete Bucket CORS Policy`,builder:ee,handler:async n=>f({command:`r2 buckets cors delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{let l={};if(n[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 buckets cors delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(n[`bucket-name`]??``)},bodyKind:`none`});return}let u=await t(n),f=n.local?i:await o();if(n.accountId=f,!await d({force:!!n.force,message:`This removes the R2 bucket's CORS policy. Browser requests that depend on these cross-origin permissions may fail.`}))return;let p=await c(`Deleting`,async()=>e(u,`DELETE`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/cors`,{headers:Object.keys(l).length>0?l:void 0}));s(p,{successLabel:`Deleted`})})};function ne(e){return e.usage(`$0 r2 buckets cors get <bucket-name>
|
|
5
|
+
|
|
6
|
+
Get the CORS policy for a bucket.`).positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`get <bucket-name>`,describe:`Get Bucket CORS Policy`,builder:ne,handler:async n=>f({command:`r2 buckets cors get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let l={};if(n[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 buckets cors get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(n[`bucket-name`]??``)},bodyKind:`none`});return}let u=await t(n),d=n.local?i:await o();n.accountId=d;let f=await c(`Loading`,async()=>e(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/cors`,{headers:Object.keys(l).length>0?l:void 0}));s(f,{successLabel:`Loaded`})})};function ie(e){return e.usage(`$0 r2 buckets cors update <bucket-name>
|
|
7
|
+
|
|
8
|
+
Replaces the Cross-Origin Resource Sharing (CORS) rules for an R2 bucket. Rules specify which origins, methods, and headers are allowed for browser requests to objects in the bucket.`).positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`rules`,{type:`string`,description:`The rules field. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"allowed": {...}, "exposeHeaders"?: [string], "id"?: string, "maxAgeSeconds"?: number}]. ? marks optional keys.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ae={command:`update <bucket-name>`,describe:`Set Bucket CORS Policy`,builder:ie,handler:async n=>f({command:`r2 buckets cors update`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{let l={};if(n[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 buckets cors update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(n[`bucket-name`]??``)},bodyKind:`json`,body:n.body===void 0?g({rules:m(n.rules,`rules`)}):h(n.body)});return}let u=n.body===void 0?void 0:h(n.body),f=await t(n),_=n.local?i:await o();if(n.accountId=_,!await d({force:!!n.force,message:`This replaces the R2 bucket's CORS policy. Browser requests that relied on the previous rules may fail.`}))return;if(n.body!==void 0){let t=u,r=await c(`Updating`,async()=>e(f,`PUT`,`/accounts/${_}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/cors`,{body:t,headers:Object.keys(l).length>0?l:void 0}));s(r,{successLabel:`Updated`});return}let v={};n.rules!==void 0&&p(v,[`rules`],m(n.rules,`rules`));let y=await c(`Updating`,async()=>e(f,`PUT`,`/accounts/${_}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/cors`,{body:v,headers:Object.keys(l).length>0?l:void 0}));s(y,{successLabel:`Updated`})})},oe={command:`cors`,describe:`Operations for buckets.cors`,builder:e=>e.command(te).command(re).command(ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function se(e){return e.usage("$0 r2 buckets create-by-name <bucket-name>\n\nCreates a new R2 bucket using the name from the URL path. Similar to `r2-create-bucket` (POST), but the bucket name comes from the path and the optional storage class is supplied via the `cf-r2-storage-class` header. There is no request body. Unlike the POST variant, this endpoint does not accept a location hint — the bucket is placed in the R2 region for the caller's edge colo. Use the POST variant if you need to set a `locationHint`.").positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`cf-r2-storage-class`,{type:`string`,description:`Storage class for newly uploaded objects, unless specified otherwise.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`create-by-name <bucket-name>`,describe:`Create Bucket (by name)`,builder:se,handler:async n=>f({command:`r2 buckets create-by-name`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let l={};if(n[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n[`cf-r2-storage-class`]!==void 0&&(l[`cf-r2-storage-class`]=String(n[`cf-r2-storage-class`])),n.dryRun){let e=await a();r({command:`cf r2 buckets create-by-name`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}`,pathParams:{"bucket-name":String(n[`bucket-name`]??``)},bodyKind:`none`});return}let u=await t(n),d=n.local?i:await o();n.accountId=d;let f=await c(`Updating`,async()=>e(u,`PUT`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}`,{headers:Object.keys(l).length>0?l:void 0}));s(f,{successLabel:`Updated`})})};function C(e){return e.usage(`$0 r2 buckets create
|
|
9
|
+
|
|
10
|
+
Creates an R2 bucket in the account and selected jurisdiction, with an optional location hint and default storage class.`).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`location-hint`,{type:`string`,description:`Location of the bucket.`,choices:[`apac`,`eeur`,`enam`,`weur`,`wnam`,`oc`]}).coerce(`location-hint`,e=>_(e,`location-hint`,`text`)).option(`name`,{type:`string`,description:`Name of the bucket.`}).option(`storage-class`,{type:`string`,description:`Storage class for newly uploaded objects, unless specified otherwise.`,choices:[`Standard`,`InfrequentAccess`],default:`Standard`}).coerce(`storage-class`,e=>_(e,`storage-class`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const w={command:`create`,describe:`Create Bucket`,builder:C,handler:async n=>f({command:`r2 buckets create`,classification:{safeFlags:[`location-hint`,`storage-class`,`dry-run`]}},n,async()=>{let u={};if(n[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 buckets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets`,pathParams:{},bodyKind:`json`,body:n.body===void 0?g({locationHint:n[`location-hint`],name:_(n.name,`name`,`text`),storageClass:n[`storage-class`]}):h(n.body)});return}let d=n.body===void 0?void 0:h(n.body),f=await t(n),m=n.local?i:await o();if(n.accountId=m,n.body!==void 0){let t=d,n=await c(`Creating`,async()=>e(f,`POST`,`/accounts/${m}/r2/buckets`,{body:t,headers:Object.keys(u).length>0?u:void 0}));s(n,{successLabel:`Created`});return}n.name===void 0&&(n.name=await l(`name`,`Name of the bucket.`));let v={};n[`location-hint`]!==void 0&&p(v,[`locationHint`],n[`location-hint`]),n.name!==void 0&&p(v,[`name`],_(n.name,`name`,`text`)),n[`storage-class`]!==void 0&&p(v,[`storageClass`],n[`storage-class`]);let y=await c(`Creating`,async()=>e(f,`POST`,`/accounts/${m}/r2/buckets`,{body:v,headers:Object.keys(u).length>0?u:void 0}));s(y,{successLabel:`Created`})})};function T(e){return e.usage(`$0 r2 buckets delete <bucket-name>
|
|
11
|
+
|
|
12
|
+
Deletes an empty R2 bucket and its configuration. The bucket must have no objects, no in-progress multipart uploads, and no event notification rules; otherwise the request fails.`).positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const E={command:`delete <bucket-name>`,describe:`Delete Bucket`,builder:T,handler:async n=>f({command:`r2 buckets delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{let l={};if(n[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 buckets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}`,pathParams:{"bucket-name":String(n[`bucket-name`]??``)},bodyKind:`none`});return}let u=await t(n),f=n.local?i:await o();if(n.accountId=f,!await d({force:!!n.force,message:`This permanently deletes the empty R2 bucket and its configuration.`}))return;let p=await c(`Deleting`,async()=>e(u,`DELETE`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}`,{headers:Object.keys(l).length>0?l:void 0}));s(p,{successLabel:`Deleted`})})};function D(e){return e.usage(`$0 r2 buckets domains custom create <bucket-name>
|
|
13
|
+
|
|
14
|
+
Register a new custom domain for an existing R2 bucket.`).positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`ciphers`,{type:`string`,array:!0,description:`An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format.`}).option(`domain`,{type:`string`,description:`Name of the custom domain to be added.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable public bucket access at the custom domain. If undefined, the domain will be enabled.`}).option(`min-tls`,{type:`string`,description:`Minimum TLS Version the custom domain will accept for incoming connections. If not set, defaults to 1.0.`,choices:[`1.0`,`1.1`,`1.2`,`1.3`]}).coerce(`min-tls`,e=>_(e,`min-tls`,`text`)).option(`zone-id`,{type:`string`,description:`Zone ID of the custom domain.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const O={command:`create <bucket-name>`,describe:`Attach Custom Domain To Bucket`,builder:D,handler:async n=>f({command:`r2 buckets domains custom create`,classification:{safeFlags:[`enabled`,`min-tls`,`dry-run`]}},n,async()=>{let u={};if(n[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 buckets domains custom create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/domains/custom`,pathParams:{"bucket-name":String(n[`bucket-name`]??``)},bodyKind:`json`,body:n.body===void 0?g({ciphers:n.ciphers,domain:_(n.domain,`domain`,`text`),enabled:n.enabled,minTLS:n[`min-tls`],zoneId:_(n[`zone-id`],`zone-id`,`text`)}):h(n.body)});return}let d=n.body===void 0?void 0:h(n.body),f=await t(n),m=n.local?i:await o();if(n.accountId=m,n.body!==void 0){let t=d,r=await c(`Creating`,async()=>e(f,`POST`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/domains/custom`,{body:t,headers:Object.keys(u).length>0?u:void 0}));s(r,{successLabel:`Created`});return}if(n.domain===void 0&&(n.domain=await l(`domain`,`Name of the custom domain to be added.`)),n.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);n[`zone-id`]===void 0&&(n[`zone-id`]=await l(`zone-id`,`Zone ID of the custom domain.`));let v={};n.ciphers!==void 0&&p(v,[`ciphers`],n.ciphers),n.domain!==void 0&&p(v,[`domain`],_(n.domain,`domain`,`text`)),n.enabled!==void 0&&p(v,[`enabled`],n.enabled),n[`min-tls`]!==void 0&&p(v,[`minTLS`],n[`min-tls`]),n[`zone-id`]!==void 0&&p(v,[`zoneId`],_(n[`zone-id`],`zone-id`,`text`));let y=await c(`Creating`,async()=>e(f,`POST`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/domains/custom`,{body:v,headers:Object.keys(u).length>0?u:void 0}));s(y,{successLabel:`Created`})})};function k(e){return e.usage(`$0 r2 buckets domains custom delete <domain>
|
|
15
|
+
|
|
16
|
+
Disconnects a custom domain from an R2 bucket and removes its configuration. Access through other enabled custom domains or the bucket's r2.dev domain is unaffected.`).positional(`domain`,{type:`string`,description:`Name of the custom domain.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).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 A={command:`delete <domain>`,describe:`Remove Custom Domain From Bucket`,builder:k,handler:async n=>f({command:`r2 buckets domains custom delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{let l={};if(n[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 buckets domains custom delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/domains/custom/${n.domain==null?`<domain>`:encodeURIComponent(String(n.domain))}`,pathParams:{"bucket-name":String(n[`bucket-name`]??``),domain:String(n.domain??``)},bodyKind:`none`});return}let u=await t(n),f=n.local?i:await o();if(n.accountId=f,!await d({force:!!n.force,message:`This disconnects the custom domain from the R2 bucket. Access through other enabled domains remains available.`}))return;let p=await c(`Deleting`,async()=>e(u,`DELETE`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(n.domain))}`,{headers:Object.keys(l).length>0?l:void 0}));s(p,{successLabel:`Deleted`})})};function j(e){return e.usage(`$0 r2 buckets domains custom get <domain>
|
|
17
|
+
|
|
18
|
+
Get the configuration for a custom domain on an existing R2 bucket.`).positional(`domain`,{type:`string`,description:`Name of the custom domain.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`get <domain>`,describe:`Get Custom Domain Settings`,builder:j,handler:async n=>f({command:`r2 buckets domains custom get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let l={};if(n[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 buckets domains custom get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/domains/custom/${n.domain==null?`<domain>`:encodeURIComponent(String(n.domain))}`,pathParams:{"bucket-name":String(n[`bucket-name`]??``),domain:String(n.domain??``)},bodyKind:`none`});return}let u=await t(n),d=n.local?i:await o();n.accountId=d;let f=await c(`Loading`,async()=>e(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(n.domain))}`,{headers:Object.keys(l).length>0?l:void 0}));s(f,{successLabel:`Loaded`})})};function N(e){return e.usage(`$0 r2 buckets domains custom list
|
|
19
|
+
|
|
20
|
+
Gets a list of all custom domains registered with an existing R2 bucket.`).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`list`,describe:`List Custom Domains of Bucket`,builder:N,handler:async n=>f({command:`r2 buckets domains custom list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let l={};if(n[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 buckets domains custom list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/domains/custom`,pathParams:{"bucket-name":String(n[`bucket-name`]??``)},bodyKind:`none`});return}let u=await t(n),d=n.local?i:await o();n.accountId=d;let f=await c(`Loading`,async()=>e(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/domains/custom`,{headers:Object.keys(l).length>0?l:void 0}));s(f,{successLabel:`Loaded`})})};function F(e){return e.usage(`$0 r2 buckets domains custom update <domain>
|
|
21
|
+
|
|
22
|
+
Edit the configuration for a custom domain on an existing R2 bucket.`).positional(`domain`,{type:`string`,description:`Name of the custom domain.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`ciphers`,{type:`string`,array:!0,description:`An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable public bucket access at the specified custom domain.`}).option(`min-tls`,{type:`string`,description:`Minimum TLS Version the custom domain will accept for incoming connections. If not set, defaults to previous value.`,choices:[`1.0`,`1.1`,`1.2`,`1.3`]}).coerce(`min-tls`,e=>_(e,`min-tls`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const I={command:`update <domain>`,describe:`Configure Custom Domain Settings`,builder:F,handler:async n=>f({command:`r2 buckets domains custom update`,classification:{safeFlags:[`enabled`,`min-tls`,`dry-run`]}},n,async()=>{let l={};if(n[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 buckets domains custom update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/domains/custom/${n.domain==null?`<domain>`:encodeURIComponent(String(n.domain))}`,pathParams:{"bucket-name":String(n[`bucket-name`]??``),domain:String(n.domain??``)},bodyKind:`json`,body:n.body===void 0?g({ciphers:n.ciphers,enabled:n.enabled,minTLS:n[`min-tls`]}):h(n.body)});return}let u=n.body===void 0?void 0:h(n.body),d=await t(n),f=n.local?i:await o();if(n.accountId=f,n.body!==void 0){let t=u,r=await c(`Updating`,async()=>e(d,`PUT`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(n.domain))}`,{body:t,headers:Object.keys(l).length>0?l:void 0}));s(r,{successLabel:`Updated`});return}let m={};n.ciphers!==void 0&&p(m,[`ciphers`],n.ciphers),n.enabled!==void 0&&p(m,[`enabled`],n.enabled),n[`min-tls`]!==void 0&&p(m,[`minTLS`],n[`min-tls`]);let _=await c(`Updating`,async()=>e(d,`PUT`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(n.domain))}`,{body:m,headers:Object.keys(l).length>0?l:void 0}));s(_,{successLabel:`Updated`})})},L={command:`custom`,describe:`Operations for buckets.domains.custom`,builder:e=>e.command(O).command(A).command(M).command(P).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function R(e){return e.usage(`$0 r2 buckets domains managed get <bucket-name>
|
|
23
|
+
|
|
24
|
+
Gets the R2 bucket's managed r2.dev domain and whether public access is enabled. The r2.dev domain is rate-limited and intended for development use.`).positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`get <bucket-name>`,describe:`Get r2.dev Domain of Bucket`,builder:R,handler:async n=>f({command:`r2 buckets domains managed get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let l={};if(n[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 buckets domains managed get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/domains/managed`,pathParams:{"bucket-name":String(n[`bucket-name`]??``)},bodyKind:`none`});return}let u=await t(n),d=n.local?i:await o();n.accountId=d;let f=await c(`Loading`,async()=>e(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/domains/managed`,{headers:Object.keys(l).length>0?l:void 0}));s(f,{successLabel:`Loaded`})})};function B(e){return e.usage(`$0 r2 buckets domains managed update <bucket-name>
|
|
25
|
+
|
|
26
|
+
Enables or disables public access to the R2 bucket through its managed r2.dev domain. Custom domain access is unaffected. The r2.dev domain is rate-limited and intended for development use.`).positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`enabled`,{type:`boolean`,description:`Whether to enable public bucket access at the r2.dev domain.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const V={command:`update <bucket-name>`,describe:`Update r2.dev Domain of Bucket`,builder:B,handler:async n=>f({command:`r2 buckets domains managed update`,classification:{safeFlags:[`enabled`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{let l={};if(n[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 buckets domains managed update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/domains/managed`,pathParams:{"bucket-name":String(n[`bucket-name`]??``)},bodyKind:`json`,body:n.body===void 0?g({enabled:n.enabled}):h(n.body)});return}let u=n.body===void 0?void 0:h(n.body),f=await t(n),m=n.local?i:await o();if(n.accountId=m,!await d({force:!!n.force,message:`This changes public access to the R2 bucket through its r2.dev domain.`}))return;if(n.body!==void 0){let t=u,r=await c(`Updating`,async()=>e(f,`PUT`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/domains/managed`,{body:t,headers:Object.keys(l).length>0?l:void 0}));s(r,{successLabel:`Updated`});return}if(n.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let _={};n.enabled!==void 0&&p(_,[`enabled`],n.enabled);let v=await c(`Updating`,async()=>e(f,`PUT`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/domains/managed`,{body:_,headers:Object.keys(l).length>0?l:void 0}));s(v,{successLabel:`Updated`})})},H={command:`managed`,describe:`Operations for buckets.domains.managed`,builder:e=>e.command(z).command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},U={command:`domains`,describe:`Operations for buckets.domains`,builder:e=>e.command(L).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(e){return e.usage(`$0 r2 buckets edit <bucket-name>
|
|
27
|
+
|
|
28
|
+
Changes the default storage class for newly uploaded objects in an existing R2 bucket. Existing objects retain their storage class, and individual uploads can override the bucket default.`).positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`cf-r2-storage-class`,{type:`string`,description:`Storage class for newly uploaded objects, unless specified otherwise.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`edit <bucket-name>`,describe:`Patch Bucket`,builder:W,handler:async n=>f({command:`r2 buckets edit`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let l={};if(n[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n[`cf-r2-storage-class`]!==void 0&&(l[`cf-r2-storage-class`]=String(n[`cf-r2-storage-class`])),n.dryRun){let e=await a();r({command:`cf r2 buckets edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}`,pathParams:{"bucket-name":String(n[`bucket-name`]??``)},bodyKind:`none`});return}let u=await t(n),d=n.local?i:await o();n.accountId=d;let f=await c(`Updating`,async()=>e(u,`PATCH`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}`,{headers:Object.keys(l).length>0?l:void 0}));s(f,{successLabel:`Updated`})})};function K(e){return e.usage(`$0 r2 buckets event-notifications delete <queue-id>
|
|
29
|
+
|
|
30
|
+
Deletes the specified event notification rules for an R2 bucket and Cloudflare Queue. Provide ruleIds in the request body to select rules. If no body is provided, all rules for that bucket and queue are deleted.`).positional(`queue-id`,{type:`string`,description:`ID of the Cloudflare Queue that receives notifications for matching R2 object events.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`rule-ids`,{type:`string`,array:!0,description:`Array of rule ids to delete.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ce={command:`delete <queue-id>`,describe:`Delete Event Notification Rules`,builder:K,handler:async n=>f({command:`r2 buckets event-notifications delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{let l={};if(n[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 buckets event-notifications delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/event_notifications/r2/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/configuration/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}`,pathParams:{"bucket-name":String(n[`bucket-name`]??``),"queue-id":String(n[`queue-id`]??``)},bodyKind:`json`,body:n.body===void 0?g({ruleIds:n[`rule-ids`]}):h(n.body)});return}let u=n.body===void 0?void 0:h(n.body),f=await t(n),m=n.local?i:await o();if(n.accountId=m,!await d({force:!!n.force,message:`This deletes event notification rules for the selected R2 bucket and queue. Without a request body, all rules for that bucket and queue are deleted.`}))return;if(n.body!==void 0){let t=u,r=await c(`Deleting`,async()=>e(f,`DELETE`,`/accounts/${m}/event_notifications/r2/${encodeURIComponent(String(n[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(n[`queue-id`]))}`,{body:t,headers:Object.keys(l).length>0?l:void 0}));s(r,{successLabel:`Deleted`});return}let _={};n[`rule-ids`]!==void 0&&p(_,[`ruleIds`],n[`rule-ids`]);let v=await c(`Deleting`,async()=>e(f,`DELETE`,`/accounts/${m}/event_notifications/r2/${encodeURIComponent(String(n[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(n[`queue-id`]))}`,{body:_,headers:Object.keys(l).length>0?l:void 0}));s(v,{successLabel:`Deleted`})})};function le(e){return e.usage(`$0 r2 buckets event-notifications get <queue-id>
|
|
31
|
+
|
|
32
|
+
Gets the event notification rules for the specified R2 bucket and Cloudflare Queue. The response includes the queue's configuration and its array of rules.`).positional(`queue-id`,{type:`string`,description:`ID of the Cloudflare Queue that receives notifications for matching R2 object events.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ue={command:`get <queue-id>`,describe:`Get Event Notification Rules for a Queue`,builder:le,handler:async n=>f({command:`r2 buckets event-notifications get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let l={};if(n[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 buckets event-notifications get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/event_notifications/r2/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/configuration/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}`,pathParams:{"bucket-name":String(n[`bucket-name`]??``),"queue-id":String(n[`queue-id`]??``)},bodyKind:`none`});return}let u=await t(n),d=n.local?i:await o();n.accountId=d;let f=await c(`Loading`,async()=>e(u,`GET`,`/accounts/${d}/event_notifications/r2/${encodeURIComponent(String(n[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(n[`queue-id`]))}`,{headers:Object.keys(l).length>0?l:void 0}));s(f,{successLabel:`Loaded`})})};function de(e){return e.usage(`$0 r2 buckets event-notifications list
|
|
33
|
+
|
|
34
|
+
Lists event notification rules for an R2 bucket, grouped by the Cloudflare Queue that receives matching object events.`).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fe={command:`list`,describe:`List Event Notification Rules`,builder:de,handler:async n=>f({command:`r2 buckets event-notifications list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let l={};if(n[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 buckets event-notifications list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/event_notifications/r2/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/configuration`,pathParams:{"bucket-name":String(n[`bucket-name`]??``)},bodyKind:`none`});return}let u=await t(n),d=n.local?i:await o();n.accountId=d;let f=await c(`Loading`,async()=>e(u,`GET`,`/accounts/${d}/event_notifications/r2/${encodeURIComponent(String(n[`bucket-name`]))}/configuration`,{headers:Object.keys(l).length>0?l:void 0}));s(f,{successLabel:`Loaded`})})};function pe(e){return e.usage(`$0 r2 buckets event-notifications update <queue-id>
|
|
35
|
+
|
|
36
|
+
Creates rules that send notifications for matching R2 object events to the specified Cloudflare Queue. Rules can filter objects by key prefix and suffix. New rules are added to any existing rules for the queue; a rule that overlaps an existing rule is rejected.`).positional(`queue-id`,{type:`string`,description:`ID of the Cloudflare Queue that receives notifications for matching R2 object events.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`rules`,{type:`string`,description:`Array of rules to drive notifications. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"actions": ["PutObject" | "CopyObject" | "DeleteObject" | ...more], "description"?: string, "prefix"?: string, "suffix"?: string}]. ? marks optional keys.`}).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 me={command:`update <queue-id>`,describe:`Create Event Notification Rules`,builder:pe,handler:async n=>f({command:`r2 buckets event-notifications update`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let l={};if(n[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 buckets event-notifications update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/event_notifications/r2/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/configuration/queues/${n[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(n[`queue-id`]))}`,pathParams:{"bucket-name":String(n[`bucket-name`]??``),"queue-id":String(n[`queue-id`]??``)},bodyKind:`json`,body:n.body===void 0?g({rules:m(n.rules,`rules`)}):h(n.body)});return}let u=n.body===void 0?void 0:h(n.body),d=await t(n),f=n.local?i:await o();if(n.accountId=f,n.body!==void 0){let t=u,r=await c(`Updating`,async()=>e(d,`PUT`,`/accounts/${f}/event_notifications/r2/${encodeURIComponent(String(n[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(n[`queue-id`]))}`,{body:t,headers:Object.keys(l).length>0?l:void 0}));s(r,{successLabel:`Updated`});return}if(n.rules===void 0)throw Error(`--rules is required (or pass --body with this field set).`);let _={};n.rules!==void 0&&p(_,[`rules`],m(n.rules,`rules`));let v=await c(`Updating`,async()=>e(d,`PUT`,`/accounts/${f}/event_notifications/r2/${encodeURIComponent(String(n[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(n[`queue-id`]))}`,{body:_,headers:Object.keys(l).length>0?l:void 0}));s(v,{successLabel:`Updated`})})},he={command:`event-notifications`,describe:`Operations for buckets.event-notifications`,builder:e=>e.command(ce).command(ue).command(fe).command(me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ge(e){return e.usage(`$0 r2 buckets get <bucket-name>
|
|
37
|
+
|
|
38
|
+
Gets properties of an existing R2 bucket.`).positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _e={command:`get <bucket-name>`,describe:`Get Bucket`,builder:ge,handler:async n=>f({command:`r2 buckets get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let l={};if(n[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 buckets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}`,pathParams:{"bucket-name":String(n[`bucket-name`]??``)},bodyKind:`none`});return}let u=await t(n),d=n.local?i:await o();n.accountId=d;let f=await c(`Loading`,async()=>e(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}`,{headers:Object.keys(l).length>0?l:void 0}));s(f,{successLabel:`Loaded`})})};function ve(e){return e.usage('$0 r2 buckets jobs create <bucket-name>\n\nCreates a background job for an R2 bucket. The `jobType` field selects the job: - **`prefixDelete`**: deletes every object whose key begins with `prefix`. A non-empty prefix must end in `/`. An empty prefix (`""`) empties the entire bucket. - **`storageClassMigration`**: migrates every object in the bucket between storage classes. `sourceStorageClass` and `destinationStorageClass` must be provided together and must differ; omitting both migrates from `InfrequentAccess` to `Standard`. Poll the returned `id` with the Get Bucket Job endpoint. Small prefix-delete jobs can finish synchronously and return `COMPLETED`. Objects uploaded after a background job starts are not affected by that job. For prefix-delete jobs: abort active multipart uploads before submitting the request, since a synchronously completed job does not abort them, and avoid writing objects or starting multipart uploads while a bucket-emptying job is in progress. Each request creates a distinct job, and the number of active prefix-delete jobs is limited per bucket; wait for an existing job to finish before retrying a request rejected with HTTP 429. A bucket cannot be emptied while event notifications are configured (HTTP 409 / error code 10083). To protect a bucket with R2 Data Catalog enabled, send the `cf-r2-data-catalog-check` header; a conflict is returned with HTTP 409 / error code 10081. Prefix-delete jobs require permission to delete objects; storage-class migration jobs require permission to write to the bucket.').positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`cf-r2-data-catalog-check`,{type:`string`,description:`For prefix-delete jobs, set this header to reject the request when R2 Data Catalog is enabled for the bucket.`}).option(`job-type`,{type:`string`,description:`The jobType field`,choices:[`prefixDelete`,`storageClassMigration`]}).coerce(`job-type`,e=>_(e,`job-type`,`text`)).option(`prefix`,{type:`string`,description:`Prefix matched against object keys. A non-empty value must end in \`/\`.
|
|
39
|
+
An empty string empties the entire bucket.
|
|
40
|
+
`}).option(`destination-storage-class`,{type:`string`,description:`The destinationStorageClass field`,choices:[`Standard`,`InfrequentAccess`]}).coerce(`destination-storage-class`,e=>_(e,`destination-storage-class`,`text`)).option(`source-storage-class`,{type:`string`,description:`The sourceStorageClass field`,choices:[`Standard`,`InfrequentAccess`]}).coerce(`source-storage-class`,e=>_(e,`source-storage-class`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`prefix`,[`destination-storage-class`,`source-storage-class`]).conflicts(`destination-storage-class`,[`prefix`]).conflicts(`source-storage-class`,[`prefix`])}const ye={command:`create <bucket-name>`,describe:`Create Bucket Job`,builder:ve,handler:async n=>f({command:`r2 buckets jobs create`,classification:{safeFlags:[`job-type`,`destination-storage-class`,`source-storage-class`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{let f={};if(n[`cf-r2-jurisdiction`]!==void 0&&(f[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n[`cf-r2-data-catalog-check`]!==void 0&&(f[`cf-r2-data-catalog-check`]=String(n[`cf-r2-data-catalog-check`])),n.dryRun){let e=await a();r({command:`cf r2 buckets jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/jobs`,pathParams:{"bucket-name":String(n[`bucket-name`]??``)},bodyKind:`json`,body:n.body===void 0?g({jobType:n[`job-type`],prefix:_(n.prefix,`prefix`,`text`),destinationStorageClass:n[`destination-storage-class`],sourceStorageClass:n[`source-storage-class`]}):h(n.body)});return}let m=n.body===void 0?void 0:h(n.body),v=await t(n),y=n.local?i:await o();if(n.accountId=y,!await d({force:!!n.force,message:`This starts a background job that either permanently deletes every object under the given prefix (every object in the bucket for an empty prefix) or migrates every object in the bucket between storage classes.`}))return;if(n.body!==void 0){let t=m,r=await c(`Processing`,async()=>e(v,`POST`,`/accounts/${y}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/jobs`,{body:t,headers:Object.keys(f).length>0?f:void 0}));s(r,{successLabel:`Done`});return}n[`job-type`]===void 0&&(n[`job-type`]=await u(`job-type`,`The jobType field`,[`prefixDelete`,`storageClassMigration`])),n[`job-type`]===`prefixDelete`&&n.prefix===void 0&&(n.prefix=await l(`prefix`,"Prefix matched against object keys. A non-empty value must end in `/`. An empty string empties the entire bucket. ",{question:`Enter value for --prefix`}));let b={};n[`job-type`]!==void 0&&p(b,[`jobType`],n[`job-type`]),n.prefix!==void 0&&p(b,[`prefix`],_(n.prefix,`prefix`,`text`)),n[`destination-storage-class`]!==void 0&&p(b,[`destinationStorageClass`],n[`destination-storage-class`]),n[`source-storage-class`]!==void 0&&p(b,[`sourceStorageClass`],n[`source-storage-class`]);let x=await c(`Processing`,async()=>e(v,`POST`,`/accounts/${y}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/jobs`,{body:b,headers:Object.keys(f).length>0?f:void 0}));s(x,{successLabel:`Done`})})};function be(e){return e.usage("$0 r2 buckets jobs get <job-id>\n\nGets the current status of a background job of any type for an R2 bucket. Poll this endpoint with the job identifier returned by Create Bucket Job until the status is `COMPLETED`, `FAILED`, or `CANCELLED`.").positional(`job-id`,{type:`string`,description:`Identifier returned when the background job was submitted.`,demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xe={command:`get <job-id>`,describe:`Get Bucket Job`,builder:be,handler:async n=>f({command:`r2 buckets jobs get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let l={};if(n[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 buckets jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/jobs/${n[`job-id`]==null?`<job-id>`:encodeURIComponent(String(n[`job-id`]))}`,pathParams:{"bucket-name":String(n[`bucket-name`]??``),"job-id":String(n[`job-id`]??``)},bodyKind:`none`});return}let u=await t(n),d=n.local?i:await o();n.accountId=d;let f=await c(`Loading`,async()=>e(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/jobs/${encodeURIComponent(String(n[`job-id`]))}`,{headers:Object.keys(l).length>0?l:void 0}));s(f,{successLabel:`Loaded`})})};function Se(e){return e.usage(`$0 r2 buckets jobs list
|
|
41
|
+
|
|
42
|
+
Lists background jobs for an R2 bucket, including prefix-delete (and bucket-emptying) jobs and storage-class migration jobs. Jobs of every type are returned unless \`jobType\` is provided.`).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`job-type`,{type:`string`,description:`Restricts results to jobs of the specified type.`,choices:[`prefixDelete`,`storageClassMigration`]}).option(`status`,{type:`string`,description:"Restricts results to jobs with the specified status. `jobType` is required when this parameter is provided.",choices:[`ENQUEUED`,`RUNNING`,`COMPLETED`,`FAILED`,`CANCELLED`]}).option(`max-keys`,{type:`number`,description:`Maximum number of jobs to return.`}).option(`continuation-token`,{type:`string`,description:"Pagination token received as `nextContinuationToken` in the previous response."}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ce={command:`list`,describe:`List Bucket Jobs`,builder:Se,handler:async n=>f({command:`r2 buckets jobs list`,classification:{safeFlags:[`job-type`,`status`,`dry-run`]}},n,async()=>{let l={jobType:n[`job-type`],status:n.status,maxKeys:n[`max-keys`],continuationToken:n[`continuation-token`]},u={};if(n[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 buckets jobs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/jobs`,pathParams:{"bucket-name":String(n[`bucket-name`]??``)},query:l,bodyKind:`none`});return}let d=await t(n),f=n.local?i:await o();n.accountId=f;let p=await c(`Loading`,async()=>e(d,`GET`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/jobs`,{query:l,headers:Object.keys(u).length>0?u:void 0}));s(p,{successLabel:`Loaded`})})},we={command:`jobs`,describe:`Create and inspect background jobs for an R2 bucket`,builder:e=>e.command(ye).command(xe).command(Ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Te(e){return e.usage(`$0 r2 buckets lifecycle get <bucket-name>
|
|
43
|
+
|
|
44
|
+
Get object lifecycle rules for a bucket.`).positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ee={command:`get <bucket-name>`,describe:`Get Object Lifecycle Rules`,builder:Te,handler:async n=>f({command:`r2 buckets lifecycle get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let l={};if(n[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 buckets lifecycle get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/lifecycle`,pathParams:{"bucket-name":String(n[`bucket-name`]??``)},bodyKind:`none`});return}let u=await t(n),d=n.local?i:await o();n.accountId=d;let f=await c(`Loading`,async()=>e(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/lifecycle`,{headers:Object.keys(l).length>0?l:void 0}));s(f,{successLabel:`Loaded`})})};function De(e){return e.usage(`$0 r2 buckets lifecycle update <bucket-name>
|
|
45
|
+
|
|
46
|
+
Replaces the object lifecycle rules for an R2 bucket. Rules match object-key prefixes and can expire objects, abort incomplete multipart uploads, or transition objects to Infrequent Access storage.`).positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`rules`,{type:`string`,description:`The rules field. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"conditions": {...}, "enabled": boolean, "id": string, "abortMultipartUploadsTransition"?: {...}, "deleteObjectsTransition"?: {...}, ...more}]. ? marks optional keys.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Oe={command:`update <bucket-name>`,describe:`Set Object Lifecycle Rules`,builder:De,handler:async n=>f({command:`r2 buckets lifecycle update`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{let l={};if(n[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 buckets lifecycle update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/lifecycle`,pathParams:{"bucket-name":String(n[`bucket-name`]??``)},bodyKind:`json`,body:n.body===void 0?g({rules:m(n.rules,`rules`)}):h(n.body)});return}let u=n.body===void 0?void 0:h(n.body),f=await t(n),_=n.local?i:await o();if(n.accountId=_,!await d({force:!!n.force,message:`This replaces the R2 bucket's object lifecycle rules and can schedule object deletion or abort multipart uploads.`}))return;if(n.body!==void 0){let t=u,r=await c(`Updating`,async()=>e(f,`PUT`,`/accounts/${_}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/lifecycle`,{body:t,headers:Object.keys(l).length>0?l:void 0}));s(r,{successLabel:`Updated`});return}let v={};n.rules!==void 0&&p(v,[`rules`],m(n.rules,`rules`));let y=await c(`Updating`,async()=>e(f,`PUT`,`/accounts/${_}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/lifecycle`,{body:v,headers:Object.keys(l).length>0?l:void 0}));s(y,{successLabel:`Updated`})})},ke={command:`lifecycle`,describe:`Operations for buckets.lifecycle`,builder:e=>e.command(Ee).command(Oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ae(e){return e.usage(`$0 r2 buckets list
|
|
47
|
+
|
|
48
|
+
Lists a page of R2 buckets in the account and selected jurisdiction. Use the returned cursor to retrieve the next page.`).option(`name-contains`,{type:`string`,description:`Bucket names to filter by. Only buckets with this phrase in their name will be returned.`}).option(`start-after`,{type:`string`,description:`Bucket name to start searching after. Buckets are ordered lexicographically.`}).option(`per-page`,{type:`number`,description:`Maximum number of buckets to return in a single call.`}).option(`order`,{type:`string`,description:`Field to order buckets by.`,choices:[`name`]}).option(`direction`,{type:`string`,description:`Direction to order buckets.`,choices:[`asc`,`desc`]}).option(`cursor`,{type:`string`,description:`Pagination cursor received during the last List Buckets call. R2 buckets are paginated using cursors instead of page numbers.`}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const je={command:`list`,describe:`List Buckets`,builder:Ae,handler:async n=>f({command:`r2 buckets list`,classification:{safeFlags:[`order`,`direction`,`dry-run`]}},n,async()=>{let l={name_contains:n[`name-contains`],start_after:n[`start-after`],per_page:n[`per-page`],order:n.order,direction:n.direction,cursor:n.cursor},u={};if(n[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 buckets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets`,pathParams:{},query:l,bodyKind:`none`});return}let d=await t(n),f=n.local?i:await o();n.accountId=f;let p=await c(`Loading`,async()=>e(d,`GET`,`/accounts/${f}/r2/buckets`,{query:l,headers:Object.keys(u).length>0?u:void 0}));s(p,{successLabel:`Loaded`})})};var Me={method:`GET`,path:e=>n`/accounts/${e.account_id}/r2/buckets/${e.bucket_name}/local-uploads`};function Ne(e){return e.usage(`$0 r2 buckets local-uploads get <bucket-name>
|
|
49
|
+
|
|
50
|
+
Gets the Local Uploads configuration for an R2 bucket. When enabled, object data is written near the client before being asynchronously copied to the bucket's primary region. Local Uploads is only supported in the default jurisdiction.`).positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Pe={command:`get <bucket-name>`,describe:`Get Local Uploads Configuration`,builder:Ne,handler:async e=>f({command:`r2 buckets local-uploads get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();r({command:`cf r2 buckets local-uploads get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/local-uploads`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`none`});return}let n=await t(e),l=e.local?i:await o();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Me,{account_id:l,bucket_name:e[`bucket-name`]}));s(u,{successLabel:`Loaded`})})};var q={method:`PUT`,path:e=>n`/accounts/${e.account_id}/r2/buckets/${e.bucket_name}/local-uploads`,body:`json`};function Fe(e){return e.usage(`$0 r2 buckets local-uploads update <bucket-name>
|
|
51
|
+
|
|
52
|
+
Enables or disables Local Uploads for an R2 bucket in the default jurisdiction. When enabled, object data is written near the client before being asynchronously copied to the bucket's primary region. Disabling Local Uploads allows existing replication to finish.`).positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`Whether to enable local uploads for this bucket.`}).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 Ie={command:`update <bucket-name>`,describe:`Set Local Uploads Configuration`,builder:Fe,handler:async e=>f({command:`r2 buckets local-uploads update`,classification:{safeFlags:[`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();r({command:`cf r2 buckets local-uploads update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/local-uploads`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`json`,body:e.body===void 0?g({enabled:e.enabled}):h(e.body)});return}let n=e.body===void 0?void 0:h(e.body),l=await t(e),u=e.local?i:await o();if(e.accountId=u,e.body!==void 0){let t=n,r=await c(`Updating`,async()=>l.send(q,{body:t,account_id:u,bucket_name:e[`bucket-name`]}));s(r,{successLabel:`Updated`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let d=g({enabled:e.enabled}),f=await c(`Updating`,async()=>l.send(q,{body:d,account_id:u,bucket_name:e[`bucket-name`]}));s(f,{successLabel:`Updated`})})},Le={command:`local-uploads`,describe:`R2 bucket local upload configuration`,builder:e=>e.command(Pe).command(Ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Re(e){return e.usage(`$0 r2 buckets locks delete <bucket-name>
|
|
53
|
+
|
|
54
|
+
Delete all lock rules for a bucket.`).positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).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 ze={command:`delete <bucket-name>`,describe:`Delete Bucket Lock Rules`,builder:Re,handler:async n=>f({command:`r2 buckets locks delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{let l={};if(n[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 buckets locks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/lock`,pathParams:{"bucket-name":String(n[`bucket-name`]??``)},bodyKind:`none`});return}let u=await t(n),f=n.local?i:await o();if(n.accountId=f,!await d({force:!!n.force,message:`This removes all lock rules from the R2 bucket, removing their protection against object deletion and overwriting.`}))return;let p=await c(`Deleting`,async()=>e(u,`DELETE`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/lock`,{headers:Object.keys(l).length>0?l:void 0}));s(p,{successLabel:`Deleted`})})};function Be(e){return e.usage(`$0 r2 buckets locks get <bucket-name>
|
|
55
|
+
|
|
56
|
+
Get lock rules for a bucket.`).positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ve={command:`get <bucket-name>`,describe:`Get Bucket Lock Rules`,builder:Be,handler:async n=>f({command:`r2 buckets locks get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let l={};if(n[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 buckets locks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/lock`,pathParams:{"bucket-name":String(n[`bucket-name`]??``)},bodyKind:`none`});return}let u=await t(n),d=n.local?i:await o();n.accountId=d;let f=await c(`Loading`,async()=>e(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/lock`,{headers:Object.keys(l).length>0?l:void 0}));s(f,{successLabel:`Loaded`})})};function He(e){return e.usage(`$0 r2 buckets locks update <bucket-name>
|
|
57
|
+
|
|
58
|
+
Replaces the lock rules for an R2 bucket. Enabled rules prevent matching objects from being overwritten or deleted for a duration, until a date, or indefinitely. Rules apply to existing and newly uploaded objects.`).positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`rules`,{type:`string`,description:`The rules field. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"condition": {...}, "enabled": boolean, "id": string, "prefix"?: string}]. ? marks optional keys.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ue={command:`update <bucket-name>`,describe:`Set Bucket Lock Rules`,builder:He,handler:async n=>f({command:`r2 buckets locks update`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{let l={};if(n[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 buckets locks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/lock`,pathParams:{"bucket-name":String(n[`bucket-name`]??``)},bodyKind:`json`,body:n.body===void 0?g({rules:m(n.rules,`rules`)}):h(n.body)});return}let u=n.body===void 0?void 0:h(n.body),f=await t(n),_=n.local?i:await o();if(n.accountId=_,!await d({force:!!n.force,message:`This replaces the R2 bucket's lock rules. Removing or shortening retention can allow objects to be overwritten or deleted.`}))return;if(n.body!==void 0){let t=u,r=await c(`Updating`,async()=>e(f,`PUT`,`/accounts/${_}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/lock`,{body:t,headers:Object.keys(l).length>0?l:void 0}));s(r,{successLabel:`Updated`});return}let v={};n.rules!==void 0&&p(v,[`rules`],m(n.rules,`rules`));let y=await c(`Updating`,async()=>e(f,`PUT`,`/accounts/${_}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/lock`,{body:v,headers:Object.keys(l).length>0?l:void 0}));s(y,{successLabel:`Updated`})})},We={command:`locks`,describe:`Operations for buckets.locks`,builder:e=>e.command(ze).command(Ve).command(Ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Ge={method:`GET`,path:e=>n`/accounts/${e.account_id}/r2/metrics`};function Ke(e){return e.usage(`$0 r2 buckets metrics list
|
|
59
|
+
|
|
60
|
+
Get Storage/Object Count Metrics across all buckets in your account. Note that Account-Level Metrics may not immediately reflect the latest data.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const qe={command:`list`,describe:`Get Account-Level Metrics`,builder:Ke,handler:async e=>f({command:`r2 buckets metrics list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await a();r({command:`cf r2 buckets metrics list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/metrics`,pathParams:{},bodyKind:`none`});return}let n=await t(e),l=e.local?i:await o();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Ge,{account_id:l}));s(u,{successLabel:`Loaded`})})},Je={command:`metrics`,describe:`Operations for buckets.metrics`,builder:e=>e.command(qe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ye(e){return e.usage(`$0 r2 buckets sippy delete <bucket-name>
|
|
61
|
+
|
|
62
|
+
Disables Sippy on-demand migration for an R2 bucket. Requests no longer fetch missing objects from the source storage provider. Objects already copied to R2 remain in the bucket.`).positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).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 Xe={command:`delete <bucket-name>`,describe:`Disable Sippy`,builder:Ye,handler:async n=>f({command:`r2 buckets sippy delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{let l={};if(n[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 buckets sippy delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/sippy`,pathParams:{"bucket-name":String(n[`bucket-name`]??``)},bodyKind:`none`});return}let u=await t(n),f=n.local?i:await o();if(n.accountId=f,!await d({force:!!n.force,message:`This disables Sippy on-demand migration for the R2 bucket. Objects already copied to R2 remain in the bucket.`}))return;let p=await c(`Deleting`,async()=>e(u,`DELETE`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/sippy`,{headers:Object.keys(l).length>0?l:void 0}));s(p,{successLabel:`Deleted`})})};function Ze(e){return e.usage(`$0 r2 buckets sippy get <bucket-name>
|
|
63
|
+
|
|
64
|
+
Gets configuration for Sippy for an existing R2 bucket.`).positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Qe={command:`get <bucket-name>`,describe:`Get Sippy Configuration`,builder:Ze,handler:async n=>f({command:`r2 buckets sippy get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let l={};if(n[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 buckets sippy get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/sippy`,pathParams:{"bucket-name":String(n[`bucket-name`]??``)},bodyKind:`none`});return}let u=await t(n),d=n.local?i:await o();n.accountId=d;let f=await c(`Loading`,async()=>e(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/sippy`,{headers:Object.keys(l).length>0?l:void 0}));s(f,{successLabel:`Loaded`})})};function $e(e){return e.usage(`$0 r2 buckets sippy update <bucket-name>
|
|
65
|
+
|
|
66
|
+
Configures and enables Sippy on-demand migration for an R2 bucket. When a requested object is missing from R2, Sippy serves it from the configured source storage provider and copies it to R2.`).positional(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`destination-access-key-id`,{type:`string`,description:`ID of a Cloudflare API token.
|
|
67
|
+
This is the value labelled "Access Key ID" when creating an API.
|
|
68
|
+
token from the [R2 dashboard](https://dash.cloudflare.com/?to=/:account/r2/api-tokens).
|
|
69
|
+
|
|
70
|
+
Sippy will use this token when writing objects to R2, so it is
|
|
71
|
+
best to scope this token to the bucket you're enabling Sippy for.
|
|
72
|
+
`}).option(`destination-provider`,{type:`string`,description:`The destination.provider field`,choices:[`r2`]}).coerce(`destination-provider`,e=>_(e,`destination-provider`,`text`)).option(`destination-secret-access-key`,{type:`string`,description:`Value of a Cloudflare API token.
|
|
73
|
+
This is the value labelled "Secret Access Key" when creating an API.
|
|
74
|
+
token from the [R2 dashboard](https://dash.cloudflare.com/?to=/:account/r2/api-tokens).
|
|
75
|
+
|
|
76
|
+
Sippy will use this token when writing objects to R2, so it is
|
|
77
|
+
best to scope this token to the bucket you're enabling Sippy for.
|
|
78
|
+
`}).option(`source-access-key-id`,{type:`string`,description:`Access Key ID of an IAM credential (ideally scoped to a single S3 bucket).`}).option(`source-bucket`,{type:`string`,description:`Name of the AWS S3 bucket.`}).option(`source-provider`,{type:`string`,description:`The source.provider field`,choices:[`aws`,`gcs`,`s3`,`azure`]}).coerce(`source-provider`,e=>_(e,`source-provider`,`text`)).option(`source-region`,{type:`string`,description:`AWS region containing the source S3 bucket.`}).option(`source-secret-access-key`,{type:`string`,description:`Secret Access Key of an IAM credential (ideally scoped to a single S3 bucket).`}).option(`source-client-email`,{type:`string`,description:`Client email of an IAM credential (ideally scoped to a single GCS bucket).`}).option(`source-private-key`,{type:`string`,description:`Private Key of an IAM credential (ideally scoped to a single GCS bucket).`}).option(`source-bucket-url`,{type:`string`,description:`URL to the S3-compatible API of the bucket.`}).option(`source-account-key`,{type:`string`,description:`Access key for the Azure Storage account. Mutually exclusive with sasToken.`}).option(`source-account-name`,{type:`string`,description:`Name of the Azure Storage account.`}).option(`source-container`,{type:`string`,description:`Name of the Azure Blob Storage container.`}).option(`source-sas-token`,{type:`string`,description:`Shared Access Signature token for the Azure Storage account. Mutually exclusive with accountKey.`}).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 et={command:`update <bucket-name>`,describe:`Enable Sippy`,builder:$e,handler:async n=>f({command:`r2 buckets sippy update`,classification:{safeFlags:[`destination-provider`,`source-provider`,`dry-run`]}},n,async()=>{let l={};if(n[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 buckets sippy update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/sippy`,pathParams:{"bucket-name":String(n[`bucket-name`]??``)},bodyKind:`json`,body:n.body===void 0?g({destination:{accessKeyId:_(n[`destination-access-key-id`],`destination-access-key-id`,`text`),provider:n[`destination-provider`],secretAccessKey:_(n[`destination-secret-access-key`],`destination-secret-access-key`,`text`)},source:{accessKeyId:_(n[`source-access-key-id`],`source-access-key-id`,`text`),bucket:_(n[`source-bucket`],`source-bucket`,`text`),provider:n[`source-provider`],region:_(n[`source-region`],`source-region`,`text`),secretAccessKey:_(n[`source-secret-access-key`],`source-secret-access-key`,`text`),clientEmail:_(n[`source-client-email`],`source-client-email`,`text`),privateKey:_(n[`source-private-key`],`source-private-key`,`text`),bucketUrl:_(n[`source-bucket-url`],`source-bucket-url`,`text`),accountKey:_(n[`source-account-key`],`source-account-key`,`text`),accountName:_(n[`source-account-name`],`source-account-name`,`text`),container:_(n[`source-container`],`source-container`,`text`),sasToken:_(n[`source-sas-token`],`source-sas-token`,`text`)}}):h(n.body),sensitiveBodyPaths:[[`destination`,`secretAccessKey`],[`source`,`secretAccessKey`],[`source`,`privateKey`],[`source`,`accountKey`],[`source`,`sasToken`]]});return}let u=n.body===void 0?void 0:h(n.body),d=await t(n),f=n.local?i:await o();if(n.accountId=f,n.body!==void 0){let t=u,r=await c(`Updating`,async()=>e(d,`PUT`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/sippy`,{body:t,headers:Object.keys(l).length>0?l:void 0}));s(r,{successLabel:`Updated`});return}let m={};n[`destination-access-key-id`]!==void 0&&p(m,[`destination`,`accessKeyId`],_(n[`destination-access-key-id`],`destination-access-key-id`,`text`)),n[`destination-provider`]!==void 0&&p(m,[`destination`,`provider`],n[`destination-provider`]),n[`destination-secret-access-key`]!==void 0&&p(m,[`destination`,`secretAccessKey`],_(n[`destination-secret-access-key`],`destination-secret-access-key`,`text`)),n[`source-access-key-id`]!==void 0&&p(m,[`source`,`accessKeyId`],_(n[`source-access-key-id`],`source-access-key-id`,`text`)),n[`source-bucket`]!==void 0&&p(m,[`source`,`bucket`],_(n[`source-bucket`],`source-bucket`,`text`)),n[`source-provider`]!==void 0&&p(m,[`source`,`provider`],n[`source-provider`]),n[`source-region`]!==void 0&&p(m,[`source`,`region`],_(n[`source-region`],`source-region`,`text`)),n[`source-secret-access-key`]!==void 0&&p(m,[`source`,`secretAccessKey`],_(n[`source-secret-access-key`],`source-secret-access-key`,`text`)),n[`source-client-email`]!==void 0&&p(m,[`source`,`clientEmail`],_(n[`source-client-email`],`source-client-email`,`text`)),n[`source-private-key`]!==void 0&&p(m,[`source`,`privateKey`],_(n[`source-private-key`],`source-private-key`,`text`)),n[`source-bucket-url`]!==void 0&&p(m,[`source`,`bucketUrl`],_(n[`source-bucket-url`],`source-bucket-url`,`text`)),n[`source-account-key`]!==void 0&&p(m,[`source`,`accountKey`],_(n[`source-account-key`],`source-account-key`,`text`)),n[`source-account-name`]!==void 0&&p(m,[`source`,`accountName`],_(n[`source-account-name`],`source-account-name`,`text`)),n[`source-container`]!==void 0&&p(m,[`source`,`container`],_(n[`source-container`],`source-container`,`text`)),n[`source-sas-token`]!==void 0&&p(m,[`source`,`sasToken`],_(n[`source-sas-token`],`source-sas-token`,`text`));let v=await c(`Updating`,async()=>e(d,`PUT`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/sippy`,{body:m,headers:Object.keys(l).length>0?l:void 0}));s(v,{successLabel:`Updated`})})},tt={command:`sippy`,describe:`Operations for buckets.sippy`,builder:e=>e.command(Xe).command(Qe).command(et).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},nt={command:`buckets`,describe:`Create and configure R2 buckets including CORS, lifecycle, custom domains, event notifications, and object locks`,builder:e=>e.command(w).command(S).command(E).command(G).command(_e).command(je).command(oe).command(U).command(he).command(we).command(ke).command(Le).command(We).command(Je).command(tt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function rt(e){return e.usage("$0 r2 objects bulk-delete\n\nDeletes the listed objects from an R2 bucket. Provide a JSON array of 1 to 1000 object keys in the request body. If any key cannot be deleted (for example, because it does not exist or is locked), the remaining keys are still deleted, but the response is HTTP 200 with `success: false`, `result: null` and one entry in `errors` per failed key. The entries in `errors` do not identify which key failed. To delete every object under a prefix, or to empty a bucket, create a `prefixDelete` job with the Create Bucket Job endpoint instead. The `prefix` query parameter on this endpoint is deprecated; it creates the same job, but responses to it carry a `Deprecation` header and a message pointing to Create Bucket Job. For most workloads, we recommend using R2's [S3-compatible API](https://developers.cloudflare.com/r2/api/s3/api/) or a [Worker with an R2 binding](https://developers.cloudflare.com/r2/api/workers/workers-api-reference/) instead.").option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`prefix`,{type:`string`,description:"Deprecated. Create a `prefixDelete` job with the Create Bucket Job endpoint instead.\nWhen present, the request body is ignored and a prefix-delete job is created for this\nprefix, exactly as Create Bucket Job does; an empty value empties the bucket. The\nresponse is the job descriptor, with a `Deprecation` header and a deprecation message\nin `messages`."}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`cf-r2-data-catalog-check`,{type:`string`,description:`Set this header to reject the operation when R2 Data Catalog is enabled for the bucket.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:"A JSON array of 1 to 1000 object keys to delete. Required unless the deprecated `prefix` parameter is present."})}const it={command:`bulk-delete`,describe:`Delete Objects`,builder:rt,handler:async n=>f({command:`r2 objects bulk-delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{let l={prefix:n.prefix},u={};if(n[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n[`cf-r2-data-catalog-check`]!==void 0&&(u[`cf-r2-data-catalog-check`]=String(n[`cf-r2-data-catalog-check`])),n.dryRun){let e=await a();r({command:`cf r2 objects bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/objects`,pathParams:{"bucket-name":String(n[`bucket-name`]??``)},query:l,bodyKind:`json`,body:n.body===void 0?void 0:h(n.body,[],1e3)});return}if(n.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`);let f=n.body===void 0?void 0:h(n.body,[],1e3),p=await t(n),m=n.local?i:await o();if(n.accountId=m,await d({force:!!n.force,message:"This permanently deletes the listed R2 objects. With the deprecated `prefix` parameter it deletes every object under that prefix, and an empty prefix empties the bucket."})&&n.body!==void 0){let t=f,r=new URLSearchParams(Object.entries(l).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),i=await c(`Deleting`,async()=>e(p,`DELETE`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/objects${r?`?`+r:``}`,{body:t,headers:Object.keys(u).length>0?u:void 0}));s(i,{successLabel:`Deleted`})}})};function at(e){return e.usage(`$0 r2 objects delete <object-key>
|
|
79
|
+
|
|
80
|
+
Deletes an object from an R2 bucket. For most workloads, we recommend using R2's [S3-compatible API](https://developers.cloudflare.com/r2/api/s3/api/) or a [Worker with an R2 binding](https://developers.cloudflare.com/r2/api/workers/workers-api-reference/) instead.`).positional(`object-key`,{type:`string`,description:"The key (name) of the object to delete. May contain slashes for path-like keys. Slashes (`/`) within the key MUST be sent literally and MUST NOT be percent-encoded (i.e. `%2F`); other reserved characters should be percent-encoded as usual.",demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).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 ot={command:`delete <object-key>`,describe:`Delete Object`,builder:at,handler:async n=>f({command:`r2 objects delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{let l={};if(n[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 objects delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/objects/${n[`object-key`]==null?`<object-key>`:encodeURIComponent(String(n[`object-key`]))}`,pathParams:{"bucket-name":String(n[`bucket-name`]??``),"object-key":String(n[`object-key`]??``)},bodyKind:`none`});return}let u=await t(n),f=n.local?i:await o();if(n.accountId=f,!await d({force:!!n.force,message:`This permanently deletes the specified object from the R2 bucket.`}))return;let p=await c(`Deleting`,async()=>e(u,`DELETE`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/objects/${encodeURIComponent(String(n[`object-key`]))}`,{headers:Object.keys(l).length>0?l:void 0}));s(p,{successLabel:`Deleted`})})};function st(e){return e.usage(`$0 r2 objects get <object-key>
|
|
81
|
+
|
|
82
|
+
Retrieves an object from an R2 bucket. Returns the object body along with metadata headers. For most workloads, we recommend using R2's [S3-compatible API](https://developers.cloudflare.com/r2/api/s3/api/) or a [Worker with an R2 binding](https://developers.cloudflare.com/r2/api/workers/workers-api-reference/) instead.`).positional(`object-key`,{type:`string`,description:"The key (name) of the object to retrieve. May contain slashes for path-like keys. Slashes (`/`) within the key MUST be sent literally and MUST NOT be percent-encoded (i.e. `%2F`); other reserved characters should be percent-encoded as usual.",demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`if-none-match`,{type:`string`,description:`Returns the object only if its ETag does not match the given value.`}).option(`if-modified-since`,{type:`string`,description:"Returns the object only if it has been modified since the specified time.\nMust be formatted as an HTTP-date (RFC 7231), e.g. `Tue, 15 Jan 2024 10:30:00 GMT`."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const ct={command:`get <object-key>`,describe:`Get Object`,builder:st,handler:async e=>f({command:`r2 objects get`,classification:{safeFlags:[`dry-run`,`text`]}},e,async()=>{let n={};if(e[`cf-r2-jurisdiction`]!==void 0&&(n[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e[`if-none-match`]!==void 0&&(n[`If-None-Match`]=String(e[`if-none-match`])),e[`if-modified-since`]!==void 0&&(n[`If-Modified-Since`]=String(e[`if-modified-since`])),e.dryRun){let t=await a();r({command:`cf r2 objects get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/objects/${e[`object-key`]==null?`<object-key>`:encodeURIComponent(String(e[`object-key`]))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``),"object-key":String(e[`object-key`]??``)},bodyKind:`none`});return}await t(e);let s=e.local?i:await o();e.accountId=s;let l=await c(`Loading`,async()=>b(`/accounts/${s}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/objects/${encodeURIComponent(String(e[`object-key`]))}`,{method:`GET`,local:e.local===!0,persistTo:e.persistTo,headers:Object.keys(n).length>0?n:void 0}));y(e.text===!0?l.toString(`utf-8`):l)})};function lt(e){return e.usage(`$0 r2 objects list
|
|
83
|
+
|
|
84
|
+
Lists objects in an R2 bucket. Returns object metadata including key, size, etag, last modified date, HTTP metadata, and custom metadata. For most workloads, we recommend using R2's [S3-compatible API](https://developers.cloudflare.com/r2/api/s3/api/) or a [Worker with an R2 binding](https://developers.cloudflare.com/r2/api/workers/workers-api-reference/) instead.`).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`per-page`,{type:`number`,description:`Maximum number of objects to return per page.`}).option(`prefix`,{type:`string`,description:`Restricts results to only those objects whose keys begin with the specified prefix.`}).option(`delimiter`,{type:`string`,description:`A single character used to group keys. All keys that contain the delimiter between the prefix and the first occurrence of the delimiter after the prefix are grouped under a single result element.`}).option(`cursor`,{type:`string`,description:`Pagination cursor received from a previous List Objects call. Used to retrieve the next page of results.`}).option(`start-after`,{type:`string`,description:`Returns objects with keys that come after the specified key in lexicographic order.`}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ut={command:`list`,describe:`List Objects`,builder:lt,handler:async n=>f({command:`r2 objects list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let l={per_page:n[`per-page`],prefix:n.prefix,delimiter:n.delimiter,cursor:n.cursor,start_after:n[`start-after`]},u={};if(n[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n.dryRun){let e=await a();r({command:`cf r2 objects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/objects`,pathParams:{"bucket-name":String(n[`bucket-name`]??``)},query:l,bodyKind:`none`});return}let d=await t(n),f=n.local?i:await o();n.accountId=f;let p=await c(`Loading`,async()=>e(d,`GET`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/objects`,{query:l,headers:Object.keys(u).length>0?u:void 0}));s(p,{successLabel:`Loaded`})})};function dt(e){return e.usage(`$0 r2 objects put <object-key>
|
|
85
|
+
|
|
86
|
+
Uploads an object to an R2 bucket. The object body is provided as the request body. Returns metadata about the uploaded object. The maximum upload size for this endpoint is 300 MB. For most workloads, we recommend using R2's [S3-compatible API](https://developers.cloudflare.com/r2/api/s3/api/) or a [Worker with an R2 binding](https://developers.cloudflare.com/r2/api/workers/workers-api-reference/) instead.`).positional(`object-key`,{type:`string`,description:"The key (name) to assign to the object. May contain slashes for path-like keys. Slashes (`/`) within the key MUST be sent literally and MUST NOT be percent-encoded (i.e. `%2F`); other reserved characters should be percent-encoded as usual.",demandOption:!0}).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`cf-r2-jurisdiction`,{type:`string`,description:`Jurisdiction where objects in this bucket are guaranteed to be stored.`}).option(`content-type`,{type:`string`,description:`The MIME type of the object being uploaded.`}).option(`content-length`,{type:`string`,description:`The size of the object body in bytes.`}).option(`cf-r2-storage-class`,{type:`string`,description:`Storage class for this object. Overrides the bucket default.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The object body to upload.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const ft={command:`put <object-key>`,describe:`Upload Object`,builder:dt,handler:async n=>f({command:`r2 objects put`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let l={};if(n[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(n[`cf-r2-jurisdiction`])),n[`content-type`]!==void 0&&(l[`Content-Type`]=String(n[`content-type`])),n[`content-length`]!==void 0&&(l[`Content-Length`]=String(n[`content-length`])),n[`cf-r2-storage-class`]!==void 0&&(l[`cf-r2-storage-class`]=String(n[`cf-r2-storage-class`])),n.dryRun){let e=await a();r({command:`cf r2 objects put`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/r2/buckets/${n[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(n[`bucket-name`]))}/objects/${n[`object-key`]==null?`<object-key>`:encodeURIComponent(String(n[`object-key`]))}`,pathParams:{"bucket-name":String(n[`bucket-name`]??``),"object-key":String(n[`object-key`]??``)},bodyKind:`octet-stream`,body:n.file===void 0?n.body:{file:n.file}});return}if(n.body===void 0&&n.file===void 0)throw Error(`--body or --file is required for this command. Pass --body '<value>' or --file path/to/file.`);let u=n.file===void 0?_(n.body,`body`,`binary`):void 0,d=await t(n),f=n.local?i:await o();if(n.accountId=f,n.file!==void 0){let t=v(n.file),r=await c(`Updating`,async()=>e(d,`PUT`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/objects/${encodeURIComponent(String(n[`object-key`]))}`,{body:t,headers:{"Content-Type":`application/octet-stream`,...Object.keys(l).length>0?l:void 0}}));s(r,{successLabel:`Updated`})}else if(n.body!==void 0){let t=u,r=await c(`Updating`,async()=>e(d,`PUT`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(n[`bucket-name`]))}/objects/${encodeURIComponent(String(n[`object-key`]))}`,{body:t,headers:{"Content-Type":`application/octet-stream`,...l}}));s(r,{successLabel:`Updated`})}})},pt={command:`objects`,describe:`Operations for objects`,builder:e=>e.command(it).command(ot).command(ct).command(ut).command(ft).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var J={method:`PUT`,path:e=>n`/accounts/${e.account_id}/slurper/source/connectivity-precheck`,body:`json`};function mt(e){return e.usage(`$0 r2 super-slurper connectivity-precheck source
|
|
87
|
+
|
|
88
|
+
Check whether tokens are valid against the source bucket`).option(`bucket`,{type:`string`,description:`The bucket field`}).option(`endpoint`,{type:`string`,description:`Custom S3-compatible endpoint that must use https://.`}).option(`keys`,{type:`string`,array:!0,description:`The keys field`}).option(`path-prefix`,{type:`string`,description:`The pathPrefix field`}).option(`region`,{type:`string`,description:`The region field`}).option(`secret-access-key-id`,{type:`string`,description:`The secret.accessKeyId field`}).option(`secret-secret-access-key`,{type:`string`,description:`The secret.secretAccessKey field`}).option(`secret-client-email`,{type:`string`,description:`The secret.clientEmail field`}).option(`secret-private-key`,{type:`string`,description:`The secret.privateKey field`}).option(`vendor`,{type:`string`,description:`The vendor field`,choices:[`s3`,`gcs`,`r2`]}).coerce(`vendor`,e=>_(e,`vendor`,`text`)).option(`jurisdiction`,{type:`string`,description:`The jurisdiction field`,choices:[`default`,`eu`,`us`,`fedramp`]}).coerce(`jurisdiction`,e=>_(e,`jurisdiction`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`endpoint`,[`secret-client-email`,`secret-private-key`,`jurisdiction`]).implies(`endpoint`,[`secret-access-key-id`,`secret-secret-access-key`]).conflicts(`region`,[`secret-client-email`,`secret-private-key`,`jurisdiction`]).implies(`region`,[`secret-access-key-id`,`secret-secret-access-key`]).conflicts(`secret-access-key-id`,[`secret-client-email`,`secret-private-key`]).implies(`secret-access-key-id`,[`secret-secret-access-key`]).conflicts(`secret-secret-access-key`,[`secret-client-email`,`secret-private-key`]).implies(`secret-secret-access-key`,[`secret-access-key-id`]).conflicts(`secret-client-email`,[`endpoint`,`region`,`secret-access-key-id`,`secret-secret-access-key`,`jurisdiction`]).implies(`secret-client-email`,[`secret-private-key`]).conflicts(`secret-private-key`,[`endpoint`,`region`,`secret-access-key-id`,`secret-secret-access-key`,`jurisdiction`]).implies(`secret-private-key`,[`secret-client-email`]).conflicts(`jurisdiction`,[`endpoint`,`region`,`secret-client-email`,`secret-private-key`]).implies(`jurisdiction`,[`secret-access-key-id`,`secret-secret-access-key`])}const ht={command:`source`,describe:`Check source connectivity`,builder:mt,handler:async e=>f({command:`r2 super-slurper connectivity-precheck source`,classification:{safeFlags:[`vendor`,`jurisdiction`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();r({command:`cf r2 super-slurper connectivity-precheck source`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/slurper/source/connectivity-precheck`,pathParams:{},bodyKind:`json`,body:e.body===void 0?g({bucket:_(e.bucket,`bucket`,`text`),endpoint:_(e.endpoint,`endpoint`,`text`),keys:e.keys,pathPrefix:_(e[`path-prefix`],`path-prefix`,`text`),region:_(e.region,`region`,`text`),secret:{accessKeyId:_(e[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:_(e[`secret-secret-access-key`],`secret-secret-access-key`,`text`),clientEmail:_(e[`secret-client-email`],`secret-client-email`,`text`),privateKey:_(e[`secret-private-key`],`secret-private-key`,`text`)},vendor:e.vendor,jurisdiction:e.jurisdiction}):h(e.body),sensitiveBodyPaths:[[`secret`,`secretAccessKey`],[`secret`,`privateKey`]]});return}let n=e.body===void 0?void 0:h(e.body),d=await t(e),f=e.local?i:await o();if(e.accountId=f,e.body!==void 0){let e=n,t=await c(`Updating`,async()=>d.send(J,{body:e,account_id:f}));s(t,{successLabel:`Updated`});return}e.bucket===void 0&&(e.bucket=await l(`bucket`,`The bucket field`)),e.vendor===void 0&&(e.vendor=await u(`vendor`,`The vendor field`,[`s3`,`gcs`,`r2`]));let p=g({bucket:_(e.bucket,`bucket`,`text`),endpoint:_(e.endpoint,`endpoint`,`text`),keys:e.keys,pathPrefix:_(e[`path-prefix`],`path-prefix`,`text`),region:_(e.region,`region`,`text`),secret:{accessKeyId:_(e[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:_(e[`secret-secret-access-key`],`secret-secret-access-key`,`text`),clientEmail:_(e[`secret-client-email`],`secret-client-email`,`text`),privateKey:_(e[`secret-private-key`],`secret-private-key`,`text`)},vendor:e.vendor,jurisdiction:e.jurisdiction}),m=await c(`Updating`,async()=>d.send(J,{body:p,account_id:f}));s(m,{successLabel:`Updated`})})};var Y={method:`PUT`,path:e=>n`/accounts/${e.account_id}/slurper/target/connectivity-precheck`,body:`json`,constants:{vendor:`r2`}};function gt(e){return e.usage(`$0 r2 super-slurper connectivity-precheck target
|
|
89
|
+
|
|
90
|
+
Check whether tokens are valid against the target bucket`).option(`bucket`,{type:`string`,description:`The bucket field`}).option(`jurisdiction`,{type:`string`,description:`The jurisdiction field`,choices:[`default`,`eu`,`us`,`fedramp`]}).coerce(`jurisdiction`,e=>_(e,`jurisdiction`,`text`)).option(`secret-access-key-id`,{type:`string`,description:`The secret.accessKeyId field`}).option(`secret-secret-access-key`,{type:`string`,description:`The secret.secretAccessKey field`}).option(`vendor`,{type:`string`,description:`The vendor field`,choices:[`r2`]}).coerce(`vendor`,e=>_(e,`vendor`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _t={command:`target`,describe:`Check target connectivity`,builder:gt,handler:async e=>f({command:`r2 super-slurper connectivity-precheck target`,classification:{safeFlags:[`jurisdiction`,`vendor`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();r({command:`cf r2 super-slurper connectivity-precheck target`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/slurper/target/connectivity-precheck`,pathParams:{},bodyKind:`json`,body:e.body===void 0?g({bucket:_(e.bucket,`bucket`,`text`),jurisdiction:e.jurisdiction,secret:{accessKeyId:_(e[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:_(e[`secret-secret-access-key`],`secret-secret-access-key`,`text`)},vendor:e.vendor}):h(e.body),sensitiveBodyPaths:[[`secret`,`secretAccessKey`]]});return}let n=e.body===void 0?void 0:h(e.body),d=await t(e),f=e.local?i:await o();if(e.accountId=f,e.body!==void 0){let e=n,t=await c(`Updating`,async()=>d.send(Y,{body:e,account_id:f}));s(t,{successLabel:`Updated`});return}e.bucket===void 0&&(e.bucket=await l(`bucket`,`The bucket field`)),e[`secret-access-key-id`]===void 0&&(e[`secret-access-key-id`]=await l(`secret-access-key-id`,`The secret.accessKeyId field`)),e[`secret-secret-access-key`]===void 0&&(e[`secret-secret-access-key`]=await l(`secret-secret-access-key`,`The secret.secretAccessKey field`,{kind:`secret`})),e.vendor===void 0&&(e.vendor=await u(`vendor`,`The vendor field`,[`r2`]));let p=g({bucket:_(e.bucket,`bucket`,`text`),jurisdiction:e.jurisdiction,secret:{accessKeyId:_(e[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:_(e[`secret-secret-access-key`],`secret-secret-access-key`,`text`)},vendor:e.vendor}),m=await c(`Updating`,async()=>d.send(Y,{body:p,account_id:f}));s(m,{successLabel:`Updated`})})},vt={command:`connectivity-precheck`,describe:`Operations for super-slurper.connectivity-precheck`,builder:e=>e.command(ht).command(_t).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var yt={method:`PUT`,path:e=>n`/accounts/${e.account_id}/slurper/jobs/abortAll`};function bt(e){return e.usage(`$0 r2 super-slurper jobs abort-all
|
|
91
|
+
|
|
92
|
+
Cancels all running R2 Super Slurper migration jobs for the account. Any objects in the middle of a transfer will finish, but no new objects will start transferring.`).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 xt={command:`abort-all`,describe:`Abort all jobs`,builder:bt,handler:async e=>f({command:`r2 super-slurper jobs abort-all`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let e=await a();r({command:`cf r2 super-slurper jobs abort-all`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/slurper/jobs/abortAll`,pathParams:{},bodyKind:`none`});return}let n=await t(e),l=e.local?i:await o();if(e.accountId=l,!await d({force:!!e.force,message:`This operation stops every running migration job.`}))return;let u=await c(`Updating`,async()=>n.send(yt,{account_id:l}));s(u,{successLabel:`Updated`})})};var St={method:`PUT`,path:e=>n`/accounts/${e.account_id}/slurper/jobs/${e.job_id}/abort`};function Ct(e){return e.usage(`$0 r2 super-slurper jobs abort <job-id>
|
|
93
|
+
|
|
94
|
+
Cancels a specific R2 Super Slurper migration job. Any objects in the middle of a transfer will finish, but no new objects will start transferring.`).positional(`job-id`,{type:`string`,description:`Job 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 wt={command:`abort <job-id>`,describe:`Abort a job`,builder:Ct,handler:async e=>f({command:`r2 super-slurper jobs abort`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await a();r({command:`cf r2 super-slurper jobs abort`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/slurper/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}/abort`,pathParams:{"job-id":String(e[`job-id`]??``)},bodyKind:`none`});return}let n=await t(e),l=e.local?i:await o();if(e.accountId=l,!await d({force:!!e.force,message:`This operation stops a running migration job.`}))return;let u=await c(`Updating`,async()=>n.send(St,{account_id:l,job_id:e[`job-id`]}));s(u,{successLabel:`Updated`})})};var X={method:`POST`,path:e=>n`/accounts/${e.account_id}/slurper/jobs`,body:`json`,errors:{409:`ConflictError`}};function Tt(e){return e.usage(`$0 r2 super-slurper jobs create
|
|
95
|
+
|
|
96
|
+
Creates a new R2 Super Slurper migration job to transfer objects from a source bucket (e.g. S3, GCS, R2) to R2.`).option(`overwrite`,{type:`boolean`,description:`The overwrite field`,default:!0}).option(`source-bucket`,{type:`string`,description:`The source.bucket field`}).option(`source-endpoint`,{type:`string`,description:`Custom S3-compatible endpoint that must use https://.`}).option(`source-keys`,{type:`string`,array:!0,description:`The source.keys field`}).option(`source-path-prefix`,{type:`string`,description:`The source.pathPrefix field`}).option(`source-region`,{type:`string`,description:`The source.region field`}).option(`source-secret-access-key-id`,{type:`string`,description:`The source.secret.accessKeyId field`}).option(`source-secret-secret-access-key`,{type:`string`,description:`The source.secret.secretAccessKey field`}).option(`source-secret-client-email`,{type:`string`,description:`The source.secret.clientEmail field`}).option(`source-secret-private-key`,{type:`string`,description:`The source.secret.privateKey field`}).option(`source-vendor`,{type:`string`,description:`The source.vendor field`,choices:[`s3`,`gcs`,`r2`]}).coerce(`source-vendor`,e=>_(e,`source-vendor`,`text`)).option(`source-jurisdiction`,{type:`string`,description:`The source.jurisdiction field`,choices:[`default`,`eu`,`us`,`fedramp`]}).coerce(`source-jurisdiction`,e=>_(e,`source-jurisdiction`,`text`)).option(`target-bucket`,{type:`string`,description:`The target.bucket field`}).option(`target-jurisdiction`,{type:`string`,description:`The target.jurisdiction field`,choices:[`default`,`eu`,`us`,`fedramp`]}).coerce(`target-jurisdiction`,e=>_(e,`target-jurisdiction`,`text`)).option(`target-secret-access-key-id`,{type:`string`,description:`The target.secret.accessKeyId field`}).option(`target-secret-secret-access-key`,{type:`string`,description:`The target.secret.secretAccessKey field`}).option(`target-vendor`,{type:`string`,description:`The target.vendor field`,choices:[`r2`]}).coerce(`target-vendor`,e=>_(e,`target-vendor`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`source-endpoint`,[`source-secret-client-email`,`source-secret-private-key`,`source-jurisdiction`]).implies(`source-endpoint`,[`source-secret-access-key-id`,`source-secret-secret-access-key`]).conflicts(`source-region`,[`source-secret-client-email`,`source-secret-private-key`,`source-jurisdiction`]).implies(`source-region`,[`source-secret-access-key-id`,`source-secret-secret-access-key`]).conflicts(`source-secret-access-key-id`,[`source-secret-client-email`,`source-secret-private-key`]).implies(`source-secret-access-key-id`,[`source-secret-secret-access-key`]).conflicts(`source-secret-secret-access-key`,[`source-secret-client-email`,`source-secret-private-key`]).implies(`source-secret-secret-access-key`,[`source-secret-access-key-id`]).conflicts(`source-secret-client-email`,[`source-endpoint`,`source-region`,`source-secret-access-key-id`,`source-secret-secret-access-key`,`source-jurisdiction`]).implies(`source-secret-client-email`,[`source-secret-private-key`]).conflicts(`source-secret-private-key`,[`source-endpoint`,`source-region`,`source-secret-access-key-id`,`source-secret-secret-access-key`,`source-jurisdiction`]).implies(`source-secret-private-key`,[`source-secret-client-email`]).conflicts(`source-jurisdiction`,[`source-endpoint`,`source-region`,`source-secret-client-email`,`source-secret-private-key`]).implies(`source-jurisdiction`,[`source-secret-access-key-id`,`source-secret-secret-access-key`]).check(e=>{let t=[`source-bucket`,`source-endpoint`,`source-keys`,`source-path-prefix`,`source-region`,`source-secret-access-key-id`,`source-secret-secret-access-key`,`source-secret-client-email`,`source-secret-private-key`,`source-vendor`,`source-jurisdiction`].some(t=>e[t]!==void 0);if(!e.body&&t){let t=[`source-bucket`,`source-vendor`].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 --source-* flag is set`)}return!0}).check(e=>{let t=[`target-bucket`,`target-jurisdiction`,`target-secret-access-key-id`,`target-secret-secret-access-key`,`target-vendor`].some(t=>e[t]!==void 0);if(!e.body&&t){let t=[`target-bucket`,`target-secret-access-key-id`,`target-secret-secret-access-key`,`target-vendor`].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 --target-* flag is set`)}return!0})}const Z=[{path:[`source`],selector:`vendor`,variants:[{values:[`s3`],schema:{type:`object`,properties:{bucket:{type:`string`},endpoint:{anyOf:[{type:`string`},{type:`null`}]},keys:{anyOf:[{type:`array`,items:{type:`string`},maxItems:1e4},{type:`null`}]},pathPrefix:{anyOf:[{type:`string`},{type:`null`}]},region:{anyOf:[{type:`string`},{type:`null`}]},secret:{type:`object`,properties:{accessKeyId:{type:`string`},secretAccessKey:{type:`string`}},required:[`accessKeyId`,`secretAccessKey`],additionalProperties:!1},vendor:{enum:[`s3`]}},required:[`bucket`,`secret`,`vendor`],additionalProperties:!1}},{values:[`gcs`],schema:{type:`object`,properties:{bucket:{type:`string`},keys:{anyOf:[{type:`array`,items:{type:`string`},maxItems:1e4},{type:`null`}]},pathPrefix:{anyOf:[{type:`string`},{type:`null`}]},secret:{type:`object`,properties:{clientEmail:{type:`string`},privateKey:{type:`string`}},required:[`clientEmail`,`privateKey`],additionalProperties:!1},vendor:{enum:[`gcs`]}},required:[`bucket`,`secret`,`vendor`],additionalProperties:!1}},{values:[`r2`],schema:{type:`object`,properties:{bucket:{type:`string`},jurisdiction:{anyOf:[{enum:[`default`,`eu`,`us`,`fedramp`]},{type:`null`}]},keys:{anyOf:[{type:`array`,items:{type:`string`},maxItems:1e4},{type:`null`}]},pathPrefix:{anyOf:[{type:`string`},{type:`null`}]},secret:{type:`object`,properties:{accessKeyId:{type:`string`},secretAccessKey:{type:`string`}},required:[`accessKeyId`,`secretAccessKey`],additionalProperties:!1},vendor:{enum:[`r2`]}},required:[`bucket`,`secret`,`vendor`],additionalProperties:!1}}]}],Et={command:`create`,describe:`Create a job`,builder:Tt,handler:async e=>f({command:`r2 super-slurper jobs create`,classification:{safeFlags:[`overwrite`,`source-vendor`,`source-jurisdiction`,`target-jurisdiction`,`target-vendor`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();r({command:`cf r2 super-slurper jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/slurper/jobs`,pathParams:{},bodyKind:`json`,body:e.body===void 0?x(g({overwrite:e.overwrite,source:{bucket:_(e[`source-bucket`],`source-bucket`,`text`),endpoint:_(e[`source-endpoint`],`source-endpoint`,`text`),keys:e[`source-keys`],pathPrefix:_(e[`source-path-prefix`],`source-path-prefix`,`text`),region:_(e[`source-region`],`source-region`,`text`),secret:{accessKeyId:_(e[`source-secret-access-key-id`],`source-secret-access-key-id`,`text`),secretAccessKey:_(e[`source-secret-secret-access-key`],`source-secret-secret-access-key`,`text`),clientEmail:_(e[`source-secret-client-email`],`source-secret-client-email`,`text`),privateKey:_(e[`source-secret-private-key`],`source-secret-private-key`,`text`)},vendor:e[`source-vendor`],jurisdiction:e[`source-jurisdiction`]},target:{bucket:_(e[`target-bucket`],`target-bucket`,`text`),jurisdiction:e[`target-jurisdiction`],secret:{accessKeyId:_(e[`target-secret-access-key-id`],`target-secret-access-key-id`,`text`),secretAccessKey:_(e[`target-secret-secret-access-key`],`target-secret-secret-access-key`,`text`)},vendor:e[`target-vendor`]}}),Z):h(e.body),sensitiveBodyPaths:[[`source`,`secret`,`secretAccessKey`],[`source`,`secret`,`privateKey`],[`target`,`secret`,`secretAccessKey`]]});return}let n=e.body===void 0?void 0:h(e.body),l=await t(e),u=e.local?i:await o();if(e.accountId=u,e.body!==void 0){let e=n,t=await c(`Creating`,async()=>l.send(X,{body:e,account_id:u}));s(t,{successLabel:`Created`});return}let d=g({overwrite:e.overwrite,source:{bucket:_(e[`source-bucket`],`source-bucket`,`text`),endpoint:_(e[`source-endpoint`],`source-endpoint`,`text`),keys:e[`source-keys`],pathPrefix:_(e[`source-path-prefix`],`source-path-prefix`,`text`),region:_(e[`source-region`],`source-region`,`text`),secret:{accessKeyId:_(e[`source-secret-access-key-id`],`source-secret-access-key-id`,`text`),secretAccessKey:_(e[`source-secret-secret-access-key`],`source-secret-secret-access-key`,`text`),clientEmail:_(e[`source-secret-client-email`],`source-secret-client-email`,`text`),privateKey:_(e[`source-secret-private-key`],`source-secret-private-key`,`text`)},vendor:e[`source-vendor`],jurisdiction:e[`source-jurisdiction`]},target:{bucket:_(e[`target-bucket`],`target-bucket`,`text`),jurisdiction:e[`target-jurisdiction`],secret:{accessKeyId:_(e[`target-secret-access-key-id`],`target-secret-access-key-id`,`text`),secretAccessKey:_(e[`target-secret-secret-access-key`],`target-secret-secret-access-key`,`text`)},vendor:e[`target-vendor`]}});x(d,Z);let f=await c(`Creating`,async()=>l.send(X,{body:d,account_id:u}));s(f,{successLabel:`Created`})})};var Dt={method:`DELETE`,path:e=>n`/accounts/${e.account_id}/slurper/jobs/${e.job_id}`,errors:{409:`ConflictError`}};function Ot(e){return e.usage(`$0 r2 super-slurper jobs delete <job-id>
|
|
97
|
+
|
|
98
|
+
Deletes a completed, aborted, or errored R2 Super Slurper migration job. Active jobs cannot be deleted.`).positional(`job-id`,{type:`string`,description:`Job 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 kt={command:`delete <job-id>`,describe:`Delete a job`,builder:Ot,handler:async e=>f({command:`r2 super-slurper jobs delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await a();r({command:`cf r2 super-slurper jobs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/slurper/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}`,pathParams:{"job-id":String(e[`job-id`]??``)},bodyKind:`none`});return}let n=await t(e),l=e.local?i:await o();if(e.accountId=l,!await d({force:!!e.force}))return;let u=await c(`Deleting`,async()=>n.send(Dt,{account_id:l,job_id:e[`job-id`]}));s(u,{successLabel:`Deleted`})})};var At={method:`GET`,path:e=>n`/accounts/${e.account_id}/slurper/jobs/${e.job_id}`};function jt(e){return e.usage(`$0 r2 super-slurper jobs get <job-id>
|
|
99
|
+
|
|
100
|
+
Retrieves detailed status and configuration for a specific R2 Super Slurper migration job.`).positional(`job-id`,{type:`string`,description:`Job ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Mt={command:`get <job-id>`,describe:`Get job details`,builder:jt,handler:async e=>f({command:`r2 super-slurper jobs get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();r({command:`cf r2 super-slurper jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/slurper/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}`,pathParams:{"job-id":String(e[`job-id`]??``)},bodyKind:`none`});return}let n=await t(e),l=e.local?i:await o();e.accountId=l;let u=await c(`Loading`,async()=>n.send(At,{account_id:l,job_id:e[`job-id`]}));s(u,{successLabel:`Loaded`})})};var Nt={method:`GET`,path:e=>n`/accounts/${e.account_id}/slurper/jobs`,query:[`limit`,`offset`]};function Pt(e){return e.usage(`$0 r2 super-slurper jobs list
|
|
101
|
+
|
|
102
|
+
Lists all R2 Super Slurper migration jobs for the account with their status.`).option(`limit`,{type:`number`,description:`Limit`}).option(`offset`,{type:`number`,description:`Offset`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ft={command:`list`,describe:`List jobs`,builder:Pt,handler:async e=>f({command:`r2 super-slurper jobs list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={limit:e.limit,offset:e.offset};if(e.dryRun){let e=await a();r({command:`cf r2 super-slurper jobs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/slurper/jobs`,pathParams:{},query:n,bodyKind:`none`});return}let l=await t(e),u=e.local?i:await o();e.accountId=u;let d=await c(`Loading`,async()=>l.send(Nt,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})};var It={method:`GET`,path:e=>n`/accounts/${e.account_id}/slurper/jobs/${e.job_id}/logs`,query:[`limit`,`offset`]};function Lt(e){return e.usage(`$0 r2 super-slurper jobs logs list
|
|
103
|
+
|
|
104
|
+
Gets log entries for an R2 Super Slurper migration job, showing migration status changes, errors, etc.`).option(`job-id`,{type:`string`,description:`Job ID`,demandOption:!0}).option(`limit`,{type:`number`,description:`Limit`}).option(`offset`,{type:`number`,description:`Offset`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Rt={command:`list`,describe:`Get job logs`,builder:Lt,handler:async e=>f({command:`r2 super-slurper jobs logs list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={limit:e.limit,offset:e.offset};if(e.dryRun){let t=await a();r({command:`cf r2 super-slurper jobs logs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/slurper/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}/logs`,pathParams:{"job-id":String(e[`job-id`]??``)},query:n,bodyKind:`none`});return}let l=await t(e),u=e.local?i:await o();e.accountId=u;let d=await c(`Loading`,async()=>l.send(It,{account_id:u,job_id:e[`job-id`],...n}));s(d,{successLabel:`Loaded`})})},zt={command:`logs`,describe:`Operations for super-slurper.jobs.logs`,builder:e=>e.command(Rt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Bt={method:`PUT`,path:e=>n`/accounts/${e.account_id}/slurper/jobs/${e.job_id}/pause`,errors:{409:`ConflictError`}};function Vt(e){return e.usage(`$0 r2 super-slurper jobs pause <job-id>
|
|
105
|
+
|
|
106
|
+
Pauses a running R2 Super Slurper migration job. The job can be resumed later to continue transferring.`).positional(`job-id`,{type:`string`,description:`Job ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`pause <job-id>`,describe:`Pause a job`,builder:Vt,handler:async e=>f({command:`r2 super-slurper jobs pause`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();r({command:`cf r2 super-slurper jobs pause`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/slurper/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}/pause`,pathParams:{"job-id":String(e[`job-id`]??``)},bodyKind:`none`});return}let n=await t(e),l=e.local?i:await o();e.accountId=l;let u=await c(`Updating`,async()=>n.send(Bt,{account_id:l,job_id:e[`job-id`]}));s(u,{successLabel:`Updated`})})};var Ht={method:`GET`,path:e=>n`/accounts/${e.account_id}/slurper/jobs/${e.job_id}/progress`};function Ut(e){return e.usage(`$0 r2 super-slurper jobs progress <job-id>
|
|
107
|
+
|
|
108
|
+
Retrieves current progress metrics for an R2 Super Slurper migration job`).positional(`job-id`,{type:`string`,description:`Job ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Wt={command:`progress <job-id>`,describe:`Get job progress`,builder:Ut,handler:async e=>f({command:`r2 super-slurper jobs progress`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();r({command:`cf r2 super-slurper jobs progress`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/slurper/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}/progress`,pathParams:{"job-id":String(e[`job-id`]??``)},bodyKind:`none`});return}let n=await t(e),l=e.local?i:await o();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Ht,{account_id:l,job_id:e[`job-id`]}));s(u,{successLabel:`Loaded`})})};var Gt={method:`PUT`,path:e=>n`/accounts/${e.account_id}/slurper/jobs/${e.job_id}/resume`};function Kt(e){return e.usage(`$0 r2 super-slurper jobs resume <job-id>
|
|
109
|
+
|
|
110
|
+
Resumes a paused R2 Super Slurper migration job, continuing the transfer from where it stopped.`).positional(`job-id`,{type:`string`,description:`Job ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const qt={command:`resume <job-id>`,describe:`Resume a job`,builder:Kt,handler:async e=>f({command:`r2 super-slurper jobs resume`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();r({command:`cf r2 super-slurper jobs resume`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/slurper/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}/resume`,pathParams:{"job-id":String(e[`job-id`]??``)},bodyKind:`none`});return}let n=await t(e),l=e.local?i:await o();e.accountId=l;let u=await c(`Updating`,async()=>n.send(Gt,{account_id:l,job_id:e[`job-id`]}));s(u,{successLabel:`Updated`})})},Jt={command:`jobs`,describe:`Operations for super-slurper.jobs`,builder:e=>e.command(wt).command(xt).command(Et).command(kt).command(Mt).command(Ft).command(Q).command(Wt).command(qt).command(zt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Yt={command:`super-slurper`,describe:`Migrate data from external S3-compatible storage into R2 buckets with resumable transfer jobs`,builder:e=>e.command(vt).command(Jt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var $={method:`POST`,path:e=>n`/accounts/${e.account_id}/r2/temp-access-credentials`,body:`json`};function Xt(e){return e.usage(`$0 r2 temporary-credentials create
|
|
111
|
+
|
|
112
|
+
Creates temporary access credentials on a bucket that can be optionally scoped to prefixes or objects.`).option(`bucket`,{type:`string`,description:`Name of the R2 bucket.`}).option(`objects`,{type:`string`,array:!0,description:`Optional object paths to scope the credentials to.`}).option(`parent-access-key-id`,{type:`string`,description:`Access key ID of the parent R2 API token. The temporary credentials cannot exceed this token's permissions.`}).option(`permission`,{type:`string`,description:`Permissions allowed on the credentials.`,choices:[`admin-read-write`,`admin-read-only`,`object-read-write`,`object-read-only`]}).coerce(`permission`,e=>_(e,`permission`,`text`)).option(`prefixes`,{type:`string`,array:!0,description:`Optional prefix paths to scope the credentials to.`}).option(`ttl-seconds`,{type:`number`,description:`Lifetime of the temporary credentials in seconds, up to 604800 seconds (7 days).`,default:900}).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 Zt={command:`create`,describe:`Create Temporary Access Credentials`,builder:Xt,handler:async e=>f({command:`r2 temporary-credentials create`,classification:{safeFlags:[`permission`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();r({command:`cf r2 temporary-credentials create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/temp-access-credentials`,pathParams:{},bodyKind:`json`,body:e.body===void 0?g({bucket:_(e.bucket,`bucket`,`text`),objects:e.objects,parentAccessKeyId:_(e[`parent-access-key-id`],`parent-access-key-id`,`text`),permission:e.permission,prefixes:e.prefixes,ttlSeconds:e[`ttl-seconds`]}):h(e.body)});return}let n=e.body===void 0?void 0:h(e.body),d=await t(e),f=e.local?i:await o();if(e.accountId=f,e.body!==void 0){let e=n,t=await c(`Creating`,async()=>d.send($,{body:e,account_id:f}));s(t,{successLabel:`Created`});return}if(e.bucket===void 0&&(e.bucket=await l(`bucket`,`Name of the R2 bucket.`)),e[`parent-access-key-id`]===void 0&&(e[`parent-access-key-id`]=await l(`parent-access-key-id`,`Access key ID of the parent R2 API token. The temporary credentials cannot exceed this token's permissions.`)),e.permission===void 0&&(e.permission=await u(`permission`,`Permissions allowed on the credentials.`,[`admin-read-write`,`admin-read-only`,`object-read-write`,`object-read-only`])),e[`ttl-seconds`]===void 0)throw Error(`--ttl-seconds is required (or pass --body with this field set).`);let p=g({bucket:_(e.bucket,`bucket`,`text`),objects:e.objects,parentAccessKeyId:_(e[`parent-access-key-id`],`parent-access-key-id`,`text`),permission:e.permission,prefixes:e.prefixes,ttlSeconds:e[`ttl-seconds`]}),m=await c(`Creating`,async()=>d.send($,{body:p,account_id:f}));s(m,{successLabel:`Created`})})},Qt={command:`temporary-credentials`,describe:`Generate short-lived S3-compatible credentials scoped to specific buckets and operations`,builder:e=>e.command(Zt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},$t={command:`r2`,describe:`S3-compatible object storage with zero egress fees — buckets, lifecycle rules, event notifications, and data migration`,builder:e=>e.command(nt).command(pt).command(Yt).command(Qt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{$t as default};
|