cf 0.14.0 → 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE-APACHE +176 -0
- package/LICENSE-MIT +25 -0
- package/README.md +6 -7
- package/dist/_meta/commands.json +4040 -1629
- package/dist/_meta/hand-written-commands.json +16 -43
- package/dist/_meta/schemas.json +445 -756
- package/dist/abuse-reports-BwsJLiPN.mjs +26 -0
- package/dist/access-BVbIajYr.mjs +27 -0
- package/dist/account-DBLarar2.mjs +12 -0
- package/dist/account-tags-BNrSShjj.mjs +15 -0
- package/dist/accounts-CCAnDjFk.mjs +132 -0
- package/dist/acm-ZPYQbZQr.mjs +15 -0
- package/dist/addressing-BFpzLfTn.mjs +93 -0
- package/dist/agent-memory-DEvy2dLU.mjs +34 -0
- package/dist/ai-BF0_0NtS.mjs +31 -0
- package/dist/ai-audit-Dn03zntn.mjs +6 -0
- package/dist/ai-gateway-CVABbCjv.mjs +147 -0
- package/dist/ai-search-g0tR8Cut.mjs +79 -0
- package/dist/ai-security-BXXA0Jnk.mjs +10 -0
- package/dist/alerting-Bst10SOG.mjs +56 -0
- package/dist/analytics-DgEaxta8.mjs +21 -0
- package/dist/analytics_engine-B4DvcYmB.mjs +4 -0
- package/dist/{lifecycle-CadF_i2n.mjs → ansi-styles-eKEZXVwN.mjs} +1 -1
- package/dist/api-security-Dkx1Codr.mjs +154 -0
- package/dist/argo-BvswWPlP.mjs +10 -0
- package/dist/artifacts-D8kZKJq0.mjs +43 -0
- package/dist/audit-logs-Bp_yQpXJ.mjs +4 -0
- package/dist/auth-B9w55oRg.mjs +2 -0
- package/dist/auth-C80y97yu.mjs +8 -0
- package/dist/billing-Cqj64fqz.mjs +23 -0
- package/dist/bot-management-CzZx_aml.mjs +9 -0
- package/dist/botnet-feed-Co0c8Xdj.mjs +11 -0
- package/dist/brand-protection-CDsGaPIl.mjs +27 -0
- package/dist/browser-extension-BRHJm3Qf.mjs +15 -0
- package/dist/browser-run-DFrohJ1p.mjs +46 -0
- package/dist/build-BbjcJxKq.mjs +2 -0
- package/dist/build-DQh5-KK4.mjs +2 -0
- package/dist/builds-CamhClyb.mjs +71 -0
- package/dist/cache-BiTk4-Zc.mjs +45 -0
- package/dist/certificate-authorities-Dal9DNjW.mjs +6 -0
- package/dist/cf-oadujOtC.mjs +18 -0
- package/dist/{chunk-6EUZQHAF-B7bSMYLe.mjs → chunk-6EUZQHAF-QVTL_mC-.mjs} +1 -1
- package/dist/chunk-DL5FNmn1.mjs +2 -0
- package/dist/{chunk-Q72B4Q5Z-CPy_WJKU.mjs → chunk-Q72B4Q5Z-Cr1H_iK6.mjs} +1 -1
- package/dist/chunk-Q72B4Q5Z-DKhx_4ok.mjs +2 -0
- package/dist/chunk-QBZBEHZB-Byagrlop.mjs +2 -0
- package/dist/chunk-XLADBZ7F-BXKOjWbx.mjs +374 -0
- package/dist/client-certificates-DDisXoTE.mjs +13 -0
- package/dist/client-side-security-CIO_YPtN.mjs +63 -0
- package/dist/cloud-connector-vwdixea0.mjs +6 -0
- package/dist/cloudflared-DhItYrCq.mjs +2 -0
- package/dist/cloudforce-one-C1cFVBGK.mjs +456 -0
- package/dist/command-BP7ldws1.mjs +2 -0
- package/dist/command-BtNRBTP6.mjs +2 -0
- package/dist/{command-BL6weJf3.mjs → command-CF0giIIc.mjs} +1 -1
- package/dist/command-Ck9rbHA4.mjs +2 -0
- package/dist/{completions-Dn621okY.mjs → completions-xPLd1cvL.mjs} +3 -3
- package/dist/{config-BY6KpMZs.mjs → config-B4vIa0zp.mjs} +1 -1
- package/dist/connector-interrupts-DQ5T-HMN.mjs +6 -0
- package/dist/connector-telemetry-events-DWam38_9.mjs +6 -0
- package/dist/connector-telemetry-snapshots-DX6AJf9Q.mjs +6 -0
- package/dist/connectors-CBhLWVd-.mjs +15 -0
- package/dist/{dist-CFQREIRi.mjs → containers-Bx_44bmJ.mjs} +84 -83
- package/dist/containers-C7blN-pe.mjs +78 -0
- package/dist/content-scan-CC91dAlv.mjs +14 -0
- package/dist/cps-D9a4N_bH.mjs +6 -0
- package/dist/csamScanner-T7nbCnep.mjs +10 -0
- package/dist/ct-alerting-CkjNJlla.mjs +5 -0
- package/dist/custom-certificates-DnWnt9oJ.mjs +17 -0
- package/dist/custom-csrs-Db2pF9Ib.mjs +11 -0
- package/dist/custom-hostnames-B_N-uSIa.mjs +27 -0
- package/dist/custom-nameservers-DPA_sFY8.mjs +9 -0
- package/dist/custom-pages-D6fxEBoh.mjs +21 -0
- package/dist/d1-DXs1xVmH.mjs +45 -0
- package/dist/data-security-CVZAIzhe.mjs +71 -0
- package/dist/dcv-delegation-as1ue_wx.mjs +4 -0
- package/dist/delegate-GctF_lrq.mjs +2 -0
- package/dist/delegate.mjs +1 -1
- package/dist/{deploy-BtETDvDA.mjs → deploy-D2XXCkqk.mjs} +1 -1
- package/dist/{deploy-input-BoLTdQzS.mjs → deploy-input-BCYyKXpp.mjs} +1 -1
- package/dist/{dev-B5WcIpEr.mjs → dev-nsNxyg2D.mjs} +1 -1
- package/dist/diagnostics-BKH1Oh-C.mjs +15 -0
- package/dist/{dialog-Bud0hiYv.mjs → dialog-Dx4rRcKM.mjs} +1 -1
- package/dist/dist-BDOzKthe.mjs +48 -0
- package/dist/{dist-BRg_z9Ut.mjs → dist-BpadEMNY.mjs} +1 -1
- package/dist/dist-dc4E1u01.mjs +272 -0
- package/dist/dls-C5kAQsN6.mjs +17 -0
- package/dist/dns-CYwXrdJO.mjs +135 -0
- package/dist/dns-firewall-BEw4QcXj.mjs +71 -0
- package/dist/{dot-prop-6SRZBKHT-wIVDg_fl.mjs → dot-prop-6SRZBKHT-Dj7YOlwR.mjs} +1 -1
- package/dist/dry-run-CLX6Pbtq.mjs +2 -0
- package/dist/durable-objects-3jvUgzKd.mjs +8 -0
- package/dist/email-auth-B3MD8FrJ.mjs +6 -0
- package/dist/email-routing-C4YhZGPw.mjs +45 -0
- package/dist/email-security-BcFyWNby.mjs +160 -0
- package/dist/email-sending-BO1GOAho.mjs +47 -0
- package/dist/error-sanitization-BkgUhGVc.mjs +2 -0
- package/dist/error-sanitization-DOlqWkNu.mjs +2 -0
- package/dist/fieldExtractors-BJDnzNCN.mjs +9 -0
- package/dist/firewall-BSMa9aH3.mjs +56 -0
- package/dist/flagship-BJYMb7hb.mjs +28 -0
- package/dist/fraud-C7kS7kP9.mjs +22 -0
- package/dist/google-tag-gateway-8VR-j0sa.mjs +6 -0
- package/dist/healthchecks-BJleItOD.mjs +22 -0
- package/dist/hostnames-CHajvoHa.mjs +11 -0
- package/dist/hyperdrive-DlxQrok-.mjs +37 -0
- package/dist/iam-B7oTr6vW.mjs +52 -0
- package/dist/images-xLAYe436.mjs +71 -0
- package/dist/index.mjs +1 -1
- package/dist/intel-DwZXY1YE.mjs +76 -0
- package/dist/{interactive-CGOh-aYq.mjs → interactive-B6woOLo-.mjs} +23 -23
- package/dist/interactive-DnUvQHjc.mjs +2 -0
- package/dist/ips-BC_9nKE7.mjs +4 -0
- package/dist/keyless-certificates-CtsCsbZ2.mjs +13 -0
- package/dist/keys-K-GFzhku.mjs +4 -0
- package/dist/kv-Bfwz_ULu.mjs +21 -0
- package/dist/leaked-credential-checks-D8UuxztO.mjs +18 -0
- package/dist/lifecycle-Ichnb2x1.mjs +2 -0
- package/dist/load-balancers-B0XeGLhT.mjs +76 -0
- package/dist/local-B6b2OIBW.mjs +2 -0
- package/dist/local-BrfySqnx.mjs +2 -0
- package/dist/{local-runtime-Dj8k-p62.mjs → local-runtime-DD8DAIlm.mjs} +1 -1
- package/dist/login-CAsRUF4c.mjs +2 -0
- package/dist/login-DaglE6WA.mjs +5 -0
- package/dist/logo-matches-DWg5ezsM.mjs +6 -0
- package/dist/logos-6A6gJC5C.mjs +7 -0
- package/dist/logpush-DwehajAw.mjs +46 -0
- package/dist/logs-BWg7YymF.mjs +48 -0
- package/dist/magic-cloud-networking--14hNj2F.mjs +71 -0
- package/dist/magic-network-monitoring-Dzo4L6kd.mjs +36 -0
- package/dist/magic-transit-DDO0A5v4.mjs +387 -0
- package/dist/managed-defense-DQ0iwWdG.mjs +18 -0
- package/dist/managed-transforms-DDIdcPG0.mjs +9 -0
- package/dist/matches-D6ahHNaP.mjs +6 -0
- package/dist/mcp-BcIrLbRv.mjs +32 -0
- package/dist/mesh-wLiPcWyN.mjs +26 -0
- package/dist/mtls-certificates-AEuNOERQ.mjs +13 -0
- package/dist/network-DZsrs_sw.mjs +50 -0
- package/dist/network-interconnects-Cjbu4EMv.mjs +73 -0
- package/dist/oauth-C-QCVfWz.mjs +14 -0
- package/dist/oauth-Cu1twz9z.mjs +2 -0
- package/dist/oauth-clients-DR0hzakz.mjs +16 -0
- package/dist/oauth-scopes-BDNpJJ32.mjs +4 -0
- package/dist/observability-BnHy2M6p.mjs +80 -0
- package/dist/{open-PBXRGS4R-ClEt4E8F.mjs → open-PBXRGS4R-C4CKEADM.mjs} +1 -1
- package/dist/open-PBXRGS4R-C_-G_4DC.mjs +4 -0
- package/dist/organization-iasRm69J.mjs +75 -0
- package/dist/organizations-CUzCIKXV.mjs +4 -0
- package/dist/origin-ca-certificates-iQXSqBI0.mjs +11 -0
- package/dist/origin-post-quantum-encryption-DcMDK6Tz.mjs +6 -0
- package/dist/origin-tls-client-auth-D1X26X7y.mjs +30 -0
- package/dist/{output-Z2lQmPUW.mjs → output-Bia1u2k5.mjs} +1 -1
- package/dist/page-rules-CXa8EYcP.mjs +39 -0
- package/dist/pages-Cu0m9GSH.mjs +60 -0
- package/dist/pay-per-crawl-DmF8xlm_.mjs +65 -0
- package/dist/pay-per-use-DIp2fwJU.mjs +6 -0
- package/dist/pipelines-MmXlsxYO.mjs +44 -0
- package/dist/precursor-jqeEG_mJ.mjs +4 -0
- package/dist/previews-Cg6lc24N.mjs +4 -0
- package/dist/progress-Bpp73hIu.mjs +2 -0
- package/dist/{prompt-BP8XrQSj.mjs → prompt-CpZztV8c.mjs} +1 -1
- package/dist/queries-VzdcSR5H.mjs +9 -0
- package/dist/queues-BZYl2emH.mjs +63 -0
- package/dist/r2-data-catalog-DISnPFPY.mjs +44 -0
- package/dist/r2-omcKF8_A.mjs +127 -0
- package/dist/radar-JzBTD249.mjs +300 -0
- package/dist/{raw-fetch-DNH2V8qH.mjs → raw-fetch-DxGs_eRm.mjs} +1 -1
- package/dist/realtime-yIdAJ0Yf.mjs +172 -0
- package/dist/registrar-D-Li9gNk.mjs +43 -0
- package/dist/registrar-sandbox-CKSSHAyv.mjs +56 -0
- package/dist/{registry-BrtVdMrC.mjs → registry-vreNkX6u.mjs} +1 -1
- package/dist/reporting-Cf-pnw6h.mjs +14 -0
- package/dist/request-headers-DaXBfmVn.mjs +2 -0
- package/dist/request-tracers-BegIQTzt.mjs +4 -0
- package/dist/resolve-BXemCSyA.mjs +2 -0
- package/dist/resolve-CUDKxUrW.mjs +2 -0
- package/dist/resource-sharing-DEVgiYzM.mjs +40 -0
- package/dist/resource-tagging-Cm2yJkU9.mjs +4 -0
- package/dist/rules-DDCa7cYF.mjs +18 -0
- package/dist/rulesets-BhS7Hvtu.mjs +37 -0
- package/dist/rum-EIj9ViSn.mjs +30 -0
- package/dist/run-CSFE1qVX.mjs +2 -0
- package/dist/run-ChM_YpZ0.mjs +2 -0
- package/dist/{schema-DmuJtMN5.mjs → schema-DCBb3Fcs.mjs} +1 -1
- package/dist/{schema-flags-CUGxFeZe.mjs → schema-flags--GosoCMU.mjs} +1 -1
- package/dist/scim-DA83eNe-.mjs +18 -0
- package/dist/{sdk-Bvqx-_3z.mjs → sdk-CvIO3tWS.mjs} +1 -1
- package/dist/secrets-store-BTd3eGIB.mjs +24 -0
- package/dist/security-center-DbH_7h-T.mjs +30 -0
- package/dist/security-txt-DSrHhVEN.mjs +9 -0
- package/dist/shared-CtBkOWGN.mjs +2 -0
- package/dist/smart-shield-DnSTo-OI.mjs +24 -0
- package/dist/snippets-An5kQs33.mjs +20 -0
- package/dist/source-BR4_k2ad.mjs +6 -0
- package/dist/spawn-7IW1UyoH.mjs +523 -0
- package/dist/spectrum-Ci79n7fd.mjs +83 -0
- package/dist/speed-BBL7LrLn.mjs +24 -0
- package/dist/src-CNHNCZpy.mjs +108 -0
- package/dist/ssl-B2psFIRm.mjs +45 -0
- package/dist/startup-profile-CYEokTVe.mjs +2 -0
- package/dist/startup-profile-CgWHy4rE.mjs +17 -0
- package/dist/state-BxCejn42.mjs +2 -0
- package/dist/state-DSzkxXML.mjs +2 -0
- package/dist/stream-Du0Q7UOh.mjs +102 -0
- package/dist/submit-CU8S2jBT.mjs +4 -0
- package/dist/tags-C3l5aZSi.mjs +4 -0
- package/dist/telemetry-CNt8H3aA.mjs +2 -0
- package/dist/{telemetry-2s9Y3FaN.mjs → telemetry-Dk1GcQ0u.mjs} +1 -1
- package/dist/telemetry-PHe8XxA2.mjs +2 -0
- package/dist/tenant-BZ0ysR9L.mjs +12 -0
- package/dist/tenant-custom-nameservers-DtKeyM5J.mjs +9 -0
- package/dist/{tools-Dz1JCrHd.mjs → tools-BMKpYraQ.mjs} +1 -1
- package/dist/tunnels-D1tRWQQi.mjs +29 -0
- package/dist/turnstile-DBa4_Vyz.mjs +33 -0
- package/dist/ui-DH95w1Qk.mjs +5 -0
- package/dist/undici-DTSBJHNS.mjs +96 -0
- package/dist/update-check-AAn7EXw8.mjs +2 -0
- package/dist/update-check-BbIXBq1o.mjs +2 -0
- package/dist/update-check-worker.mjs +2 -0
- package/dist/url-info-BRA0XGT2.mjs +4 -0
- package/dist/url-normalization-B6N2m5s6.mjs +9 -0
- package/dist/url-scanner-CeKkzkhe.mjs +16 -0
- package/dist/user-CftksgmF.mjs +112 -0
- package/dist/values-m7w9PX3o.mjs +4 -0
- package/dist/vectorize-BWBEtsgZ.mjs +32 -0
- package/dist/version-cPq-WKL8.mjs +2 -0
- package/dist/waiting-rooms-BVZSYTNJ.mjs +53 -0
- package/dist/web-assets-CLU5vAgP.mjs +64 -0
- package/dist/web3-Dkd4XRNH.mjs +28 -0
- package/dist/workers-BQi4_SBS.mjs +36 -0
- package/dist/workers-builds-BgtPSDYJ.mjs +14 -0
- package/dist/workers-for-platforms-actLCM6Q.mjs +25 -0
- package/dist/workers-vpc-DjGfJgQn.mjs +13 -0
- package/dist/workflows-Cm7WsAgB.mjs +43 -0
- package/dist/zaraz-DurWe32F.mjs +22 -0
- package/dist/zero-trust-D8SVU8YZ.mjs +795 -0
- package/dist/zone-B3AEAfcd.mjs +4 -0
- package/dist/zones-DiX5LoSU.mjs +124 -0
- package/package.json +26 -11
- package/dist/_meta/agent-context.json +0 -195
- package/dist/abuse-reports-CDFjJ2e8.mjs +0 -8
- package/dist/access-BoT1waG4.mjs +0 -11
- package/dist/account-agnMUKWj.mjs +0 -2
- package/dist/account-tags-BRMMHCee.mjs +0 -9
- package/dist/accounts-Cut77dAt.mjs +0 -30
- package/dist/acm-C8WgXNCl.mjs +0 -3
- package/dist/addressing-CR8EV42x.mjs +0 -13
- package/dist/agent-context-Wj5TRRbW.mjs +0 -8
- package/dist/agent-memory-CVJpKKZy.mjs +0 -6
- package/dist/ai-BbNYt-yI.mjs +0 -5
- package/dist/ai-audit-mVajM-2i.mjs +0 -2
- package/dist/ai-gateway-BsepSA_v.mjs +0 -13
- package/dist/ai-search-DbEJqm5-.mjs +0 -7
- package/dist/ai-security-DmyB5EYk.mjs +0 -4
- package/dist/alerting-dmy3hd8O.mjs +0 -6
- package/dist/analytics-B1xBMla0.mjs +0 -5
- package/dist/analytics_engine-DazCn3iC.mjs +0 -2
- package/dist/api-security-0HXCzfHk.mjs +0 -50
- package/dist/argo-DSHsE8zv.mjs +0 -2
- package/dist/artifacts-CwiU9Mxu.mjs +0 -5
- package/dist/audit-logs-DwFtMDwH.mjs +0 -2
- package/dist/auth-B0ZyXc3y.mjs +0 -5
- package/dist/auth-DWxtJ918.mjs +0 -8
- package/dist/billing-Cbpadkgu.mjs +0 -3
- package/dist/bot-management-B6M2Vyyn.mjs +0 -5
- package/dist/botnet-feed-Dn8UuE4h.mjs +0 -3
- package/dist/brand-protection-B5R0b3pu.mjs +0 -3
- package/dist/browser-extension-D55pYZf_.mjs +0 -3
- package/dist/browser-run-C1b2VkGB.mjs +0 -4
- package/dist/build-CP2JUfV1.mjs +0 -2
- package/dist/builds-CVEXO_4a.mjs +0 -9
- package/dist/cache-BU5xX82E.mjs +0 -9
- package/dist/certificate-authorities--tZTWJWD.mjs +0 -2
- package/dist/cf-BV2HLCQm.mjs +0 -18
- package/dist/chunk-QBZBEHZB-BcCMlc8C.mjs +0 -2
- package/dist/chunk-XLADBZ7F-DgFrtUhW.mjs +0 -103
- package/dist/chunk-vbHwaUoU.mjs +0 -2
- package/dist/client-certificates-DX84qeYG.mjs +0 -3
- package/dist/client-side-security-DsSO2rZQ.mjs +0 -37
- package/dist/cloud-connector-cf8qlxap.mjs +0 -2
- package/dist/cloudforce-one-DzVXorbu.mjs +0 -32
- package/dist/command-DYrspBc0.mjs +0 -2
- package/dist/connector-interrupts-DqpqPPkp.mjs +0 -2
- package/dist/connector-telemetry-events-CCD-_B-8.mjs +0 -2
- package/dist/connector-telemetry-snapshots-D3CeGGhk.mjs +0 -2
- package/dist/connectors-aPQspZdg.mjs +0 -3
- package/dist/containers-D0Kjl8h-.mjs +0 -58
- package/dist/content-scan-BVx18XmS.mjs +0 -4
- package/dist/cps-ByazyM0x.mjs +0 -2
- package/dist/csamScanner-OG5lQxBC.mjs +0 -6
- package/dist/ct-alerting-BJx5n8Zf.mjs +0 -3
- package/dist/custom-certificates-BuJ2e9TA.mjs +0 -5
- package/dist/custom-csrs-CR_5qbST.mjs +0 -3
- package/dist/custom-hostnames-BzDTsQXb.mjs +0 -5
- package/dist/custom-nameservers-OfMPRGkD.mjs +0 -3
- package/dist/custom-pages-BmGXoTIo.mjs +0 -3
- package/dist/d1-DedC8N0N.mjs +0 -21
- package/dist/data-security-B2UB26ry.mjs +0 -7
- package/dist/dcv-delegation-C11vmzbG.mjs +0 -2
- package/dist/diagnostics-Cf6BLpAo.mjs +0 -3
- package/dist/dist-CyisSore.mjs +0 -371
- package/dist/dist-Dr4Hg_Up.mjs +0 -48
- package/dist/dls-R6PvHbhj.mjs +0 -3
- package/dist/dns-Cl8se64c.mjs +0 -29
- package/dist/dns-firewall-WtmKilDT.mjs +0 -57
- package/dist/dry-run-YSQndLvt.mjs +0 -2
- package/dist/durable-objects-jfVU6yp_.mjs +0 -2
- package/dist/email-auth-DPmZ85eW.mjs +0 -2
- package/dist/email-routing-Bf6DbNTr.mjs +0 -6
- package/dist/email-security-DTifjSxM.mjs +0 -18
- package/dist/email-sending-Dm3WkFHV.mjs +0 -7
- package/dist/error-sanitization-D8zuyPj_.mjs +0 -2
- package/dist/fieldExtractors-CeXZL0-I.mjs +0 -3
- package/dist/firewall-D5N2APXO.mjs +0 -8
- package/dist/flagship-sUOy9jei.mjs +0 -4
- package/dist/fraud-WLW2Ep1Z.mjs +0 -20
- package/dist/google-tag-gateway-lbww1FaJ.mjs +0 -2
- package/dist/healthchecks-0ih8Qjiw.mjs +0 -4
- package/dist/hostnames-Ba6FuL8K.mjs +0 -3
- package/dist/hyperdrive-DMqcU639.mjs +0 -21
- package/dist/iam-CXlYm0uC.mjs +0 -6
- package/dist/images-D_g1oli6.mjs +0 -8
- package/dist/intel-B8bS0ARd.mjs +0 -8
- package/dist/ips-68fzniN4.mjs +0 -2
- package/dist/keyless-certificates-CeLnqBvX.mjs +0 -3
- package/dist/keys-DkVdS2lF.mjs +0 -2
- package/dist/kv-gDAN50BQ.mjs +0 -5
- package/dist/leaked-credential-checks-DfnvHpvg.mjs +0 -4
- package/dist/load-balancers-m0HqyXPZ.mjs +0 -6
- package/dist/local-BwL_gesw.mjs +0 -2
- package/dist/logo-matches-DPbHlsKQ.mjs +0 -2
- package/dist/logos-DFBJFAYJ.mjs +0 -3
- package/dist/logpush-gzmlZayc.mjs +0 -4
- package/dist/logs-BuzwQgt5.mjs +0 -18
- package/dist/magic-cloud-networking-BbHCi1Vp.mjs +0 -5
- package/dist/magic-network-monitoring-kWMmnPTG.mjs +0 -4
- package/dist/magic-transit-ClSmJDKw.mjs +0 -111
- package/dist/managed-defense-EOihg1UR.mjs +0 -2
- package/dist/managed-transforms-BZ_XdGE2.mjs +0 -3
- package/dist/matches-B6sG0_fr.mjs +0 -2
- package/dist/mcp--kK0vS5i.mjs +0 -4
- package/dist/mesh-DfXYUHOO.mjs +0 -4
- package/dist/mtls-certificates-DZd-0X7l.mjs +0 -3
- package/dist/network-U6f_5ihp.mjs +0 -6
- package/dist/network-interconnects-DKZGTiYM.mjs +0 -41
- package/dist/oauth-BdVr2hJp.mjs +0 -14
- package/dist/oauth-clients-CY3OkPhC.mjs +0 -4
- package/dist/oauth-scopes-BTY7_5L-.mjs +0 -2
- package/dist/observability-Bsp-LdmJ.mjs +0 -10
- package/dist/organization-BSeMdj-7.mjs +0 -45
- package/dist/organizations-BroR48Nv.mjs +0 -2
- package/dist/origin-ca-certificates-jC-EMn6W.mjs +0 -3
- package/dist/origin-post-quantum-encryption-DIspLvA0.mjs +0 -2
- package/dist/origin-tls-client-auth-CZ_nUEcM.mjs +0 -4
- package/dist/page-rules-ZcdjPohY.mjs +0 -27
- package/dist/pages-W4tKa7xk.mjs +0 -14
- package/dist/pay-per-crawl-BNM1mJmP.mjs +0 -5
- package/dist/pay-per-use-DKxlnkH3.mjs +0 -2
- package/dist/pipelines-Dug0BR-c.mjs +0 -6
- package/dist/precursor-D-11DkRU.mjs +0 -4
- package/dist/previews-D_Nv4dR6.mjs +0 -4
- package/dist/progress-a5IKeKni.mjs +0 -2
- package/dist/queries-BdA2vJoe.mjs +0 -3
- package/dist/queues-Bu06ZqUE.mjs +0 -7
- package/dist/r2-COC9wMKb.mjs +0 -25
- package/dist/r2-data-catalog-CX5Rl5Qx.mjs +0 -16
- package/dist/radar-L-yoLIHF.mjs +0 -2
- package/dist/realtime-JKIiXfzi.mjs +0 -20
- package/dist/registrar-_dYUZrK0.mjs +0 -43
- package/dist/registrar-sandbox-D1yfW_Q_.mjs +0 -56
- package/dist/reporting-3fyoMcmb.mjs +0 -2
- package/dist/request-headers-BhQQAfJt.mjs +0 -2
- package/dist/request-tracers-TisEth2p.mjs +0 -2
- package/dist/resolve-CYUp6YgC.mjs +0 -2
- package/dist/resource-sharing-C4-dnohU.mjs +0 -6
- package/dist/resource-tagging-BRDifKqM.mjs +0 -2
- package/dist/rules-BCF3gIkw.mjs +0 -4
- package/dist/rulesets-wp6rllt3.mjs +0 -5
- package/dist/rum-B77awgoB.mjs +0 -4
- package/dist/run-BS8otL3u.mjs +0 -2
- package/dist/scim-C9BmUYil.mjs +0 -4
- package/dist/secrets-store-ckkZR2dM.mjs +0 -7
- package/dist/security-center-BCahKT57.mjs +0 -2
- package/dist/security-txt-0SI5du7I.mjs +0 -3
- package/dist/shared-D0B-7q-D.mjs +0 -2
- package/dist/smart-shield-BDPbrZa4.mjs +0 -4
- package/dist/snippets-CVRR_h0i.mjs +0 -4
- package/dist/spawn-DP4T92ss.mjs +0 -519
- package/dist/spectrum-CjNXQIQE.mjs +0 -63
- package/dist/speed-CrXCHk3h.mjs +0 -4
- package/dist/src-BbnV77C4.mjs +0 -108
- package/dist/ssl-DKORhHkh.mjs +0 -15
- package/dist/startup-profile-CBIH6yZy.mjs +0 -17
- package/dist/state-QUu6HfxC.mjs +0 -2
- package/dist/stream-wY3zi3FK.mjs +0 -16
- package/dist/submit-B-4oCBSk.mjs +0 -2
- package/dist/tags-5uJEkYJZ.mjs +0 -2
- package/dist/telemetry-n3NJourL.mjs +0 -2
- package/dist/tenant-BkFvv2o3.mjs +0 -2
- package/dist/tenant-custom-nameservers-DcjC1q0r.mjs +0 -3
- package/dist/tunnel-Cd4ipbvJ.mjs +0 -2
- package/dist/tunnels-9Zg3ePwD.mjs +0 -5
- package/dist/turnstile-BTwKYpzD.mjs +0 -23
- package/dist/ui-DQSZeaG5.mjs +0 -5
- package/dist/url-info-D7Y61BFd.mjs +0 -2
- package/dist/url-normalization-B4n8HiNQ.mjs +0 -3
- package/dist/url-scanner-CiCIltSQ.mjs +0 -2
- package/dist/user-DDFDGJ0Y.mjs +0 -12
- package/dist/values-DRznB_Cl.mjs +0 -2
- package/dist/vectorize-CbznPhzq.mjs +0 -4
- package/dist/waiting-rooms-CKP5hYBK.mjs +0 -11
- package/dist/web-assets-C-ZoSkkh.mjs +0 -8
- package/dist/web3-DwlN4dOw.mjs +0 -4
- package/dist/workers-builds-ECw_x_kp.mjs +0 -2
- package/dist/workers-for-platforms-BYGy46R6.mjs +0 -5
- package/dist/workers-vpc-CCosFcxz.mjs +0 -3
- package/dist/workers-zFMrbUkg.mjs +0 -6
- package/dist/workflows-C8GXGDRW.mjs +0 -5
- package/dist/zaraz-B5UIREaz.mjs +0 -2
- package/dist/zero-trust-DUp0XoIo.mjs +0 -91
- package/dist/zone-BGLkk-mL.mjs +0 -2
- package/dist/zones-CwYjNXMH.mjs +0 -44
- /package/dist/{alerts-CarPLL8k.mjs → alerts-CstOk8n0.mjs} +0 -0
- /package/dist/{autorag-zK-3harf.mjs → autorag-PRTwXGgn.mjs} +0 -0
- /package/dist/{body-parser-Cmw7PZ7a.mjs → body-parser-CUWbw_Tq.mjs} +0 -0
- /package/dist/{brands-CpgTsX8h.mjs → brands-BHRXlWDm.mjs} +0 -0
- /package/dist/{clear-C5gzBA8G.mjs → clear-UvKESVx3.mjs} +0 -0
- /package/dist/{cli-types-abvWQN3T.mjs → cli-types-tt_LZMbn.mjs} +0 -0
- /package/dist/{connector-telemetry-events-latest-BY-dbhQZ.mjs → connector-telemetry-events-latest-DwnFeZg0.mjs} +0 -0
- /package/dist/{connector-telemetry-snapshots-latest-DoMvHvCO.mjs → connector-telemetry-snapshots-latest-Dv6rZlxs.mjs} +0 -0
- /package/dist/{domain-info-Cw3G4nap.mjs → domain-info-BqTDXNBo.mjs} +0 -0
- /package/dist/{health-DkEXPkS6.mjs → health-CwPzzrV6.mjs} +0 -0
- /package/dist/{input-validation-nF-0Ze2h.mjs → input-validation-Ch4Vllrm.mjs} +0 -0
- /package/dist/{internal-4fU2r5en.mjs → internal-WLHfxX64.mjs} +0 -0
- /package/dist/{live-B4iGrwY2.mjs → live-D_k7eHdv.mjs} +0 -0
- /package/dist/{metadata-C5fJJr-k.mjs → metadata-APBiectA.mjs} +0 -0
- /package/dist/{project-settings-Bc3wYHo8.mjs → project-settings-DSXevRvj.mjs} +0 -0
- /package/dist/{rate-limit-analytics-DNsAFIeM.mjs → rate-limit-analytics-CDTPxSET.mjs} +0 -0
- /package/dist/{rate-limits-CsOim7bm.mjs → rate-limits-C3K9smdl.mjs} +0 -0
- /package/dist/{ready-tTe-zcIw.mjs → ready-CvwvbdTX.mjs} +0 -0
- /package/dist/{recent-submissions-B3eTV5yC.mjs → recent-submissions-CjzcT-iH.mjs} +0 -0
- /package/dist/{refute-BY76YVrT.mjs → refute-CIAFMj00.mjs} +0 -0
- /package/dist/{scan-logo-DdoF_a5y.mjs → scan-logo-zFkphtQ3.mjs} +0 -0
- /package/dist/{scan-page-sSgLwwZN.mjs → scan-page-CLl2MAkZ.mjs} +0 -0
- /package/dist/{search-BFvQr-sl.mjs → search-12jA1b4l.mjs} +0 -0
- /package/dist/{signed-url-Cr8hiZPJ.mjs → signed-url-U0T_PEMR.mjs} +0 -0
- /package/dist/{submission-info-DT2mLnu1.mjs → submission-info-CZ84a3Nb.mjs} +0 -0
- /package/dist/{theme-CeVf-5qG.mjs → theme-BiIYWOed.mjs} +0 -0
- /package/dist/{total-queries-6gs5iy9T.mjs → total-queries-CJTc9Pde.mjs} +0 -0
- /package/dist/{tracked-domains-D6XKO2EV.mjs → tracked-domains-BKLxnnSv.mjs} +0 -0
- /package/dist/{verify-CM1NakP0.mjs → verify-CZW5Fo1q.mjs} +0 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-B6b2OIBW.mjs";import{m as t,v as n}from"./oauth-C-QCVfWz.mjs";import{a as r,r as i}from"./auth-C80y97yu.mjs";import{t as a}from"./output-Bia1u2k5.mjs";import{t as o}from"./dry-run-CLX6Pbtq.mjs";import{t as s}from"./progress-Bpp73hIu.mjs";import{t as c}from"./run-ChM_YpZ0.mjs";import"./telemetry-CNt8H3aA.mjs";import{i as l,n as u,r as d,t as f}from"./body-parser-CUWbw_Tq.mjs";import{n as p,t as m}from"./input-validation-Ch4Vllrm.mjs";import{a as h,i as g,n as _}from"./prompt-CpZztV8c.mjs";import{n as ee,t as te}from"./raw-fetch-DxGs_eRm.mjs";function v(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 y={command:`delete <bucket-name>`,describe:`Delete Bucket CORS Policy`,builder:v,handler:async l=>c({command:`r2 buckets cors delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets cors delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();if(l.accountId=d,!await _({force:!!l.force})){process.stderr.write(`Aborted.
|
|
5
|
+
`);return}a(await s(`Deleting`,async()=>r(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/cors`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Deleted`})})};function b(e){return e.usage(`$0 r2 buckets cors get <bucket-name>
|
|
6
|
+
|
|
7
|
+
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 x={command:`get <bucket-name>`,describe:`Get Bucket CORS Policy`,builder:b,handler:async l=>c({command:`r2 buckets cors get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets cors get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/cors`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function S(e){return e.usage(`$0 r2 buckets cors update <bucket-name>
|
|
8
|
+
|
|
9
|
+
Set 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(`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(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`update <bucket-name>`,describe:`Put Bucket CORS Policy`,builder:S,handler:async p=>c({command:`r2 buckets cors update`,classification:{safeFlags:[`dry-run`]}},p,async()=>{let c={};if(p[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(p[`cf-r2-jurisdiction`])),p.dryRun){o({command:`cf r2 buckets cors update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${p[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(p[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(p[`bucket-name`]??``)},bodyKind:`json`,body:p.body===void 0?f({rules:d(p.rules,`rules`)}):u(p.body)});return}let m=await i(p),h=p.local?e:await t();if(p.accountId=h,p.body){let e=u(p.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(p[`bucket-name`]))}/cors`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`});return}let g={};p.rules!==void 0&&l(g,[`rules`],d(p.rules,`rules`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(p[`bucket-name`]))}/cors`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`})})},w={command:`cors`,describe:`Operations for buckets.cors`,builder:e=>e.command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(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 E={command:`create-by-name <bucket-name>`,describe:`Create Bucket (by name)`,builder:T,handler:async l=>c({command:`r2 buckets create-by-name`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l[`cf-r2-storage-class`]!==void 0&&(c[`cf-r2-storage-class`]=String(l[`cf-r2-storage-class`])),l.dryRun){o({command:`cf r2 buckets create-by-name`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Updating`,async()=>r(u,`PUT`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`})})};function D(e){return e.usage(`$0 r2 buckets create
|
|
10
|
+
|
|
11
|
+
Creates a new R2 bucket.`).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`]}).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`}).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`,describe:`Create Bucket`,builder:D,handler:async d=>c({command:`r2 buckets create`,classification:{safeFlags:[`location-hint`,`storage-class`,`dry-run`]}},d,async()=>{let c={};if(d[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(d[`cf-r2-jurisdiction`])),d.dryRun){o({command:`cf r2 buckets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets`,pathParams:{},bodyKind:`json`,body:d.body===void 0?f({locationHint:p(d[`location-hint`],`location-hint`,`text`),name:p(d.name,`name`,`text`),storageClass:p(d[`storage-class`],`storage-class`,`text`)}):u(d.body)});return}let m=await i(d),g=d.local?e:await t();if(d.accountId=g,d.body){let e=u(d.body);a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${g}/r2/buckets`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await h(`name`,`Name of the bucket.`));let _={};d[`location-hint`]!==void 0&&l(_,[`locationHint`],p(d[`location-hint`],`location-hint`,`text`)),d.name!==void 0&&l(_,[`name`],p(d.name,`name`,`text`)),d[`storage-class`]!==void 0&&l(_,[`storageClass`],p(d[`storage-class`],`storage-class`,`text`)),a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${g}/r2/buckets`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`})})};function k(e){return e.usage(`$0 r2 buckets delete <bucket-name>
|
|
12
|
+
|
|
13
|
+
Deletes 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}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const A={command:`delete <bucket-name>`,describe:`Delete Bucket`,builder:k,handler:async l=>c({command:`r2 buckets delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();if(l.accountId=d,!await _({force:!!l.force})){process.stderr.write(`Aborted.
|
|
14
|
+
`);return}a(await s(`Deleting`,async()=>r(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Deleted`})})};function j(e){return e.usage(`$0 r2 buckets domains custom create <bucket-name>
|
|
15
|
+
|
|
16
|
+
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`]}).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 M={command:`create <bucket-name>`,describe:`Attach Custom Domain To Bucket`,builder:j,handler:async d=>c({command:`r2 buckets domains custom create`,classification:{safeFlags:[`enabled`,`min-tls`,`dry-run`]}},d,async()=>{let c={};if(d[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(d[`cf-r2-jurisdiction`])),d.dryRun){o({command:`cf r2 buckets domains custom create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${d[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(d[`bucket-name`]))}/domains/custom`,pathParams:{"bucket-name":String(d[`bucket-name`]??``)},bodyKind:`json`,body:d.body===void 0?f({ciphers:d.ciphers,domain:p(d.domain,`domain`,`text`),enabled:d.enabled,minTLS:p(d[`min-tls`],`min-tls`,`text`),zoneId:p(d[`zone-id`],`zone-id`,`text`)}):u(d.body)});return}let m=await i(d),g=d.local?e:await t();if(d.accountId=g,d.body){let e=u(d.body);a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${g}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/domains/custom`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`});return}if(d.domain===void 0&&(d.domain=await h(`domain`,`Name of the custom domain to be added.`)),d.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);d[`zone-id`]===void 0&&(d[`zone-id`]=await h(`zone-id`,`Zone ID of the custom domain.`));let _={};d.ciphers!==void 0&&l(_,[`ciphers`],d.ciphers),d.domain!==void 0&&l(_,[`domain`],p(d.domain,`domain`,`text`)),d.enabled!==void 0&&l(_,[`enabled`],d.enabled),d[`min-tls`]!==void 0&&l(_,[`minTLS`],p(d[`min-tls`],`min-tls`,`text`)),d[`zone-id`]!==void 0&&l(_,[`zoneId`],p(d[`zone-id`],`zone-id`,`text`)),a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${g}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/domains/custom`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`})})};function N(e){return e.usage(`$0 r2 buckets domains custom delete <domain>
|
|
17
|
+
|
|
18
|
+
Remove custom domain registration from 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}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const P={command:`delete <domain>`,describe:`Remove Custom Domain From Bucket`,builder:N,handler:async l=>c({command:`r2 buckets domains custom delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets domains custom delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/domains/custom/${l.domain==null?`<domain>`:encodeURIComponent(String(l.domain))}`,pathParams:{"bucket-name":String(l[`bucket-name`]??``),domain:String(l.domain??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();if(l.accountId=d,!await _({force:!!l.force})){process.stderr.write(`Aborted.
|
|
19
|
+
`);return}a(await s(`Deleting`,async()=>r(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(l.domain))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Deleted`})})};function F(e){return e.usage(`$0 r2 buckets domains custom get <domain>
|
|
20
|
+
|
|
21
|
+
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 I={command:`get <domain>`,describe:`Get Custom Domain Settings`,builder:F,handler:async l=>c({command:`r2 buckets domains custom get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets domains custom get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/domains/custom/${l.domain==null?`<domain>`:encodeURIComponent(String(l.domain))}`,pathParams:{"bucket-name":String(l[`bucket-name`]??``),domain:String(l.domain??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(l.domain))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function L(e){return e.usage(`$0 r2 buckets domains custom list
|
|
22
|
+
|
|
23
|
+
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 R={command:`list`,describe:`List Custom Domains of Bucket`,builder:L,handler:async l=>c({command:`r2 buckets domains custom list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets domains custom list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/domains/custom`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/domains/custom`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function z(e){return e.usage(`$0 r2 buckets domains custom update <domain>
|
|
24
|
+
|
|
25
|
+
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`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`update <domain>`,describe:`Configure Custom Domain Settings`,builder:z,handler:async d=>c({command:`r2 buckets domains custom update`,classification:{safeFlags:[`enabled`,`min-tls`,`dry-run`]}},d,async()=>{let c={};if(d[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(d[`cf-r2-jurisdiction`])),d.dryRun){o({command:`cf r2 buckets domains custom update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${d[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(d[`bucket-name`]))}/domains/custom/${d.domain==null?`<domain>`:encodeURIComponent(String(d.domain))}`,pathParams:{"bucket-name":String(d[`bucket-name`]??``),domain:String(d.domain??``)},bodyKind:`json`,body:d.body===void 0?f({ciphers:d.ciphers,enabled:d.enabled,minTLS:p(d[`min-tls`],`min-tls`,`text`)}):u(d.body)});return}let m=await i(d),h=d.local?e:await t();if(d.accountId=h,d.body){let e=u(d.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(d.domain))}`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`});return}let g={};d.ciphers!==void 0&&l(g,[`ciphers`],d.ciphers),d.enabled!==void 0&&l(g,[`enabled`],d.enabled),d[`min-tls`]!==void 0&&l(g,[`minTLS`],p(d[`min-tls`],`min-tls`,`text`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(d.domain))}`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`})})},V={command:`custom`,describe:`Operations for buckets.domains.custom`,builder:e=>e.command(M).command(P).command(I).command(R).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function H(e){return e.usage(`$0 r2 buckets domains managed list
|
|
26
|
+
|
|
27
|
+
Gets state of public access over the bucket's R2-managed (r2.dev) domain.`).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 U={command:`list`,describe:`Get r2.dev Domain of Bucket`,builder:H,handler:async l=>c({command:`r2 buckets domains managed list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets domains managed list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/domains/managed`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/domains/managed`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function W(e){return e.usage(`$0 r2 buckets domains managed update <bucket-name>
|
|
28
|
+
|
|
29
|
+
Updates state of public access over the bucket's R2-managed (r2.dev) domain.`).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(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const G={command:`update <bucket-name>`,describe:`Update r2.dev Domain of Bucket`,builder:W,handler:async d=>c({command:`r2 buckets domains managed update`,classification:{safeFlags:[`enabled`,`dry-run`]}},d,async()=>{let c={};if(d[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(d[`cf-r2-jurisdiction`])),d.dryRun){o({command:`cf r2 buckets domains managed update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${d[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(d[`bucket-name`]))}/domains/managed`,pathParams:{"bucket-name":String(d[`bucket-name`]??``)},bodyKind:`json`,body:d.body===void 0?f({enabled:d.enabled}):u(d.body)});return}let p=await i(d),m=d.local?e:await t();if(d.accountId=m,d.body){let e=u(d.body);a(await s(`Updating`,async()=>r(p,`PUT`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/domains/managed`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`});return}if(d.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let h={};d.enabled!==void 0&&l(h,[`enabled`],d.enabled),a(await s(`Updating`,async()=>r(p,`PUT`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/domains/managed`,{body:Object.keys(h).length>0?h:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`})})},K={command:`managed`,describe:`Operations for buckets.domains.managed`,builder:e=>e.command(U).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},q={command:`domains`,describe:`Operations for buckets.domains`,builder:e=>e.command(V).command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function J(e){return e.usage(`$0 r2 buckets edit <bucket-name>
|
|
30
|
+
|
|
31
|
+
Updates 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(`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 Y={command:`edit <bucket-name>`,describe:`Patch Bucket`,builder:J,handler:async l=>c({command:`r2 buckets edit`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l[`cf-r2-storage-class`]!==void 0&&(c[`cf-r2-storage-class`]=String(l[`cf-r2-storage-class`])),l.dryRun){o({command:`cf r2 buckets edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Updating`,async()=>r(u,`PATCH`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`})})};function X(e){return e.usage(`$0 r2 buckets event-notifications delete <queue-id>
|
|
32
|
+
|
|
33
|
+
Delete an event notification rule. **If no body is provided, all rules for specified queue will be deleted**.`).positional(`queue-id`,{type:`string`,description:`Queue ID.`,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 Z={command:`delete <queue-id>`,describe:`Delete Event Notification Rules`,builder:X,handler:async d=>c({command:`r2 buckets event-notifications delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},d,async()=>{let c={};if(d[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(d[`cf-r2-jurisdiction`])),d.dryRun){o({command:`cf r2 buckets event-notifications delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/event_notifications/r2/${d[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(d[`bucket-name`]))}/configuration/queues/${d[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(d[`queue-id`]))}`,pathParams:{"queue-id":String(d[`queue-id`]??``),"bucket-name":String(d[`bucket-name`]??``)},bodyKind:`json`,body:d.body===void 0?f({ruleIds:d[`rule-ids`]}):u(d.body)});return}let p=await i(d),m=d.local?e:await t();if(d.accountId=m,!await _({force:!!d.force})){process.stderr.write(`Aborted.
|
|
34
|
+
`);return}if(d.body){let e=u(d.body);a(await s(`Deleting`,async()=>r(p,`DELETE`,`/accounts/${m}/event_notifications/r2/${encodeURIComponent(String(d[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(d[`queue-id`]))}`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Deleted`});return}let h={};d[`rule-ids`]!==void 0&&l(h,[`ruleIds`],d[`rule-ids`]),a(await s(`Deleting`,async()=>r(p,`DELETE`,`/accounts/${m}/event_notifications/r2/${encodeURIComponent(String(d[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(d[`queue-id`]))}`,{body:Object.keys(h).length>0?h:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Deleted`})})};function Q(e){return e.usage(`$0 r2 buckets event-notifications get <queue-id>
|
|
35
|
+
|
|
36
|
+
Get a single event notification rule.`).positional(`queue-id`,{type:`string`,description:`Queue ID.`,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 ne={command:`get <queue-id>`,describe:`Get Event Notification Rule`,builder:Q,handler:async l=>c({command:`r2 buckets event-notifications get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets event-notifications get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/event_notifications/r2/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/configuration/queues/${l[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(l[`queue-id`]))}`,pathParams:{"queue-id":String(l[`queue-id`]??``),"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/event_notifications/r2/${encodeURIComponent(String(l[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(l[`queue-id`]))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function re(e){return e.usage(`$0 r2 buckets event-notifications list
|
|
37
|
+
|
|
38
|
+
List all event notification rules for a 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 ie={command:`list`,describe:`List Event Notification Rules`,builder:re,handler:async l=>c({command:`r2 buckets event-notifications list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets event-notifications list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/event_notifications/r2/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/configuration`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/event_notifications/r2/${encodeURIComponent(String(l[`bucket-name`]))}/configuration`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function ae(e){return e.usage(`$0 r2 buckets event-notifications update <queue-id>
|
|
39
|
+
|
|
40
|
+
Create event notification rule.`).positional(`queue-id`,{type:`string`,description:`Queue ID.`,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 oe={command:`update <queue-id>`,describe:`Create Event Notification Rule`,builder:ae,handler:async p=>c({command:`r2 buckets event-notifications update`,classification:{safeFlags:[`dry-run`]}},p,async()=>{let c={};if(p[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(p[`cf-r2-jurisdiction`])),p.dryRun){o({command:`cf r2 buckets event-notifications update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/event_notifications/r2/${p[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(p[`bucket-name`]))}/configuration/queues/${p[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(p[`queue-id`]))}`,pathParams:{"queue-id":String(p[`queue-id`]??``),"bucket-name":String(p[`bucket-name`]??``)},bodyKind:`json`,body:p.body===void 0?f({rules:d(p.rules,`rules`)}):u(p.body)});return}let m=await i(p),h=p.local?e:await t();if(p.accountId=h,p.body){let e=u(p.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/event_notifications/r2/${encodeURIComponent(String(p[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(p[`queue-id`]))}`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`});return}if(p.rules===void 0)throw Error(`--rules is required (or pass --body with this field set).`);let g={};p.rules!==void 0&&l(g,[`rules`],d(p.rules,`rules`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/event_notifications/r2/${encodeURIComponent(String(p[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(p[`queue-id`]))}`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`})})},se={command:`event-notifications`,describe:`Operations for buckets.event-notifications`,builder:e=>e.command(Z).command(ne).command(ie).command(oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ce(e){return e.usage(`$0 r2 buckets get <bucket-name>
|
|
41
|
+
|
|
42
|
+
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 le={command:`get <bucket-name>`,describe:`Get Bucket`,builder:ce,handler:async l=>c({command:`r2 buckets get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function ue(e){return e.usage("$0 r2 buckets jobs get <job-id>\n\nGets the current status of a background job for an R2 bucket. Poll this endpoint with the job identifier returned when the operation was submitted 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 de={command:`get <job-id>`,describe:`Get Bucket Job`,builder:ue,handler:async l=>c({command:`r2 buckets jobs get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/jobs/${l[`job-id`]==null?`<job-id>`:encodeURIComponent(String(l[`job-id`]))}`,pathParams:{"bucket-name":String(l[`bucket-name`]??``),"job-id":String(l[`job-id`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/jobs/${encodeURIComponent(String(l[`job-id`]))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function fe(e){return e.usage(`$0 r2 buckets jobs list
|
|
43
|
+
|
|
44
|
+
Lists background jobs for an R2 bucket. Use this endpoint to poll jobs returned by asynchronous operations such as deleting objects by prefix or emptying a bucket.`).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`]}).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 pe={command:`list`,describe:`List Bucket Jobs`,builder:fe,handler:async l=>c({command:`r2 buckets jobs list`,classification:{safeFlags:[`job-type`,`status`,`dry-run`]}},l,async()=>{let c={jobType:l[`job-type`],status:l.status,maxKeys:l[`max-keys`],continuationToken:l[`continuation-token`]},u={};if(l[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets jobs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/jobs`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},query:c,bodyKind:`none`});return}let d=await i(l),f=l.local?e:await t();l.accountId=f,a(await s(`Loading`,async()=>r(d,`GET`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/jobs`,{query:c,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Loaded`})})},me={command:`jobs`,describe:`Inspect background jobs for an R2 bucket`,builder:e=>e.command(de).command(pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function he(e){return e.usage(`$0 r2 buckets lifecycle get <bucket-name>
|
|
45
|
+
|
|
46
|
+
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 ge={command:`get <bucket-name>`,describe:`Get Object Lifecycle Rules`,builder:he,handler:async l=>c({command:`r2 buckets lifecycle get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets lifecycle get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/lifecycle`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/lifecycle`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function _e(e){return e.usage(`$0 r2 buckets lifecycle update <bucket-name>
|
|
47
|
+
|
|
48
|
+
Set the 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(`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(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ve={command:`update <bucket-name>`,describe:`Put Object Lifecycle Rules`,builder:_e,handler:async p=>c({command:`r2 buckets lifecycle update`,classification:{safeFlags:[`dry-run`]}},p,async()=>{let c={};if(p[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(p[`cf-r2-jurisdiction`])),p.dryRun){o({command:`cf r2 buckets lifecycle update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${p[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(p[`bucket-name`]))}/lifecycle`,pathParams:{"bucket-name":String(p[`bucket-name`]??``)},bodyKind:`json`,body:p.body===void 0?f({rules:d(p.rules,`rules`)}):u(p.body)});return}let m=await i(p),h=p.local?e:await t();if(p.accountId=h,p.body){let e=u(p.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(p[`bucket-name`]))}/lifecycle`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`});return}let g={};p.rules!==void 0&&l(g,[`rules`],d(p.rules,`rules`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(p[`bucket-name`]))}/lifecycle`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`})})},ye={command:`lifecycle`,describe:`Operations for buckets.lifecycle`,builder:e=>e.command(ge).command(ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function be(e){return e.usage(`$0 r2 buckets list
|
|
49
|
+
|
|
50
|
+
Lists all R2 buckets on your account.`).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 xe={command:`list`,describe:`List Buckets`,builder:be,handler:async l=>c({command:`r2 buckets list`,classification:{safeFlags:[`order`,`direction`,`dry-run`]}},l,async()=>{let c={name_contains:l[`name-contains`],start_after:l[`start-after`],per_page:l[`per-page`],order:l.order,direction:l.direction,cursor:l.cursor},u={};if(l[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets`,pathParams:{},query:c,bodyKind:`none`});return}let d=await i(l),f=l.local?e:await t();l.accountId=f,a(await s(`Loading`,async()=>r(d,`GET`,`/accounts/${f}/r2/buckets`,{query:c,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Loaded`})})};function Se(e){return e.usage(`$0 r2 buckets local-uploads get <bucket-name>
|
|
51
|
+
|
|
52
|
+
Get the local uploads configuration for a bucket. When enabled, object's data is written to the nearest region first, then asynchronously replicated to the bucket's primary region.`).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 Ce={command:`get <bucket-name>`,describe:`Get Local Uploads Configuration`,builder:Se,handler:async r=>c({command:`r2 buckets local-uploads get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf r2 buckets local-uploads get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${r[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(r[`bucket-name`]))}/local-uploads`,pathParams:{"bucket-name":String(r[`bucket-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.r2.buckets.localUploads.get({account_id:l,bucket_name:r[`bucket-name`]})),{successLabel:`Loaded`})})};function we(e){return e.usage(`$0 r2 buckets local-uploads update <bucket-name>
|
|
53
|
+
|
|
54
|
+
Set the local uploads configuration for a bucket. When enabled, object's data is written to the nearest region first, then asynchronously replicated to the bucket's primary region.`).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 Te={command:`update <bucket-name>`,describe:`Put Local Uploads Configuration`,builder:we,handler:async r=>c({command:`r2 buckets local-uploads update`,classification:{safeFlags:[`enabled`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf r2 buckets local-uploads update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${r[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(r[`bucket-name`]))}/local-uploads`,pathParams:{"bucket-name":String(r[`bucket-name`]??``)},bodyKind:`json`,body:r.body===void 0?f({enabled:r.enabled}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.r2.buckets.localUploads.update({...e,account_id:l,bucket_name:r[`bucket-name`]})),{successLabel:`Updated`});return}if(r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let d=f({enabled:r.enabled});a(await s(`Updating`,async()=>c.r2.buckets.localUploads.update({...d,account_id:l,bucket_name:r[`bucket-name`]})),{successLabel:`Updated`})})},Ee={command:`local-uploads`,describe:`R2 bucket local upload configuration`,builder:e=>e.command(Ce).command(Te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function De(e){return e.usage(`$0 r2 buckets locks delete <bucket-name>
|
|
55
|
+
|
|
56
|
+
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 Oe={command:`delete <bucket-name>`,describe:`Delete Bucket Lock Rules`,builder:De,handler:async l=>c({command:`r2 buckets locks delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets locks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/lock`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();if(l.accountId=d,!await _({force:!!l.force})){process.stderr.write(`Aborted.
|
|
57
|
+
`);return}a(await s(`Deleting`,async()=>r(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/lock`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Deleted`})})};function ke(e){return e.usage(`$0 r2 buckets locks get <bucket-name>
|
|
58
|
+
|
|
59
|
+
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 Ae={command:`get <bucket-name>`,describe:`Get Bucket Lock Rules`,builder:ke,handler:async l=>c({command:`r2 buckets locks get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets locks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/lock`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/lock`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function je(e){return e.usage(`$0 r2 buckets locks update <bucket-name>
|
|
60
|
+
|
|
61
|
+
Set 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(`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(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Me={command:`update <bucket-name>`,describe:`Put Bucket Lock Rules`,builder:je,handler:async p=>c({command:`r2 buckets locks update`,classification:{safeFlags:[`dry-run`]}},p,async()=>{let c={};if(p[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(p[`cf-r2-jurisdiction`])),p.dryRun){o({command:`cf r2 buckets locks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${p[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(p[`bucket-name`]))}/lock`,pathParams:{"bucket-name":String(p[`bucket-name`]??``)},bodyKind:`json`,body:p.body===void 0?f({rules:d(p.rules,`rules`)}):u(p.body)});return}let m=await i(p),h=p.local?e:await t();if(p.accountId=h,p.body){let e=u(p.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(p[`bucket-name`]))}/lock`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`});return}let g={};p.rules!==void 0&&l(g,[`rules`],d(p.rules,`rules`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(p[`bucket-name`]))}/lock`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`})})},Ne={command:`locks`,describe:`Operations for buckets.locks`,builder:e=>e.command(Oe).command(Ae).command(Me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Pe(e){return e.usage(`$0 r2 buckets metrics list
|
|
62
|
+
|
|
63
|
+
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 Fe={command:`list`,describe:`Get Account-Level Metrics`,builder:Pe,handler:async r=>c({command:`r2 buckets metrics list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf r2 buckets metrics list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/metrics`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.r2.buckets.metrics.list({account_id:l})),{successLabel:`Loaded`})})},Ie={command:`metrics`,describe:`Operations for buckets.metrics`,builder:e=>e.command(Fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Le(e){return e.usage("$0 r2 buckets objects bulk-delete\n\nDeletes objects from an R2 bucket. Three modes are supported: 1. **Delete by list** (default): Provide a JSON array of object keys in the request body. All listed objects are deleted; per-key errors are reported in the response. 2. **Delete by prefix**: Provide a non-empty `prefix` query parameter and no request body to delete every object whose key begins with that prefix. 3. **Empty bucket**: Provide the `prefix` query parameter with an empty value (`?prefix=`) and no request body to delete all objects in the bucket. Prefix and empty-bucket requests return a job descriptor. Small jobs can finish synchronously and return `COMPLETED`; larger jobs continue in the background. Poll the returned `id` with the Get Bucket Job endpoint. Objects uploaded after a background job starts are not deleted by that job. Abort active multipart uploads before submitting the request; a synchronously completed job does not abort them. Avoid writing objects or starting multipart uploads while a bucket-emptying job is in progress. Each repeated or concurrent request creates a distinct job. The number of active 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. Remove the event notification rules and retry requests rejected with HTTP 409 / error code 10034. 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. 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:"When present, switches the operation to prefix-delete mode. A non-empty value must\nend in `/` and deletes keys beginning with that prefix. Preserve an empty value\n(`?prefix=`) to empty the entire bucket. Omitting this parameter instead selects\ndelete-by-list mode and requires a JSON request body."}).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:'Required for "delete by list" mode (when `prefix` query parameter is omitted). A JSON array of object keys to delete. Ignored when `prefix` is provided. '})}const Re={command:`bulk-delete`,describe:`Delete Objects or Empty a Bucket`,builder:Le,handler:async l=>c({command:`r2 buckets objects bulk-delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={prefix:l.prefix},d={};if(l[`cf-r2-jurisdiction`]!==void 0&&(d[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l[`cf-r2-data-catalog-check`]!==void 0&&(d[`cf-r2-data-catalog-check`]=String(l[`cf-r2-data-catalog-check`])),l.dryRun){o({command:`cf r2 buckets objects bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/objects`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},query:c,bodyKind:`json`,body:l.body===void 0?void 0:u(l.body)});return}let f=await i(l),p=l.local?e:await t();if(l.accountId=p,!await _({force:!!l.force})){process.stderr.write(`Aborted.
|
|
64
|
+
`);return}if(l.body){let e=u(l.body),t=new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();a(await s(`Deleting`,async()=>r(f,`DELETE`,`/accounts/${p}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/objects${t?`?`+t:``}`,{body:e,headers:Object.keys(d).length>0?d:void 0})),{successLabel:`Deleted`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function ze(e){return e.usage(`$0 r2 buckets objects delete <object-key>
|
|
65
|
+
|
|
66
|
+
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 Be={command:`delete <object-key>`,describe:`Delete Object`,builder:ze,handler:async l=>c({command:`r2 buckets objects delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets objects delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/objects/${l[`object-key`]==null?`<object-key>`:encodeURIComponent(String(l[`object-key`]))}`,pathParams:{"bucket-name":String(l[`bucket-name`]??``),"object-key":String(l[`object-key`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();if(l.accountId=d,!await _({force:!!l.force})){process.stderr.write(`Aborted.
|
|
67
|
+
`);return}a(await s(`Deleting`,async()=>r(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/objects/${encodeURIComponent(String(l[`object-key`]))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Deleted`})})};function Ve(e){return e.usage(`$0 r2 buckets objects get <object-key>
|
|
68
|
+
|
|
69
|
+
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 He={command:`get <object-key>`,describe:`Get Object`,builder:Ve,handler:async r=>c({command:`r2 buckets objects get`,classification:{safeFlags:[`dry-run`,`text`]}},r,async()=>{let a={};if(r[`cf-r2-jurisdiction`]!==void 0&&(a[`cf-r2-jurisdiction`]=String(r[`cf-r2-jurisdiction`])),r[`if-none-match`]!==void 0&&(a[`If-None-Match`]=String(r[`if-none-match`])),r[`if-modified-since`]!==void 0&&(a[`If-Modified-Since`]=String(r[`if-modified-since`])),r.dryRun){o({command:`cf r2 buckets objects get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${r[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(r[`bucket-name`]))}/objects/${r[`object-key`]==null?`<object-key>`:encodeURIComponent(String(r[`object-key`]))}`,pathParams:{"bucket-name":String(r[`bucket-name`]??``),"object-key":String(r[`object-key`]??``)},bodyKind:`none`});return}await i(r);let c=r.local?e:await t();r.accountId=c;let l=await s(`Loading`,async()=>te(`/accounts/${c}/r2/buckets/${encodeURIComponent(String(r[`bucket-name`]))}/objects/${encodeURIComponent(String(r[`object-key`]))}`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));ee(r.text===!0?l.toString(`utf-8`):l)})};function Ue(e){return e.usage(`$0 r2 buckets objects list
|
|
70
|
+
|
|
71
|
+
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 We={command:`list`,describe:`List Objects`,builder:Ue,handler:async l=>c({command:`r2 buckets objects list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={per_page:l[`per-page`],prefix:l.prefix,delimiter:l.delimiter,cursor:l.cursor,start_after:l[`start-after`]},u={};if(l[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets objects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/objects`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},query:c,bodyKind:`none`});return}let d=await i(l),f=l.local?e:await t();l.accountId=f,a(await s(`Loading`,async()=>r(d,`GET`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/objects`,{query:c,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Loaded`})})};function Ge(e){return e.usage(`$0 r2 buckets objects upload <object-key>
|
|
72
|
+
|
|
73
|
+
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 Ke={command:`upload <object-key>`,describe:`Upload Object`,builder:Ge,handler:async l=>c({command:`r2 buckets objects upload`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l[`content-type`]!==void 0&&(c[`Content-Type`]=String(l[`content-type`])),l[`content-length`]!==void 0&&(c[`Content-Length`]=String(l[`content-length`])),l[`cf-r2-storage-class`]!==void 0&&(c[`cf-r2-storage-class`]=String(l[`cf-r2-storage-class`])),l.dryRun){o({command:`cf r2 buckets objects upload`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/objects/${l[`object-key`]==null?`<object-key>`:encodeURIComponent(String(l[`object-key`]))}`,pathParams:{"bucket-name":String(l[`bucket-name`]??``),"object-key":String(l[`object-key`]??``)},bodyKind:`octet-stream`,body:l.body});return}let u=await i(l),d=l.local?e:await t();if(l.accountId=d,l.file){let e=m(l.file);a(await s(`Updating`,async()=>r(u,`PUT`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/objects/${encodeURIComponent(String(l[`object-key`]))}`,{body:e,headers:{"Content-Type":`application/octet-stream`,...Object.keys(c).length>0?c:void 0}})),{successLabel:`Updated`});return}if(l.body){let e=p(l.body,`body`,`binary`);a(await s(`Updating`,async()=>r(u,`PUT`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/objects/${encodeURIComponent(String(l[`object-key`]))}`,{body:e,headers:{"Content-Type":`application/octet-stream`,...c}})),{successLabel:`Updated`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},qe={command:`objects`,describe:`Operations for buckets.objects`,builder:e=>e.command(Re).command(Be).command(He).command(We).command(Ke).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Je(e){return e.usage(`$0 r2 buckets sippy delete <bucket-name>
|
|
74
|
+
|
|
75
|
+
Disables Sippy on this 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 Ye={command:`delete <bucket-name>`,describe:`Disable Sippy`,builder:Je,handler:async l=>c({command:`r2 buckets sippy delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets sippy delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/sippy`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();if(l.accountId=d,!await _({force:!!l.force})){process.stderr.write(`Aborted.
|
|
76
|
+
`);return}a(await s(`Deleting`,async()=>r(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/sippy`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Deleted`})})};function Xe(e){return e.usage(`$0 r2 buckets sippy get <bucket-name>
|
|
77
|
+
|
|
78
|
+
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 Ze={command:`get <bucket-name>`,describe:`Get Sippy Configuration`,builder:Xe,handler:async l=>c({command:`r2 buckets sippy get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets sippy get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/sippy`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/sippy`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function Qe(e){return e.usage(`$0 r2 buckets sippy update <bucket-name>
|
|
79
|
+
|
|
80
|
+
Sets 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(`destination-access-key-id`,{type:`string`,description:`ID of a Cloudflare API token.
|
|
81
|
+
This is the value labelled "Access Key ID" when creating an API.
|
|
82
|
+
token from the [R2 dashboard](https://dash.cloudflare.com/?to=/:account/r2/api-tokens).
|
|
83
|
+
|
|
84
|
+
Sippy will use this token when writing objects to R2, so it is
|
|
85
|
+
best to scope this token to the bucket you're enabling Sippy for.
|
|
86
|
+
`}).option(`destination-provider`,{type:`string`,description:`The destination.provider field`,choices:[`r2`]}).option(`destination-secret-access-key`,{type:`string`,description:`Value of a Cloudflare API token.
|
|
87
|
+
This is the value labelled "Secret Access Key" when creating an API.
|
|
88
|
+
token from the [R2 dashboard](https://dash.cloudflare.com/?to=/:account/r2/api-tokens).
|
|
89
|
+
|
|
90
|
+
Sippy will use this token when writing objects to R2, so it is
|
|
91
|
+
best to scope this token to the bucket you're enabling Sippy for.
|
|
92
|
+
`}).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`]}).option(`source-region`,{type:`string`,description:`Name of the AWS availability zone.`}).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)`}).conflicts(`source-bucket`,[`source-bucket-url`,`source-account-key`,`source-account-name`,`source-container`,`source-sas-token`]).conflicts(`source-region`,[`source-client-email`,`source-private-key`,`source-bucket-url`,`source-account-key`,`source-account-name`,`source-container`,`source-sas-token`]).conflicts(`source-client-email`,[`source-region`,`source-bucket-url`,`source-account-key`,`source-account-name`,`source-container`,`source-sas-token`]).conflicts(`source-private-key`,[`source-region`,`source-bucket-url`,`source-account-key`,`source-account-name`,`source-container`,`source-sas-token`]).conflicts(`source-bucket-url`,[`source-bucket`,`source-region`,`source-client-email`,`source-private-key`,`source-account-key`,`source-account-name`,`source-container`,`source-sas-token`]).conflicts(`source-account-key`,[`source-bucket`,`source-region`,`source-client-email`,`source-private-key`,`source-bucket-url`]).conflicts(`source-account-name`,[`source-bucket`,`source-region`,`source-client-email`,`source-private-key`,`source-bucket-url`]).conflicts(`source-container`,[`source-bucket`,`source-region`,`source-client-email`,`source-private-key`,`source-bucket-url`]).conflicts(`source-sas-token`,[`source-bucket`,`source-region`,`source-client-email`,`source-private-key`,`source-bucket-url`])}const $e={command:`update <bucket-name>`,describe:`Enable Sippy`,builder:Qe,handler:async d=>c({command:`r2 buckets sippy update`,classification:{safeFlags:[`destination-provider`,`source-provider`,`dry-run`]}},d,async()=>{let c={};if(d[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(d[`cf-r2-jurisdiction`])),d.dryRun){o({command:`cf r2 buckets sippy update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${d[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(d[`bucket-name`]))}/sippy`,pathParams:{"bucket-name":String(d[`bucket-name`]??``)},bodyKind:`json`,body:d.body===void 0?f({destination:{accessKeyId:p(d[`destination-access-key-id`],`destination-access-key-id`,`text`),provider:p(d[`destination-provider`],`destination-provider`,`text`),secretAccessKey:p(d[`destination-secret-access-key`],`destination-secret-access-key`,`text`)},source:{accessKeyId:p(d[`source-access-key-id`],`source-access-key-id`,`text`),bucket:p(d[`source-bucket`],`source-bucket`,`text`),provider:p(d[`source-provider`],`source-provider`,`text`),region:p(d[`source-region`],`source-region`,`text`),secretAccessKey:p(d[`source-secret-access-key`],`source-secret-access-key`,`text`),clientEmail:p(d[`source-client-email`],`source-client-email`,`text`),privateKey:p(d[`source-private-key`],`source-private-key`,`text`),bucketUrl:p(d[`source-bucket-url`],`source-bucket-url`,`text`),accountKey:p(d[`source-account-key`],`source-account-key`,`text`),accountName:p(d[`source-account-name`],`source-account-name`,`text`),container:p(d[`source-container`],`source-container`,`text`),sasToken:p(d[`source-sas-token`],`source-sas-token`,`text`)}}):u(d.body)});return}let m=await i(d),h=d.local?e:await t();if(d.accountId=h,d.body){let e=u(d.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/sippy`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`});return}let g={};d[`destination-access-key-id`]!==void 0&&l(g,[`destination`,`accessKeyId`],p(d[`destination-access-key-id`],`destination-access-key-id`,`text`)),d[`destination-provider`]!==void 0&&l(g,[`destination`,`provider`],p(d[`destination-provider`],`destination-provider`,`text`)),d[`destination-secret-access-key`]!==void 0&&l(g,[`destination`,`secretAccessKey`],p(d[`destination-secret-access-key`],`destination-secret-access-key`,`text`)),d[`source-access-key-id`]!==void 0&&l(g,[`source`,`accessKeyId`],p(d[`source-access-key-id`],`source-access-key-id`,`text`)),d[`source-bucket`]!==void 0&&l(g,[`source`,`bucket`],p(d[`source-bucket`],`source-bucket`,`text`)),d[`source-provider`]!==void 0&&l(g,[`source`,`provider`],p(d[`source-provider`],`source-provider`,`text`)),d[`source-region`]!==void 0&&l(g,[`source`,`region`],p(d[`source-region`],`source-region`,`text`)),d[`source-secret-access-key`]!==void 0&&l(g,[`source`,`secretAccessKey`],p(d[`source-secret-access-key`],`source-secret-access-key`,`text`)),d[`source-client-email`]!==void 0&&l(g,[`source`,`clientEmail`],p(d[`source-client-email`],`source-client-email`,`text`)),d[`source-private-key`]!==void 0&&l(g,[`source`,`privateKey`],p(d[`source-private-key`],`source-private-key`,`text`)),d[`source-bucket-url`]!==void 0&&l(g,[`source`,`bucketUrl`],p(d[`source-bucket-url`],`source-bucket-url`,`text`)),d[`source-account-key`]!==void 0&&l(g,[`source`,`accountKey`],p(d[`source-account-key`],`source-account-key`,`text`)),d[`source-account-name`]!==void 0&&l(g,[`source`,`accountName`],p(d[`source-account-name`],`source-account-name`,`text`)),d[`source-container`]!==void 0&&l(g,[`source`,`container`],p(d[`source-container`],`source-container`,`text`)),d[`source-sas-token`]!==void 0&&l(g,[`source`,`sasToken`],p(d[`source-sas-token`],`source-sas-token`,`text`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/sippy`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Updated`})})},et={command:`sippy`,describe:`Operations for buckets.sippy`,builder:e=>e.command(Ye).command(Ze).command($e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function tt(e){return e.usage(`$0 r2 buckets storage-class-migration-jobs create <bucket-name>
|
|
93
|
+
|
|
94
|
+
Creates a storage-class migration background job for an 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(`destination-storage-class`,{type:`string`,description:`The destinationStorageClass field`,choices:[`Standard`,`InfrequentAccess`]}).option(`job-type`,{type:`string`,description:`The jobType field`,choices:[`storageClassMigration`]}).option(`source-storage-class`,{type:`string`,description:`The sourceStorageClass field`,choices:[`Standard`,`InfrequentAccess`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Creates a storage-class migration background job. Direction fields must be provided together and must differ. Omitting both defaults to InfrequentAccess to Standard. `})}const nt={command:`create <bucket-name>`,describe:`Create a Storage Class Migration Job`,builder:tt,handler:async d=>c({command:`r2 buckets storage-class-migration-jobs create`,classification:{safeFlags:[`destination-storage-class`,`job-type`,`source-storage-class`,`dry-run`]}},d,async()=>{let c={};if(d[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(d[`cf-r2-jurisdiction`])),d.dryRun){o({command:`cf r2 buckets storage-class-migration-jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${d[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(d[`bucket-name`]))}/storage-class-migration-jobs`,pathParams:{"bucket-name":String(d[`bucket-name`]??``)},bodyKind:`json`,body:d.body===void 0?f({destinationStorageClass:p(d[`destination-storage-class`],`destination-storage-class`,`text`),jobType:p(d[`job-type`],`job-type`,`text`),sourceStorageClass:p(d[`source-storage-class`],`source-storage-class`,`text`)}):u(d.body)});return}let m=await i(d),h=d.local?e:await t();if(d.accountId=h,d.body){let e=u(d.body);a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/storage-class-migration-jobs`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`});return}d[`job-type`]===void 0&&(d[`job-type`]=await g(`job-type`,`The jobType field`,[`storageClassMigration`]));let _={};d[`destination-storage-class`]!==void 0&&l(_,[`destinationStorageClass`],p(d[`destination-storage-class`],`destination-storage-class`,`text`)),d[`job-type`]!==void 0&&l(_,[`jobType`],p(d[`job-type`],`job-type`,`text`)),d[`source-storage-class`]!==void 0&&l(_,[`sourceStorageClass`],p(d[`source-storage-class`],`source-storage-class`,`text`)),a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/storage-class-migration-jobs`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`})})};function rt(e){return e.usage(`$0 r2 buckets storage-class-migration-jobs get <job-id>
|
|
95
|
+
|
|
96
|
+
Gets the current status of a storage-class migration job.`).positional(`job-id`,{type:`string`,description:`Identifier returned when the migration 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 it={command:`get <job-id>`,describe:`Get Storage Class Migration Job`,builder:rt,handler:async l=>c({command:`r2 buckets storage-class-migration-jobs get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`cf-r2-jurisdiction`]!==void 0&&(c[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets storage-class-migration-jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/storage-class-migration-jobs/${l[`job-id`]==null?`<job-id>`:encodeURIComponent(String(l[`job-id`]))}`,pathParams:{"bucket-name":String(l[`bucket-name`]??``),"job-id":String(l[`job-id`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/storage-class-migration-jobs/${encodeURIComponent(String(l[`job-id`]))}`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})};function at(e){return e.usage(`$0 r2 buckets storage-class-migration-jobs list
|
|
97
|
+
|
|
98
|
+
Lists storage-class migration jobs for an R2 bucket.`).option(`bucket-name`,{type:`string`,description:`Name of the bucket.`,demandOption:!0}).option(`status`,{type:`string`,description:`Restricts results to jobs with the specified status.`,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 ot={command:`list`,describe:`List Storage Class Migration Jobs`,builder:at,handler:async l=>c({command:`r2 buckets storage-class-migration-jobs list`,classification:{safeFlags:[`status`,`dry-run`]}},l,async()=>{let c={status:l.status,maxKeys:l[`max-keys`],continuationToken:l[`continuation-token`]},u={};if(l[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets storage-class-migration-jobs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/storage-class-migration-jobs`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},query:c,bodyKind:`none`});return}let d=await i(l),f=l.local?e:await t();l.accountId=f,a(await s(`Loading`,async()=>r(d,`GET`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/storage-class-migration-jobs`,{query:c,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Loaded`})})},st={command:`storage-class-migration-jobs`,describe:`Operations for buckets.storage-class-migration-jobs`,builder:e=>e.command(nt).command(it).command(ot).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ct={command:`buckets`,describe:`Create and configure R2 buckets including CORS, lifecycle, custom domains, event notifications, and object locks`,builder:e=>e.command(O).command(E).command(A).command(Y).command(le).command(xe).command(w).command(q).command(se).command(me).command(ye).command(Ee).command(Ne).command(Ie).command(qe).command(et).command(st).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function lt(e){return e.usage(`$0 r2 super-slurper connectivity-precheck source
|
|
99
|
+
|
|
100
|
+
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`]}).option(`jurisdiction`,{type:`string`,description:`The jurisdiction field`,choices:[`default`,`eu`,`us`,`fedramp`]}).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`]).conflicts(`region`,[`secret-client-email`,`secret-private-key`,`jurisdiction`]).conflicts(`secret-access-key-id`,[`secret-client-email`,`secret-private-key`]).conflicts(`secret-secret-access-key`,[`secret-client-email`,`secret-private-key`]).conflicts(`secret-client-email`,[`endpoint`,`region`,`secret-access-key-id`,`secret-secret-access-key`,`jurisdiction`]).conflicts(`secret-private-key`,[`endpoint`,`region`,`secret-access-key-id`,`secret-secret-access-key`,`jurisdiction`]).conflicts(`jurisdiction`,[`endpoint`,`region`,`secret-client-email`,`secret-private-key`])}const ut={command:`source`,describe:`Check source connectivity`,builder:lt,handler:async r=>c({command:`r2 super-slurper connectivity-precheck source`,classification:{safeFlags:[`vendor`,`jurisdiction`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf r2 super-slurper connectivity-precheck source`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/source/connectivity-precheck`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({bucket:p(r.bucket,`bucket`,`text`),endpoint:p(r.endpoint,`endpoint`,`text`),keys:r.keys,pathPrefix:p(r[`path-prefix`],`path-prefix`,`text`),region:p(r.region,`region`,`text`),secret:{accessKeyId:p(r[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:p(r[`secret-secret-access-key`],`secret-secret-access-key`,`text`),clientEmail:p(r[`secret-client-email`],`secret-client-email`,`text`),privateKey:p(r[`secret-private-key`],`secret-private-key`,`text`)},vendor:p(r.vendor,`vendor`,`text`),jurisdiction:p(r.jurisdiction,`jurisdiction`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.r2.superSlurper.connectivityPrecheck.source({body:e,account_id:l})),{successLabel:`Updated`});return}r.bucket===void 0&&(r.bucket=await h(`bucket`,`The bucket field`)),r.vendor===void 0&&(r.vendor=await g(`vendor`,`The vendor field`,[`s3`,`gcs`,`r2`]));let d=f({bucket:p(r.bucket,`bucket`,`text`),endpoint:p(r.endpoint,`endpoint`,`text`),keys:r.keys,pathPrefix:p(r[`path-prefix`],`path-prefix`,`text`),region:p(r.region,`region`,`text`),secret:{accessKeyId:p(r[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:p(r[`secret-secret-access-key`],`secret-secret-access-key`,`text`),clientEmail:p(r[`secret-client-email`],`secret-client-email`,`text`),privateKey:p(r[`secret-private-key`],`secret-private-key`,`text`)},vendor:p(r.vendor,`vendor`,`text`),jurisdiction:p(r.jurisdiction,`jurisdiction`,`text`)});a(await s(`Updating`,async()=>c.r2.superSlurper.connectivityPrecheck.source({body:d,account_id:l})),{successLabel:`Updated`})})};function dt(e){return e.usage(`$0 r2 super-slurper connectivity-precheck target
|
|
101
|
+
|
|
102
|
+
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`]}).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`]}).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 ft={command:`target`,describe:`Check target connectivity`,builder:dt,handler:async r=>c({command:`r2 super-slurper connectivity-precheck target`,classification:{safeFlags:[`jurisdiction`,`vendor`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf r2 super-slurper connectivity-precheck target`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/target/connectivity-precheck`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({bucket:p(r.bucket,`bucket`,`text`),jurisdiction:p(r.jurisdiction,`jurisdiction`,`text`),secret:{accessKeyId:p(r[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:p(r[`secret-secret-access-key`],`secret-secret-access-key`,`text`)},vendor:p(r.vendor,`vendor`,`text`)}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Updating`,async()=>c.r2.superSlurper.connectivityPrecheck.target({body:e,account_id:l})),{successLabel:`Updated`});return}r.bucket===void 0&&(r.bucket=await h(`bucket`,`The bucket field`)),r[`secret-access-key-id`]===void 0&&(r[`secret-access-key-id`]=await h(`secret-access-key-id`,`The secret.accessKeyId field`)),r[`secret-secret-access-key`]===void 0&&(r[`secret-secret-access-key`]=await h(`secret-secret-access-key`,`The secret.secretAccessKey field`,{kind:`secret`})),r.vendor===void 0&&(r.vendor=await g(`vendor`,`The vendor field`,[`r2`]));let d=f({bucket:p(r.bucket,`bucket`,`text`),jurisdiction:p(r.jurisdiction,`jurisdiction`,`text`),secret:{accessKeyId:p(r[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:p(r[`secret-secret-access-key`],`secret-secret-access-key`,`text`)},vendor:p(r.vendor,`vendor`,`text`)});a(await s(`Updating`,async()=>c.r2.superSlurper.connectivityPrecheck.target({body:d,account_id:l})),{successLabel:`Updated`})})},pt={command:`connectivity-precheck`,describe:`Operations for super-slurper.connectivity-precheck`,builder:e=>e.command(ut).command(ft).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function mt(e){return e.usage(`$0 r2 super-slurper jobs abort-all
|
|
103
|
+
|
|
104
|
+
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 ht={command:`abort-all`,describe:`Abort all jobs`,builder:mt,handler:async r=>c({command:`r2 super-slurper jobs abort-all`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf r2 super-slurper jobs abort-all`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs/abortAll`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await _({force:!!r.force,message:`This operation stops every running migration job.`})){process.stderr.write(`Aborted.
|
|
105
|
+
`);return}a(await s(`Deleting`,async()=>c.r2.superSlurper.jobs.abortAll({account_id:l})),{successLabel:`Deleted`})})};function gt(e){return e.usage(`$0 r2 super-slurper jobs abort <job-id>
|
|
106
|
+
|
|
107
|
+
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 _t={command:`abort <job-id>`,describe:`Abort a job`,builder:gt,handler:async r=>c({command:`r2 super-slurper jobs abort`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf r2 super-slurper jobs abort`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs/${r[`job-id`]==null?`<job-id>`:encodeURIComponent(String(r[`job-id`]))}/abort`,pathParams:{"job-id":String(r[`job-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await _({force:!!r.force,message:`This operation stops a running migration job.`})){process.stderr.write(`Aborted.
|
|
108
|
+
`);return}a(await s(`Deleting`,async()=>c.r2.superSlurper.jobs.abort({account_id:l,job_id:r[`job-id`]})),{successLabel:`Deleted`})})};function vt(e){return e.usage(`$0 r2 super-slurper jobs create
|
|
109
|
+
|
|
110
|
+
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`]}).option(`source-jurisdiction`,{type:`string`,description:`The source.jurisdiction field`,choices:[`default`,`eu`,`us`,`fedramp`]}).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`]}).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`]}).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`]).conflicts(`source-region`,[`source-secret-client-email`,`source-secret-private-key`,`source-jurisdiction`]).conflicts(`source-secret-access-key-id`,[`source-secret-client-email`,`source-secret-private-key`]).conflicts(`source-secret-secret-access-key`,[`source-secret-client-email`,`source-secret-private-key`]).conflicts(`source-secret-client-email`,[`source-endpoint`,`source-region`,`source-secret-access-key-id`,`source-secret-secret-access-key`,`source-jurisdiction`]).conflicts(`source-secret-private-key`,[`source-endpoint`,`source-region`,`source-secret-access-key-id`,`source-secret-secret-access-key`,`source-jurisdiction`]).conflicts(`source-jurisdiction`,[`source-endpoint`,`source-region`,`source-secret-client-email`,`source-secret-private-key`]).check(e=>{if([`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)){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=>{if([`target-bucket`,`target-jurisdiction`,`target-secret-access-key-id`,`target-secret-secret-access-key`,`target-vendor`].some(t=>e[t]!==void 0)){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 yt={command:`create`,describe:`Create a job`,builder:vt,handler:async r=>c({command:`r2 super-slurper jobs create`,classification:{safeFlags:[`overwrite`,`source-vendor`,`source-jurisdiction`,`target-jurisdiction`,`target-vendor`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf r2 super-slurper jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({overwrite:r.overwrite,source:{bucket:p(r[`source-bucket`],`source-bucket`,`text`),endpoint:p(r[`source-endpoint`],`source-endpoint`,`text`),keys:r[`source-keys`],pathPrefix:p(r[`source-path-prefix`],`source-path-prefix`,`text`),region:p(r[`source-region`],`source-region`,`text`),secret:{accessKeyId:p(r[`source-secret-access-key-id`],`source-secret-access-key-id`,`text`),secretAccessKey:p(r[`source-secret-secret-access-key`],`source-secret-secret-access-key`,`text`),clientEmail:p(r[`source-secret-client-email`],`source-secret-client-email`,`text`),privateKey:p(r[`source-secret-private-key`],`source-secret-private-key`,`text`)},vendor:p(r[`source-vendor`],`source-vendor`,`text`),jurisdiction:p(r[`source-jurisdiction`],`source-jurisdiction`,`text`)},target:{bucket:p(r[`target-bucket`],`target-bucket`,`text`),jurisdiction:p(r[`target-jurisdiction`],`target-jurisdiction`,`text`),secret:{accessKeyId:p(r[`target-secret-access-key-id`],`target-secret-access-key-id`,`text`),secretAccessKey:p(r[`target-secret-secret-access-key`],`target-secret-secret-access-key`,`text`)},vendor:p(r[`target-vendor`],`target-vendor`,`text`)}}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.r2.superSlurper.jobs.create({...e,account_id:l})),{successLabel:`Created`});return}let d=f({overwrite:r.overwrite,source:{bucket:p(r[`source-bucket`],`source-bucket`,`text`),endpoint:p(r[`source-endpoint`],`source-endpoint`,`text`),keys:r[`source-keys`],pathPrefix:p(r[`source-path-prefix`],`source-path-prefix`,`text`),region:p(r[`source-region`],`source-region`,`text`),secret:{accessKeyId:p(r[`source-secret-access-key-id`],`source-secret-access-key-id`,`text`),secretAccessKey:p(r[`source-secret-secret-access-key`],`source-secret-secret-access-key`,`text`),clientEmail:p(r[`source-secret-client-email`],`source-secret-client-email`,`text`),privateKey:p(r[`source-secret-private-key`],`source-secret-private-key`,`text`)},vendor:p(r[`source-vendor`],`source-vendor`,`text`),jurisdiction:p(r[`source-jurisdiction`],`source-jurisdiction`,`text`)},target:{bucket:p(r[`target-bucket`],`target-bucket`,`text`),jurisdiction:p(r[`target-jurisdiction`],`target-jurisdiction`,`text`),secret:{accessKeyId:p(r[`target-secret-access-key-id`],`target-secret-access-key-id`,`text`),secretAccessKey:p(r[`target-secret-secret-access-key`],`target-secret-secret-access-key`,`text`)},vendor:p(r[`target-vendor`],`target-vendor`,`text`)}});a(await s(`Creating`,async()=>c.r2.superSlurper.jobs.create({...d,account_id:l})),{successLabel:`Created`})})};function bt(e){return e.usage(`$0 r2 super-slurper jobs delete <job-id>
|
|
111
|
+
|
|
112
|
+
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 xt={command:`delete <job-id>`,describe:`Delete a job`,builder:bt,handler:async r=>c({command:`r2 super-slurper jobs delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf r2 super-slurper jobs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs/${r[`job-id`]==null?`<job-id>`:encodeURIComponent(String(r[`job-id`]))}`,pathParams:{"job-id":String(r[`job-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await _({force:!!r.force})){process.stderr.write(`Aborted.
|
|
113
|
+
`);return}a(await s(`Deleting`,async()=>c.r2.superSlurper.jobs.delete({account_id:l,job_id:r[`job-id`]})),{successLabel:`Deleted`})})};function St(e){return e.usage(`$0 r2 super-slurper jobs get <job-id>
|
|
114
|
+
|
|
115
|
+
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 Ct={command:`get <job-id>`,describe:`Get job details`,builder:St,handler:async r=>c({command:`r2 super-slurper jobs get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf r2 super-slurper jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs/${r[`job-id`]==null?`<job-id>`:encodeURIComponent(String(r[`job-id`]))}`,pathParams:{"job-id":String(r[`job-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.r2.superSlurper.jobs.get({account_id:l,job_id:r[`job-id`]})),{successLabel:`Loaded`})})};function wt(e){return e.usage(`$0 r2 super-slurper jobs list
|
|
116
|
+
|
|
117
|
+
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 Tt={command:`list`,describe:`List jobs`,builder:wt,handler:async r=>c({command:`r2 super-slurper jobs list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={limit:r.limit,offset:r.offset};if(r.dryRun){o({command:`cf r2 super-slurper jobs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.r2.superSlurper.jobs.list({account_id:u,...c})),{successLabel:`Loaded`})})};function Et(e){return e.usage(`$0 r2 super-slurper jobs logs list
|
|
118
|
+
|
|
119
|
+
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 $={command:`list`,describe:`Get job logs`,builder:Et,handler:async r=>c({command:`r2 super-slurper jobs logs list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={limit:r.limit,offset:r.offset};if(r.dryRun){o({command:`cf r2 super-slurper jobs logs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs/${r[`job-id`]==null?`<job-id>`:encodeURIComponent(String(r[`job-id`]))}/logs`,pathParams:{"job-id":String(r[`job-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.r2.superSlurper.jobs.logs.list({account_id:u,job_id:r[`job-id`],...c})),{successLabel:`Loaded`})})},Dt={command:`logs`,describe:`Operations for super-slurper.jobs.logs`,builder:e=>e.command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ot(e){return e.usage(`$0 r2 super-slurper jobs pause <job-id>
|
|
120
|
+
|
|
121
|
+
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 kt={command:`pause <job-id>`,describe:`Pause a job`,builder:Ot,handler:async r=>c({command:`r2 super-slurper jobs pause`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf r2 super-slurper jobs pause`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs/${r[`job-id`]==null?`<job-id>`:encodeURIComponent(String(r[`job-id`]))}/pause`,pathParams:{"job-id":String(r[`job-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Updating`,async()=>c.r2.superSlurper.jobs.pause({account_id:l,job_id:r[`job-id`]})),{successLabel:`Updated`})})};function At(e){return e.usage(`$0 r2 super-slurper jobs progress <job-id>
|
|
122
|
+
|
|
123
|
+
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 jt={command:`progress <job-id>`,describe:`Get job progress`,builder:At,handler:async r=>c({command:`r2 super-slurper jobs progress`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf r2 super-slurper jobs progress`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs/${r[`job-id`]==null?`<job-id>`:encodeURIComponent(String(r[`job-id`]))}/progress`,pathParams:{"job-id":String(r[`job-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.r2.superSlurper.jobs.progress({account_id:l,job_id:r[`job-id`]})),{successLabel:`Loaded`})})};function Mt(e){return e.usage(`$0 r2 super-slurper jobs resume <job-id>
|
|
124
|
+
|
|
125
|
+
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 Nt={command:`resume <job-id>`,describe:`Resume a job`,builder:Mt,handler:async r=>c({command:`r2 super-slurper jobs resume`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf r2 super-slurper jobs resume`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/slurper/jobs/${r[`job-id`]==null?`<job-id>`:encodeURIComponent(String(r[`job-id`]))}/resume`,pathParams:{"job-id":String(r[`job-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Updating`,async()=>c.r2.superSlurper.jobs.resume({account_id:l,job_id:r[`job-id`]})),{successLabel:`Updated`})})},Pt={command:`jobs`,describe:`Operations for super-slurper.jobs`,builder:e=>e.command(_t).command(ht).command(yt).command(xt).command(Ct).command(Tt).command(kt).command(jt).command(Nt).command(Dt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ft={command:`super-slurper`,describe:`Migrate data from external S3-compatible storage into R2 buckets with resumable transfer jobs`,builder:e=>e.command(pt).command(Pt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function It(e){return e.usage(`$0 r2 temporary-credentials create
|
|
126
|
+
|
|
127
|
+
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:`The parent access key id to use for signing.`}).option(`permission`,{type:`string`,description:`Permissions allowed on the credentials.`,choices:[`admin-read-write`,`admin-read-only`,`object-read-write`,`object-read-only`]}).option(`prefixes`,{type:`string`,array:!0,description:`Optional prefix paths to scope the credentials to.`}).option(`ttl-seconds`,{type:`number`,description:`How long the credentials will live for in seconds.`,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 Lt={command:`create`,describe:`Create Temporary Access Credentials`,builder:It,handler:async r=>c({command:`r2 temporary-credentials create`,classification:{safeFlags:[`permission`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf r2 temporary-credentials create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/temp-access-credentials`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({bucket:p(r.bucket,`bucket`,`text`),objects:r.objects,parentAccessKeyId:p(r[`parent-access-key-id`],`parent-access-key-id`,`text`),permission:p(r.permission,`permission`,`text`),prefixes:r.prefixes,ttlSeconds:r[`ttl-seconds`]}):u(r.body)});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=u(r.body);a(await s(`Creating`,async()=>c.r2.temporaryCredentials.create({...e,account_id:l})),{successLabel:`Created`});return}if(r.bucket===void 0&&(r.bucket=await h(`bucket`,`Name of the R2 bucket.`)),r[`parent-access-key-id`]===void 0&&(r[`parent-access-key-id`]=await h(`parent-access-key-id`,`The parent access key id to use for signing.`)),r.permission===void 0&&(r.permission=await g(`permission`,`Permissions allowed on the credentials.`,[`admin-read-write`,`admin-read-only`,`object-read-write`,`object-read-only`])),r[`ttl-seconds`]===void 0)throw Error(`--ttl-seconds is required (or pass --body with this field set).`);let d=f({bucket:p(r.bucket,`bucket`,`text`),objects:r.objects,parentAccessKeyId:p(r[`parent-access-key-id`],`parent-access-key-id`,`text`),permission:p(r.permission,`permission`,`text`),prefixes:r.prefixes,ttlSeconds:r[`ttl-seconds`]});a(await s(`Creating`,async()=>c.r2.temporaryCredentials.create({...d,account_id:l})),{successLabel:`Created`})})},Rt={command:`temporary-credentials`,describe:`Generate short-lived S3-compatible credentials scoped to specific buckets and operations`,builder:e=>e.command(Lt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},zt={command:`r2`,describe:`S3-compatible object storage with zero egress fees — buckets, lifecycle rules, event notifications, and data migration`,builder:e=>e.command(ct).command(Ft).command(Rt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{zt as default};
|