cf 0.10.0 → 0.12.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/README.md +15 -5
- package/dist/_meta/agent-context.json +13 -5
- package/dist/_meta/commands.json +2393 -262
- package/dist/_meta/hand-written-commands.json +960 -0
- package/dist/_meta/schemas.json +1882 -155
- package/dist/{abuse-reports-CGF4zcKf.mjs → abuse-reports-D40QFl-y.mjs} +2 -2
- package/dist/{access-lhLJo1v2.mjs → access-Dl2IU1ID.mjs} +1 -1
- package/dist/account-CPbieCZ4.mjs +2 -0
- package/dist/{account-tags-B88TotoH.mjs → account-tags-skfP7H8k.mjs} +4 -4
- package/dist/{accounts-BSIAT_iP.mjs → accounts-CSgR6909.mjs} +12 -12
- package/dist/{acm-VULm1djv.mjs → acm-CVvCTaNk.mjs} +1 -1
- package/dist/{addressing-BHPBIkRY.mjs → addressing-Uq5hEDDP.mjs} +11 -11
- package/dist/{agent-context-KBy48G1b.mjs → agent-context-BvuDdaJb.mjs} +1 -1
- package/dist/agent-memory-BrHMIU0E.mjs +6 -0
- package/dist/ai-audit-BoZuL84i.mjs +2 -0
- package/dist/ai-gateway-DE50Jem1.mjs +13 -0
- package/dist/ai-search-Fx7NHCHB.mjs +7 -0
- package/dist/ai-security-DyLbY9kv.mjs +4 -0
- package/dist/ai-v2fP1r0s.mjs +5 -0
- package/dist/{alerting-Bl8OqViR.mjs → alerting-5mFZjTcD.mjs} +1 -1
- package/dist/analytics-BygTfozw.mjs +3 -0
- package/dist/analytics_engine-4L-q362P.mjs +2 -0
- package/dist/{api-security-4FVrD4n8.mjs → api-security-DjFsRYWx.mjs} +20 -20
- package/dist/argo-TzXPN7tz.mjs +2 -0
- package/dist/args-CDgWUP4J.mjs +2 -0
- package/dist/{artifacts-CVDGnr2V.mjs → artifacts-dEw2UUBV.mjs} +1 -1
- package/dist/audit-logs-CqY7zzwv.mjs +2 -0
- package/dist/auth-CPLdkOC7.mjs +5 -0
- package/dist/{auth-MQEamPN9.mjs → auth-DY_Y2bXC.mjs} +3 -3
- package/dist/billing-DHQuRT8S.mjs +3 -0
- package/dist/body-parser-BGVbwPeM.mjs +2 -0
- package/dist/bot-management-CfqG79hF.mjs +5 -0
- package/dist/botnet-feed-BOeNnDoH.mjs +3 -0
- package/dist/brand-protection-DYttrKIM.mjs +3 -0
- package/dist/{browser-extension-BtpCbh-2.mjs → browser-extension-CTUCdgfn.mjs} +1 -1
- package/dist/browser-run-373D4e1i.mjs +4 -0
- package/dist/build-D0ir_S70.mjs +2 -0
- package/dist/{cache-VyWK1SjY.mjs → cache-DJXBmc3w.mjs} +1 -1
- package/dist/{calls-BxoRYxs4.mjs → calls-COO0Eoz1.mjs} +1 -1
- package/dist/certificate-authorities-DbHLmKbd.mjs +2 -0
- package/dist/cf-yPz_IqW6.mjs +18 -0
- package/dist/chunk-LQW53VED-9MACsvSG.mjs +119 -0
- package/dist/chunk-QBZBEHZB-yeyhVUeD.mjs +2 -0
- package/dist/{client-certificates-DDUv8K0a.mjs → client-certificates-RBRqYP3f.mjs} +1 -1
- package/dist/{client-side-security-D4ysjwWT.mjs → client-side-security-HOmA37et.mjs} +1 -1
- package/dist/cloud-connector-C7hw1c1f.mjs +2 -0
- package/dist/cloudforce-one-DLOj76q4.mjs +36 -0
- package/dist/command-BV87D4tR.mjs +2 -0
- package/dist/{completions-BHE4pRjB.mjs → completions-BnD46cXe.mjs} +3 -3
- package/dist/config.d.mts +1451 -1366
- package/dist/config.mjs +1 -1
- package/dist/connector-interrupts-DY-z_LrH.mjs +2 -0
- package/dist/connector-telemetry-events-DCXmcAc9.mjs +2 -0
- package/dist/connector-telemetry-snapshots-D8GNuzx3.mjs +2 -0
- package/dist/{connectors-BqxYMMtQ.mjs → connectors-fEOn-J_i.mjs} +1 -1
- package/dist/containers-BDBsEs7-.mjs +58 -0
- package/dist/{content-scan-Dgd7A8KF.mjs → content-scan-Cmj9--XY.mjs} +1 -1
- package/dist/{csamScanner-DYL37wLc.mjs → csamScanner-BRXyMCyH.mjs} +1 -1
- package/dist/{ct-alerting-CkhSbfAs.mjs → ct-alerting-9AvYys-f.mjs} +1 -1
- package/dist/custom-certificates-C5qrlyhb.mjs +5 -0
- package/dist/custom-csrs-BgOnTbBW.mjs +3 -0
- package/dist/{custom-hostnames-q_nsnlye.mjs → custom-hostnames-CbQD9aYo.mjs} +1 -1
- package/dist/custom-nameservers-2ZajBkRC.mjs +3 -0
- package/dist/custom-pages-Buki_Cb8.mjs +3 -0
- package/dist/d1-n2in0cSF.mjs +20 -0
- package/dist/data-security-DzOQMkv3.mjs +7 -0
- package/dist/dcv-delegation-BTP9LCOm.mjs +2 -0
- package/dist/delegate.mjs +1 -1
- package/dist/deploy-BUSz35vq.mjs +2 -0
- package/dist/deploy-input-BvD9aRP1.mjs +2 -0
- package/dist/dev-DY_DquQx.mjs +4 -0
- package/dist/{diagnostics-BTH-8nJH.mjs → diagnostics-BvHV8kQb.mjs} +1 -1
- package/dist/{directory-BlH6N6Qy.mjs → directory-BeiSyg8A.mjs} +1 -1
- package/dist/{dispatch-namespaces-BCjH1JzB.mjs → dispatch-namespaces-Dp8Jjpwy.mjs} +1 -1
- package/dist/dist-BBx1io2f.mjs +2 -0
- package/dist/dist-Cb9TJ2VV.mjs +9 -0
- package/dist/dist-DV7LR38l.mjs +387 -0
- package/dist/dist-DvizctjW.mjs +48 -0
- package/dist/{dls-BF5iN78p.mjs → dls-BwoU29mS.mjs} +1 -1
- package/dist/{dns-CeCTNqRk.mjs → dns-DISAfuzj.mjs} +13 -13
- package/dist/{dns-firewall-B54MaLGm.mjs → dns-firewall-wBcCx_ua.mjs} +1 -1
- package/dist/{dot-prop-6SRZBKHT-wIVDg_fl.mjs → dot-prop-6SRZBKHT-wwGHcwAa.mjs} +1 -1
- package/dist/dry-run-ILZRVpnp.mjs +2 -0
- package/dist/durable-objects-DhDL3San.mjs +2 -0
- package/dist/email-auth-BROqK6-C.mjs +2 -0
- package/dist/email-routing-BZXHDAOO.mjs +6 -0
- package/dist/email-security-DVumybrk.mjs +18 -0
- package/dist/email-sending-CDQ3_wyz.mjs +7 -0
- package/dist/fieldExtractors-Cy1rxHEF.mjs +3 -0
- package/dist/{firewall-CBPGJ43p.mjs → firewall-C0g5X7Zd.mjs} +9 -9
- package/dist/flagship-fFBiZUz-.mjs +4 -0
- package/dist/{fraud-BIhS8pLf.mjs → fraud-CjIETOaM.mjs} +1 -1
- package/dist/google-tag-gateway-hPa5IHUx.mjs +2 -0
- package/dist/{healthchecks-FiXIk-KP.mjs → healthchecks-CoycpTf9.mjs} +1 -1
- package/dist/{hostnames-Bx0mykMR.mjs → hostnames-x_Yezxpr.mjs} +1 -1
- package/dist/{hyperdrive-C8qCabBF.mjs → hyperdrive-BlfrTwSq.mjs} +1 -1
- package/dist/iam-Bk7K_PPO.mjs +6 -0
- package/dist/images-BAEFb9q1.mjs +8 -0
- package/dist/index.mjs +1 -1
- package/dist/{intel-B-9Z_sJs.mjs → intel-DDkyJVaP.mjs} +1 -1
- package/dist/interactive-CRnq-B5I.mjs +11 -0
- package/dist/{interactive-DtsCYfrK.mjs → interactive-cytQzL94.mjs} +1 -1
- package/dist/ips-DU0ti0i0.mjs +2 -0
- package/dist/{keyless-certificates-THHvoXX3.mjs → keyless-certificates-E1P9jBTb.mjs} +1 -1
- package/dist/keys-DqldTZqH.mjs +2 -0
- package/dist/{kv-BFDUCnft.mjs → kv-CcfCfnwq.mjs} +1 -1
- package/dist/{leaked-credential-checks-DUlUCOoJ.mjs → leaked-credential-checks-CqmKaEbd.mjs} +1 -1
- package/dist/load-balancers-Dg4pDad1.mjs +6 -0
- package/dist/{local-D-aVNu6A.mjs → local-DGiIS1uM.mjs} +1 -1
- package/dist/local-runtime--IQr44qq.mjs +2 -0
- package/dist/logexplorer-Bu2mG5rh.mjs +17 -0
- package/dist/logo-matches-CWUzxY7G.mjs +2 -0
- package/dist/logos-BTfdkDPi.mjs +3 -0
- package/dist/{logpush-BK34mMQs.mjs → logpush-BZyay3h2.mjs} +1 -1
- package/dist/{logs-CLAqX9h2.mjs → logs-BqF7jjQO.mjs} +1 -1
- package/dist/{magic-cloud-networking-h_ozrC5S.mjs → magic-cloud-networking-Dhd8pTyM.mjs} +4 -4
- package/dist/magic-network-monitoring-D0FnkjuN.mjs +4 -0
- package/dist/magic-transit-B5skt0G7.mjs +111 -0
- package/dist/managed-transforms-B6X_crcJ.mjs +3 -0
- package/dist/matches-DeYaB4I0.mjs +2 -0
- package/dist/mcp-ChjBiMx2.mjs +4 -0
- package/dist/mesh-DRVAFLBX.mjs +4 -0
- package/dist/{moq-qmuVPAO0.mjs → moq-DE7VDEFS.mjs} +1 -1
- package/dist/mtls-certificates-Cbc3uAkN.mjs +3 -0
- package/dist/{network-D74cSy3t.mjs → network-CDPZNFbn.mjs} +1 -1
- package/dist/{network-interconnects-BJ0Nc48J.mjs → network-interconnects-CMRs_chR.mjs} +1 -1
- package/dist/oauth-DAa7SwkM.mjs +14 -0
- package/dist/{oauth-clients-Br-smLxQ.mjs → oauth-clients-DAI_gcuL.mjs} +1 -1
- package/dist/oauth-scopes-BE6xF4_h.mjs +2 -0
- package/dist/observability-DnyI8rPJ.mjs +4 -0
- package/dist/{open-PBXRGS4R-R-qesf18.mjs → open-PBXRGS4R-DIiYQyU9.mjs} +3 -3
- package/dist/{organization-NX7yCZrq.mjs → organization-yh0mSUdI.mjs} +6 -6
- package/dist/organizations-B3aU-RCG.mjs +2 -0
- package/dist/origin-ca-certificates-BaNWfVqf.mjs +3 -0
- package/dist/origin-post-quantum-encryption-CIUtQgyv.mjs +2 -0
- package/dist/origin-tls-client-auth-CvEpbX2Q.mjs +4 -0
- package/dist/{output-DrpYYfnB.mjs → output-BqDR9h74.mjs} +1 -1
- package/dist/page-rules-CzbyXbt6.mjs +27 -0
- package/dist/pages-CX8yefTI.mjs +14 -0
- package/dist/pay-per-crawl-v4vBOMWD.mjs +4 -0
- package/dist/pipelines-BZ1KGupx.mjs +6 -0
- package/dist/precursor-D42A9ay5.mjs +4 -0
- package/dist/progress-jYW64HY7.mjs +2 -0
- package/dist/project-settings-BN7tL0c7.mjs +3 -0
- package/dist/prompt-CyATfGUu.mjs +3 -0
- package/dist/{public-BwQqexwo-CNW_dPly.mjs → public-BMg6-Hxh-DgIH5obr.mjs} +1 -1
- package/dist/queries-xvETUjUE.mjs +3 -0
- package/dist/queues-CpqHDtxF.mjs +6 -0
- package/dist/{r2-data-catalog-Du7hN9jA.mjs → r2-data-catalog-DgKmlTKR.mjs} +1 -1
- package/dist/r2-jhmLvD1z.mjs +24 -0
- package/dist/radar-C2J16wpX.mjs +2 -0
- package/dist/{rate-limits-yBF3qoYD.mjs → rate-limits-CoH9Xma0.mjs} +1 -1
- package/dist/raw-fetch-CNKIypJ7.mjs +2 -0
- package/dist/{realtimekit-CIP7lP-a.mjs → realtimekit-CDs0Z5WW.mjs} +1 -1
- package/dist/registrar-BI5ewTAk.mjs +23 -0
- package/dist/{registrar-sandbox-DiXg8p_1.mjs → registrar-sandbox-al1znWMc.mjs} +4 -4
- package/dist/{registry-Bck_zFkz.mjs → registry-5-I2XLwF.mjs} +1 -1
- package/dist/reporting-CxsdHAH3.mjs +2 -0
- package/dist/request-tracers-DJJCncft.mjs +2 -0
- package/dist/{resource-sharing-D1pSDvtf.mjs → resource-sharing-qQGn8AEn.mjs} +1 -1
- package/dist/resource-tagging-aTtpX5e5.mjs +2 -0
- package/dist/rules-PpsDU89Q.mjs +4 -0
- package/dist/rulesets-DP12Aqik.mjs +5 -0
- package/dist/rum-DxvpzJYc.mjs +4 -0
- package/dist/{schema-B34Q9tLF.mjs → schema-DlLbiOJj.mjs} +1 -1
- package/dist/schema-flags-CTfQVGCs.mjs +5 -0
- package/dist/schemas-BFCBlp_W.mjs +65 -0
- package/dist/{scim-CcSyfKCH.mjs → scim-DJ4AVU20.mjs} +1 -1
- package/dist/{secrets-store-DFmvtphu.mjs → secrets-store-D6KDNo_s.mjs} +1 -1
- package/dist/security-center-008FMs_z.mjs +2 -0
- package/dist/{security-txt-DqnFpjMI.mjs → security-txt-CqcfrhlN.mjs} +1 -1
- package/dist/{share-BuwYUzOL.mjs → share-D5fzsVAJ.mjs} +4 -4
- package/dist/{deploy-input-CrvuoDGJ.mjs → shared-DlKGNPiT.mjs} +97 -99
- package/dist/smart-shield-DpFscIk8.mjs +4 -0
- package/dist/snippets-CCKgI2ZX.mjs +4 -0
- package/dist/spawn-C3_tJ3RB.mjs +526 -0
- package/dist/{spectrum-b7N1ZRAm.mjs → spectrum-LmdqY3ki.mjs} +1 -1
- package/dist/{speed-cw31yFva.mjs → speed-CEK36h3A.mjs} +1 -1
- package/dist/src-CEb2fgtT.mjs +108 -0
- package/dist/{ssl-CsEhRVTO.mjs → ssl-ChHUyaQm.mjs} +1 -1
- package/dist/startup-profile-Dpxg-MjV.mjs +17 -0
- package/dist/{state-Bb5Cbc_L.mjs → state-DeX23Kmg.mjs} +1 -1
- package/dist/{stream-DFOao6Gu.mjs → stream-DfUSELMX.mjs} +13 -13
- package/dist/submit-DF2G5CIz.mjs +2 -0
- package/dist/tags-nFJJHlLJ.mjs +2 -0
- package/dist/tenant-CRLw1oRU.mjs +2 -0
- package/dist/tenant-custom-nameservers-BvBQRDcs.mjs +3 -0
- package/dist/{tools-BHfBOZOU.mjs → tools-j8UGEtP1.mjs} +1 -1
- package/dist/{tunnel-DkMiNtVY.mjs → tunnel-CMQeBgmb.mjs} +1 -1
- package/dist/tunnels-iVA3MrdS.mjs +2 -0
- package/dist/turnstile-DQHP6-_b.mjs +23 -0
- package/dist/{ui-DE8CNn6c.mjs → ui-DJFcf61J.mjs} +1 -1
- package/dist/url-info-BVgdb_pf.mjs +2 -0
- package/dist/{url-normalization-ClfFiruK.mjs → url-normalization-BTcxLxIQ.mjs} +1 -1
- package/dist/url-scanner-DwuDZLPk.mjs +2 -0
- package/dist/user-I_MbB_KX.mjs +12 -0
- package/dist/values-S-Q7-5o8.mjs +2 -0
- package/dist/{vectorize-CVKu7lEt.mjs → vectorize-CNZdF_0A.mjs} +1 -1
- package/dist/waiting-rooms-Bo-OSsxu.mjs +11 -0
- package/dist/{web-assets-C2s9kzWf.mjs → web-assets-tlFzKdNL.mjs} +1 -1
- package/dist/web3-CdbfoZ2x.mjs +4 -0
- package/dist/workers-DQ9Q7czn.mjs +28 -0
- package/dist/{workers-builds-B55-oXOa.mjs → workers-builds-CGRhYx-x.mjs} +1 -1
- package/dist/{workflows-B-kGHxFu.mjs → workflows-BhEy-crm.mjs} +1 -1
- package/dist/zaraz-DbKvA_8C.mjs +2 -0
- package/dist/{zero-trust-DV3sIOvu.mjs → zero-trust-DrHCPVOc.mjs} +67 -66
- package/dist/zone-D2zrbJI2.mjs +2 -0
- package/dist/zones-DrpxQ_-A.mjs +21 -0
- package/package.json +12 -8
- package/dist/account-CYRm3yoN.mjs +0 -2
- package/dist/agent-memory-DDv_Gxr7.mjs +0 -6
- package/dist/ai-audit-BWZGvbca.mjs +0 -2
- package/dist/ai-gateway-jeB-sAgP.mjs +0 -13
- package/dist/ai-search-BmdskMjR.mjs +0 -7
- package/dist/ai-security-CsmfcaUx.mjs +0 -4
- package/dist/ai-viHB1tgI.mjs +0 -5
- package/dist/analytics-vOxw8Hy0.mjs +0 -3
- package/dist/analytics_engine-DO4-C0wD.mjs +0 -2
- package/dist/argo-CQfCgazW.mjs +0 -2
- package/dist/args-DlUhyGU0.mjs +0 -2
- package/dist/audit-logs-CzpwvQ6A.mjs +0 -2
- package/dist/auth-D0xZxAEa.mjs +0 -5
- package/dist/billing-aJgapeRm.mjs +0 -3
- package/dist/body-parser-C-c9gfH1.mjs +0 -2
- package/dist/bot-management-Y2q5d-pi.mjs +0 -5
- package/dist/botnet-feed-DANJqfmE.mjs +0 -3
- package/dist/brand-protection-CjpZWBjp.mjs +0 -3
- package/dist/browser-run-BFn9h2Tz.mjs +0 -4
- package/dist/build-DcflwvqN.mjs +0 -2
- package/dist/certificate-authorities-D7OAFxF_.mjs +0 -2
- package/dist/cf-C7DU4819.mjs +0 -18
- package/dist/chunk-LQW53VED-DLrXV-hE.mjs +0 -499
- package/dist/cloud-connector-Bhec6z2P.mjs +0 -2
- package/dist/cloudforce-one-J_hn9ss9.mjs +0 -36
- package/dist/connector-interrupts-Dycx8zFx.mjs +0 -2
- package/dist/connector-telemetry-events-BmxOSNtN.mjs +0 -2
- package/dist/connector-telemetry-snapshots-CdcqfKnH.mjs +0 -2
- package/dist/containers-CKW081JA.mjs +0 -54
- package/dist/custom-certificates-BzAOnEoT.mjs +0 -5
- package/dist/custom-csrs-CgzG3pd3.mjs +0 -3
- package/dist/custom-nameservers-BUBmfhUe.mjs +0 -3
- package/dist/custom-pages-M7jA2Hit.mjs +0 -3
- package/dist/d1-BFvMd6-S.mjs +0 -20
- package/dist/data-security-Bji4Or_j.mjs +0 -7
- package/dist/dcv-delegation-BuoRQ1Yh.mjs +0 -2
- package/dist/deploy-CZ7bgNDu.mjs +0 -2
- package/dist/dev-V10MG-Bg.mjs +0 -4
- package/dist/dist-CgrMkXFx.mjs +0 -72
- package/dist/durable-objects-D8FQORrL.mjs +0 -2
- package/dist/email-auth-DJK0Eb30.mjs +0 -2
- package/dist/email-routing-NpmiKIrl.mjs +0 -6
- package/dist/email-security-BLZ7WZ9Z.mjs +0 -18
- package/dist/email-sending-dn-353Nx.mjs +0 -7
- package/dist/fieldExtractors-ahysj57J.mjs +0 -3
- package/dist/flagship-BusjRNIb.mjs +0 -4
- package/dist/google-tag-gateway-TZZ3F1tV.mjs +0 -2
- package/dist/iam-Cj63Kjc6.mjs +0 -6
- package/dist/images-CBWXCDhy.mjs +0 -8
- package/dist/ips-qs9eGJnI.mjs +0 -2
- package/dist/keys-D7N0j4-x.mjs +0 -2
- package/dist/load-balancers-D2zbQ8fT.mjs +0 -6
- package/dist/local-runtime-Dh3keC5v.mjs +0 -2
- package/dist/logexplorer-CUsfZ_bS.mjs +0 -13
- package/dist/logo-matches-CJcthPHf.mjs +0 -2
- package/dist/logos-BS65zN8q.mjs +0 -3
- package/dist/magic-network-monitoring-C7tAPNKP.mjs +0 -4
- package/dist/magic-transit-BtsFePMx.mjs +0 -111
- package/dist/managed-transforms-Cm_KVCMB.mjs +0 -3
- package/dist/matches-InA1hwII.mjs +0 -2
- package/dist/mcp-mJ7bekNJ.mjs +0 -4
- package/dist/mesh-BK4S1Ezy.mjs +0 -4
- package/dist/mtls-certificates-CU4OAAXY.mjs +0 -3
- package/dist/oauth-B0ETkNcX.mjs +0 -15
- package/dist/oauth-scopes-D5bF11ju.mjs +0 -2
- package/dist/observability-BWE0Gg3V.mjs +0 -4
- package/dist/organizations-DLhiRt8g.mjs +0 -2
- package/dist/origin-ca-certificates-Ff4McZRQ.mjs +0 -3
- package/dist/origin-post-quantum-encryption-UuTr4_SW.mjs +0 -2
- package/dist/origin-tls-client-auth-DOJ1zlH3.mjs +0 -4
- package/dist/page-rules-BSz1gO-_.mjs +0 -18
- package/dist/pages-DVDogxPs.mjs +0 -14
- package/dist/pay-per-crawl-BrLXK7gT.mjs +0 -4
- package/dist/pipelines-BszRk4sM.mjs +0 -6
- package/dist/precursor-BPNjQr76.mjs +0 -4
- package/dist/progress-CsHIt3Tp.mjs +0 -2
- package/dist/prompt-DdegNPpg.mjs +0 -3
- package/dist/queries-JL1H1Biz.mjs +0 -3
- package/dist/queues-DpkYdRUE.mjs +0 -6
- package/dist/r2-CKozthw_.mjs +0 -24
- package/dist/radar-C-92vggG.mjs +0 -2
- package/dist/raw-fetch-CteyTOM2.mjs +0 -2
- package/dist/registrar-DKKN0M29.mjs +0 -21
- package/dist/reporting-fg_GKXe1.mjs +0 -2
- package/dist/request-tracers-CkMya96z.mjs +0 -2
- package/dist/resource-tagging-z48JGHCq.mjs +0 -2
- package/dist/rules-BTmNjDN-.mjs +0 -4
- package/dist/rulesets-CsoSM-17.mjs +0 -5
- package/dist/rum-DB4iO2q5.mjs +0 -4
- package/dist/schema-flags-iGoOriJt.mjs +0 -5
- package/dist/security-center-DFKeHq5c.mjs +0 -2
- package/dist/session-D6KHthHf.mjs +0 -2
- package/dist/shared-VppSAQf4.mjs +0 -2
- package/dist/smart-shield-D6X8L7p8.mjs +0 -4
- package/dist/snippets-DIpc9pb_.mjs +0 -4
- package/dist/spawn-O1RS01vr.mjs +0 -523
- package/dist/src-D_HETJNy.mjs +0 -108
- package/dist/submit--xTzyNPy.mjs +0 -2
- package/dist/tags-efICDkah.mjs +0 -2
- package/dist/tenant-CerHuToJ.mjs +0 -2
- package/dist/tenant-custom-nameservers-C4otMBm2.mjs +0 -3
- package/dist/triggers-BEsiiKAf.mjs +0 -2
- package/dist/tunnels-D0J8lJoI.mjs +0 -2
- package/dist/turnstile-CFmtY5bn.mjs +0 -23
- package/dist/url-info-DBCeRWwb.mjs +0 -2
- package/dist/url-scanner-CNyvg65L.mjs +0 -2
- package/dist/user-bifVEQq5.mjs +0 -12
- package/dist/values-OxkdP1tV.mjs +0 -2
- package/dist/versions-BVL-Ludh.mjs +0 -2
- package/dist/waiting-rooms-CmRAl51T.mjs +0 -11
- package/dist/web3-y_cY91V_.mjs +0 -4
- package/dist/workers-jDcq14GH.mjs +0 -24
- package/dist/zaraz-27zwjLvv.mjs +0 -2
- package/dist/zone-BJix2KQ9.mjs +0 -2
- package/dist/zones-Bkj5i92c.mjs +0 -21
- /package/dist/{alerts-CRmjqOZi.mjs → alerts-9PR5sQ_z.mjs} +0 -0
- /package/dist/{autorag-BD7cu5NU.mjs → autorag-Bevo1kIH.mjs} +0 -0
- /package/dist/{brands-BhALBkX2.mjs → brands-C4M04Man.mjs} +0 -0
- /package/dist/{chunk-6EUZQHAF-B7bSMYLe.mjs → chunk-6EUZQHAF-C3w62dek.mjs} +0 -0
- /package/dist/{clear-BgF8No7D.mjs → clear-DS0eRXOc.mjs} +0 -0
- /package/dist/{cli-types-BsTty22w.mjs → cli-types-C3nVfpSG.mjs} +0 -0
- /package/dist/{connector-telemetry-events-latest-BY2556uL.mjs → connector-telemetry-events-latest-CKKG6_pD.mjs} +0 -0
- /package/dist/{connector-telemetry-snapshots-latest-BHYdxUEF.mjs → connector-telemetry-snapshots-latest-Bv5OddJr.mjs} +0 -0
- /package/dist/{domain-info-C50W5GhA.mjs → domain-info-BUiaGCEq.mjs} +0 -0
- /package/dist/{health-BFNZqiAm.mjs → health-vX6Ml2Na.mjs} +0 -0
- /package/dist/{input-validation-Bav2M9F-.mjs → input-validation-1esLElok.mjs} +0 -0
- /package/dist/{internal-BTeSewwB.mjs → internal-ROz7anul.mjs} +0 -0
- /package/dist/{live-Dkiyu30_.mjs → live-CSxvigCS.mjs} +0 -0
- /package/dist/{metadata-8AkOftcB.mjs → metadata-DEqBUaSv.mjs} +0 -0
- /package/dist/{rate-limit-analytics-Dz-Wv1T0.mjs → rate-limit-analytics-CgHgKjmV.mjs} +0 -0
- /package/dist/{ready-TKOkKeRg.mjs → ready-6G9zVGPJ.mjs} +0 -0
- /package/dist/{recent-submissions-3Asm6eIi.mjs → recent-submissions-B3Smh-QM.mjs} +0 -0
- /package/dist/{refute-BVz9nMyd.mjs → refute-DjkmLSNe.mjs} +0 -0
- /package/dist/{resolve-CeBbH6Pq.mjs → resolve-DEvdeprv.mjs} +0 -0
- /package/dist/{scan-logo-ZteA-PUV.mjs → scan-logo-545qLcGs.mjs} +0 -0
- /package/dist/{scan-page-DWDSyzQ7.mjs → scan-page-DRQiVufl.mjs} +0 -0
- /package/dist/{search-DGNc37HK.mjs → search-CXbqFoqe.mjs} +0 -0
- /package/dist/{signed-url-B5Qpn2mn.mjs → signed-url-rU_nvgFA.mjs} +0 -0
- /package/dist/{submission-info-FjUolE6A.mjs → submission-info-D6PgXNQP.mjs} +0 -0
- /package/dist/{theme-CeVf-5qG.mjs → theme-CrIBazAF.mjs} +0 -0
- /package/dist/{total-queries-NHJj1HGq.mjs → total-queries-XkFyu8H5.mjs} +0 -0
- /package/dist/{tracked-domains-CniKVHIp.mjs → tracked-domains-CmcRXHj_.mjs} +0 -0
- /package/dist/{verify-DS1PWAJe.mjs → verify-CM1NakP0.mjs} +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{a as r,r as i}from"./auth-DY_Y2bXC.mjs";import{t as a}from"./output-BqDR9h74.mjs";import{t as o}from"./dry-run-ILZRVpnp.mjs";import{t as s}from"./progress-jYW64HY7.mjs";import{i as c,n as l,r as u,t as d}from"./body-parser-BGVbwPeM.mjs";import{n as f,t as p}from"./input-validation-1esLElok.mjs";import{a as m,i as h,n as g}from"./prompt-CyATfGUu.mjs";import{n as _,t as ee}from"./raw-fetch-CNKIypJ7.mjs";function te(e){return e.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 v={command:`delete <bucket-name>`,describe:`Delete the CORS policy for a bucket.`,builder:te,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets cors delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(c),d=c.local?e:await t();if(c.accountId=d,!await g({force:!!c.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}a(await s(`Deleting`,async()=>r(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/cors`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Deleted`})}};function y(e){return e.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 b={command:`get <bucket-name>`,describe:`Get the CORS policy for a bucket.`,builder:y,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets cors get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(c),d=c.local?e:await t();c.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/cors`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function x(e){return e.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 S={command:`update <bucket-name>`,describe:`Set the CORS policy for a bucket.`,builder:x,handler:async f=>{let p={};if(f[`cf-r2-jurisdiction`]!==void 0&&(p[`cf-r2-jurisdiction`]=String(f[`cf-r2-jurisdiction`])),f.dryRun){o({command:`cf r2 buckets cors update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${f[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(f[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(f[`bucket-name`]??``)},bodyKind:`json`,body:f.body===void 0?d({rules:u(f.rules,`rules`)}):l(f.body)});return}let m=await i(f),h=f.local?e:await t();if(f.accountId=h,f.body){let e=l(f.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/cors`,{body:e,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`});return}let g={};f.rules!==void 0&&c(g,[`rules`],u(f.rules,`rules`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/cors`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}},C={command:`cors`,describe:`Operations for buckets.cors`,builder:e=>e.command(v).command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.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 T={command:`create`,describe:`Creates a new R2 bucket.`,builder:w,handler:async u=>{let p={};if(u[`cf-r2-jurisdiction`]!==void 0&&(p[`cf-r2-jurisdiction`]=String(u[`cf-r2-jurisdiction`])),u.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:u.body===void 0?d({locationHint:f(u[`location-hint`],`location-hint`,`text`),name:f(u.name,`name`,`text`),storageClass:f(u[`storage-class`],`storage-class`,`text`)}):l(u.body)});return}let h=await i(u),g=u.local?e:await t();if(u.accountId=g,u.body){let e=l(u.body);a(await s(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/r2/buckets`,{body:e,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Created`});return}u.name===void 0&&(u.name=await m(`name`,`Name of the bucket.`));let _={};u[`location-hint`]!==void 0&&c(_,[`locationHint`],f(u[`location-hint`],`location-hint`,`text`)),u.name!==void 0&&c(_,[`name`],f(u.name,`name`,`text`)),u[`storage-class`]!==void 0&&c(_,[`storageClass`],f(u[`storage-class`],`storage-class`,`text`)),a(await s(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/r2/buckets`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Created`})}};function E(e){return e.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 D={command:`createByName <bucket-name>`,describe:"Creates 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`.",builder:E,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c[`cf-r2-storage-class`]!==void 0&&(l[`cf-r2-storage-class`]=String(c[`cf-r2-storage-class`])),c.dryRun){o({command:`cf r2 buckets createByName`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(c),d=c.local?e:await t();c.accountId=d,a(await s(`Updating`,async()=>r(u,`PUT`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Updated`})}};function O(e){return e.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 k={command:`delete <bucket-name>`,describe:`Deletes an existing R2 bucket.`,builder:O,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(c),d=c.local?e:await t();if(c.accountId=d,!await g({force:!!c.force})){process.stderr.write(`Aborted.
|
|
4
|
+
`);return}a(await s(`Deleting`,async()=>r(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Deleted`})}};function A(e){return e.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 j={command:`create <bucket-name>`,describe:`Register a new custom domain for an existing R2 bucket.`,builder:A,handler:async u=>{let p={};if(u[`cf-r2-jurisdiction`]!==void 0&&(p[`cf-r2-jurisdiction`]=String(u[`cf-r2-jurisdiction`])),u.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/${u[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(u[`bucket-name`]))}/domains/custom`,pathParams:{"bucket-name":String(u[`bucket-name`]??``)},bodyKind:`json`,body:u.body===void 0?d({ciphers:u.ciphers,domain:f(u.domain,`domain`,`text`),enabled:u.enabled,minTLS:f(u[`min-tls`],`min-tls`,`text`),zoneId:f(u[`zone-id`],`zone-id`,`text`)}):l(u.body)});return}let h=await i(u),g=u.local?e:await t();if(u.accountId=g,u.body){let e=l(u.body);a(await s(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/r2/buckets/${encodeURIComponent(String(u[`bucket-name`]))}/domains/custom`,{body:e,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Created`});return}if(u.domain===void 0&&(u.domain=await m(`domain`,`Name of the custom domain to be added.`)),u.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);u[`zone-id`]===void 0&&(u[`zone-id`]=await m(`zone-id`,`Zone ID of the custom domain.`));let _={};u.ciphers!==void 0&&c(_,[`ciphers`],u.ciphers),u.domain!==void 0&&c(_,[`domain`],f(u.domain,`domain`,`text`)),u.enabled!==void 0&&c(_,[`enabled`],u.enabled),u[`min-tls`]!==void 0&&c(_,[`minTLS`],f(u[`min-tls`],`min-tls`,`text`)),u[`zone-id`]!==void 0&&c(_,[`zoneId`],f(u[`zone-id`],`zone-id`,`text`)),a(await s(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/r2/buckets/${encodeURIComponent(String(u[`bucket-name`]))}/domains/custom`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Created`})}};function M(e){return e.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 N={command:`delete <domain>`,describe:`Remove custom domain registration from an existing R2 bucket.`,builder:M,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.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/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/domains/custom/${c.domain==null?`<domain>`:encodeURIComponent(String(c.domain))}`,pathParams:{"bucket-name":String(c[`bucket-name`]??``),domain:String(c.domain??``)},bodyKind:`none`});return}let u=await i(c),d=c.local?e:await t();if(c.accountId=d,!await g({force:!!c.force})){process.stderr.write(`Aborted.
|
|
5
|
+
`);return}a(await s(`Deleting`,async()=>r(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(c.domain))}`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Deleted`})}};function P(e){return e.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 F={command:`get <domain>`,describe:`Get the configuration for a custom domain on an existing R2 bucket.`,builder:P,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.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/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/domains/custom/${c.domain==null?`<domain>`:encodeURIComponent(String(c.domain))}`,pathParams:{"bucket-name":String(c[`bucket-name`]??``),domain:String(c.domain??``)},bodyKind:`none`});return}let u=await i(c),d=c.local?e:await t();c.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(c.domain))}`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function I(e){return e.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 L={command:`list`,describe:`Gets a list of all custom domains registered with an existing R2 bucket.`,builder:I,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.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/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/domains/custom`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(c),d=c.local?e:await t();c.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/domains/custom`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function R(e){return e.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 z={command:`update <domain>`,describe:`Edit the configuration for a custom domain on an existing R2 bucket.`,builder:R,handler:async u=>{let p={};if(u[`cf-r2-jurisdiction`]!==void 0&&(p[`cf-r2-jurisdiction`]=String(u[`cf-r2-jurisdiction`])),u.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/${u[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(u[`bucket-name`]))}/domains/custom/${u.domain==null?`<domain>`:encodeURIComponent(String(u.domain))}`,pathParams:{"bucket-name":String(u[`bucket-name`]??``),domain:String(u.domain??``)},bodyKind:`json`,body:u.body===void 0?d({ciphers:u.ciphers,enabled:u.enabled,minTLS:f(u[`min-tls`],`min-tls`,`text`)}):l(u.body)});return}let m=await i(u),h=u.local?e:await t();if(u.accountId=h,u.body){let e=l(u.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(u[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(u.domain))}`,{body:e,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`});return}let g={};u.ciphers!==void 0&&c(g,[`ciphers`],u.ciphers),u.enabled!==void 0&&c(g,[`enabled`],u.enabled),u[`min-tls`]!==void 0&&c(g,[`minTLS`],f(u[`min-tls`],`min-tls`,`text`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(u[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(u.domain))}`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}},B={command:`custom`,describe:`Operations for buckets.domains.custom`,builder:e=>e.command(j).command(N).command(F).command(L).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.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 H={command:`list`,describe:`Gets state of public access over the bucket's R2-managed (r2.dev) domain.`,builder:V,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.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/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/domains/managed`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(c),d=c.local?e:await t();c.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/domains/managed`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function U(e){return e.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 W={command:`update <bucket-name>`,describe:`Updates state of public access over the bucket's R2-managed (r2.dev) domain.`,builder:U,handler:async u=>{let f={};if(u[`cf-r2-jurisdiction`]!==void 0&&(f[`cf-r2-jurisdiction`]=String(u[`cf-r2-jurisdiction`])),u.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/${u[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(u[`bucket-name`]))}/domains/managed`,pathParams:{"bucket-name":String(u[`bucket-name`]??``)},bodyKind:`json`,body:u.body===void 0?d({enabled:u.enabled}):l(u.body)});return}let p=await i(u),m=u.local?e:await t();if(u.accountId=m,u.body){let e=l(u.body);a(await s(`Updating`,async()=>r(p,`PUT`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(u[`bucket-name`]))}/domains/managed`,{body:e,headers:Object.keys(f).length>0?f:void 0})),{successLabel:`Updated`});return}if(u.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let h={};u.enabled!==void 0&&c(h,[`enabled`],u.enabled),a(await s(`Updating`,async()=>r(p,`PUT`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(u[`bucket-name`]))}/domains/managed`,{body:Object.keys(h).length>0?h:void 0,headers:Object.keys(f).length>0?f:void 0})),{successLabel:`Updated`})}},G={command:`managed`,describe:`Operations for buckets.domains.managed`,builder:e=>e.command(H).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},K={command:`domains`,describe:`Operations for buckets.domains`,builder:e=>e.command(B).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function q(e){return e.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 J={command:`edit <bucket-name>`,describe:`Updates properties of an existing R2 bucket.`,builder:q,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c[`cf-r2-storage-class`]!==void 0&&(l[`cf-r2-storage-class`]=String(c[`cf-r2-storage-class`])),c.dryRun){o({command:`cf r2 buckets edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(c),d=c.local?e:await t();c.accountId=d,a(await s(`Updating`,async()=>r(u,`PATCH`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Updated`})}};function Y(e){return e.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 X={command:`delete <queue-id>`,describe:`Delete an event notification rule. **If no body is provided, all rules for specified queue will be deleted**.`,builder:Y,handler:async u=>{let f={};if(u[`cf-r2-jurisdiction`]!==void 0&&(f[`cf-r2-jurisdiction`]=String(u[`cf-r2-jurisdiction`])),u.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/${u[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(u[`bucket-name`]))}/configuration/queues/${u[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(u[`queue-id`]))}`,pathParams:{"queue-id":String(u[`queue-id`]??``),"bucket-name":String(u[`bucket-name`]??``)},bodyKind:`json`,body:u.body===void 0?d({ruleIds:u[`rule-ids`]}):l(u.body)});return}let p=await i(u),m=u.local?e:await t();if(u.accountId=m,!await g({force:!!u.force})){process.stderr.write(`Aborted.
|
|
6
|
+
`);return}if(u.body){let e=l(u.body);a(await s(`Deleting`,async()=>r(p,`DELETE`,`/accounts/${m}/event_notifications/r2/${encodeURIComponent(String(u[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(u[`queue-id`]))}`,{body:e,headers:Object.keys(f).length>0?f:void 0})),{successLabel:`Deleted`});return}let h={};u[`rule-ids`]!==void 0&&c(h,[`ruleIds`],u[`rule-ids`]),a(await s(`Deleting`,async()=>r(p,`DELETE`,`/accounts/${m}/event_notifications/r2/${encodeURIComponent(String(u[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(u[`queue-id`]))}`,{body:Object.keys(h).length>0?h:void 0,headers:Object.keys(f).length>0?f:void 0})),{successLabel:`Deleted`})}};function Z(e){return e.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:`The bucket jurisdiction.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`get <queue-id>`,describe:`Get a single event notification rule.`,builder:Z,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.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/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/configuration/queues/${c[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(c[`queue-id`]))}`,pathParams:{"queue-id":String(c[`queue-id`]??``),"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(c),d=c.local?e:await t();c.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/event_notifications/r2/${encodeURIComponent(String(c[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(c[`queue-id`]))}`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function ne(e){return e.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 re={command:`list`,describe:`List all event notification rules for a bucket.`,builder:ne,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.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/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/configuration`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(c),d=c.local?e:await t();c.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/event_notifications/r2/${encodeURIComponent(String(c[`bucket-name`]))}/configuration`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function ie(e){return e.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 ae={command:`update <queue-id>`,describe:`Create event notification rule.`,builder:ie,handler:async f=>{let p={};if(f[`cf-r2-jurisdiction`]!==void 0&&(p[`cf-r2-jurisdiction`]=String(f[`cf-r2-jurisdiction`])),f.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/${f[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(f[`bucket-name`]))}/configuration/queues/${f[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(f[`queue-id`]))}`,pathParams:{"queue-id":String(f[`queue-id`]??``),"bucket-name":String(f[`bucket-name`]??``)},bodyKind:`json`,body:f.body===void 0?d({rules:u(f.rules,`rules`)}):l(f.body)});return}let m=await i(f),h=f.local?e:await t();if(f.accountId=h,f.body){let e=l(f.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/event_notifications/r2/${encodeURIComponent(String(f[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(f[`queue-id`]))}`,{body:e,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`});return}if(f.rules===void 0)throw Error(`--rules is required (or pass --body with this field set).`);let g={};f.rules!==void 0&&c(g,[`rules`],u(f.rules,`rules`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/event_notifications/r2/${encodeURIComponent(String(f[`bucket-name`]))}/configuration/queues/${encodeURIComponent(String(f[`queue-id`]))}`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}},oe={command:`event-notifications`,describe:`Operations for buckets.event-notifications`,builder:e=>e.command(X).command(Q).command(re).command(ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function se(e){return e.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 ce={command:`get <bucket-name>`,describe:`Gets properties of an existing R2 bucket.`,builder:se,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(c),d=c.local?e:await t();c.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function le(e){return e.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 ue={command:`get <job-id>`,describe:"Gets 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`.",builder:le,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/jobs/${c[`job-id`]==null?`<job-id>`:encodeURIComponent(String(c[`job-id`]))}`,pathParams:{"bucket-name":String(c[`bucket-name`]??``),"job-id":String(c[`job-id`]??``)},bodyKind:`none`});return}let u=await i(c),d=c.local?e:await t();c.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/jobs/${encodeURIComponent(String(c[`job-id`]))}`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function de(e){return e.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 fe={command:`list`,describe:`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.`,builder:de,handler:async c=>{let l={jobType:c[`job-type`],status:c.status,maxKeys:c[`max-keys`],continuationToken:c[`continuation-token`]},u={};if(c[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets jobs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/jobs`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},query:l,bodyKind:`none`});return}let d=await i(c),f=c.local?e:await t();c.accountId=f,a(await s(`Loading`,async()=>r(d,`GET`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/jobs`,{query:l,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Loaded`})}},pe={command:`jobs`,describe:`Inspect background jobs for an R2 bucket`,builder:e=>e.command(ue).command(fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function me(e){return e.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 he={command:`get <bucket-name>`,describe:`Get object lifecycle rules for a bucket.`,builder:me,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets lifecycle get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/lifecycle`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(c),d=c.local?e:await t();c.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/lifecycle`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function ge(e){return e.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 _e={command:`update <bucket-name>`,describe:`Set the object lifecycle rules for a bucket.`,builder:ge,handler:async f=>{let p={};if(f[`cf-r2-jurisdiction`]!==void 0&&(p[`cf-r2-jurisdiction`]=String(f[`cf-r2-jurisdiction`])),f.dryRun){o({command:`cf r2 buckets lifecycle update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${f[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(f[`bucket-name`]))}/lifecycle`,pathParams:{"bucket-name":String(f[`bucket-name`]??``)},bodyKind:`json`,body:f.body===void 0?d({rules:u(f.rules,`rules`)}):l(f.body)});return}let m=await i(f),h=f.local?e:await t();if(f.accountId=h,f.body){let e=l(f.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/lifecycle`,{body:e,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`});return}let g={};f.rules!==void 0&&c(g,[`rules`],u(f.rules,`rules`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/lifecycle`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}},ve={command:`lifecycle`,describe:`Operations for buckets.lifecycle`,builder:e=>e.command(he).command(_e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ye(e){return e.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 be={command:`list`,describe:`Lists all R2 buckets on your account.`,builder:ye,handler:async c=>{let l={name_contains:c[`name-contains`],start_after:c[`start-after`],per_page:c[`per-page`],order:c.order,direction:c.direction,cursor:c.cursor},u={};if(c[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.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:l,bodyKind:`none`});return}let d=await i(c),f=c.local?e:await t();c.accountId=f,a(await s(`Loading`,async()=>r(d,`GET`,`/accounts/${f}/r2/buckets`,{query:l,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Loaded`})}};function xe(e){return e.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 Se={command:`get <bucket-name>`,describe:`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.`,builder:xe,handler:async r=>{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 Ce(e){return e.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 we={command:`update <bucket-name>`,describe:`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.`,builder:Ce,handler:async r=>{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?d({enabled:r.enabled}):l(r.body)});return}let c=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.r2.buckets.localUploads.update({...e,account_id:u,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 f=d({enabled:r.enabled});a(await s(`Updating`,async()=>c.r2.buckets.localUploads.update({...f,account_id:u,bucket_name:r[`bucket-name`]})),{successLabel:`Updated`})}},Te={command:`local-uploads`,describe:`R2 bucket local upload configuration`,builder:e=>e.command(Se).command(we).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ee(e){return e.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 De={command:`get <bucket-name>`,describe:`Get lock rules for a bucket.`,builder:Ee,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets locks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/lock`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(c),d=c.local?e:await t();c.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/lock`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function Oe(e){return e.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 ke={command:`update <bucket-name>`,describe:`Set lock rules for a bucket.`,builder:Oe,handler:async f=>{let p={};if(f[`cf-r2-jurisdiction`]!==void 0&&(p[`cf-r2-jurisdiction`]=String(f[`cf-r2-jurisdiction`])),f.dryRun){o({command:`cf r2 buckets locks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${f[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(f[`bucket-name`]))}/lock`,pathParams:{"bucket-name":String(f[`bucket-name`]??``)},bodyKind:`json`,body:f.body===void 0?d({rules:u(f.rules,`rules`)}):l(f.body)});return}let m=await i(f),h=f.local?e:await t();if(f.accountId=h,f.body){let e=l(f.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/lock`,{body:e,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`});return}let g={};f.rules!==void 0&&c(g,[`rules`],u(f.rules,`rules`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/lock`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}},Ae={command:`locks`,describe:`Operations for buckets.locks`,builder:e=>e.command(De).command(ke).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function je(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Me={command:`list`,describe:`Get Storage/Object Count Metrics across all buckets in your account. Note that Account-Level Metrics may not immediately reflect the latest data.`,builder:je,handler:async r=>{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`})}},Ne={command:`metrics`,describe:`Operations for buckets.metrics`,builder:e=>e.command(Me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Pe(e){return e.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 Fe={command:`bulk-delete`,describe:"Deletes 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.",builder:Pe,handler:async c=>{let u={prefix:c.prefix},d={};if(c[`cf-r2-jurisdiction`]!==void 0&&(d[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c[`cf-r2-data-catalog-check`]!==void 0&&(d[`cf-r2-data-catalog-check`]=String(c[`cf-r2-data-catalog-check`])),c.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/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/objects`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},query:u,bodyKind:`json`,body:c.body===void 0?void 0:l(c.body)});return}let f=await i(c),p=c.local?e:await t();if(c.accountId=p,!await g({force:!!c.force})){process.stderr.write(`Aborted.
|
|
7
|
+
`);return}if(c.body){let e=l(c.body),t=new URLSearchParams(Object.entries(u).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(c[`bucket-name`]))}/objects${t?`?`+t:``}`,{body:e,headers:Object.keys(d).length>0?d:void 0})),{successLabel:`Deleted`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function Ie(e){return e.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 Le={command:`delete <object-key>`,describe:`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.`,builder:Ie,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets objects delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/objects/${c[`object-key`]==null?`<object-key>`:encodeURIComponent(String(c[`object-key`]))}`,pathParams:{"bucket-name":String(c[`bucket-name`]??``),"object-key":String(c[`object-key`]??``)},bodyKind:`none`});return}let u=await i(c),d=c.local?e:await t();if(c.accountId=d,!await g({force:!!c.force})){process.stderr.write(`Aborted.
|
|
8
|
+
`);return}a(await s(`Deleting`,async()=>r(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/objects/${encodeURIComponent(String(c[`object-key`]))}`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Deleted`})}};function Re(e){return e.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 ze={command:`get <object-key>`,describe:`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.`,builder:Re,handler:async r=>{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()=>ee(`/accounts/${c}/r2/buckets/${encodeURIComponent(String(r[`bucket-name`]))}/objects/${encodeURIComponent(String(r[`object-key`]))}`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));_(r.text===!0?l.toString(`utf-8`):l)}};function Be(e){return e.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 Ve={command:`list`,describe:`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.`,builder:Be,handler:async c=>{let l={per_page:c[`per-page`],prefix:c.prefix,delimiter:c.delimiter,cursor:c.cursor,start_after:c[`start-after`]},u={};if(c[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets objects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/objects`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},query:l,bodyKind:`none`});return}let d=await i(c),f=c.local?e:await t();c.accountId=f,a(await s(`Loading`,async()=>r(d,`GET`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/objects`,{query:l,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Loaded`})}};function He(e){return e.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 Ue={command:`upload <object-key>`,describe:`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.`,builder:He,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c[`content-type`]!==void 0&&(l[`Content-Type`]=String(c[`content-type`])),c[`content-length`]!==void 0&&(l[`Content-Length`]=String(c[`content-length`])),c[`cf-r2-storage-class`]!==void 0&&(l[`cf-r2-storage-class`]=String(c[`cf-r2-storage-class`])),c.dryRun){o({command:`cf r2 buckets objects upload`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/objects/${c[`object-key`]==null?`<object-key>`:encodeURIComponent(String(c[`object-key`]))}`,pathParams:{"bucket-name":String(c[`bucket-name`]??``),"object-key":String(c[`object-key`]??``)},bodyKind:`octet-stream`,body:c.body});return}let u=await i(c),d=c.local?e:await t();if(c.accountId=d,c.file){let e=p(c.file);a(await s(`Updating`,async()=>r(u,`PUT`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/objects/${encodeURIComponent(String(c[`object-key`]))}`,{body:e,headers:{"Content-Type":`application/octet-stream`,...Object.keys(l).length>0?l:void 0}})),{successLabel:`Updated`});return}if(c.body){let e=f(c.body,`body`,`binary`);a(await s(`Updating`,async()=>r(u,`PUT`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/objects/${encodeURIComponent(String(c[`object-key`]))}`,{body:e,headers:{"Content-Type":`application/octet-stream`,...l}})),{successLabel:`Updated`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},We={command:`objects`,describe:`Operations for buckets.objects`,builder:e=>e.command(Fe).command(Le).command(ze).command(Ve).command(Ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ge(e){return e.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 Ke={command:`delete <bucket-name>`,describe:`Disables Sippy on this bucket.`,builder:Ge,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets sippy delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/sippy`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(c),d=c.local?e:await t();if(c.accountId=d,!await g({force:!!c.force})){process.stderr.write(`Aborted.
|
|
9
|
+
`);return}a(await s(`Deleting`,async()=>r(u,`DELETE`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/sippy`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Deleted`})}};function qe(e){return e.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 Je={command:`get <bucket-name>`,describe:`Gets configuration for Sippy for an existing R2 bucket.`,builder:qe,handler:async c=>{let l={};if(c[`cf-r2-jurisdiction`]!==void 0&&(l[`cf-r2-jurisdiction`]=String(c[`cf-r2-jurisdiction`])),c.dryRun){o({command:`cf r2 buckets sippy get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${c[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(c[`bucket-name`]))}/sippy`,pathParams:{"bucket-name":String(c[`bucket-name`]??``)},bodyKind:`none`});return}let u=await i(c),d=c.local?e:await t();c.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/r2/buckets/${encodeURIComponent(String(c[`bucket-name`]))}/sippy`,{headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Loaded`})}};function Ye(e){return e.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.
|
|
10
|
+
This is the value labelled "Access Key ID" when creating an API.
|
|
11
|
+
token from the [R2 dashboard](https://dash.cloudflare.com/?to=/:account/r2/api-tokens).
|
|
12
|
+
|
|
13
|
+
Sippy will use this token when writing objects to R2, so it is
|
|
14
|
+
best to scope this token to the bucket you're enabling Sippy for.
|
|
15
|
+
`}).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.
|
|
16
|
+
This is the value labelled "Secret Access Key" when creating an API.
|
|
17
|
+
token from the [R2 dashboard](https://dash.cloudflare.com/?to=/:account/r2/api-tokens).
|
|
18
|
+
|
|
19
|
+
Sippy will use this token when writing objects to R2, so it is
|
|
20
|
+
best to scope this token to the bucket you're enabling Sippy for.
|
|
21
|
+
`}).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 Xe={command:`update <bucket-name>`,describe:`Sets configuration for Sippy for an existing R2 bucket.`,builder:Ye,handler:async u=>{let p={};if(u[`cf-r2-jurisdiction`]!==void 0&&(p[`cf-r2-jurisdiction`]=String(u[`cf-r2-jurisdiction`])),u.dryRun){o({command:`cf r2 buckets sippy update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${u[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(u[`bucket-name`]))}/sippy`,pathParams:{"bucket-name":String(u[`bucket-name`]??``)},bodyKind:`json`,body:u.body===void 0?d({destination:{accessKeyId:f(u[`destination-access-key-id`],`destination-access-key-id`,`text`),provider:f(u[`destination-provider`],`destination-provider`,`text`),secretAccessKey:f(u[`destination-secret-access-key`],`destination-secret-access-key`,`text`)},source:{accessKeyId:f(u[`source-access-key-id`],`source-access-key-id`,`text`),bucket:f(u[`source-bucket`],`source-bucket`,`text`),provider:f(u[`source-provider`],`source-provider`,`text`),region:f(u[`source-region`],`source-region`,`text`),secretAccessKey:f(u[`source-secret-access-key`],`source-secret-access-key`,`text`),clientEmail:f(u[`source-client-email`],`source-client-email`,`text`),privateKey:f(u[`source-private-key`],`source-private-key`,`text`),bucketUrl:f(u[`source-bucket-url`],`source-bucket-url`,`text`),accountKey:f(u[`source-account-key`],`source-account-key`,`text`),accountName:f(u[`source-account-name`],`source-account-name`,`text`),container:f(u[`source-container`],`source-container`,`text`),sasToken:f(u[`source-sas-token`],`source-sas-token`,`text`)}}):l(u.body)});return}let m=await i(u),h=u.local?e:await t();if(u.accountId=h,u.body){let e=l(u.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(u[`bucket-name`]))}/sippy`,{body:e,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`});return}let g={};u[`destination-access-key-id`]!==void 0&&c(g,[`destination`,`accessKeyId`],f(u[`destination-access-key-id`],`destination-access-key-id`,`text`)),u[`destination-provider`]!==void 0&&c(g,[`destination`,`provider`],f(u[`destination-provider`],`destination-provider`,`text`)),u[`destination-secret-access-key`]!==void 0&&c(g,[`destination`,`secretAccessKey`],f(u[`destination-secret-access-key`],`destination-secret-access-key`,`text`)),u[`source-access-key-id`]!==void 0&&c(g,[`source`,`accessKeyId`],f(u[`source-access-key-id`],`source-access-key-id`,`text`)),u[`source-bucket`]!==void 0&&c(g,[`source`,`bucket`],f(u[`source-bucket`],`source-bucket`,`text`)),u[`source-provider`]!==void 0&&c(g,[`source`,`provider`],f(u[`source-provider`],`source-provider`,`text`)),u[`source-region`]!==void 0&&c(g,[`source`,`region`],f(u[`source-region`],`source-region`,`text`)),u[`source-secret-access-key`]!==void 0&&c(g,[`source`,`secretAccessKey`],f(u[`source-secret-access-key`],`source-secret-access-key`,`text`)),u[`source-client-email`]!==void 0&&c(g,[`source`,`clientEmail`],f(u[`source-client-email`],`source-client-email`,`text`)),u[`source-private-key`]!==void 0&&c(g,[`source`,`privateKey`],f(u[`source-private-key`],`source-private-key`,`text`)),u[`source-bucket-url`]!==void 0&&c(g,[`source`,`bucketUrl`],f(u[`source-bucket-url`],`source-bucket-url`,`text`)),u[`source-account-key`]!==void 0&&c(g,[`source`,`accountKey`],f(u[`source-account-key`],`source-account-key`,`text`)),u[`source-account-name`]!==void 0&&c(g,[`source`,`accountName`],f(u[`source-account-name`],`source-account-name`,`text`)),u[`source-container`]!==void 0&&c(g,[`source`,`container`],f(u[`source-container`],`source-container`,`text`)),u[`source-sas-token`]!==void 0&&c(g,[`source`,`sasToken`],f(u[`source-sas-token`],`source-sas-token`,`text`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(u[`bucket-name`]))}/sippy`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}},Ze={command:`sippy`,describe:`Operations for buckets.sippy`,builder:e=>e.command(Ke).command(Je).command(Xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Qe={command:`buckets`,describe:`Create and configure R2 buckets including CORS, lifecycle, custom domains, event notifications, and object locks`,builder:e=>e.command(T).command(D).command(k).command(J).command(ce).command(be).command(C).command(K).command(oe).command(pe).command(ve).command(Te).command(Ae).command(Ne).command(We).command(Ze).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function $e(e){return e.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 et={command:`source`,describe:`Check whether tokens are valid against the source bucket`,builder:$e,handler:async r=>{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?d({bucket:f(r.bucket,`bucket`,`text`),endpoint:f(r.endpoint,`endpoint`,`text`),keys:r.keys,pathPrefix:f(r[`path-prefix`],`path-prefix`,`text`),region:f(r.region,`region`,`text`),secret:{accessKeyId:f(r[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:f(r[`secret-secret-access-key`],`secret-secret-access-key`,`text`),clientEmail:f(r[`secret-client-email`],`secret-client-email`,`text`),privateKey:f(r[`secret-private-key`],`secret-private-key`,`text`)},vendor:f(r.vendor,`vendor`,`text`),jurisdiction:f(r.jurisdiction,`jurisdiction`,`text`)}):l(r.body)});return}let c=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.r2.superSlurper.connectivityPrecheck.source({body:e,account_id:u})),{successLabel:`Updated`});return}r.bucket===void 0&&(r.bucket=await m(`bucket`,`The bucket field`)),r.vendor===void 0&&(r.vendor=await h(`vendor`,`The vendor field`,[`s3`,`gcs`,`r2`]));let p=d({bucket:f(r.bucket,`bucket`,`text`),endpoint:f(r.endpoint,`endpoint`,`text`),keys:r.keys,pathPrefix:f(r[`path-prefix`],`path-prefix`,`text`),region:f(r.region,`region`,`text`),secret:{accessKeyId:f(r[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:f(r[`secret-secret-access-key`],`secret-secret-access-key`,`text`),clientEmail:f(r[`secret-client-email`],`secret-client-email`,`text`),privateKey:f(r[`secret-private-key`],`secret-private-key`,`text`)},vendor:f(r.vendor,`vendor`,`text`),jurisdiction:f(r.jurisdiction,`jurisdiction`,`text`)});a(await s(`Updating`,async()=>c.r2.superSlurper.connectivityPrecheck.source({body:p,account_id:u})),{successLabel:`Updated`})}};function tt(e){return e.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 nt={command:`target`,describe:`Check whether tokens are valid against the target bucket`,builder:tt,handler:async r=>{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?d({bucket:f(r.bucket,`bucket`,`text`),jurisdiction:f(r.jurisdiction,`jurisdiction`,`text`),secret:{accessKeyId:f(r[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:f(r[`secret-secret-access-key`],`secret-secret-access-key`,`text`)},vendor:f(r.vendor,`vendor`,`text`)}):l(r.body)});return}let c=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.r2.superSlurper.connectivityPrecheck.target({body:e,account_id:u})),{successLabel:`Updated`});return}r.bucket===void 0&&(r.bucket=await m(`bucket`,`The bucket field`)),r[`secret-access-key-id`]===void 0&&(r[`secret-access-key-id`]=await m(`secret-access-key-id`,`The secret.accessKeyId field`)),r[`secret-secret-access-key`]===void 0&&(r[`secret-secret-access-key`]=await m(`secret-secret-access-key`,`The secret.secretAccessKey field`,{kind:`secret`})),r.vendor===void 0&&(r.vendor=await h(`vendor`,`The vendor field`,[`r2`]));let p=d({bucket:f(r.bucket,`bucket`,`text`),jurisdiction:f(r.jurisdiction,`jurisdiction`,`text`),secret:{accessKeyId:f(r[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:f(r[`secret-secret-access-key`],`secret-secret-access-key`,`text`)},vendor:f(r.vendor,`vendor`,`text`)});a(await s(`Updating`,async()=>c.r2.superSlurper.connectivityPrecheck.target({body:p,account_id:u})),{successLabel:`Updated`})}},rt={command:`connectivity-precheck`,describe:`Operations for super-slurper.connectivity-precheck`,builder:e=>e.command(et).command(nt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function it(e){return e.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 at={command:`abort-all`,describe:`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.`,builder:it,handler:async r=>{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 g({force:!!r.force,message:`This operation stops every running migration job.`})){process.stderr.write(`Aborted.
|
|
22
|
+
`);return}a(await s(`Deleting`,async()=>c.r2.superSlurper.jobs.abortAll({account_id:l})),{successLabel:`Deleted`})}};function ot(e){return e.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 st={command:`abort <job-id>`,describe:`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.`,builder:ot,handler:async r=>{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 g({force:!!r.force,message:`This operation stops a running migration job.`})){process.stderr.write(`Aborted.
|
|
23
|
+
`);return}a(await s(`Deleting`,async()=>c.r2.superSlurper.jobs.abort({account_id:l,job_id:r[`job-id`]})),{successLabel:`Deleted`})}};function ct(e){return e.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 lt={command:`create`,describe:`Creates a new R2 Super Slurper migration job to transfer objects from a source bucket (e.g. S3, GCS, R2) to R2.`,builder:ct,handler:async r=>{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?d({overwrite:r.overwrite,source:{bucket:f(r[`source-bucket`],`source-bucket`,`text`),endpoint:f(r[`source-endpoint`],`source-endpoint`,`text`),keys:r[`source-keys`],pathPrefix:f(r[`source-path-prefix`],`source-path-prefix`,`text`),region:f(r[`source-region`],`source-region`,`text`),secret:{accessKeyId:f(r[`source-secret-access-key-id`],`source-secret-access-key-id`,`text`),secretAccessKey:f(r[`source-secret-secret-access-key`],`source-secret-secret-access-key`,`text`),clientEmail:f(r[`source-secret-client-email`],`source-secret-client-email`,`text`),privateKey:f(r[`source-secret-private-key`],`source-secret-private-key`,`text`)},vendor:f(r[`source-vendor`],`source-vendor`,`text`),jurisdiction:f(r[`source-jurisdiction`],`source-jurisdiction`,`text`)},target:{bucket:f(r[`target-bucket`],`target-bucket`,`text`),jurisdiction:f(r[`target-jurisdiction`],`target-jurisdiction`,`text`),secret:{accessKeyId:f(r[`target-secret-access-key-id`],`target-secret-access-key-id`,`text`),secretAccessKey:f(r[`target-secret-secret-access-key`],`target-secret-secret-access-key`,`text`)},vendor:f(r[`target-vendor`],`target-vendor`,`text`)}}):l(r.body)});return}let c=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Creating`,async()=>c.r2.superSlurper.jobs.create({...e,account_id:u})),{successLabel:`Created`});return}let p=d({overwrite:r.overwrite,source:{bucket:f(r[`source-bucket`],`source-bucket`,`text`),endpoint:f(r[`source-endpoint`],`source-endpoint`,`text`),keys:r[`source-keys`],pathPrefix:f(r[`source-path-prefix`],`source-path-prefix`,`text`),region:f(r[`source-region`],`source-region`,`text`),secret:{accessKeyId:f(r[`source-secret-access-key-id`],`source-secret-access-key-id`,`text`),secretAccessKey:f(r[`source-secret-secret-access-key`],`source-secret-secret-access-key`,`text`),clientEmail:f(r[`source-secret-client-email`],`source-secret-client-email`,`text`),privateKey:f(r[`source-secret-private-key`],`source-secret-private-key`,`text`)},vendor:f(r[`source-vendor`],`source-vendor`,`text`),jurisdiction:f(r[`source-jurisdiction`],`source-jurisdiction`,`text`)},target:{bucket:f(r[`target-bucket`],`target-bucket`,`text`),jurisdiction:f(r[`target-jurisdiction`],`target-jurisdiction`,`text`),secret:{accessKeyId:f(r[`target-secret-access-key-id`],`target-secret-access-key-id`,`text`),secretAccessKey:f(r[`target-secret-secret-access-key`],`target-secret-secret-access-key`,`text`)},vendor:f(r[`target-vendor`],`target-vendor`,`text`)}});a(await s(`Creating`,async()=>c.r2.superSlurper.jobs.create({...p,account_id:u})),{successLabel:`Created`})}};function ut(e){return e.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 dt={command:`delete <job-id>`,describe:`Deletes a completed, aborted, or errored R2 Super Slurper migration job. Active jobs cannot be deleted.`,builder:ut,handler:async r=>{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 g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
24
|
+
`);return}a(await s(`Deleting`,async()=>c.r2.superSlurper.jobs.delete({account_id:l,job_id:r[`job-id`]})),{successLabel:`Deleted`})}};function ft(e){return e.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 pt={command:`get <job-id>`,describe:`Retrieves detailed status and configuration for a specific R2 Super Slurper migration job.`,builder:ft,handler:async r=>{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 mt(e){return e.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 ht={command:`list`,describe:`Lists all R2 Super Slurper migration jobs for the account with their status.`,builder:mt,handler:async r=>{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 gt(e){return e.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 _t={command:`list`,describe:`Gets log entries for an R2 Super Slurper migration job, showing migration status changes, errors, etc.`,builder:gt,handler:async r=>{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`})}},vt={command:`logs`,describe:`Operations for super-slurper.jobs.logs`,builder:e=>e.command(_t).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function yt(e){return e.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 $={command:`pause <job-id>`,describe:`Pauses a running R2 Super Slurper migration job. The job can be resumed later to continue transferring.`,builder:yt,handler:async r=>{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 bt(e){return e.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 xt={command:`progress <job-id>`,describe:`Retrieves current progress metrics for an R2 Super Slurper migration job`,builder:bt,handler:async r=>{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 St(e){return e.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:`resume <job-id>`,describe:`Resumes a paused R2 Super Slurper migration job, continuing the transfer from where it stopped.`,builder:St,handler:async r=>{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`})}},wt={command:`jobs`,describe:`Operations for super-slurper.jobs`,builder:e=>e.command(st).command(at).command(lt).command(dt).command(pt).command(ht).command($).command(xt).command(Ct).command(vt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Tt={command:`super-slurper`,describe:`Migrate data from external S3-compatible storage into R2 buckets with resumable transfer jobs`,builder:e=>e.command(rt).command(wt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Et(e){return e.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 Dt={command:`create`,describe:`Creates temporary access credentials on a bucket that can be optionally scoped to prefixes or objects.`,builder:Et,handler:async r=>{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?d({bucket:f(r.bucket,`bucket`,`text`),objects:r.objects,parentAccessKeyId:f(r[`parent-access-key-id`],`parent-access-key-id`,`text`),permission:f(r.permission,`permission`,`text`),prefixes:r.prefixes,ttlSeconds:r[`ttl-seconds`]}):l(r.body)});return}let c=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Creating`,async()=>c.r2.temporaryCredentials.create({...e,account_id:u})),{successLabel:`Created`});return}if(r.bucket===void 0&&(r.bucket=await m(`bucket`,`Name of the R2 bucket.`)),r[`parent-access-key-id`]===void 0&&(r[`parent-access-key-id`]=await m(`parent-access-key-id`,`The parent access key id to use for signing.`)),r.permission===void 0&&(r.permission=await h(`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 p=d({bucket:f(r.bucket,`bucket`,`text`),objects:r.objects,parentAccessKeyId:f(r[`parent-access-key-id`],`parent-access-key-id`,`text`),permission:f(r.permission,`permission`,`text`),prefixes:r.prefixes,ttlSeconds:r[`ttl-seconds`]});a(await s(`Creating`,async()=>c.r2.temporaryCredentials.create({...p,account_id:u})),{successLabel:`Created`})}},Ot={command:`temporary-credentials`,describe:`Generate short-lived S3-compatible credentials scoped to specific buckets and operations`,builder:e=>e.command(Dt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},kt={command:`r2`,describe:`S3-compatible object storage with zero egress fees — buckets, lifecycle rules, event notifications, and data migration`,builder:e=>e.command(Qe).command(Tt).command(Ot).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{kt as default};
|