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
package/dist/r2-BYjdHDEZ.mjs
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CgBhtmON.mjs";import{i as n,n as r}from"./auth-FK2eLQ02.mjs";import{a as i,t as a}from"./context-Dp4CXG22.mjs";import{t as o}from"./output-BJEgbI0G.mjs";import{t as s}from"./dry-run-gy0Hl9xo.mjs";import{t as c}from"./progress-DLri-rA7.mjs";import{t as l}from"./run-Ciw_GIrC.mjs";import"./telemetry-Pt5GpCKD.mjs";import{a as u,n as d,s as f,t as p}from"./body-parser-BKcZS9iJ.mjs";import{n as m,t as h}from"./input-validation-D7z60HJH.mjs";import{a as g,i as _,n as v}from"./prompt-D0dXwuME.mjs";import{n as y,t as b}from"./raw-fetch-DQeDx1wT.mjs";import{t as x}from"./body-unions-CjpNjwSW.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 e=>l({command:`r2 buckets cors delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets cors delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();if(e.accountId=d,!await v({force:!!e.force,message:`This removes the R2 bucket's CORS policy. Browser requests that depend on these cross-origin permissions may fail.`}))return;let f=await c(`Deleting`,async()=>n(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/cors`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{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 e=>l({command:`r2 buckets cors get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets cors 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`]))}/cors`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/cors`,{headers:Object.keys(l).length>0?l:void 0}));o(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.`}).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 e=>l({command:`r2 buckets cors update`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets cors 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`]))}/cors`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`json`,body:e.body===void 0?p({rules:u(e.rules,`rules`)}):d(e.body)});return}let m=await r(e),h=e.local?t:await a();if(e.accountId=h,!await v({force:!!e.force,message:`This replaces the R2 bucket's CORS policy. Browser requests that relied on the previous rules may fail.`}))return;if(e.body){let t=d(e.body),r=await c(`Deleting`,async()=>n(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/cors`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Deleted`});return}let g={};e.rules!==void 0&&f(g,[`rules`],u(e.rules,`rules`));let _=await c(`Deleting`,async()=>n(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/cors`,{body:g,headers:Object.keys(l).length>0?l:void 0}));o(_,{successLabel:`Deleted`})})},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 e=>l({command:`r2 buckets create-by-name`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e[`cf-r2-storage-class`]!==void 0&&(l[`cf-r2-storage-class`]=String(e[`cf-r2-storage-class`])),e.dryRun){let t=await i();s({command:`cf r2 buckets create-by-name`,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`]))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}`,{headers:Object.keys(l).length>0?l:void 0}));o(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=>m(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=>m(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 e=>l({command:`r2 buckets create`,classification:{safeFlags:[`location-hint`,`storage-class`,`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({locationHint:e[`location-hint`],name:m(e.name,`name`,`text`),storageClass:e[`storage-class`]}):d(e.body)});return}let u=await r(e),h=e.local?t:await a();if(e.accountId=h,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n(u,`POST`,`/accounts/${h}/r2/buckets`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Created`});return}e.name===void 0&&(e.name=await g(`name`,`Name of the bucket.`));let _={};e[`location-hint`]!==void 0&&f(_,[`locationHint`],e[`location-hint`]),e.name!==void 0&&f(_,[`name`],m(e.name,`name`,`text`)),e[`storage-class`]!==void 0&&f(_,[`storageClass`],e[`storage-class`]);let v=await c(`Creating`,async()=>n(u,`POST`,`/accounts/${h}/r2/buckets`,{body:_,headers:Object.keys(l).length>0?l:void 0}));o(v,{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 e=>l({command:`r2 buckets delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();if(e.accountId=d,!await v({force:!!e.force,message:`This permanently deletes the empty R2 bucket and its configuration.`}))return;let f=await c(`Deleting`,async()=>n(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{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=>m(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 e=>l({command:`r2 buckets domains custom create`,classification:{safeFlags:[`enabled`,`min-tls`,`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets domains custom create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/domains/custom`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`json`,body:e.body===void 0?p({ciphers:e.ciphers,domain:m(e.domain,`domain`,`text`),enabled:e.enabled,minTLS:e[`min-tls`],zoneId:m(e[`zone-id`],`zone-id`,`text`)}):d(e.body)});return}let u=await r(e),h=e.local?t:await a();if(e.accountId=h,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n(u,`POST`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/domains/custom`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Created`});return}if(e.domain===void 0&&(e.domain=await g(`domain`,`Name of the custom domain to be added.`)),e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);e[`zone-id`]===void 0&&(e[`zone-id`]=await g(`zone-id`,`Zone ID of the custom domain.`));let _={};e.ciphers!==void 0&&f(_,[`ciphers`],e.ciphers),e.domain!==void 0&&f(_,[`domain`],m(e.domain,`domain`,`text`)),e.enabled!==void 0&&f(_,[`enabled`],e.enabled),e[`min-tls`]!==void 0&&f(_,[`minTLS`],e[`min-tls`]),e[`zone-id`]!==void 0&&f(_,[`zoneId`],m(e[`zone-id`],`zone-id`,`text`));let v=await c(`Creating`,async()=>n(u,`POST`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/domains/custom`,{body:_,headers:Object.keys(l).length>0?l:void 0}));o(v,{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 e=>l({command:`r2 buckets domains custom delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets domains custom delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/domains/custom/${e.domain==null?`<domain>`:encodeURIComponent(String(e.domain))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``),domain:String(e.domain??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();if(e.accountId=d,!await v({force:!!e.force,message:`This disconnects the custom domain from the R2 bucket. Access through other enabled domains remains available.`}))return;let f=await c(`Deleting`,async()=>n(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(e.domain))}`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{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 e=>l({command:`r2 buckets domains custom get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets domains custom 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`]))}/domains/custom/${e.domain==null?`<domain>`:encodeURIComponent(String(e.domain))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``),domain:String(e.domain??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(e.domain))}`,{headers:Object.keys(l).length>0?l:void 0}));o(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 e=>l({command:`r2 buckets domains custom list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets domains custom list`,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`]))}/domains/custom`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/domains/custom`,{headers:Object.keys(l).length>0?l:void 0}));o(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=>m(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 e=>l({command:`r2 buckets domains custom update`,classification:{safeFlags:[`enabled`,`min-tls`,`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets domains custom 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`]))}/domains/custom/${e.domain==null?`<domain>`:encodeURIComponent(String(e.domain))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``),domain:String(e.domain??``)},bodyKind:`json`,body:e.body===void 0?p({ciphers:e.ciphers,enabled:e.enabled,minTLS:e[`min-tls`]}):d(e.body)});return}let u=await r(e),m=e.local?t:await a();if(e.accountId=m,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(e.domain))}`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Updated`});return}let h={};e.ciphers!==void 0&&f(h,[`ciphers`],e.ciphers),e.enabled!==void 0&&f(h,[`enabled`],e.enabled),e[`min-tls`]!==void 0&&f(h,[`minTLS`],e[`min-tls`]);let g=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(e.domain))}`,{body:h,headers:Object.keys(l).length>0?l:void 0}));o(g,{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 list
|
|
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.`).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 z={command:`list`,describe:`Get r2.dev Domain of Bucket`,builder:R,handler:async e=>l({command:`r2 buckets domains managed list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets domains managed list`,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`]))}/domains/managed`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/domains/managed`,{headers:Object.keys(l).length>0?l:void 0}));o(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 e=>l({command:`r2 buckets domains managed update`,classification:{safeFlags:[`enabled`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets domains managed 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`]))}/domains/managed`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`json`,body:e.body===void 0?p({enabled:e.enabled}):d(e.body)});return}let u=await r(e),m=e.local?t:await a();if(e.accountId=m,!await v({force:!!e.force,message:`This changes public access to the R2 bucket through its r2.dev domain.`}))return;if(e.body){let t=d(e.body),r=await c(`Deleting`,async()=>n(u,`PUT`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/domains/managed`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Deleted`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let h={};e.enabled!==void 0&&f(h,[`enabled`],e.enabled);let g=await c(`Deleting`,async()=>n(u,`PUT`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/domains/managed`,{body:h,headers:Object.keys(l).length>0?l:void 0}));o(g,{successLabel:`Deleted`})})},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 e=>l({command:`r2 buckets edit`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e[`cf-r2-storage-class`]!==void 0&&(l[`cf-r2-storage-class`]=String(e[`cf-r2-storage-class`])),e.dryRun){let t=await i();s({command:`cf r2 buckets edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Updating`,async()=>n(u,`PATCH`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}`,{headers:Object.keys(l).length>0?l:void 0}));o(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 e=>l({command:`r2 buckets event-notifications delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets event-notifications delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/event_notifications/r2/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/configuration/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``),"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({ruleIds:e[`rule-ids`]}):d(e.body)});return}let u=await r(e),m=e.local?t:await a();if(e.accountId=m,!await v({force:!!e.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(e.body){let t=d(e.body),r=await c(`Deleting`,async()=>n(u,`DELETE`,`/accounts/${m}/event_notifications/r2/${encodeURIComponent(String(e[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(e[`queue-id`]))}`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Deleted`});return}let h={};e[`rule-ids`]!==void 0&&f(h,[`ruleIds`],e[`rule-ids`]);let g=await c(`Deleting`,async()=>n(u,`DELETE`,`/accounts/${m}/event_notifications/r2/${encodeURIComponent(String(e[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(e[`queue-id`]))}`,{body:h,headers:Object.keys(l).length>0?l:void 0}));o(g,{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 e=>l({command:`r2 buckets event-notifications get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets event-notifications get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/event_notifications/r2/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/configuration/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``),"queue-id":String(e[`queue-id`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/event_notifications/r2/${encodeURIComponent(String(e[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(e[`queue-id`]))}`,{headers:Object.keys(l).length>0?l:void 0}));o(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 e=>l({command:`r2 buckets event-notifications list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets event-notifications list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/event_notifications/r2/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/configuration`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/event_notifications/r2/${encodeURIComponent(String(e[`bucket-name`]))}/configuration`,{headers:Object.keys(l).length>0?l:void 0}));o(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.`}).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 e=>l({command:`r2 buckets event-notifications update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets event-notifications update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/event_notifications/r2/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/configuration/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``),"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({rules:u(e.rules,`rules`)}):d(e.body)});return}let m=await r(e),h=e.local?t:await a();if(e.accountId=h,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n(m,`PUT`,`/accounts/${h}/event_notifications/r2/${encodeURIComponent(String(e[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(e[`queue-id`]))}`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Updated`});return}if(e.rules===void 0)throw Error(`--rules is required (or pass --body with this field set).`);let g={};e.rules!==void 0&&f(g,[`rules`],u(e.rules,`rules`));let _=await c(`Updating`,async()=>n(m,`PUT`,`/accounts/${h}/event_notifications/r2/${encodeURIComponent(String(e[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(e[`queue-id`]))}`,{body:g,headers:Object.keys(l).length>0?l:void 0}));o(_,{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 e=>l({command:`r2 buckets get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets 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`]))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}`,{headers:Object.keys(l).length>0?l:void 0}));o(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=>m(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=>m(e,`destination-storage-class`,`text`)).option(`source-storage-class`,{type:`string`,description:`The sourceStorageClass field`,choices:[`Standard`,`InfrequentAccess`]}).coerce(`source-storage-class`,e=>m(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 e=>l({command:`r2 buckets jobs create`,classification:{safeFlags:[`job-type`,`destination-storage-class`,`source-storage-class`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e[`cf-r2-data-catalog-check`]!==void 0&&(l[`cf-r2-data-catalog-check`]=String(e[`cf-r2-data-catalog-check`])),e.dryRun){let t=await i();s({command:`cf r2 buckets jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/jobs`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`json`,body:e.body===void 0?p({jobType:e[`job-type`],prefix:m(e.prefix,`prefix`,`text`),destinationStorageClass:e[`destination-storage-class`],sourceStorageClass:e[`source-storage-class`]}):d(e.body)});return}let u=await r(e),h=e.local?t:await a();if(e.accountId=h,!await v({force:!!e.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(e.body){let t=d(e.body),r=await c(`Deleting`,async()=>n(u,`POST`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/jobs`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Deleted`});return}e[`job-type`]===void 0&&(e[`job-type`]=await _(`job-type`,`The jobType field`,[`prefixDelete`,`storageClassMigration`])),e[`job-type`]===`prefixDelete`&&e.prefix===void 0&&(e.prefix=await g(`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 y={};e[`job-type`]!==void 0&&f(y,[`jobType`],e[`job-type`]),e.prefix!==void 0&&f(y,[`prefix`],m(e.prefix,`prefix`,`text`)),e[`destination-storage-class`]!==void 0&&f(y,[`destinationStorageClass`],e[`destination-storage-class`]),e[`source-storage-class`]!==void 0&&f(y,[`sourceStorageClass`],e[`source-storage-class`]);let b=await c(`Deleting`,async()=>n(u,`POST`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/jobs`,{body:y,headers:Object.keys(l).length>0?l:void 0}));o(b,{successLabel:`Deleted`})})};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 e=>l({command:`r2 buckets jobs get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets jobs 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`]))}/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}`,pathParams:{"bucket-name":String(e[`bucket-name`]??``),"job-id":String(e[`job-id`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/jobs/${encodeURIComponent(String(e[`job-id`]))}`,{headers:Object.keys(l).length>0?l:void 0}));o(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 e=>l({command:`r2 buckets jobs list`,classification:{safeFlags:[`job-type`,`status`,`dry-run`]}},e,async()=>{let l={jobType:e[`job-type`],status:e.status,maxKeys:e[`max-keys`],continuationToken:e[`continuation-token`]},u={};if(e[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets jobs list`,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`]))}/jobs`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},query:l,bodyKind:`none`});return}let d=await r(e),f=e.local?t:await a();e.accountId=f;let p=await c(`Loading`,async()=>n(d,`GET`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/jobs`,{query:l,headers:Object.keys(u).length>0?u:void 0}));o(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 e=>l({command:`r2 buckets lifecycle get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets lifecycle 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`]))}/lifecycle`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/lifecycle`,{headers:Object.keys(l).length>0?l:void 0}));o(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.`}).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 e=>l({command:`r2 buckets lifecycle update`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets lifecycle 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`]))}/lifecycle`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`json`,body:e.body===void 0?p({rules:u(e.rules,`rules`)}):d(e.body)});return}let m=await r(e),h=e.local?t:await a();if(e.accountId=h,!await v({force:!!e.force,message:`This replaces the R2 bucket's object lifecycle rules and can schedule object deletion or abort multipart uploads.`}))return;if(e.body){let t=d(e.body),r=await c(`Deleting`,async()=>n(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/lifecycle`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Deleted`});return}let g={};e.rules!==void 0&&f(g,[`rules`],u(e.rules,`rules`));let _=await c(`Deleting`,async()=>n(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/lifecycle`,{body:g,headers:Object.keys(l).length>0?l:void 0}));o(_,{successLabel:`Deleted`})})},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 e=>l({command:`r2 buckets list`,classification:{safeFlags:[`order`,`direction`,`dry-run`]}},e,async()=>{let l={name_contains:e[`name-contains`],start_after:e[`start-after`],per_page:e[`per-page`],order:e.order,direction:e.direction,cursor:e.cursor},u={};if(e[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let e=await i();s({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 r(e),f=e.local?t:await a();e.accountId=f;let p=await c(`Loading`,async()=>n(d,`GET`,`/accounts/${f}/r2/buckets`,{query:l,headers:Object.keys(u).length>0?u:void 0}));o(p,{successLabel:`Loaded`})})};var Me={method:`GET`,path:t=>e`/accounts/${t.account_id}/r2/buckets/${t.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=>l({command:`r2 buckets local-uploads get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({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 r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Me,{account_id:l,bucket_name:e[`bucket-name`]}));o(u,{successLabel:`Loaded`})})};var q={method:`PUT`,path:t=>e`/accounts/${t.account_id}/r2/buckets/${t.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=>l({command:`r2 buckets local-uploads update`,classification:{safeFlags:[`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({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?p({enabled:e.enabled}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(q,{body:t,account_id:l,bucket_name:e[`bucket-name`]}));o(r,{successLabel:`Updated`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=p({enabled:e.enabled}),f=await c(`Updating`,async()=>n.send(q,{body:u,account_id:l,bucket_name:e[`bucket-name`]}));o(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 e=>l({command:`r2 buckets locks delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets locks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/lock`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();if(e.accountId=d,!await v({force:!!e.force,message:`This removes all lock rules from the R2 bucket, removing their protection against object deletion and overwriting.`}))return;let f=await c(`Deleting`,async()=>n(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/lock`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{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 e=>l({command:`r2 buckets locks get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets locks 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`]))}/lock`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/lock`,{headers:Object.keys(l).length>0?l:void 0}));o(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.`}).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 e=>l({command:`r2 buckets locks update`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets locks 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`]))}/lock`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`json`,body:e.body===void 0?p({rules:u(e.rules,`rules`)}):d(e.body)});return}let m=await r(e),h=e.local?t:await a();if(e.accountId=h,!await v({force:!!e.force,message:`This replaces the R2 bucket's lock rules. Removing or shortening retention can allow objects to be overwritten or deleted.`}))return;if(e.body){let t=d(e.body),r=await c(`Deleting`,async()=>n(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/lock`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Deleted`});return}let g={};e.rules!==void 0&&f(g,[`rules`],u(e.rules,`rules`));let _=await c(`Deleting`,async()=>n(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/lock`,{body:g,headers:Object.keys(l).length>0?l:void 0}));o(_,{successLabel:`Deleted`})})},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:t=>e`/accounts/${t.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=>l({command:`r2 buckets metrics list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();s({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 r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Ge,{account_id:l}));o(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 e=>l({command:`r2 buckets sippy delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets sippy delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/r2/buckets/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/sippy`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();if(e.accountId=d,!await v({force:!!e.force,message:`This disables Sippy on-demand migration for the R2 bucket. Objects already copied to R2 remain in the bucket.`}))return;let f=await c(`Deleting`,async()=>n(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/sippy`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{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 e=>l({command:`r2 buckets sippy get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets sippy 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`]))}/sippy`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`none`});return}let u=await r(e),d=e.local?t:await a();e.accountId=d;let f=await c(`Loading`,async()=>n(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/sippy`,{headers:Object.keys(l).length>0?l:void 0}));o(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=>m(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=>m(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 e=>l({command:`r2 buckets sippy update`,classification:{safeFlags:[`destination-provider`,`source-provider`,`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 buckets sippy 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`]))}/sippy`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`json`,body:e.body===void 0?p({destination:{accessKeyId:m(e[`destination-access-key-id`],`destination-access-key-id`,`text`),provider:e[`destination-provider`],secretAccessKey:m(e[`destination-secret-access-key`],`destination-secret-access-key`,`text`)},source:{accessKeyId:m(e[`source-access-key-id`],`source-access-key-id`,`text`),bucket:m(e[`source-bucket`],`source-bucket`,`text`),provider:e[`source-provider`],region:m(e[`source-region`],`source-region`,`text`),secretAccessKey:m(e[`source-secret-access-key`],`source-secret-access-key`,`text`),clientEmail:m(e[`source-client-email`],`source-client-email`,`text`),privateKey:m(e[`source-private-key`],`source-private-key`,`text`),bucketUrl:m(e[`source-bucket-url`],`source-bucket-url`,`text`),accountKey:m(e[`source-account-key`],`source-account-key`,`text`),accountName:m(e[`source-account-name`],`source-account-name`,`text`),container:m(e[`source-container`],`source-container`,`text`),sasToken:m(e[`source-sas-token`],`source-sas-token`,`text`)}}):d(e.body),sensitiveBodyPaths:[[`destination`,`secretAccessKey`],[`source`,`secretAccessKey`],[`source`,`privateKey`],[`source`,`accountKey`],[`source`,`sasToken`]]});return}let u=await r(e),h=e.local?t:await a();if(e.accountId=h,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/sippy`,{body:t,headers:Object.keys(l).length>0?l:void 0}));o(r,{successLabel:`Updated`});return}let g={};e[`destination-access-key-id`]!==void 0&&f(g,[`destination`,`accessKeyId`],m(e[`destination-access-key-id`],`destination-access-key-id`,`text`)),e[`destination-provider`]!==void 0&&f(g,[`destination`,`provider`],e[`destination-provider`]),e[`destination-secret-access-key`]!==void 0&&f(g,[`destination`,`secretAccessKey`],m(e[`destination-secret-access-key`],`destination-secret-access-key`,`text`)),e[`source-access-key-id`]!==void 0&&f(g,[`source`,`accessKeyId`],m(e[`source-access-key-id`],`source-access-key-id`,`text`)),e[`source-bucket`]!==void 0&&f(g,[`source`,`bucket`],m(e[`source-bucket`],`source-bucket`,`text`)),e[`source-provider`]!==void 0&&f(g,[`source`,`provider`],e[`source-provider`]),e[`source-region`]!==void 0&&f(g,[`source`,`region`],m(e[`source-region`],`source-region`,`text`)),e[`source-secret-access-key`]!==void 0&&f(g,[`source`,`secretAccessKey`],m(e[`source-secret-access-key`],`source-secret-access-key`,`text`)),e[`source-client-email`]!==void 0&&f(g,[`source`,`clientEmail`],m(e[`source-client-email`],`source-client-email`,`text`)),e[`source-private-key`]!==void 0&&f(g,[`source`,`privateKey`],m(e[`source-private-key`],`source-private-key`,`text`)),e[`source-bucket-url`]!==void 0&&f(g,[`source`,`bucketUrl`],m(e[`source-bucket-url`],`source-bucket-url`,`text`)),e[`source-account-key`]!==void 0&&f(g,[`source`,`accountKey`],m(e[`source-account-key`],`source-account-key`,`text`)),e[`source-account-name`]!==void 0&&f(g,[`source`,`accountName`],m(e[`source-account-name`],`source-account-name`,`text`)),e[`source-container`]!==void 0&&f(g,[`source`,`container`],m(e[`source-container`],`source-container`,`text`)),e[`source-sas-token`]!==void 0&&f(g,[`source`,`sasToken`],m(e[`source-sas-token`],`source-sas-token`,`text`));let _=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/sippy`,{body:g,headers:Object.keys(l).length>0?l:void 0}));o(_,{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 e=>l({command:`r2 objects bulk-delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={prefix:e.prefix},u={};if(e[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e[`cf-r2-data-catalog-check`]!==void 0&&(u[`cf-r2-data-catalog-check`]=String(e[`cf-r2-data-catalog-check`])),e.dryRun){let t=await i();s({command:`cf r2 objects bulk-delete`,method:`DELETE`,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`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},query:l,bodyKind:`json`,body:e.body===void 0?void 0:d(e.body)});return}let f=await r(e),p=e.local?t:await a();if(e.accountId=p,await v({force:!!e.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."})){if(e.body){let t=d(e.body),r=new URLSearchParams(Object.entries(l).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();if(Array.isArray(t)&&t.length>1e3){let i=Math.ceil(t.length/1e3),a=null;for(let o=0;o<t.length;o+=1e3){let s=t.slice(o,o+1e3),l=Math.floor(o/1e3)+1;a=await c(`Deleting: batch ${l}/${i}`,async()=>n(f,`DELETE`,`/accounts/${p}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/objects${r?`?`+r:``}`,{body:s,headers:Object.keys(u).length>0?u:void 0}))}o(a,{successLabel:`Deleted`});return}let i=await c(`Deleting`,async()=>n(f,`DELETE`,`/accounts/${p}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/objects${r?`?`+r:``}`,{body:t,headers:Object.keys(u).length>0?u:void 0}));o(i,{successLabel:`Deleted`})}else if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}})};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 e=>l({command:`r2 objects delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 objects delete`,method:`DELETE`,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}let u=await r(e),d=e.local?t:await a();if(e.accountId=d,!await v({force:!!e.force,message:`This permanently deletes the specified object from the R2 bucket.`}))return;let f=await c(`Deleting`,async()=>n(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/objects/${encodeURIComponent(String(e[`object-key`]))}`,{headers:Object.keys(l).length>0?l:void 0}));o(f,{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=>l({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 i();s({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 r(e);let o=e.local?t:await a();e.accountId=o;let l=await c(`Loading`,async()=>b(`/accounts/${o}/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 e=>l({command:`r2 objects list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={per_page:e[`per-page`],prefix:e.prefix,delimiter:e.delimiter,cursor:e.cursor,start_after:e[`start-after`]},u={};if(e[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e.dryRun){let t=await i();s({command:`cf r2 objects list`,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`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},query:l,bodyKind:`none`});return}let d=await r(e),f=e.local?t:await a();e.accountId=f;let p=await c(`Loading`,async()=>n(d,`GET`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/objects`,{query:l,headers:Object.keys(u).length>0?u:void 0}));o(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 e=>l({command:`r2 objects put`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={};if(e[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(e[`cf-r2-jurisdiction`])),e[`content-type`]!==void 0&&(l[`Content-Type`]=String(e[`content-type`])),e[`content-length`]!==void 0&&(l[`Content-Length`]=String(e[`content-length`])),e[`cf-r2-storage-class`]!==void 0&&(l[`cf-r2-storage-class`]=String(e[`cf-r2-storage-class`])),e.dryRun){let t=await i();s({command:`cf r2 objects put`,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`]))}/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:`octet-stream`,body:e.body});return}let u=await r(e),d=e.local?t:await a();if(e.accountId=d,e.file){let t=h(e.file),r=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/objects/${encodeURIComponent(String(e[`object-key`]))}`,{body:t,headers:{"Content-Type":`application/octet-stream`,...Object.keys(l).length>0?l:void 0}}));o(r,{successLabel:`Updated`})}else if(e.body){let t=m(e.body,`body`,`binary`),r=await c(`Updating`,async()=>n(u,`PUT`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(e[`bucket-name`]))}/objects/${encodeURIComponent(String(e[`object-key`]))}`,{body:t,headers:{"Content-Type":`application/octet-stream`,...l}}));o(r,{successLabel:`Updated`})}else if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},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:t=>e`/accounts/${t.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=>m(e,`vendor`,`text`)).option(`jurisdiction`,{type:`string`,description:`The jurisdiction field`,choices:[`default`,`eu`,`us`,`fedramp`]}).coerce(`jurisdiction`,e=>m(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=>l({command:`r2 super-slurper connectivity-precheck source`,classification:{safeFlags:[`vendor`,`jurisdiction`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({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?p({bucket:m(e.bucket,`bucket`,`text`),endpoint:m(e.endpoint,`endpoint`,`text`),keys:e.keys,pathPrefix:m(e[`path-prefix`],`path-prefix`,`text`),region:m(e.region,`region`,`text`),secret:{accessKeyId:m(e[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:m(e[`secret-secret-access-key`],`secret-secret-access-key`,`text`),clientEmail:m(e[`secret-client-email`],`secret-client-email`,`text`),privateKey:m(e[`secret-private-key`],`secret-private-key`,`text`)},vendor:e.vendor,jurisdiction:e.jurisdiction}):d(e.body),sensitiveBodyPaths:[[`secret`,`secretAccessKey`],[`secret`,`privateKey`]]});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(J,{body:t,account_id:l}));o(r,{successLabel:`Updated`});return}e.bucket===void 0&&(e.bucket=await g(`bucket`,`The bucket field`)),e.vendor===void 0&&(e.vendor=await _(`vendor`,`The vendor field`,[`s3`,`gcs`,`r2`]));let u=p({bucket:m(e.bucket,`bucket`,`text`),endpoint:m(e.endpoint,`endpoint`,`text`),keys:e.keys,pathPrefix:m(e[`path-prefix`],`path-prefix`,`text`),region:m(e.region,`region`,`text`),secret:{accessKeyId:m(e[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:m(e[`secret-secret-access-key`],`secret-secret-access-key`,`text`),clientEmail:m(e[`secret-client-email`],`secret-client-email`,`text`),privateKey:m(e[`secret-private-key`],`secret-private-key`,`text`)},vendor:e.vendor,jurisdiction:e.jurisdiction}),f=await c(`Updating`,async()=>n.send(J,{body:u,account_id:l}));o(f,{successLabel:`Updated`})})};var Y={method:`PUT`,path:t=>e`/accounts/${t.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=>m(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=>m(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=>l({command:`r2 super-slurper connectivity-precheck target`,classification:{safeFlags:[`jurisdiction`,`vendor`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({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?p({bucket:m(e.bucket,`bucket`,`text`),jurisdiction:e.jurisdiction,secret:{accessKeyId:m(e[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:m(e[`secret-secret-access-key`],`secret-secret-access-key`,`text`)},vendor:e.vendor}):d(e.body),sensitiveBodyPaths:[[`secret`,`secretAccessKey`]]});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Updating`,async()=>n.send(Y,{body:t,account_id:l}));o(r,{successLabel:`Updated`});return}e.bucket===void 0&&(e.bucket=await g(`bucket`,`The bucket field`)),e[`secret-access-key-id`]===void 0&&(e[`secret-access-key-id`]=await g(`secret-access-key-id`,`The secret.accessKeyId field`)),e[`secret-secret-access-key`]===void 0&&(e[`secret-secret-access-key`]=await g(`secret-secret-access-key`,`The secret.secretAccessKey field`,{kind:`secret`})),e.vendor===void 0&&(e.vendor=await _(`vendor`,`The vendor field`,[`r2`]));let u=p({bucket:m(e.bucket,`bucket`,`text`),jurisdiction:e.jurisdiction,secret:{accessKeyId:m(e[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:m(e[`secret-secret-access-key`],`secret-secret-access-key`,`text`)},vendor:e.vendor}),f=await c(`Updating`,async()=>n.send(Y,{body:u,account_id:l}));o(f,{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:t=>e`/accounts/${t.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=>l({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 i();s({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 r(e),l=e.local?t:await a();if(e.accountId=l,!await v({force:!!e.force,message:`This operation stops every running migration job.`}))return;let u=await c(`Deleting`,async()=>n.send(yt,{account_id:l}));o(u,{successLabel:`Deleted`})})};var St={method:`PUT`,path:t=>e`/accounts/${t.account_id}/slurper/jobs/${t.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=>l({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 i();s({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 r(e),l=e.local?t:await a();if(e.accountId=l,!await v({force:!!e.force,message:`This operation stops a running migration job.`}))return;let u=await c(`Deleting`,async()=>n.send(St,{account_id:l,job_id:e[`job-id`]}));o(u,{successLabel:`Deleted`})})};var X={method:`POST`,path:t=>e`/accounts/${t.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=>m(e,`source-vendor`,`text`)).option(`source-jurisdiction`,{type:`string`,description:`The source.jurisdiction field`,choices:[`default`,`eu`,`us`,`fedramp`]}).coerce(`source-jurisdiction`,e=>m(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=>m(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=>m(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:{enum:[`default`,`eu`,`us`,`fedramp`]},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=>l({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 i();s({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(p({overwrite:e.overwrite,source:{bucket:m(e[`source-bucket`],`source-bucket`,`text`),endpoint:m(e[`source-endpoint`],`source-endpoint`,`text`),keys:e[`source-keys`],pathPrefix:m(e[`source-path-prefix`],`source-path-prefix`,`text`),region:m(e[`source-region`],`source-region`,`text`),secret:{accessKeyId:m(e[`source-secret-access-key-id`],`source-secret-access-key-id`,`text`),secretAccessKey:m(e[`source-secret-secret-access-key`],`source-secret-secret-access-key`,`text`),clientEmail:m(e[`source-secret-client-email`],`source-secret-client-email`,`text`),privateKey:m(e[`source-secret-private-key`],`source-secret-private-key`,`text`)},vendor:e[`source-vendor`],jurisdiction:e[`source-jurisdiction`]},target:{bucket:m(e[`target-bucket`],`target-bucket`,`text`),jurisdiction:e[`target-jurisdiction`],secret:{accessKeyId:m(e[`target-secret-access-key-id`],`target-secret-access-key-id`,`text`),secretAccessKey:m(e[`target-secret-secret-access-key`],`target-secret-secret-access-key`,`text`)},vendor:e[`target-vendor`]}}),Z):d(e.body),sensitiveBodyPaths:[[`source`,`secret`,`secretAccessKey`],[`source`,`secret`,`privateKey`],[`target`,`secret`,`secretAccessKey`]]});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send(X,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}let u=p({overwrite:e.overwrite,source:{bucket:m(e[`source-bucket`],`source-bucket`,`text`),endpoint:m(e[`source-endpoint`],`source-endpoint`,`text`),keys:e[`source-keys`],pathPrefix:m(e[`source-path-prefix`],`source-path-prefix`,`text`),region:m(e[`source-region`],`source-region`,`text`),secret:{accessKeyId:m(e[`source-secret-access-key-id`],`source-secret-access-key-id`,`text`),secretAccessKey:m(e[`source-secret-secret-access-key`],`source-secret-secret-access-key`,`text`),clientEmail:m(e[`source-secret-client-email`],`source-secret-client-email`,`text`),privateKey:m(e[`source-secret-private-key`],`source-secret-private-key`,`text`)},vendor:e[`source-vendor`],jurisdiction:e[`source-jurisdiction`]},target:{bucket:m(e[`target-bucket`],`target-bucket`,`text`),jurisdiction:e[`target-jurisdiction`],secret:{accessKeyId:m(e[`target-secret-access-key-id`],`target-secret-access-key-id`,`text`),secretAccessKey:m(e[`target-secret-secret-access-key`],`target-secret-secret-access-key`,`text`)},vendor:e[`target-vendor`]}});x(u,Z);let f=await c(`Creating`,async()=>n.send(X,{body:u,account_id:l}));o(f,{successLabel:`Created`})})};var Dt={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/slurper/jobs/${t.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=>l({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 i();s({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 r(e),l=e.local?t:await a();if(e.accountId=l,!await v({force:!!e.force}))return;let u=await c(`Deleting`,async()=>n.send(Dt,{account_id:l,job_id:e[`job-id`]}));o(u,{successLabel:`Deleted`})})};var At={method:`GET`,path:t=>e`/accounts/${t.account_id}/slurper/jobs/${t.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=>l({command:`r2 super-slurper jobs get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({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 r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(At,{account_id:l,job_id:e[`job-id`]}));o(u,{successLabel:`Loaded`})})};var Nt={method:`GET`,path:t=>e`/accounts/${t.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=>l({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 i();s({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 r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(Nt,{account_id:u,...n}));o(d,{successLabel:`Loaded`})})};var It={method:`GET`,path:t=>e`/accounts/${t.account_id}/slurper/jobs/${t.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=>l({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 i();s({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 r(e),u=e.local?t:await a();e.accountId=u;let d=await c(`Loading`,async()=>l.send(It,{account_id:u,job_id:e[`job-id`],...n}));o(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:t=>e`/accounts/${t.account_id}/slurper/jobs/${t.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=>l({command:`r2 super-slurper jobs pause`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({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 r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Updating`,async()=>n.send(Bt,{account_id:l,job_id:e[`job-id`]}));o(u,{successLabel:`Updated`})})};var Ht={method:`GET`,path:t=>e`/accounts/${t.account_id}/slurper/jobs/${t.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=>l({command:`r2 super-slurper jobs progress`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({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 r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Ht,{account_id:l,job_id:e[`job-id`]}));o(u,{successLabel:`Loaded`})})};var Gt={method:`PUT`,path:t=>e`/accounts/${t.account_id}/slurper/jobs/${t.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=>l({command:`r2 super-slurper jobs resume`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({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 r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Updating`,async()=>n.send(Gt,{account_id:l,job_id:e[`job-id`]}));o(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:t=>e`/accounts/${t.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=>m(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=>l({command:`r2 temporary-credentials create`,classification:{safeFlags:[`permission`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({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?p({bucket:m(e.bucket,`bucket`,`text`),objects:e.objects,parentAccessKeyId:m(e[`parent-access-key-id`],`parent-access-key-id`,`text`),permission:e.permission,prefixes:e.prefixes,ttlSeconds:e[`ttl-seconds`]}):d(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=d(e.body),r=await c(`Creating`,async()=>n.send($,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}if(e.bucket===void 0&&(e.bucket=await g(`bucket`,`Name of the R2 bucket.`)),e[`parent-access-key-id`]===void 0&&(e[`parent-access-key-id`]=await g(`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 _(`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 u=p({bucket:m(e.bucket,`bucket`,`text`),objects:e.objects,parentAccessKeyId:m(e[`parent-access-key-id`],`parent-access-key-id`,`text`),permission:e.permission,prefixes:e.prefixes,ttlSeconds:e[`ttl-seconds`]}),f=await c(`Creating`,async()=>n.send($,{body:u,account_id:l}));o(f,{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};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{K as e}from"./dist-D5qkmHhC.mjs";import{n as t}from"./api-X3wKppsT.mjs";import{r as n}from"./local-CgBhtmON.mjs";import{c as r,l as i}from"./auth-FK2eLQ02.mjs";import{n as a}from"./context-Dp4CXG22.mjs";import{t as o}from"./auth-token-BwpERbnG.mjs";import{n as s}from"./request-headers-CoxHUNcB.mjs";async function c(c,l={}){let{method:u=`GET`,local:d=!1}=l,f=e({compliance_region:await a()}),p=`${f.replace(/\/+$/,``)}${c}`,m={...s()};l.headers&&Object.assign(m,l.headers);let h=globalThis.fetch;d?h=n({persistTo:l.persistTo,apiBaseUrl:f}):m.Authorization=`Bearer ${await o()}`;let g,_=l.body;_!=null&&(_ instanceof FormData?g=_:Buffer.isBuffer(_)||_ instanceof Uint8Array||_ instanceof ArrayBuffer?(g=_,m[`Content-Type`]??=l.contentType??`application/octet-stream`):typeof _==`string`?(g=_,l.contentType&&(m[`Content-Type`]??=l.contentType)):(g=JSON.stringify(_),m[`Content-Type`]??=l.contentType??`application/json`));let v=await h(p,{method:u,headers:m,...g===void 0?{}:{body:g},...r(g)?{}:{signal:AbortSignal.timeout(i)}});if(!v.ok){let e=v.headers.get(`content-type`)??``,n;try{n=e.includes(`application/json`)?await v.json():await v.text()}catch{n=null}throw new t({statusCode:v.status,body:n,rawResponse:{status:v.status,statusText:v.statusText,url:v.url||p,headers:v.headers,redirected:v.redirected,type:v.type}})}let y=await v.arrayBuffer();return Buffer.from(y)}function l(e){process.stdout.write(e)}export{l as n,c as t};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{r as e}from"./theme-BGHWSKCw.mjs";import"./api-X3wKppsT.mjs";import{t}from"./path-DRw6Y-nd.mjs";import{n,t as r}from"./local-CgBhtmON.mjs";import{a as i,i as a,n as o}from"./auth-FK2eLQ02.mjs";import{a as s,t as c}from"./context-Dp4CXG22.mjs";import{t as l}from"./output-BJEgbI0G.mjs";import{t as u}from"./dry-run-gy0Hl9xo.mjs";import{t as d}from"./progress-DLri-rA7.mjs";import{n as f,t as p}from"./run-Ciw_GIrC.mjs";import"./telemetry-Pt5GpCKD.mjs";import{a as m,n as h,r as g,s as _,t as v}from"./body-parser-BKcZS9iJ.mjs";import{n as y}from"./input-validation-D7z60HJH.mjs";import{a as ee,i as b,n as te,o as x,r as S}from"./prompt-D0dXwuME.mjs";import{a as C,i as w,n as T,r as E,t as D}from"./schema-cache-BIo0Gi2H.mjs";import{a as O,c as k,d as A,i as ne,o as re,r as j,s as M,t as N,u as ie}from"./schema-flags-DrqvwQNw.mjs";import{domainToASCII as ae}from"node:url";import{isDeepStrictEqual as oe}from"node:util";var P={method:`GET`,path:e=>t`/accounts/${e.account_id}/registrar/extensions/${e.extension}`};function se(e){return e.usage("$0 registrar extensions get <extension>\n\nReturns metadata and JSON Schema documents describing the expected input structure for registration and transfer operations on a specific extension (TLD). Supports HTTP conditional GET via `ETag`. Include the `ETag` value from a previous response in an `If-None-Match` header to receive a `304 Not Modified` when the data has not changed.").positional(`extension`,{type:`string`,description:"The extension name (e.g., `com`, `co.uk`).",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ce={command:`get <extension>`,describe:`Get extension`,builder:se,handler:async e=>p({command:`registrar extensions get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await s();u({command:`cf registrar extensions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/registrar/extensions/${e.extension==null?`<extension>`:encodeURIComponent(String(e.extension))}`,pathParams:{extension:String(e.extension??``)},bodyKind:`none`});return}let t=await o(e),n=e.local?r:await c();e.accountId=n;let i=await d(`Loading`,async()=>t.send(P,{account_id:n,extension:e.extension}));l(i,{successLabel:`Loaded`})})};var le={method:`GET`,path:e=>t`/accounts/${e.account_id}/registrar/extensions`,query:[`name`,`cursor`,`per_page`,`direction`,`sort_by`]};function ue(e){return e.usage("$0 registrar extensions list\n\nReturns metadata and JSON Schema documents describing the expected input structure for registration and transfer operations on each supported extension (TLD). This endpoint uses cursor-based pagination. Results are ordered by extension name by default. To fetch the next page, pass the `cursor` value from the `result_info` object in the response as the `cursor` query parameter in your next request. An empty `cursor` string indicates there are no more pages. Supports HTTP conditional GET via `ETag`. Include the `ETag` value from a previous response in an `If-None-Match` header to receive a `304 Not Modified` when the data has not changed.").option(`name`,{type:`string`,description:"Filter extensions by exact name match.\nFor example, `name=com` returns only the `com` extension."}).option(`cursor`,{type:`string`,description:`Opaque token from a previous response's \`result_info.cursor\`.
|
|
3
|
-
Pass this value to fetch the next page of results. Omit (or
|
|
4
|
-
pass an empty string) for the first page.`}).option(`per-page`,{type:`number`,description:`Number of items to return per page.`}).option(`direction`,{type:`string`,description:`Sort direction for results. Defaults to ascending order.`,choices:[`asc`,`desc`]}).option(`sort-by`,{type:`string`,description:"Column to sort results by. Defaults to `name` when omitted.",choices:[`name`,`created_at`,`updated_at`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`list`,describe:`List extensions`,builder:ue,handler:async e=>p({command:`registrar extensions list`,classification:{safeFlags:[`direction`,`sort-by`,`dry-run`]}},e,async()=>{let t={name:e.name,cursor:e.cursor,per_page:e[`per-page`],direction:e.direction,sort_by:e[`sort-by`]};if(e.dryRun){let e=await s();u({command:`cf registrar extensions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/registrar/extensions`,pathParams:{},query:t,bodyKind:`none`});return}let n=await o(e),i=e.local?r:await c();e.accountId=i;let a=await d(`Loading`,async()=>n.send(le,{account_id:i,...t}));l(a,{successLabel:`Loaded`})})},fe={command:`extensions`,describe:`Operations for extensions`,builder:e=>e.command(ce).command(de).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var F={method:`POST`,path:e=>t`/accounts/${e.account_id}/registrar/domain-check`,body:`json`,errors:{400:`BadRequestError`}};function pe(e){return e.usage("$0 registrar registrations check <domains...>\n\nPerforms real-time, authoritative availability checks directly against domain registries. Use this endpoint to verify a domain is available before attempting registration via `POST /registrations`. **Important:** Unlike the Search endpoint, these results are authoritative and reflect current registry status. Always check availability immediately before registration as domain status can change rapidly. **Note:** This endpoint uses POST to accept a list of domains in the request body. It is a read-only operation — it does not create, modify, or reserve any domains. ### Extension support Only domains on extensions supported for programmatic registration by this API can be registered. If you check a domain on an unsupported extension, the response will include `registrable: false` with a `reason` field explaining why: - `extension_not_supported_via_api` — Cloudflare Registrar supports this extension in the dashboard, but it is not yet available for programmatic registration via this API. Register via `https://dash.cloudflare.com/{account_id}/domains/registrations` instead. - `extension_not_supported` — This extension is not supported by Cloudflare Registrar. - `extension_disallows_registration` — The extension's registry has temporarily or permanently frozen new registrations. No registrar can register domains on this extension at this time. - `domain_premium` — The domain is premium priced. Premium registration is not currently supported by this API. - `domain_unavailable` — The domain is already registered, reserved, or otherwise not available for registration on a supported extension. The `reason` field is only present when `registrable` is `false`. ### Behavior - Maximum 20 domains per request - Pricing is only returned for domains where `registrable: true` - Results are not cached; each request queries the registry ### Workflow 1. Call this endpoint with domains the user wants to register. 2. For each domain where `registrable: true`, present pricing to the user. 3. If `tier: premium`, note that premium registration is not currently supported by this API and do not proceed to `POST /registrations`. 4. Proceed to `POST /registrations` only for supported non-premium domains.").positional(`domains`,{type:`string`,array:!0,description:"List of fully qualified domain names (FQDNs) to check for availability. Each domain must include the extension. - Minimum: 1 domain. - Maximum: 20 domains per request. - The response returns domains on unsupported extensions with `registrable: false` and a `reason` field. - The response may omit malformed domain names (e.g., names missing an extension). ",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`List of fully qualified domain names (FQDNs) to check. Each domain must include the extension (e.g., "example.com", not "example").`})}const me={command:`check <domains...>`,describe:`Check domain availability`,builder:pe,handler:async e=>p({command:`registrar registrations check`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await s();u({command:`cf registrar registrations check`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/registrar/domain-check`,pathParams:{},bodyKind:`json`,body:e.body===void 0?v({domains:e.domains}):h(e.body)});return}let t=await o(e),n=e.local?r:await c();if(e.accountId=n,e.body){let r=h(e.body),i=await d(`Creating`,async()=>t.send(F,{body:r,account_id:n}));l(i,{successLabel:`Created`});return}let i=v({domains:e.domains}),a=await d(`Creating`,async()=>t.send(F,{body:i,account_id:n}));l(a,{successLabel:`Created`})})};var he={method:`GET`,path:e=>t`/accounts/${e.account_id}/registrar/registrations/${e.domain_name}/registration-status`};function ge(e){return e.usage("$0 registrar registrations get-registration-status <domain-name>\n\nReturns the current status of a domain registration workflow. Use this endpoint to poll for completion when the POST response returned `202 Accepted`. The URL is provided in the `links.self` field of the workflow status response. Poll this endpoint until the workflow reaches a terminal state or a state that requires user attention. **Terminal states:** `succeeded` and `failed` are terminal and always have `completed: true`. **Non-terminal states:** - `action_required` has `completed: false` and will not resolve on its own. The workflow is paused pending user intervention. - `blocked` has `completed: false` and indicates the workflow is waiting on a third party such as the extension registry or losing registrar. Continue polling while informing the user of the delay. Use increasing backoff between polls. When `state: blocked`, use a longer polling interval and do not poll indefinitely. A naive polling loop that only checks `completed` can run indefinitely when `state: action_required`. Break explicitly on `action_required`: ```js let status; do { await new Promise(r => setTimeout(r, 2000)); status = await cloudflare.request({ method: 'GET', path: reg.result.links.self, }); } while ( !status.result.completed && status.result.state !== 'action_required' ); if (status.result.state === 'action_required') { // Surface context.action and context.confirmation_sent_to to the user. // Do not re-submit the registration request. } ```").positional(`domain-name`,{type:`string`,description:"Provides a fully qualified domain name (FQDN), including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration. Cloudflare permits only one registration per domain, making the domain name a natural idempotency key for registration requests.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _e={command:`get-registration-status <domain-name>`,describe:`Get Registration Status`,builder:ge,handler:async e=>p({command:`registrar registrations get-registration-status`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await s();u({command:`cf registrar registrations get-registration-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/registrar/registrations/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}/registration-status`,pathParams:{"domain-name":String(e[`domain-name`]??``)},bodyKind:`none`});return}let t=await o(e),n=e.local?r:await c();e.accountId=n;let i=await d(`Loading`,async()=>t.send(he,{account_id:n,domain_name:e[`domain-name`]}));l(i,{successLabel:`Loaded`})})};var ve={method:`GET`,path:e=>t`/accounts/${e.account_id}/registrar/registrations/${e.domain_name}/transfer-in-status`};function ye(e){return e.usage("$0 registrar registrations get-transfer-status <domain-name>\n\nReturns the current status of a domain transfer workflow. Use this endpoint to poll transfer progress after initiating a transfer with `POST /accounts/{account_id}/registrar/registrations/{domain_name}/transfer-in`. The URL is provided in the `links.self` field of the transfer response. ### Transfer timelines Transfers typically take 1–10 days due to ICANN-mandated approval windows. ### Workflow states **Terminal states:** `succeeded` and `failed` are terminal and always have `completed: true`. **Non-terminal states:** - `in_progress`: Transfer has been submitted to the registry and is being processed. Continue polling. - `blocked`: The workflow is waiting on the losing registrar or registry to release the domain. This is the **most common state** for transfers and is entirely normal — it means the ICANN transfer approval window is in effect. The losing registrar has up to 5 days to approve or reject. Continue polling with longer intervals (e.g., every 30–60 minutes). - `action_required`: The user needs to take action (e.g., the FOA email needs to be accepted). See `context` for details on what is needed. - `pending`: Transfer workflow created but not yet started processing. ### Polling guidance Adjust your polling interval based on the current workflow state: - `pending` or `in_progress`: Poll every 30 seconds. - `blocked`: The transfer is waiting on a third party (e.g., losing registrar approval). Poll every 30–60 minutes. - `action_required`: Stop polling. The workflow will not advance until the user takes action. Check `context` for details on what is needed. - `succeeded` or `failed`: Terminal — stop polling.").positional(`domain-name`,{type:`string`,description:"Provides a fully qualified domain name (FQDN), including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration. Cloudflare permits only one registration per domain, making the domain name a natural idempotency key for registration requests.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const be={command:`get-transfer-status <domain-name>`,describe:`Get Transfer Status`,builder:ye,handler:async e=>p({command:`registrar registrations get-transfer-status`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await s();u({command:`cf registrar registrations get-transfer-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/registrar/registrations/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}/transfer-in-status`,pathParams:{"domain-name":String(e[`domain-name`]??``)},bodyKind:`none`});return}let t=await o(e),n=e.local?r:await c();e.accountId=n;let i=await d(`Loading`,async()=>t.send(ve,{account_id:n,domain_name:e[`domain-name`]}));l(i,{successLabel:`Loaded`})})};var xe={method:`GET`,path:e=>t`/accounts/${e.account_id}/registrar/registrations/${e.domain_name}/update-status`};function Se(e){return e.usage("$0 registrar registrations get-update-status <domain-name>\n\nReturns the current status of a domain update workflow. Use this endpoint to poll for completion when the PATCH response returned `202 Accepted`. The URL is provided in the `links.self` field of the workflow status response. Poll this endpoint until the workflow reaches a terminal state or a state that requires user attention. Use increasing backoff between polls. When the workflow remains blocked on a third party, use a longer polling interval and do not poll indefinitely.").positional(`domain-name`,{type:`string`,description:"Provides a fully qualified domain name (FQDN), including the extension (e.g., `example.com`, `mybrand.app`). The domain name uniquely identifies a registration. Cloudflare permits only one registration per domain, making the domain name a natural idempotency key for registration requests.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ce={command:`get-update-status <domain-name>`,describe:`Get Update Status`,builder:Se,handler:async e=>p({command:`registrar registrations get-update-status`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await s();u({command:`cf registrar registrations get-update-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/registrar/registrations/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}/update-status`,pathParams:{"domain-name":String(e[`domain-name`]??``)},bodyKind:`none`});return}let t=await o(e),n=e.local?r:await c();e.accountId=n;let i=await d(`Loading`,async()=>t.send(xe,{account_id:n,domain_name:e[`domain-name`]}));l(i,{successLabel:`Loaded`})})};var we={method:`GET`,path:e=>t`/accounts/${e.account_id}/registrar/registrations/${e.domain_name}`};function Te(e){return e.usage("$0 registrar registrations get <domain-name>\n\nReturns the current state of a domain registration. This is the canonical read endpoint for a domain you own. It returns the full registration resource including current settings and expiration. When the registration resource is ready, both `created_at` and `expires_at` are present in the response.").positional(`domain-name`,{type:`string`,description:`Domain name to retrieve.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ee={command:`get <domain-name>`,describe:`Get Registration`,builder:Te,handler:async e=>p({command:`registrar registrations get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await s();u({command:`cf registrar registrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/registrar/registrations/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}`,pathParams:{"domain-name":String(e[`domain-name`]??``)},bodyKind:`none`});return}let t=await o(e),n=e.local?r:await c();e.accountId=n;let i=await d(`Loading`,async()=>t.send(we,{account_id:n,domain_name:e[`domain-name`]}));l(i,{successLabel:`Loaded`})})};var De={method:`GET`,path:e=>t`/accounts/${e.account_id}/registrar/registrations`,query:[`cursor`,`per_page`,`direction`,`sort_by`]};function Oe(e){return e.usage("$0 registrar registrations list\n\nReturns a paginated list of domain registrations owned by the account. This endpoint uses cursor-based pagination. Results are ordered by registration date by default. To fetch the next page, pass the `cursor` value from the `result_info` object in the response as the `cursor` query parameter in your next request. An empty `cursor` string indicates there are no more pages.").option(`cursor`,{type:`string`,description:`Opaque token from a previous response's \`result_info.cursor\`.
|
|
5
|
-
Pass this value to fetch the next page of results. Omit (or
|
|
6
|
-
pass an empty string) for the first page.`}).option(`per-page`,{type:`number`,description:`Number of items to return per page.`}).option(`direction`,{type:`string`,description:`Sort direction for results. Defaults to ascending order.`,choices:[`asc`,`desc`]}).option(`sort-by`,{type:`string`,description:"Column to sort results by. Defaults to registration date (`registry_created_at`) when omitted.",choices:[`registry_created_at`,`registry_expires_at`,`name`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ke={command:`list`,describe:`List Registrations`,builder:Oe,handler:async e=>p({command:`registrar registrations list`,classification:{safeFlags:[`direction`,`sort-by`,`dry-run`]}},e,async()=>{let t={cursor:e.cursor,per_page:e[`per-page`],direction:e.direction,sort_by:e[`sort-by`]};if(e.dryRun){let e=await s();u({command:`cf registrar registrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/registrar/registrations`,pathParams:{},query:t,bodyKind:`none`});return}let n=await o(e),i=e.local?r:await c();e.accountId=i;let a=await d(`Loading`,async()=>n.send(De,{account_id:i,...t}));l(a,{successLabel:`Loaded`})})};var Ae={method:`GET`,path:e=>t`/accounts/${e.account_id}/registrar/domain-search`,query:[`q`,`extensions`,`limit`],joined:[`extensions`],errors:{400:`BadRequestError`}};function je(e){return e.usage('$0 registrar registrations search\n\nSearches for domain name suggestions based on a keyword, phrase, or partial domain name. Returns a list of potentially available domains with pricing information. **Important:** Results are non-authoritative and based on cached data. Always use the `/domain-check` endpoint to verify real-time availability before attempting registration. Suggestions are scoped to extensions supported for programmatic registration via this API (`POST /registrations`). Domains on unsupported extensions will not appear in results, even if they are available at the registry level. ### Use cases - Brand name discovery (e.g., "acme corp" → acmecorp.com, acmecorp.dev) - Keyword-based suggestions (e.g., "coffee shop" → coffeeshop.com, mycoffeeshop.net) - Alternative extension discovery (e.g., "example.com" → example.com, example.app, example.xyz) ### Workflow 1. Call this endpoint with a keyword or domain name. 2. Present suggestions to the user. 3. Call `/domain-check` with the user\'s chosen domains to confirm real-time availability and pricing. 4. Proceed to `POST /registrations` only for supported non-premium domains where the Check response returns `registrable: true`. **Note:** Searching with just a domain extension (e.g., "com" or ".app") is not supported. Provide a keyword or domain name.').option(`query`,{type:`string`,description:`The search term to find domain suggestions. Accepts keywords, phrases, or full domain names.
|
|
7
|
-
- Phrases: "coffee shop" returns coffeeshop.com, mycoffeeshop.net, etc.
|
|
8
|
-
- Domain names: "example.com" returns example.com and variations across extensions`,demandOption:!0}).option(`extensions`,{type:`string`,array:!0,description:`Limits results to specific domain extensions from the supported set. If not specified,
|
|
9
|
-
returns results across all supported extensions. Extensions not in the supported
|
|
10
|
-
set are silently ignored.`}).option(`limit`,{type:`number`,description:`Maximum number of domain suggestions to return. Defaults to 20 if not specified.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Me={command:`search`,describe:`Search for available domains`,builder:je,handler:async e=>p({command:`registrar registrations search`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={q:e.query,extensions:e.extensions,limit:e.limit};if(e.dryRun){let e=await s();u({command:`cf registrar registrations search`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/registrar/domain-search`,pathParams:{},query:t,bodyKind:`none`});return}let n=await o(e),i=e.local?r:await c();e.accountId=i;let a=await d(`Loading`,async()=>n.send(Ae,{account_id:i,...t}));l(a,{successLabel:`Loaded`})})};var Ne={method:`POST`,path:e=>t`/accounts/${e.account_id}/registrar/domain-transfer-check`,body:`json`,errors:{400:`BadRequestError`,503:`ServiceUnavailableError`}};function Pe(e){return e.usage("$0 registrar registrations transfer-check\n\nPerforms real-time, authoritative eligibility checks directly against needed requirements. Use this endpoint to verify a domain is available before attempting a transfer via `POST /registrations/:domain_name/transfer-in`. **Note:** This endpoint uses POST to accept a list of domains in the request body. It is a read-only operation — it does not create, modify, or reserve any domains. ### Behavior - Maximum 10 domains per request - Pricing is only returned for domains where `transferable: true` - Results are not cached; each request queries the registry & other needed upstreams ## Extension Support All `.uk` extensions (`.uk`, `.co.uk`, etc) do not support auth codes. As such, Cloudflare will ignore the `auth_code` section of this request for `.uk` domains. This means that a `.uk` domain depends on public data to obtain domain information, so it might be a few minutes outdated. ### Workflow 1. Call this endpoint with domains the user wants to transfer. 2. For each domain where `transferable: true`, present pricing to the user. 3. For each domain where `transferable: false`, present reasons to the user 4. Proceed to `POST /registrations/:domain_name/transfer-in` only for the `transferable: true` domains.").option(`domains`,{type:`string`,description:`List of domain objects to evaluate for transfer eligibility. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`List of transferable domain objects to check.`})}const Fe={command:`transfer-check`,describe:`Check domain transfer eligibility`,builder:Pe,handler:async e=>p({command:`registrar registrations transfer-check`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await s();u({command:`cf registrar registrations transfer-check`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/registrar/domain-transfer-check`,pathParams:{},bodyKind:`json`,body:e.body===void 0?v({domains:m(e.domains,`domains`)}):h(e.body)});return}let t=await o(e),n=e.local?r:await c();if(e.accountId=n,e.body){let r=h(e.body),i=await d(`Creating`,async()=>t.send(Ne,{body:r,account_id:n}));l(i,{successLabel:`Created`});return}if(e.domains===void 0)throw Error(`--domains is required (or pass --body with this field set).`);let i=v({domains:m(e.domains,`domains`)}),a=await d(`Creating`,async()=>t.send(Ne,{body:i,account_id:n}));l(a,{successLabel:`Created`})})};function Ie(e){return e.usage("$0 registrar registrations transfer-in <domain-name>\n\nStarts a domain transfer-in workflow. This is typically a billable operation — successful transfers charge the account's default payment method, except for extensions with zero transfer pricing (e.g. UK extensions). All successful domain transfers are non-refundable. ### How transfers work Domain transfers move a domain from another registrar to Cloudflare. Transfers typically take 1-10 days due to ICANN-mandated approval windows. ### Prerequisites - The domain must already have a zone in the Cloudflare account (added through the dashboard or zone API). - The zone must have DNSSec disabled. - For billable transfers (i.e. extensions with non-zero transfer pricing), the account must have a billing profile with a valid default payment method. Set this up at `https://dash.cloudflare.com/{account_id}/billing/payment-info`. - The domain must be unlocked at the current registrar. - An authorization/EPP code from the current registrar is required, except for UK extensions — see Auth code below. ### Auth code An authorization code (also called EPP code, transfer key, or auth-info code) is required for most extensions, with the exception of UK extensions. Obtain this from your current registrar's control panel. The auth code in the request body must be base64-encoded per RFC 4648 §4 (standard alphabet, no line breaks). ### Response behavior Successful transfer initiation returns `202 Accepted`. Validation or initiation failures return the documented `4XX` responses. Poll `GET /accounts/{account_id}/registrar/registrations/{domain_name}/transfer-in-status` to track progress. ### Premium domains Premium domain transfers are not currently supported by this API. Please use the [dashboard](https://dash.cloudflare.com/) for now. ### Billing The account's default payment method is charged upon successful transfer completion, unless the extension has zero transfer pricing (e.g. UK extensions). The transfer adds time to the domain's existing expiration date (typically 1 year).").positional(`domain-name`,{type:`string`,description:`Domain name to transfer.`,demandOption:!0}).option(`prefer`,{type:`string`,description:"Set to `respond-async` to indicate a preference for asynchronous\nprocessing (RFC 7240)."}).option(`auth-code`,{type:`string`,description:`The EPP/authorization code from your current registrar, base64-encoded
|
|
11
|
-
per RFC 4648 §4. Obtain this from your current registrar's control panel.
|
|
12
|
-
Required for all extensions, except for UK.
|
|
13
|
-
`}).option(`auto-renew`,{type:`boolean`,description:"Enable or disable automatic renewal after transfer. Defaults to `false` if omitted.\n",default:!1}).option(`contact-extensions`,{type:`string`,description:"Registry-specific contact extension values for the registrant.\n`GET /accounts/{account_id}/registrar/extensions/{extension}` documents the\nrequired keys and allowed values for each extension in the\n`transfer_schema.properties.contact_extensions` object.\n\nExamples include `.us` nexus fields, `.uk` registrant type fields,\nand `.ca` legal type fields. Include this object only when the extension's\ntransfer schema defines `contact_extensions`. Provide as a JSON object or @path/to/file.json."}).option(`contacts-administrator-email`,{type:`string`,description:`Email address for the registrant. Used for domain-related
|
|
14
|
-
communications from the registry, including ownership verification
|
|
15
|
-
and renewal notices.
|
|
16
|
-
`}).option(`contacts-administrator-fax`,{type:`string`,description:`Fax number in E.164 format (e.g., \`+1.5555555555\`). Optional.
|
|
17
|
-
Most registrations do not require a fax number.
|
|
18
|
-
`}).option(`contacts-administrator-phone`,{type:`string`,description:"Phone number in E.164 format: `+{country_code}.{number}` without spaces or dashes. Examples: `+1.5555555555` (US), `+44.2071234567` (UK), `+81.312345678` (Japan)."}).option(`contacts-administrator-postal-info-name`,{type:`string`,description:"Full legal name of the contact, including all required name components for an individual or authorized representative. Some registries require a complete personal name that includes a family or last name where applicable. Provide the complete name in this single field, for example `Ada Lovelace`; do not send separate first-name or last-name fields."}).option(`contacts-administrator-postal-info-organization`,{type:`string`,description:`Organization or company name. Optional for individual registrants.`}).option(`contacts-billing-email`,{type:`string`,description:`Email address for the registrant. Used for domain-related
|
|
19
|
-
communications from the registry, including ownership verification
|
|
20
|
-
and renewal notices.
|
|
21
|
-
`}).option(`contacts-billing-fax`,{type:`string`,description:`Fax number in E.164 format (e.g., \`+1.5555555555\`). Optional.
|
|
22
|
-
Most registrations do not require a fax number.
|
|
23
|
-
`}).option(`contacts-billing-phone`,{type:`string`,description:"Phone number in E.164 format: `+{country_code}.{number}` without spaces or dashes. Examples: `+1.5555555555` (US), `+44.2071234567` (UK), `+81.312345678` (Japan)."}).option(`contacts-billing-postal-info-name`,{type:`string`,description:"Full legal name of the contact, including all required name components for an individual or authorized representative. Some registries require a complete personal name that includes a family or last name where applicable. Provide the complete name in this single field, for example `Ada Lovelace`; do not send separate first-name or last-name fields."}).option(`contacts-billing-postal-info-organization`,{type:`string`,description:`Organization or company name. Optional for individual registrants.`}).option(`contacts-registrant-email`,{type:`string`,description:`Email address for the registrant. Used for domain-related
|
|
24
|
-
communications from the registry, including ownership verification
|
|
25
|
-
and renewal notices.
|
|
26
|
-
`}).option(`contacts-registrant-fax`,{type:`string`,description:`Fax number in E.164 format (e.g., \`+1.5555555555\`). Optional.
|
|
27
|
-
Most registrations do not require a fax number.
|
|
28
|
-
`}).option(`contacts-registrant-phone`,{type:`string`,description:"Phone number in E.164 format: `+{country_code}.{number}` without spaces or dashes. Examples: `+1.5555555555` (US), `+44.2071234567` (UK), `+81.312345678` (Japan)."}).option(`contacts-registrant-postal-info-name`,{type:`string`,description:"Full legal name of the contact, including all required name components for an individual or authorized representative. Some registries require a complete personal name that includes a family or last name where applicable. Provide the complete name in this single field, for example `Ada Lovelace`; do not send separate first-name or last-name fields."}).option(`contacts-registrant-postal-info-organization`,{type:`string`,description:`Organization or company name. Optional for individual registrants.`}).option(`contacts-technical-email`,{type:`string`,description:`Email address for the registrant. Used for domain-related
|
|
29
|
-
communications from the registry, including ownership verification
|
|
30
|
-
and renewal notices.
|
|
31
|
-
`}).option(`contacts-technical-fax`,{type:`string`,description:`Fax number in E.164 format (e.g., \`+1.5555555555\`). Optional.
|
|
32
|
-
Most registrations do not require a fax number.
|
|
33
|
-
`}).option(`contacts-technical-phone`,{type:`string`,description:"Phone number in E.164 format: `+{country_code}.{number}` without spaces or dashes. Examples: `+1.5555555555` (US), `+44.2071234567` (UK), `+81.312345678` (Japan)."}).option(`contacts-technical-postal-info-name`,{type:`string`,description:"Full legal name of the contact, including all required name components for an individual or authorized representative. Some registries require a complete personal name that includes a family or last name where applicable. Provide the complete name in this single field, for example `Ada Lovelace`; do not send separate first-name or last-name fields."}).option(`contacts-technical-postal-info-organization`,{type:`string`,description:`Organization or company name. Optional for individual registrants.`}).option(`privacy-mode`,{type:`string`,description:`WHOIS privacy mode to apply after transfer completes. Defaults to
|
|
34
|
-
the extension's default privacy mode (typically \`redaction\`).
|
|
35
|
-
`,choices:[`off`,`redaction`]}).coerce(`privacy-mode`,e=>y(e,`privacy-mode`,`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)`}).check(e=>{let t=[`contacts-administrator-email`,`contacts-administrator-fax`,`contacts-administrator-phone`,`contacts-administrator-postal-info-name`,`contacts-administrator-postal-info-organization`].some(t=>e[t]!==void 0);if(!e.body&&t){let t=[`contacts-administrator-email`,`contacts-administrator-phone`,`contacts-administrator-postal-info-name`].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 --contacts-administrator-* flag is set`)}return!0}).check(e=>{let t=[`contacts-billing-email`,`contacts-billing-fax`,`contacts-billing-phone`,`contacts-billing-postal-info-name`,`contacts-billing-postal-info-organization`].some(t=>e[t]!==void 0);if(!e.body&&t){let t=[`contacts-billing-email`,`contacts-billing-phone`,`contacts-billing-postal-info-name`].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 --contacts-billing-* flag is set`)}return!0}).check(e=>{let t=[`contacts-registrant-email`,`contacts-registrant-fax`,`contacts-registrant-phone`,`contacts-registrant-postal-info-name`,`contacts-registrant-postal-info-organization`].some(t=>e[t]!==void 0);if(!e.body&&t){let t=[`contacts-registrant-email`,`contacts-registrant-phone`,`contacts-registrant-postal-info-name`].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 --contacts-registrant-* flag is set`)}return!0}).check(e=>{let t=[`contacts-technical-email`,`contacts-technical-fax`,`contacts-technical-phone`,`contacts-technical-postal-info-name`,`contacts-technical-postal-info-organization`].some(t=>e[t]!==void 0);if(!e.body&&t){let t=[`contacts-technical-email`,`contacts-technical-phone`,`contacts-technical-postal-info-name`].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 --contacts-technical-* flag is set`)}return!0})}const Le={command:`transfer-in <domain-name>`,describe:`Initiate Transfer`,builder:Ie,handler:async e=>p({command:`registrar registrations transfer-in`,classification:{safeFlags:[`auto-renew`,`privacy-mode`,`dry-run`]}},e,async()=>{let t={};if(e.prefer!==void 0&&(t.Prefer=String(e.prefer)),e.dryRun){let t=await s();u({command:`cf registrar registrations transfer-in`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/registrar/registrations/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}/transfer-in`,pathParams:{"domain-name":String(e[`domain-name`]??``)},bodyKind:`json`,body:e.body===void 0?v({auth_code:y(e[`auth-code`],`auth-code`,`text`),auto_renew:e[`auto-renew`],contact_extensions:g(e[`contact-extensions`],`contact-extensions`),contacts:{administrator:{email:y(e[`contacts-administrator-email`],`contacts-administrator-email`,`text`),fax:y(e[`contacts-administrator-fax`],`contacts-administrator-fax`,`text`),phone:y(e[`contacts-administrator-phone`],`contacts-administrator-phone`,`text`),postal_info:{name:y(e[`contacts-administrator-postal-info-name`],`contacts-administrator-postal-info-name`,`text`),organization:y(e[`contacts-administrator-postal-info-organization`],`contacts-administrator-postal-info-organization`,`text`)}},billing:{email:y(e[`contacts-billing-email`],`contacts-billing-email`,`text`),fax:y(e[`contacts-billing-fax`],`contacts-billing-fax`,`text`),phone:y(e[`contacts-billing-phone`],`contacts-billing-phone`,`text`),postal_info:{name:y(e[`contacts-billing-postal-info-name`],`contacts-billing-postal-info-name`,`text`),organization:y(e[`contacts-billing-postal-info-organization`],`contacts-billing-postal-info-organization`,`text`)}},registrant:{email:y(e[`contacts-registrant-email`],`contacts-registrant-email`,`text`),fax:y(e[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`),phone:y(e[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`),postal_info:{name:y(e[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`),organization:y(e[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)}},technical:{email:y(e[`contacts-technical-email`],`contacts-technical-email`,`text`),fax:y(e[`contacts-technical-fax`],`contacts-technical-fax`,`text`),phone:y(e[`contacts-technical-phone`],`contacts-technical-phone`,`text`),postal_info:{name:y(e[`contacts-technical-postal-info-name`],`contacts-technical-postal-info-name`,`text`),organization:y(e[`contacts-technical-postal-info-organization`],`contacts-technical-postal-info-organization`,`text`)}}},privacy_mode:e[`privacy-mode`]},[[`contact_extensions`]]):h(e.body)});return}let n=await o(e),i=e.local?r:await c();if(e.accountId=i,e.body){let r=h(e.body),o=await d(`Creating`,async()=>a(n,`POST`,`/accounts/${i}/registrar/registrations/${encodeURIComponent(String(e[`domain-name`]))}/transfer-in`,{body:r,headers:Object.keys(t).length>0?t:void 0}));l(o,{successLabel:`Created`});return}let f={};e[`auth-code`]!==void 0&&_(f,[`auth_code`],y(e[`auth-code`],`auth-code`,`text`)),e[`auto-renew`]!==void 0&&_(f,[`auto_renew`],e[`auto-renew`]),e[`contact-extensions`]!==void 0&&_(f,[`contact_extensions`],g(e[`contact-extensions`],`contact-extensions`)),e[`contacts-administrator-email`]!==void 0&&_(f,[`contacts`,`administrator`,`email`],y(e[`contacts-administrator-email`],`contacts-administrator-email`,`text`)),e[`contacts-administrator-fax`]!==void 0&&_(f,[`contacts`,`administrator`,`fax`],y(e[`contacts-administrator-fax`],`contacts-administrator-fax`,`text`)),e[`contacts-administrator-phone`]!==void 0&&_(f,[`contacts`,`administrator`,`phone`],y(e[`contacts-administrator-phone`],`contacts-administrator-phone`,`text`)),e[`contacts-administrator-postal-info-name`]!==void 0&&_(f,[`contacts`,`administrator`,`postal_info`,`name`],y(e[`contacts-administrator-postal-info-name`],`contacts-administrator-postal-info-name`,`text`)),e[`contacts-administrator-postal-info-organization`]!==void 0&&_(f,[`contacts`,`administrator`,`postal_info`,`organization`],y(e[`contacts-administrator-postal-info-organization`],`contacts-administrator-postal-info-organization`,`text`)),e[`contacts-billing-email`]!==void 0&&_(f,[`contacts`,`billing`,`email`],y(e[`contacts-billing-email`],`contacts-billing-email`,`text`)),e[`contacts-billing-fax`]!==void 0&&_(f,[`contacts`,`billing`,`fax`],y(e[`contacts-billing-fax`],`contacts-billing-fax`,`text`)),e[`contacts-billing-phone`]!==void 0&&_(f,[`contacts`,`billing`,`phone`],y(e[`contacts-billing-phone`],`contacts-billing-phone`,`text`)),e[`contacts-billing-postal-info-name`]!==void 0&&_(f,[`contacts`,`billing`,`postal_info`,`name`],y(e[`contacts-billing-postal-info-name`],`contacts-billing-postal-info-name`,`text`)),e[`contacts-billing-postal-info-organization`]!==void 0&&_(f,[`contacts`,`billing`,`postal_info`,`organization`],y(e[`contacts-billing-postal-info-organization`],`contacts-billing-postal-info-organization`,`text`)),e[`contacts-registrant-email`]!==void 0&&_(f,[`contacts`,`registrant`,`email`],y(e[`contacts-registrant-email`],`contacts-registrant-email`,`text`)),e[`contacts-registrant-fax`]!==void 0&&_(f,[`contacts`,`registrant`,`fax`],y(e[`contacts-registrant-fax`],`contacts-registrant-fax`,`text`)),e[`contacts-registrant-phone`]!==void 0&&_(f,[`contacts`,`registrant`,`phone`],y(e[`contacts-registrant-phone`],`contacts-registrant-phone`,`text`)),e[`contacts-registrant-postal-info-name`]!==void 0&&_(f,[`contacts`,`registrant`,`postal_info`,`name`],y(e[`contacts-registrant-postal-info-name`],`contacts-registrant-postal-info-name`,`text`)),e[`contacts-registrant-postal-info-organization`]!==void 0&&_(f,[`contacts`,`registrant`,`postal_info`,`organization`],y(e[`contacts-registrant-postal-info-organization`],`contacts-registrant-postal-info-organization`,`text`)),e[`contacts-technical-email`]!==void 0&&_(f,[`contacts`,`technical`,`email`],y(e[`contacts-technical-email`],`contacts-technical-email`,`text`)),e[`contacts-technical-fax`]!==void 0&&_(f,[`contacts`,`technical`,`fax`],y(e[`contacts-technical-fax`],`contacts-technical-fax`,`text`)),e[`contacts-technical-phone`]!==void 0&&_(f,[`contacts`,`technical`,`phone`],y(e[`contacts-technical-phone`],`contacts-technical-phone`,`text`)),e[`contacts-technical-postal-info-name`]!==void 0&&_(f,[`contacts`,`technical`,`postal_info`,`name`],y(e[`contacts-technical-postal-info-name`],`contacts-technical-postal-info-name`,`text`)),e[`contacts-technical-postal-info-organization`]!==void 0&&_(f,[`contacts`,`technical`,`postal_info`,`organization`],y(e[`contacts-technical-postal-info-organization`],`contacts-technical-postal-info-organization`,`text`)),e[`privacy-mode`]!==void 0&&_(f,[`privacy_mode`],e[`privacy-mode`]);let p=await d(`Creating`,async()=>a(n,`POST`,`/accounts/${i}/registrar/registrations/${encodeURIComponent(String(e[`domain-name`]))}/transfer-in`,{body:f,headers:Object.keys(t).length>0?t:void 0}));l(p,{successLabel:`Created`})})};function Re(e){return e.usage("$0 registrar registrations update <domain-name>\n\nUpdates an existing domain registration. By default, the server holds the connection for a bounded, server-defined amount of time while the update completes. Most updates finish within this window and return `200 OK` with a completed workflow status. If the update is still processing after this synchronous wait window, the server returns `202 Accepted`. Poll the URL in `links.self` to track progress. To skip the wait and receive an immediate `202`, send `Prefer: respond-async`. This endpoint currently supports updating `auto_renew` only.").positional(`domain-name`,{type:`string`,description:`Domain name to update.`,demandOption:!0}).option(`prefer`,{type:`string`,description:"Set to `respond-async` to receive an immediate `202 Accepted` without\nwaiting for the operation to complete (RFC 7240)."}).option(`auto-renew`,{type:`boolean`,description:`Enable or disable automatic renewal.
|
|
36
|
-
Setting this field to \`true\` authorizes Cloudflare to charge the
|
|
37
|
-
account's default payment method up to 30 days before domain expiry
|
|
38
|
-
to renew the domain automatically. Renewal pricing may change over
|
|
39
|
-
time based on registry pricing.
|
|
40
|
-
`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"Request to update an existing domain registration. This endpoint currently supports updating `auto_renew` only. "})}const ze={command:`update <domain-name>`,describe:`Update Registration`,builder:Re,handler:async e=>p({command:`registrar registrations update`,classification:{safeFlags:[`auto-renew`,`dry-run`]}},e,async()=>{let t={};if(e.prefer!==void 0&&(t.Prefer=String(e.prefer)),e.dryRun){let t=await s();u({command:`cf registrar registrations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/registrar/registrations/${e[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(e[`domain-name`]))}`,pathParams:{"domain-name":String(e[`domain-name`]??``)},bodyKind:`json`,body:e.body===void 0?v({auto_renew:e[`auto-renew`]}):h(e.body)});return}let n=await o(e),i=e.local?r:await c();if(e.accountId=i,e.body){let r=h(e.body),o=await d(`Updating`,async()=>a(n,`PATCH`,`/accounts/${i}/registrar/registrations/${encodeURIComponent(String(e[`domain-name`]))}`,{body:r,headers:Object.keys(t).length>0?t:void 0}));l(o,{successLabel:`Updated`});return}let f={};e[`auto-renew`]!==void 0&&_(f,[`auto_renew`],e[`auto-renew`]);let p=await d(`Updating`,async()=>a(n,`PATCH`,`/accounts/${i}/registrar/registrations/${encodeURIComponent(String(e[`domain-name`]))}`,{body:f,headers:Object.keys(t).length>0?t:void 0}));l(p,{successLabel:`Updated`})})};async function I(e,t,n){let r=x(n),i=ae(n.trim().replace(/\.$/,``)).toLowerCase(),a=await d(`Checking availability`,()=>e.send(F,{account_id:t,body:{domains:[n]}})),o=i===``?[]:a.domains.filter(e=>e.name.toLowerCase()===i),s=o.length===1?o[0]:void 0;if(!s)throw Error(`The availability check returned no result for ${r}, so cf cannot safely register it.`);if(s.registrable!==!0&&s.reason===`domain_premium`)throw Error(`${r} is a premium domain (domain_premium). Premium registration is not supported by this API, so cf will not submit it.`);if(s.registrable!==!0){let e=s.reason===void 0?``:` (${x(s.reason)})`;throw Error(`${r} is not available for registration${e}.`)}if(s.tier===`premium`)throw Error(`${r} is a premium domain. Premium registration is not supported by this API, so cf will not submit it.`);if(s.tier!==`standard`)throw Error(`${r} is not confirmed as a standard domain. This API only supports standard registrations, so cf will not submit it.`);if(!s.pricing)throw Error(`The availability check returned no pricing for ${r}, so cf cannot safely register it.`);return s.pricing}const Be=`registrar-extension-schema`;function Ve(e){let t=e.trim().toLowerCase().replace(/\.$/,``).split(`.`);return t.slice(1).map((e,n)=>t.slice(n+1).join(`.`))}async function He(e,t,n,r){let i;try{i=r===void 0?await n.send(P,{account_id:t,extension:e}):await n.send(P,{account_id:t,extension:e},{timeoutInSeconds:r/1e3,maxRetries:0})}catch(e){return{ok:!1,reason:T(e)}}let a=E(i,`registration_schema`);return a?{ok:!0,extension:e,schema:a}:{ok:!1,reason:`the API returned no registration schema for .${e}`}}async function Ue(e,t,n,r,i){let a=t?[t]:Ve(e);if(a.length===0)return{ok:!1,reason:`'${e}' has no extension — pass a fully qualified domain name`};let o,s=`not found`;for(let e of a){let t=w(Be,[n,e]);if(t)return{ok:!0,extension:e,schema:t};if(!o)try{o=await r()}catch(e){return{ok:!1,reason:T(e)}}let a;if(i!==void 0&&(a=i-Date.now(),a<=0))return{ok:!1,reason:`the request timed out`};let c=await He(e,n,o,a);if(c.ok)return C(Be,[n,e],c.schema),c;if(s=c.reason,!/not found/i.test(c.reason))return c}return{ok:!1,reason:a.length>1?`no registration schema for ${a.map(e=>`.${e}`).join(` or `)} (${s})`:s}}const We=/* @__PURE__ */ new Set([`domain_name`,`years`,`auto_renew`,`privacy_mode`]),Ge={acknowledgements:`Acknowledgements`,contact_extensions:`Registry Details`,contacts:`Contacts`};function L(e,t){return e!==void 0&&Object.hasOwn(e,t)?e[t]:void 0}function Ke(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).split(/[-_\s]+/).filter(Boolean).map(e=>`${e[0]?.toUpperCase()??``}${e.slice(1)}`).join(` `)}function R(e){return typeof e==`boolean`?e?`Yes`:`No`:e===null?`null`:typeof e==`string`||typeof e==`number`?String(e):JSON.stringify(e)??`undefined`}function z(e,t){return e.find(e=>e.path.length===t.length&&e.path.every((e,n)=>e===t[n]))}function qe(e,t,n){if(typeof t==`boolean`&&e.some(e=>e.includes(`acknowledgement`)))return t?`Accepted`:`Declined`;let r=z(n,e),i=R(t),a=L(r?.choiceLabels,i);if(a)return`${a} (${i})`;let o=(r?.schema.oneOf??r?.schema.anyOf)?.find(e=>e.title&&A(e,t).length===0);return o?.title?`${o.title} (${i})`:i}function Je(e,t){return e.map((n,r)=>r===e.length-1&&t?.schema.title?t.schema.title:L(Ge,n)??Ke(n)).join(` · `)}function B(e,t,n=[]){let r=[];for(let[i,a]of Object.entries(e)){if(n.length===0&&We.has(i))continue;let e=[...n,i];if(typeof a==`object`&&a&&!Array.isArray(a)&&Object.keys(a).length>0){r.push(...B(a,t,e));continue}let o=z(t,e);r.push([Je(e,o),qe(e,a,t)])}return r.sort(([e],[t])=>e.localeCompare(t))}function V(e,t,n){if(Object.hasOwn(e,n))return R(e[n]);let r=Ye(t,n);return r===void 0?`API default`:`${R(r)} (default)`}function H(e){return e===void 0?[]:[...e.default===void 0?[]:[e.default],...(e.allOf??[]).flatMap(H)]}function U(e,t){return e===void 0?[]:[...H(e.properties?.[t]),...(e.allOf??[]).flatMap(e=>U(e,t))]}function Ye(e,t){let n=U(e,t),r=n[0];return n.length>0&&n.every(e=>oe(e,r))?r:void 0}function W(t){let n=t.map(([e,t])=>[x(e),x(t)]),r=Math.min(32,Math.max(...n.map(([e])=>e.length),0));return n.map(([t,n])=>`│ ${e.muted(t.padEnd(r))} ${e.bold(n)}`)}function Xe(t){let n=[[`Domain`,t.domain],[`Account`,t.accountId],[`Registration term`,`${t.years} ${t.years===1?`year`:`years`}`],[`Due now`,t.quotedCost],[`Renewal price`,`${t.pricing.currency} ${t.pricing.renewal_cost} per year`],[`Auto-renew`,V(t.body,t.schema,`auto_renew`)],[`Privacy mode`,V(t.body,t.schema,`privacy_mode`)]],r=B(t.body,t.descriptors??[]);return[`│`,`${e.brand(`◇`)} ${e.bold(`Review registration`)}`,`│`,...W(n),...r.length>0?[`│`,`│ ${e.bold(`Registration details`)}`,...W(r)]:[],`│`].join(`
|
|
41
|
-
`)}const G=[`domain_name`],K=`Fully qualified domain name to register, e.g. example.travel`,q=[`domain-name`,`domainName`,`extension`,`force`,`f`,`prefer`,`contacts`,`body`,`dry-run`,`dryRun`];function Ze(e){return`/${e.map(e=>e.replace(/~/g,`~0`).replace(/\//g,`~1`)).join(`/`)}`}function Qe(e,t,n){return t.some(t=>{if(t.path[0]!==e||t.path.length===1)return!1;let r=t.name.replace(/-([a-z0-9])/g,(e,t)=>t.toUpperCase());return Object.hasOwn(n,t.name)&&n[t.name]!==void 0||Object.hasOwn(n,r)&&n[r]!==void 0})}function $e(e){if(e.choices===void 0)return;let t=(e.schema.enum??(e.schema.oneOf??e.schema.anyOf)?.flatMap(e=>e.const===void 0?e.enum??[]:[e.const]))?.filter(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`);return t?.length===e.choices.length?t:void 0}function et(e){let t=e.type===`boolean`&&e.schema.const===!0,n=e.schema.description,r=n===void 0?void 0:x(n);return{path:Ze(e.path),flag:`--${e.name}`,question:M(e),description:r,choices:$e(e)?.map(t=>{let n=String(t),r=e.choiceLabels!==void 0&&Object.hasOwn(e.choiceLabels,n)?e.choiceLabels[n]??n:n;return{value:t,label:x(r)}}),requiredValue:e.schema.const,acknowledgementText:t?r:void 0}}function J(e,t,n,r,i){let a=O(n,r);return a.length!==0&&(l({submitted:!1,reason:`registration_input_required`,message:`Not submitted. Additional registration input is required.`,domainName:e,extension:t,missingFields:a.map(et),validationErrors:i}),!0)}function tt(e){let t=/^(\d+)(?:\.(\d+))?$/.exec(e);if(!t)return;let n=t[2]??``;return{units:BigInt(`${t[1]}${n}`),scale:n.length}}function nt(e,t){let n=tt(e.registration_cost),r=tt(e.renewal_cost);if(!n||!r)return;let i=Math.max(n.scale,r.scale),a=e=>10n**BigInt(e),o=n.units*a(i-n.scale)+r.units*a(i-r.scale)*BigInt(t-1);if(i===0)return o.toString();let s=a(i);return`${o/s}.${(o%s).toString().padStart(i,`0`)}`}function rt(e,t){let n=nt(e,t);if(!n||!/^[A-Z]{3}$/.test(e.currency))throw Error(`The availability check returned invalid pricing, so cf cannot safely confirm this registration.`);return`${e.currency} ${n}`}function Y(e,t){return e.flatMap(e=>t.map(t=>[...e,...t]))}function X(e,t,n,r=!1,i=[]){let a=e.properties?.[t],o=a!==void 0,s=[a===void 0?[]:[a]],c=e.if&&e.then&&j(e.if)&&A(e.if,n).length===0?[e.then]:[];for(let a of[...e.allOf??[],...c]){let e=X(a,t,n,r,i);e.found&&(o=!0,s=Y(s,e.bundles))}for(let a of[e.oneOf,e.anyOf]){if(!a?.length)continue;let e=r&&a.every(j)?a.filter(e=>st(e,t,n,i)):[],c=(e.length>0?e:a).map(e=>X(e,t,n,r,i));c.some(e=>e.found)&&(o=!0,s=Y(s,c.flatMap(e=>e.bundles)))}return{found:o,bundles:s}}function Z(e,t){let n=e[t];return[...n===void 0?[]:[n],...(e.allOf??[]).flatMap(e=>Z(e,t))]}function Q(e){return e.length===0?{}:e.length===1?e[0]??{}:{allOf:e}}function it(e){let t=[...typeof e.minimum==`number`?[e.exclusiveMinimum===!0?Math.floor(e.minimum)+1:Math.ceil(e.minimum)]:[],...typeof e.exclusiveMinimum==`number`?[Math.floor(e.exclusiveMinimum)+1]:[],...(e.allOf??[]).flatMap(e=>{let t=it(e);return t===void 0?[]:[t]})];return t.length>0?Math.max(1,...t):void 0}function at(e){let t=Z(e,`const`);if(t.length>0)return t.every(e=>Object.is(e,t[0]))?{found:!0,value:t[0]}:{found:!1};let n=Z(e,`default`);if(n.length>0)return n.every(e=>Object.is(e,n[0]))?{found:!0,value:n[0]}:{found:!1};let r=it(e);return r===void 0?{found:!1}:{found:!0,value:r}}function $(e){let{allOf:t,anyOf:n,oneOf:r,...i}=e,a=[Object.keys(i).length===0?[]:[i]];for(let e of t??[])a=Y(a,$(e).map(e=>[e]));for(let e of[r,n])e?.length&&(a=Y(a,e.flatMap(e=>$(e).map(e=>[e]))));return a.map(Q)}function ot(e){return e.flatMap(e=>$(e).map(t=>({schema:e,candidate:at(t)})))}function st(e,t,n,r){let i=A(e,n);return Object.hasOwn(n,t)||i.length===0?i.length===0:r.some(r=>A(e,{...n,[t]:r}).length===0)}function ct(e,t){let n=Object.hasOwn(e,`years`),r=X(t,`years`,e,!1);if(!r.found)throw Error(`The extension schema returned no registration-term field, so cf cannot safely confirm this registration.`);let i=r.bundles.map(Q),a=X(t,`years`,e,!0,n?[]:ot(i).flatMap(({schema:e,candidate:t})=>t.found&&A(e,t.value).length===0?[t.value]:[]));if(!a.found||n&&a.bundles.some(e=>e.length===0))throw Error(`The extension schema returned no registration-term field, so cf cannot safely confirm this registration.`);let o=a.bundles.map(Q),s=o,c,l;if(n)l=e.years;else{let n=ot(o).filter(({schema:e,candidate:t})=>{if(!t.found)return!0;let[n]=A(e,t.value);return n===void 0||(c??=n,!1)});if(j(t)){let r=n.filter(({candidate:e})=>!e.found),i=n.filter(({candidate:n})=>n.found&&A(t,{...e,years:n.value}).length===0);i.length>0&&(n=[...r,...i])}s=n.map(({schema:e})=>e);let r=n.map(({candidate:e})=>e),[i]=r;l=i?.found===!0&&r.every(e=>e.found&&Object.is(e.value,i.value))?i.value:void 0}if(typeof l!=`number`||!Number.isInteger(l)||l<=0)throw!n&&s.length===0&&c?Error(`The extension schema returned an invalid default registration term: ${c}`):Error(n?`The requested registration term must be a positive whole number of years.`:`The extension schema returned no safe default registration term, so cf cannot safely confirm this registration.`);let u=n?A(o.length===1?o[0]??{}:{anyOf:o},l):s.flatMap(e=>A(e,l));if(u.length>0)throw Error(n?`The requested registration term is invalid: ${u[0]}`:`The extension schema returned an invalid default registration term: ${u[0]}`);return e.years=l,l}let lt;function ut(e){let t=y(e,`domain-name`,`text`);if(t!==void 0&&typeof t!=`string`)throw Error(`--domain-name must be a string`);return t}function dt(e){return lt=e,e.positional(`domain-name`,{type:`string`,description:`Fully qualified domain name, e.g. example.travel`}).option(`extension`,{type:`string`,description:`Extension whose registration schema to use (default: derived from the domain)`}).option(`prefer`,{type:`string`,description:"Set the Prefer header, e.g. `respond-async` to skip the synchronous wait"}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip the registration confirmation prompt`,default:!1}).option(`contacts`,{type:`string`,description:`Registrant contacts as inline JSON or @path to a reusable JSON file`}).option(`body`,{type:`string`,description:`Raw JSON request body, or @path to a JSON file`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).strictOptions(!1).help(!1).option(`help`,{type:`boolean`,alias:`h`,description:`Show help, including this extension's input flags`}).epilogue("Input flags depend on the extension: run `cf registrar registrations create <domain> --help`.\ncf rechecks availability and pricing before confirmation. Run `cf registrar registrations check --domains <domain>` to inspect them separately.")}async function ft(t){lt?.showHelp(`log`);let n=ut(t[`domain-name`]);if(!n)return;let r=x(n);if(t.local){console.log(`\n${e.muted(`Registration fields are unavailable in local mode.`)}`);return}let a=Date.now()+D,s=await i(a);if(!s){console.log(`\n${e.muted(`Set \`CLOUDFLARE_ACCOUNT_ID\` or sign in with \`cf auth login\` to see the registration fields for ${r}.`)}`);return}let c=await Ue(n,t.extension,s,()=>o(t),a);console.log(c.ok?`\n${re(k(c.schema,{exclude:[G],commandFlags:q}),`Registration fields for .${c.extension}`)}`:`\n${e.muted(`Could not load the registration fields for ${r}: ${x(c.reason)}.`)}`)}async function pt(e,t,n){for(;;){let r=ne(e,t,n);if(r.length===0)return!0;for(let e of r){let n=e.description??``,r=M(e);if(e.type===`boolean`&&e.schema.const===!0){let r=x(e.schema.description??n);if(!await S(e.name,r))return!1;t[e.name]=!0}else e.choices?.length?t[e.name]=await b(e.name,r,e.choices,e.choiceLabels):t[e.name]=await ee(e.name,r,{validate:t=>ie(e,t)})}}}function mt(e){let t=h(e);if(typeof t!=`object`||!t||Array.isArray(t))throw Error(`--body must contain a JSON object`);return t}function ht(e){let t;if(e.startsWith(`@`))t=y(e,`contacts`,`json`);else try{t=JSON.parse(e)}catch{throw Error(`--contacts must contain a JSON object or @path to a JSON file`)}if(typeof t!=`object`||!t||Array.isArray(t))throw Error(`--contacts must contain a JSON object or @path to a JSON file`);return t}var gt=f({command:`create [domain-name]`,describe:"Register a domain. Billable and non-refundable — input fields are extension-specific, see `create <domain> --help`",builder:dt,handler:async e=>{if(e.help){await ft(e);return}if(e.local)throw Error(n);let t={};e.prefer!==void 0&&(t.Prefer=String(e.prefer));let r;if(e.body!==void 0){let t=N([],e,{reserved:q}).errors.some(e=>e.startsWith(`Unknown flag`));if(e.contacts!==void 0||t)throw Error(`--body cannot be combined with registration field flags. Pass one or the other.`);r=mt(e.body)}let i=e.contacts===void 0?void 0:ht(e.contacts),f=ut(e[`domain-name`]),p=r?.domain_name;if(p!==void 0&&typeof p!=`string`)throw Error(`--body field domain_name must be a string`);if(f!==void 0&&p!==void 0&&f!==p)throw Error(`The positional domain '${x(f)}' does not match --body domain_name '${x(p)}'`);let m=f??p;if(!m){if(r!==void 0){l({submitted:!1,reason:`registration_input_required`,message:`Not submitted. A domain is required to determine the registration schema.`,missingFields:[{path:`/domain_name`,flag:`--domain-name`,question:K}],validationErrors:["`/domain_name` is required"]});return}m=await ee(`domain-name`,K)}let h=x(m);r&&(r.domain_name=m);let g=e.dryRun?await s()??`<account-id>`:await c(),_,v=async()=>(_||=await o(e),_);e.dryRun||await I(await v(),g,m);let y=await Ue(m,e.extension,g,v);if(!y.ok)throw Error(`Could not load the registration schema for ${h}: ${x(y.reason)}.`);let b=x(y.extension),S=y.schema,C=k(y.schema,{exclude:[G],commandFlags:q});if(!r){if(i!==void 0&&Qe(`contacts`,C,e))throw Error(`--contacts cannot be combined with --contacts-* fields. Pass one or the other.`);let t={...e},n=i===void 0?void 0:{contacts:i};if(n!==void 0&&delete t.contacts,!await pt(C,t,n))return;let a=N(C,t,{reserved:q,baseBody:n});if(a.errors.length>0)throw Error(`${a.errors.join(`
|
|
42
|
-
`)}\n\nRun \`cf registrar registrations create ${h} --help\` for .${b}'s registration fields.`);r={domain_name:m,...a.body}}let w;try{w=ct(r,S)}catch(e){let t=A(S,r);if(J(m,y.extension,C,r,t))return;throw e}let T=A(S,r);if(J(m,y.extension,C,r,T))return;if(T.length>0)throw Error(`${T.join(`
|
|
43
|
-
`)}\n\nRun \`cf registrar registrations create ${h} --help\` for this extension's registration fields.`);if(e.dryRun){u({command:`cf registrar registrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${g}/registrar/registrations`,pathParams:{},bodyKind:`json`,body:r});return}let E=await I(await v(),g,m),D=rt(E,w);if(e.force||process.stderr.write(`${Xe({domain:m,accountId:g,years:w,quotedCost:D,pricing:E,body:r,schema:S,descriptors:C})}\n`),!await te({force:e.force,message:`Registering ${h} for ${w} ${w===1?`year`:`years`} costs ${D}, charges the account's default payment method, and cannot be refunded.`}))return;if(r.years!==w)throw Error(`The registration term changed after confirmation, so cf will not submit this registration.`);let O=await I(await v(),g,m);if(O.currency!==E.currency||O.registration_cost!==E.registration_cost||O.renewal_cost!==E.renewal_cost)throw Error(`Availability or pricing changed while awaiting confirmation, so cf will not submit this registration. Re-run the command to review the current quote.`);let ne=await v();e.accountId=g;let re=await d(`Registering`,async()=>a(ne,`POST`,`/accounts/${g}/registrar/registrations`,{body:r,headers:Object.keys(t).length>0?t:void 0}));l(re,{successLabel:`Registered ${h}`})}},{command:`registrar registrations create`,recordArgs:!1});const _t={command:`registrations`,describe:`Operations for registrations`,builder:e=>e.command(me).command(gt).command(Ee).command(_e).command(be).command(Ce).command(ke).command(Me).command(Fe).command(Le).command(ze).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},vt={command:`registrar`,describe:`registrar`,builder:e=>e.command(fe).command(_t).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{vt as default};
|