cf 0.9.0 → 0.10.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 +5 -0
- package/dist/_meta/agent-context.json +34 -35
- package/dist/_meta/commands.json +6834 -10044
- package/dist/_meta/schemas.json +11228 -12752
- package/dist/{abuse-reports-DnNvw2gG.mjs → abuse-reports-CGF4zcKf.mjs} +2 -2
- package/dist/{access-RbqBFrSC.mjs → access-lhLJo1v2.mjs} +1 -1
- package/dist/{account-D7xvYqDx.mjs → account-CYRm3yoN.mjs} +1 -1
- package/dist/account-tags-B88TotoH.mjs +9 -0
- package/dist/accounts-BSIAT_iP.mjs +28 -0
- package/dist/{acm-Szq4CoQN.mjs → acm-VULm1djv.mjs} +1 -1
- package/dist/{addressing-CgTTbuCF.mjs → addressing-BHPBIkRY.mjs} +1 -1
- package/dist/{agent-context-Bu6yvDqA.mjs → agent-context-KBy48G1b.mjs} +1 -1
- package/dist/{agent-memory-C8pT01pR.mjs → agent-memory-DDv_Gxr7.mjs} +2 -2
- package/dist/{ai-audit-CCygMmsh.mjs → ai-audit-BWZGvbca.mjs} +1 -1
- package/dist/{ai-gateway-D4tATNRV.mjs → ai-gateway-jeB-sAgP.mjs} +1 -1
- package/dist/ai-search-BmdskMjR.mjs +7 -0
- package/dist/{ai-security-AUfzagSE.mjs → ai-security-CsmfcaUx.mjs} +1 -1
- package/dist/{ai-Cn0BniR4.mjs → ai-viHB1tgI.mjs} +1 -1
- package/dist/{alerting-DbXVpGv3.mjs → alerting-Bl8OqViR.mjs} +4 -4
- package/dist/analytics-vOxw8Hy0.mjs +3 -0
- package/dist/{analytics_engine-B_bMbfxW.mjs → analytics_engine-DO4-C0wD.mjs} +1 -1
- package/dist/{api-security-pSJdgmtK.mjs → api-security-4FVrD4n8.mjs} +1 -1
- package/dist/argo-CQfCgazW.mjs +2 -0
- package/dist/args-DlUhyGU0.mjs +2 -0
- package/dist/artifacts-CVDGnr2V.mjs +4 -0
- package/dist/{audit-logs-BIHP5-rk.mjs → audit-logs-CzpwvQ6A.mjs} +1 -1
- package/dist/{auth-MeSu8lFz.mjs → auth-D0xZxAEa.mjs} +1 -1
- package/dist/{auth-C6MhC9EZ.mjs → auth-MQEamPN9.mjs} +2 -2
- package/dist/{billing-0RNCYBJM.mjs → billing-aJgapeRm.mjs} +2 -2
- package/dist/{bot-management-uhBRnSPl.mjs → bot-management-Y2q5d-pi.mjs} +1 -1
- package/dist/{botnet-feed-DEbMknrE.mjs → botnet-feed-DANJqfmE.mjs} +1 -1
- package/dist/{brand-protection-DY2qPL8d.mjs → brand-protection-CjpZWBjp.mjs} +1 -1
- package/dist/{browser-extension-DBsmLCUj.mjs → browser-extension-BtpCbh-2.mjs} +1 -1
- package/dist/browser-run-BFn9h2Tz.mjs +4 -0
- package/dist/{build-Nivzj54_.mjs → build-DcflwvqN.mjs} +1 -1
- package/dist/{cache-BgRIDcFJ.mjs → cache-VyWK1SjY.mjs} +1 -1
- package/dist/{calls-JrRne0U0.mjs → calls-BxoRYxs4.mjs} +1 -1
- package/dist/{certificate-authorities-BJ7W8GGQ.mjs → certificate-authorities-D7OAFxF_.mjs} +1 -1
- package/dist/{cf-BUKsENG5.mjs → cf-C7DU4819.mjs} +2 -2
- package/dist/{chunk-LQW53VED-Xakf_rUn.mjs → chunk-LQW53VED-DLrXV-hE.mjs} +2 -2
- package/dist/{client-certificates-6xxvcOgI.mjs → client-certificates-DDUv8K0a.mjs} +1 -1
- package/dist/{client-side-security-cU0Z1tql.mjs → client-side-security-D4ysjwWT.mjs} +1 -1
- package/dist/{cloud-connector-DFooSAcn.mjs → cloud-connector-Bhec6z2P.mjs} +1 -1
- package/dist/cloudforce-one-J_hn9ss9.mjs +36 -0
- package/dist/config.mjs +1 -1
- package/dist/connector-interrupts-Dycx8zFx.mjs +2 -0
- package/dist/{connector-telemetry-events-CTMmX2BA.mjs → connector-telemetry-events-BmxOSNtN.mjs} +1 -1
- package/dist/connector-telemetry-events-latest-BY2556uL.mjs +2 -0
- package/dist/{connector-telemetry-snapshots-5Y7m8Cw8.mjs → connector-telemetry-snapshots-CdcqfKnH.mjs} +1 -1
- package/dist/connector-telemetry-snapshots-latest-BHYdxUEF.mjs +2 -0
- package/dist/{connectors-BRCQSsos.mjs → connectors-BqxYMMtQ.mjs} +1 -1
- package/dist/{containers-CfKOM_f5.mjs → containers-CKW081JA.mjs} +8 -8
- package/dist/{content-scan-CB4xHGv1.mjs → content-scan-Dgd7A8KF.mjs} +1 -1
- package/dist/{csamScanner-AQo_QTlq.mjs → csamScanner-DYL37wLc.mjs} +1 -1
- package/dist/{ct-alerting-Bai-1Z3k.mjs → ct-alerting-CkhSbfAs.mjs} +1 -1
- package/dist/{custom-certificates-D6aQIGu2.mjs → custom-certificates-BzAOnEoT.mjs} +1 -1
- package/dist/custom-csrs-CgzG3pd3.mjs +3 -0
- package/dist/{custom-hostnames-BiOVGwnR.mjs → custom-hostnames-q_nsnlye.mjs} +4 -4
- package/dist/custom-nameservers-BUBmfhUe.mjs +3 -0
- package/dist/custom-pages-M7jA2Hit.mjs +3 -0
- package/dist/{d1-FmAh7T7l.mjs → d1-BFvMd6-S.mjs} +1 -1
- package/dist/{data-security-2fmzF_Me.mjs → data-security-Bji4Or_j.mjs} +2 -2
- package/dist/{dcv-delegation-Cmxxgi9V.mjs → dcv-delegation-BuoRQ1Yh.mjs} +1 -1
- package/dist/{deploy-BzFbjH6a.mjs → deploy-CZ7bgNDu.mjs} +1 -1
- package/dist/{deploy-input-BRMQehgs.mjs → deploy-input-CrvuoDGJ.mjs} +1 -1
- package/dist/{dev-CWaf-qW4.mjs → dev-V10MG-Bg.mjs} +1 -1
- package/dist/{diagnostics-Ca6r_972.mjs → diagnostics-BTH-8nJH.mjs} +2 -2
- package/dist/{directory-CGNWfVQc.mjs → directory-BlH6N6Qy.mjs} +1 -1
- package/dist/{dispatch-namespaces-CBo5kuf7.mjs → dispatch-namespaces-BCjH1JzB.mjs} +1 -1
- package/dist/{dist-COfwjT96.mjs → dist-CgrMkXFx.mjs} +1 -1
- package/dist/{dls-CobKlH4N.mjs → dls-BF5iN78p.mjs} +1 -1
- package/dist/{dns-OfJXNYkK.mjs → dns-CeCTNqRk.mjs} +11 -11
- package/dist/{dns-firewall-DZ2ij-nX.mjs → dns-firewall-B54MaLGm.mjs} +1 -1
- package/dist/{dot-prop-6SRZBKHT-C_xd7eTS.mjs → dot-prop-6SRZBKHT-wIVDg_fl.mjs} +1 -1
- package/dist/{durable-objects-Cw_y37WB.mjs → durable-objects-D8FQORrL.mjs} +1 -1
- package/dist/{email-auth-DuJHdiwN.mjs → email-auth-DJK0Eb30.mjs} +1 -1
- package/dist/email-routing-NpmiKIrl.mjs +6 -0
- package/dist/{email-security-D-P8ln2L.mjs → email-security-BLZ7WZ9Z.mjs} +2 -2
- package/dist/email-sending-dn-353Nx.mjs +7 -0
- package/dist/fieldExtractors-ahysj57J.mjs +3 -0
- package/dist/firewall-CBPGJ43p.mjs +11 -0
- package/dist/{flagship-CPkQMist.mjs → flagship-BusjRNIb.mjs} +3 -3
- package/dist/{fraud-BhX0QNUl.mjs → fraud-BIhS8pLf.mjs} +1 -1
- package/dist/{google-tag-gateway-CDtRxao4.mjs → google-tag-gateway-TZZ3F1tV.mjs} +1 -1
- package/dist/{healthchecks-D2WwALvQ.mjs → healthchecks-FiXIk-KP.mjs} +2 -2
- package/dist/{hostnames-CGAFkYT1.mjs → hostnames-Bx0mykMR.mjs} +1 -1
- package/dist/{hyperdrive-zLFPWFQj.mjs → hyperdrive-C8qCabBF.mjs} +1 -1
- package/dist/{iam-Su_hpatD.mjs → iam-Cj63Kjc6.mjs} +1 -1
- package/dist/{images-D2ZflvBi.mjs → images-CBWXCDhy.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{intel-DPGzVovJ.mjs → intel-B-9Z_sJs.mjs} +2 -2
- package/dist/{interactive-CM2G03lr.mjs → interactive-DtsCYfrK.mjs} +1 -1
- package/dist/{ips-C5-NH1b0.mjs → ips-qs9eGJnI.mjs} +1 -1
- package/dist/{keyless-certificates-Xx-oAN3Z.mjs → keyless-certificates-THHvoXX3.mjs} +1 -1
- package/dist/{keys-B0FBtlOD.mjs → keys-D7N0j4-x.mjs} +1 -1
- package/dist/{kv-BbZ9st5o.mjs → kv-BFDUCnft.mjs} +1 -1
- package/dist/{leaked-credential-checks-Vonw4inx.mjs → leaked-credential-checks-DUlUCOoJ.mjs} +1 -1
- package/dist/load-balancers-D2zbQ8fT.mjs +6 -0
- package/dist/{local-eEF0NF51.mjs → local-D-aVNu6A.mjs} +1 -1
- package/dist/{local-runtime-BNCCOZ8s.mjs → local-runtime-Dh3keC5v.mjs} +1 -1
- package/dist/logexplorer-CUsfZ_bS.mjs +13 -0
- package/dist/{logo-matches-oHYc8Xaz.mjs → logo-matches-CJcthPHf.mjs} +1 -1
- package/dist/{logos-DS0krPAz.mjs → logos-BS65zN8q.mjs} +1 -1
- package/dist/logpush-BK34mMQs.mjs +4 -0
- package/dist/{logs-C07M9zn-.mjs → logs-CLAqX9h2.mjs} +1 -1
- package/dist/{magic-cloud-networking-ZPEK7O5I.mjs → magic-cloud-networking-h_ozrC5S.mjs} +1 -1
- package/dist/magic-network-monitoring-C7tAPNKP.mjs +4 -0
- package/dist/{magic-transit-CgPZ8iMn.mjs → magic-transit-BtsFePMx.mjs} +5 -5
- package/dist/{managed-transforms-2XyQ14s3.mjs → managed-transforms-Cm_KVCMB.mjs} +1 -1
- package/dist/{matches-CIaCrdrs.mjs → matches-InA1hwII.mjs} +1 -1
- package/dist/{mcp-D2afM8MD.mjs → mcp-mJ7bekNJ.mjs} +1 -1
- package/dist/mesh-BK4S1Ezy.mjs +4 -0
- package/dist/{moq-BBQVNGo1.mjs → moq-qmuVPAO0.mjs} +1 -1
- package/dist/{mtls-certificates-C5j0Gn65.mjs → mtls-certificates-CU4OAAXY.mjs} +1 -1
- package/dist/{network-CmuJqtFJ.mjs → network-D74cSy3t.mjs} +1 -1
- package/dist/{network-interconnects-BlajBQqs.mjs → network-interconnects-BJ0Nc48J.mjs} +1 -1
- package/dist/{oauth-BjHjJtnn.mjs → oauth-B0ETkNcX.mjs} +2 -2
- package/dist/{oauth-clients-BSthfZP-.mjs → oauth-clients-Br-smLxQ.mjs} +1 -1
- package/dist/{oauth-scopes-ByUp5bLU.mjs → oauth-scopes-D5bF11ju.mjs} +1 -1
- package/dist/observability-BWE0Gg3V.mjs +4 -0
- package/dist/{open-PBXRGS4R-C46yIm3u.mjs → open-PBXRGS4R-R-qesf18.mjs} +1 -1
- package/dist/{organization-DQIfNVCT.mjs → organization-NX7yCZrq.mjs} +1 -1
- package/dist/{organizations-L_ycAy6r.mjs → organizations-DLhiRt8g.mjs} +1 -1
- package/dist/{origin-ca-certificates-opIcs3_Q.mjs → origin-ca-certificates-Ff4McZRQ.mjs} +1 -1
- package/dist/{origin-post-quantum-encryption-TSMXzoEL.mjs → origin-post-quantum-encryption-UuTr4_SW.mjs} +1 -1
- package/dist/{origin-tls-client-auth-5CtcPUR6.mjs → origin-tls-client-auth-DOJ1zlH3.mjs} +1 -1
- package/dist/{output-DgW1hQGX.mjs → output-DrpYYfnB.mjs} +1 -1
- package/dist/{page-rules-DPd1Y3IL.mjs → page-rules-BSz1gO-_.mjs} +1 -1
- package/dist/{pages-CskAn5mR.mjs → pages-DVDogxPs.mjs} +4 -4
- package/dist/{pay-per-crawl-BMa_V40s.mjs → pay-per-crawl-BrLXK7gT.mjs} +1 -1
- package/dist/{pipelines-BbJjj1ZQ.mjs → pipelines-BszRk4sM.mjs} +2 -2
- package/dist/{precursor-DgRWBN9_.mjs → precursor-BPNjQr76.mjs} +1 -1
- package/dist/progress-CsHIt3Tp.mjs +2 -0
- package/dist/{prompt-DM4z101s.mjs → prompt-DdegNPpg.mjs} +1 -1
- package/dist/{queries-DrqcK0ZX.mjs → queries-JL1H1Biz.mjs} +1 -1
- package/dist/{queues-CutvMZcc.mjs → queues-DpkYdRUE.mjs} +1 -1
- package/dist/{r2-sFI62vhq.mjs → r2-CKozthw_.mjs} +4 -4
- package/dist/{r2-data-catalog-3vzU6FE1.mjs → r2-data-catalog-Du7hN9jA.mjs} +1 -1
- package/dist/radar-C-92vggG.mjs +2 -0
- package/dist/{rate-limits-HRZ8zMSl.mjs → rate-limits-yBF3qoYD.mjs} +1 -1
- package/dist/{raw-fetch-25gXED6c.mjs → raw-fetch-CteyTOM2.mjs} +1 -1
- package/dist/realtimekit-CIP7lP-a.mjs +7 -0
- package/dist/{registrar-C0EsXf83.mjs → registrar-DKKN0M29.mjs} +3 -3
- package/dist/{registrar-sandbox-CR9Rr7jV.mjs → registrar-sandbox-DiXg8p_1.mjs} +3 -3
- package/dist/{registry-CJvn75Bq.mjs → registry-Bck_zFkz.mjs} +1 -1
- package/dist/{reporting-BB6sqe6r.mjs → reporting-fg_GKXe1.mjs} +1 -1
- package/dist/{request-tracers-BrsM3zXZ.mjs → request-tracers-CkMya96z.mjs} +1 -1
- package/dist/{resource-sharing-CusU3kiy.mjs → resource-sharing-D1pSDvtf.mjs} +1 -1
- package/dist/{resource-tagging-wXAcblmz.mjs → resource-tagging-z48JGHCq.mjs} +1 -1
- package/dist/{rules-C2BxykEe.mjs → rules-BTmNjDN-.mjs} +1 -1
- package/dist/rulesets-CsoSM-17.mjs +5 -0
- package/dist/{rum-Dyno5zj3.mjs → rum-DB4iO2q5.mjs} +1 -1
- package/dist/{schema-BeXPWeK9.mjs → schema-B34Q9tLF.mjs} +1 -1
- package/dist/{schema-flags-C1BRprT2.mjs → schema-flags-iGoOriJt.mjs} +1 -1
- package/dist/{scim-Bb2xHpIz.mjs → scim-CcSyfKCH.mjs} +1 -1
- package/dist/sdk-ZctLa5jW.mjs +3 -0
- package/dist/{secrets-store-BMhjbceW.mjs → secrets-store-DFmvtphu.mjs} +1 -1
- package/dist/security-center-DFKeHq5c.mjs +2 -0
- package/dist/{security-txt-Bh_2gymk.mjs → security-txt-DqnFpjMI.mjs} +1 -1
- package/dist/{session-Br-q_UIW.mjs → session-D6KHthHf.mjs} +1 -1
- package/dist/{share-DfTpOxhk.mjs → share-BuwYUzOL.mjs} +1 -1
- package/dist/{shared-BNjZc02w.mjs → shared-VppSAQf4.mjs} +1 -1
- package/dist/{smart-shield-rHn-Lckq.mjs → smart-shield-D6X8L7p8.mjs} +2 -2
- package/dist/{snippets-nSLwH8uJ.mjs → snippets-DIpc9pb_.mjs} +1 -1
- package/dist/{spawn-Bj8QRFJ5.mjs → spawn-O1RS01vr.mjs} +2 -2
- package/dist/{spectrum-DuhSUTZI.mjs → spectrum-b7N1ZRAm.mjs} +1 -1
- package/dist/{speed-Dgby_e1J.mjs → speed-cw31yFva.mjs} +1 -1
- package/dist/src-D_HETJNy.mjs +108 -0
- package/dist/{ssl-BsxTHasY.mjs → ssl-CsEhRVTO.mjs} +1 -1
- package/dist/{state-C1m9nwUm.mjs → state-Bb5Cbc_L.mjs} +1 -1
- package/dist/{stream-CkEOX5Ko.mjs → stream-DFOao6Gu.mjs} +3 -3
- package/dist/{submit-BjdywxTq.mjs → submit--xTzyNPy.mjs} +1 -1
- package/dist/{tags-CFAw_Sce.mjs → tags-efICDkah.mjs} +1 -1
- package/dist/{tenant-C66iOy5O.mjs → tenant-CerHuToJ.mjs} +1 -1
- package/dist/{tenant-custom-nameservers-CyJZ_AB0.mjs → tenant-custom-nameservers-C4otMBm2.mjs} +1 -1
- package/dist/{tools-D2Xxfkrc.mjs → tools-BHfBOZOU.mjs} +1 -1
- package/dist/{triggers-Dv22ZXM4.mjs → triggers-BEsiiKAf.mjs} +1 -1
- package/dist/{tunnel-BatkLdds.mjs → tunnel-DkMiNtVY.mjs} +1 -1
- package/dist/{tunnels-CstoXOoq.mjs → tunnels-D0J8lJoI.mjs} +1 -1
- package/dist/{turnstile-IoRtama4.mjs → turnstile-CFmtY5bn.mjs} +2 -2
- package/dist/{ui-DjQ4AQww.mjs → ui-DE8CNn6c.mjs} +1 -1
- package/dist/{url-info-Hjhwr2la.mjs → url-info-DBCeRWwb.mjs} +1 -1
- package/dist/{url-normalization-C2BP_Kl0.mjs → url-normalization-ClfFiruK.mjs} +1 -1
- package/dist/{url-scanner-DmYVTdAE.mjs → url-scanner-CNyvg65L.mjs} +1 -1
- package/dist/{user-CVHm-cnB.mjs → user-bifVEQq5.mjs} +2 -2
- package/dist/{values-Cmlw5wGZ.mjs → values-OxkdP1tV.mjs} +1 -1
- package/dist/{vectorize-BQtIqiNO.mjs → vectorize-CVKu7lEt.mjs} +1 -1
- package/dist/{versions-CU6Av1vh.mjs → versions-BVL-Ludh.mjs} +1 -1
- package/dist/waiting-rooms-CmRAl51T.mjs +11 -0
- package/dist/{web-assets-DmSKaxzf.mjs → web-assets-C2s9kzWf.mjs} +1 -1
- package/dist/{web3-DVv4jNul.mjs → web3-y_cY91V_.mjs} +1 -1
- package/dist/{workers-builds-DgrejrUc.mjs → workers-builds-B55-oXOa.mjs} +4 -4
- package/dist/{workers-D8czeT64.mjs → workers-jDcq14GH.mjs} +6 -6
- package/dist/{workflows-BOi5MTEN.mjs → workflows-B-kGHxFu.mjs} +2 -2
- package/dist/{zaraz-CGSSFJng.mjs → zaraz-27zwjLvv.mjs} +1 -1
- package/dist/zero-trust-DV3sIOvu.mjs +92 -0
- package/dist/{zone-Bx5ElO9U.mjs → zone-BJix2KQ9.mjs} +1 -1
- package/dist/{zones-_SnlZMiM.mjs → zones-Bkj5i92c.mjs} +1 -1
- package/package.json +2 -2
- package/dist/account-tags-CKRh1jra.mjs +0 -9
- package/dist/accounts-2pGhN4s8.mjs +0 -28
- package/dist/ai-search-2xP8FP_W.mjs +0 -7
- package/dist/analytics-UQrIx99t.mjs +0 -3
- package/dist/argo-Br60zF3y.mjs +0 -2
- package/dist/artifacts-D8HMRQmb.mjs +0 -4
- package/dist/browser-run-C5pYOwtf.mjs +0 -4
- package/dist/cloudforce-one-Cp4bQmrG.mjs +0 -30
- package/dist/connector-interrupts-BR47snkh.mjs +0 -2
- package/dist/custom-csrs-D0zBkQT5.mjs +0 -4
- package/dist/custom-nameservers-G2MWpRwY.mjs +0 -3
- package/dist/custom-pages-BINNZTds.mjs +0 -4
- package/dist/email-CGOC_evd.mjs +0 -2
- package/dist/email-routing-CRvIUSFm.mjs +0 -6
- package/dist/email-sending-BwRN8PMW.mjs +0 -7
- package/dist/filters-DczM8qpH.mjs +0 -4
- package/dist/firewall-BMiETRmM.mjs +0 -11
- package/dist/load-balancers-Ct5cyyF9.mjs +0 -7
- package/dist/logexplorer-BhsAWxCr.mjs +0 -24
- package/dist/logpush-CFQBi88z.mjs +0 -5
- package/dist/magic-network-monitoring-CY3CHSpX.mjs +0 -4
- package/dist/media-CnxgOViL.mjs +0 -2
- package/dist/mesh-DLNLi3UT.mjs +0 -4
- package/dist/observability-B5p3iwrq.mjs +0 -4
- package/dist/progress-C-oFUtvC.mjs +0 -2
- package/dist/radar-Cu9rsTw_.mjs +0 -2
- package/dist/realtimekit-msnGHBbf.mjs +0 -7
- package/dist/rulesets-BHvhAeG_.mjs +0 -8
- package/dist/sdk-m4xeaua4.mjs +0 -3
- package/dist/security-center-DRC4Mf3R.mjs +0 -2
- package/dist/src-CgAVPA4I.mjs +0 -108
- package/dist/waiting-rooms-ku9UsAr9.mjs +0 -11
- package/dist/zero-trust-BmA0VkgF.mjs +0 -102
- package/dist/zone-tags-izd3WWmy.mjs +0 -9
- /package/dist/{Page-C-JHZnIy.mjs → Page-9ry_XAVC.mjs} +0 -0
- /package/dist/{alerts-B85uj2Vx.mjs → alerts-CRmjqOZi.mjs} +0 -0
- /package/dist/{autorag-Do9l_LyY.mjs → autorag-BD7cu5NU.mjs} +0 -0
- /package/dist/{body-parser-CYD7PKFC.mjs → body-parser-C-c9gfH1.mjs} +0 -0
- /package/dist/{brands-DateHCdd.mjs → brands-BhALBkX2.mjs} +0 -0
- /package/dist/{chunk-6EUZQHAF-l8tR2Qyj.mjs → chunk-6EUZQHAF-B7bSMYLe.mjs} +0 -0
- /package/dist/{chunk-Q72B4Q5Z-CPy_WJKU.mjs → chunk-Q72B4Q5Z-DVMMVVEs.mjs} +0 -0
- /package/dist/{clear-CB2kgcEB.mjs → clear-BgF8No7D.mjs} +0 -0
- /package/dist/{cli-types-BWdZbsFE.mjs → cli-types-BsTty22w.mjs} +0 -0
- /package/dist/{domain-info-DJHEt8JJ.mjs → domain-info-C50W5GhA.mjs} +0 -0
- /package/dist/{health-buY5f5pp.mjs → health-BFNZqiAm.mjs} +0 -0
- /package/dist/{input-validation-BBKJRoRB.mjs → input-validation-Bav2M9F-.mjs} +0 -0
- /package/dist/{internal-CwyoJUHh.mjs → internal-BTeSewwB.mjs} +0 -0
- /package/dist/{live-wEpA5V_n.mjs → live-Dkiyu30_.mjs} +0 -0
- /package/dist/{public-BwQqexwo-DbWj8rrr.mjs → public-BwQqexwo-CNW_dPly.mjs} +0 -0
- /package/dist/{rate-limit-analytics-Bf1uT0lT.mjs → rate-limit-analytics-Dz-Wv1T0.mjs} +0 -0
- /package/dist/{ready-CBSCPiHE.mjs → ready-TKOkKeRg.mjs} +0 -0
- /package/dist/{recent-submissions-Dpmq1f7z.mjs → recent-submissions-3Asm6eIi.mjs} +0 -0
- /package/dist/{refute-u7ZPQJZy.mjs → refute-BVz9nMyd.mjs} +0 -0
- /package/dist/{resolve-XgxRJ-Ys.mjs → resolve-CeBbH6Pq.mjs} +0 -0
- /package/dist/{scan-logo-Ba8WZAyp.mjs → scan-logo-ZteA-PUV.mjs} +0 -0
- /package/dist/{scan-page-Bcq3Ei86.mjs → scan-page-DWDSyzQ7.mjs} +0 -0
- /package/dist/{search-D9WDwnV4.mjs → search-DGNc37HK.mjs} +0 -0
- /package/dist/{signed-url-CjPbG5zV.mjs → signed-url-B5Qpn2mn.mjs} +0 -0
- /package/dist/{submission-info-Z9hhp9Rq.mjs → submission-info-FjUolE6A.mjs} +0 -0
- /package/dist/{theme-BePJemMn.mjs → theme-CeVf-5qG.mjs} +0 -0
- /package/dist/{total-queries-aKAYX1iX.mjs → total-queries-NHJj1HGq.mjs} +0 -0
- /package/dist/{tracked-domains-Ck7Jm4Kn.mjs → tracked-domains-CniKVHIp.mjs} +0 -0
- /package/dist/{verify-2yi0H93r.mjs → verify-DS1PWAJe.mjs} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{h as e}from"./oauth-
|
|
2
|
+
import{h as e}from"./oauth-B0ETkNcX.mjs";import{r as t}from"./auth-MQEamPN9.mjs";import{t as n}from"./output-DrpYYfnB.mjs";import{n as r,t as i}from"./progress-CsHIt3Tp.mjs";import{n as a,t as o}from"./body-parser-C-c9gfH1.mjs";import{n as s}from"./input-validation-Bav2M9F-.mjs";function c(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const l={command:`get`,describe:"Retrieve a zone's Precursor configuration: the zone-level `default_mode` and the ordered list of `enforcement_rules`.",builder:c,handler:async a=>{if(a.dryRun){r({command:`cf precursor get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/precursor`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.precursor.get({zone_id:s})),{successLabel:`Loaded`})}};function u(e){return e.option(`default-mode`,{type:`string`,description:`The zone-level Precursor enforcement mode applied to requests that do
|
|
3
3
|
not match a more specific enforcement rule.
|
|
4
4
|
`,choices:[`off`,`min-friction`,`max-security`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const d={command:`update`,describe:"Updates the Precursor configuration for a zone. `default_mode` sets the zone-level enforcement mode. `enforcement_rules` is the ordered list of rules that override enforcement for matching requests. This is a partial update: only the fields present in the request body are changed. - Sending an empty array (`[]`) clears all enforcement rules. - At least one of `default_mode` or `enforcement_rules` must be present; an empty body (`{}`) is rejected with `400`. - Rule `id` is read-only (assigned by Cloudflare) and ignored on input. - Rule `mode` must be `min-friction` or `max-security` (`off` is not a valid rule mode; use `default_mode` to disable enforcement). - Rule `expression` is limited to 4000 characters. The limit applies to each rule individually, not to the combined size of all rules.",builder:u,handler:async c=>{if(c.dryRun){r({command:`cf precursor update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/precursor`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({default_mode:s(c[`default-mode`],`default-mode`,`text`)}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Updating`,async()=>l.precursor.update({body:e,zone_id:u})),{successLabel:`Updated`});return}let d=o({default_mode:s(c[`default-mode`],`default-mode`,`text`)});n(await i(`Updating`,async()=>l.precursor.update({body:d,zone_id:u})),{successLabel:`Updated`})}},f={command:`precursor`,describe:`Precursor settings for a zone`,builder:e=>e.command(l).command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{f as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as e,t}from"./session-D6KHthHf.mjs";import{t as n}from"./args-DlUhyGU0.mjs";import{r}from"./theme-CeVf-5qG.mjs";import{d as i}from"./interactive-DtsCYfrK.mjs";import{t as a}from"./output-DrpYYfnB.mjs";function o(e){a(e)}const s={Hidden:0,Normal:1,Error:2,Indeterminate:3,Warning:4},c=new class{cleanupRegistered=!1;get isDisabled(){return process.env.CF_NO_OSC_PROGRESS===`1`||process.env.CF_QUIET===`1`||n()}get isSupported(){if(this.isDisabled||!process.stderr.isTTY)return!1;if(process.env.CF_FORCE_OSC_PROGRESS===`1`)return!0;let e=process.env.TERM_PROGRAM?.toLowerCase()??``;return!!(e.includes(`ghostty`)||e.includes(`iterm`)||e.includes(`wezterm`)||process.env.WT_SESSION||process.env.ConEmuANSI===`ON`)}setIndeterminate(){this.isSupported&&(this.ensureCleanup(),this.write(s.Indeterminate))}clear(){this.isSupported&&process.stderr.write(`\x1b]9;4;${s.Hidden};0\x07`)}ensureCleanup(){this.cleanupRegistered||(this.cleanupRegistered=!0,process.on(`exit`,()=>{this.clear()}))}write(e){this.isSupported&&process.stderr.write(`\x1b]9;4;${e};0\x07`)}},l=[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`];function u(){return!(!r()||!process.stdout.isTTY||process.env.CF_QUIET===`1`)}async function d(n,r){if(!u())return r();t(e);let a=i({frames:[...l],indicator:`timer`,delay:80});c.setIndeterminate(),a.start(n);try{let e=await r();return c.clear(),a.stop(n),e}catch(e){throw c.clear(),a.error(n),e}}export{o as n,d as t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as e,t}from"./session-
|
|
2
|
+
import{a as e,t}from"./session-D6KHthHf.mjs";import{n,t as r}from"./theme-CeVf-5qG.mjs";import{f as i,l as a,n as o,s,u as c,v as l}from"./interactive-DtsCYfrK.mjs";function u(){t(e)}async function d(){let e=[];for await(let t of process.stdin)e.push(Buffer.from(t));let t=Buffer.concat(e).toString(`utf-8`);return t.endsWith(`
|
|
3
3
|
`)?t.slice(0,-1):t}async function f(e,t,n){let r=n?.kind??`text`;if(o()){if(r===`secret`){let t=await d();if(t.length>0)return t;throw Error(`--${e} is required. Pipe the value via stdin, pass --${e} <value>, or run interactively.`)}throw Error(`--${e} is required. Pass --${e} <value> or run interactively.`)}let s=`Enter value for --${e}`,c=t||n?.question||s;u();let f=r===`secret`?await a({message:c,mask:`•`,validate:e=>e&&e.length>0?void 0:`Value cannot be empty`}):await i({message:c,validate:e=>e&&e.length>0?void 0:`Value cannot be empty`});return(l(f)||typeof f!=`string`)&&process.exit(130),f}async function p(e,t,n){if(o())throw Error(`--${e} is required (one of: ${n.join(`, `)}). Pass --${e} <value> or run interactively.`);let r=`Select value for --${e}`,i=t||r;u();let a=await c({message:i,options:n.map(e=>({value:e,label:e}))});return(l(a)||typeof a!=`string`)&&process.exit(130),a}async function m(e,t){if(o())throw Error(`--${e} is required and must be true. Pass --${e} or run interactively.`);u();let n=await s({message:t||`Confirm --${e}`,initialValue:!1});return l(n)&&process.exit(130),n===!0}async function h(e,{defaultValue:t=!0,fallbackValue:n=!0}={}){if(o())return process.stderr.write(`? ${e}\n Using fallback value in non-interactive context: ${n?`yes`:`no`}\n`),n;u();let r=await s({message:e,initialValue:t});return l(r)&&process.exit(130),r===!0}async function g(e={}){if(e.force===!0)return!0;let t=e.message?`${e.message} Continue?`:`This permanently deletes the resource. Continue?`;if(o()){let e=n();return process.stderr.write(`${e.hex(r.warning)(`?`)} ${t}\n ${e.dim(`(non-interactive; pass --force to confirm)`)}\n`),!1}u();let i=await s({message:t,initialValue:!1});return l(i)&&process.exit(130),i===!0}export{f as a,p as i,g as n,m as r,h as t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n}from"./oauth-B0ETkNcX.mjs";import{r}from"./auth-MQEamPN9.mjs";import{t as i}from"./output-DrpYYfnB.mjs";import{n as a,t as o}from"./progress-CsHIt3Tp.mjs";import{n as s,t as c}from"./body-parser-C-c9gfH1.mjs";import{n as l}from"./input-validation-Bav2M9F-.mjs";import{n as u}from"./prompt-DdegNPpg.mjs";function d(e){return e.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 f={command:`create`,describe:`Return a success message after creating new saved string queries in bulk`,builder:d,handler:async c=>{if(c.dryRun){a({command:`cf queries bulk create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/brand-protection/queries/bulk`,pathParams:{},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let l=await r(c),u=c.local?e:await t();if(c.accountId=u,c.body){let e=s(c.body);i(await o(`Creating`,async()=>l.queries.bulk.create({...e,account_id:u})),{successLabel:`Created`});return}i(await o(`Creating`,async()=>l.queries.bulk.create({account_id:u})),{successLabel:`Created`})}},p={command:`bulk`,describe:`Operations for bulk`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function m(e){return e.option(`id`,{type:`string`,description:`ID`}).option(`max-time`,{type:`string`,description:`The max_time field`}).option(`min-time`,{type:`string`,description:`The min_time field`}).option(`scan`,{type:`boolean`,description:`The scan field`}).option(`tag`,{type:`string`,description:`The tag field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`create`,describe:`Return a success message after creating new saved string queries`,builder:m,handler:async u=>{let d={id:u.id};if(u.dryRun){a({command:`cf queries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/brand-protection/queries`,pathParams:{},query:d,bodyKind:`json`,body:u.body===void 0?c({max_time:l(u[`max-time`],`max-time`,`text`),min_time:l(u[`min-time`],`min-time`,`text`),scan:u.scan,tag:l(u.tag,`tag`,`text`)}):s(u.body)});return}let f=await r(u),p=u.local?e:await t();if(u.accountId=p,u.body){let e=s(u.body);new URLSearchParams(Object.entries(d).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),i(await o(`Creating`,async()=>f.queries.create({...e,account_id:p,...d})),{successLabel:`Created`});return}let m=c({max_time:l(u[`max-time`],`max-time`,`text`),min_time:l(u[`min-time`],`min-time`,`text`),scan:u.scan,tag:l(u.tag,`tag`,`text`)});new URLSearchParams(Object.entries(d).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),i(await o(`Creating`,async()=>f.queries.create({...m,account_id:p,...d})),{successLabel:`Created`})}};function g(e){return e.option(`id`,{type:`string`,description:`ID`}).option(`tag`,{type:`string`,description:`Tag`}).option(`scan`,{type:`boolean`,description:`Scan`}).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 _={command:`delete`,describe:`Return a success message after deleting saved string queries by ID`,builder:g,handler:async s=>{let c={id:s.id,tag:s.tag,scan:s.scan};if(s.dryRun){a({command:`cf queries delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/brand-protection/queries`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),d=s.local?e:await t();if(s.accountId=d,!await u({force:!!s.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}i(await o(`Deleting`,async()=>l.queries.delete({account_id:d,...c})),{successLabel:`Deleted`})}},v={command:`queries`,describe:`queries`,builder:e=>e.command(h).command(_).command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{v as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n}from"./oauth-B0ETkNcX.mjs";import{a as r,r as i}from"./auth-MQEamPN9.mjs";import{t as a}from"./output-DrpYYfnB.mjs";import{n as o,t as s}from"./progress-CsHIt3Tp.mjs";import{n as c,t as l}from"./body-parser-C-c9gfH1.mjs";import{n as u}from"./input-validation-Bav2M9F-.mjs";import{a as d,i as f,n as p}from"./prompt-DdegNPpg.mjs";import{t as m}from"./cli-types-BsTty22w.mjs";function h(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dead-letter-queue`,{type:`string`,description:`The dead_letter_queue field`}).option(`script-name`,{type:`string`,description:`Name of a Worker`}).option(`settings-batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`settings-max-concurrency`,{type:`number`,description:"Maximum number of concurrent consumers that may consume from this Queue. Set to `null` to automatically opt in to the platform's maximum (recommended)."}).option(`settings-max-retries`,{type:`number`,description:`The maximum number of retries`}).option(`settings-max-wait-time-ms`,{type:`number`,description:`The number of milliseconds to wait for a batch to fill up before attempting to deliver it`}).option(`settings-retry-delay`,{type:`number`,description:`The number of seconds to delay before making the message available for another attempt.`}).option(`settings-visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).option(`type`,{type:`string`,description:`The type field`,choices:[`worker`,`http_pull`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating or updating a consumer`}).conflicts(`script-name`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-concurrency`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-wait-time-ms`,[`settings-visibility-timeout-ms`]).conflicts(`settings-visibility-timeout-ms`,[`script-name`,`settings-max-concurrency`,`settings-max-wait-time-ms`])}const ee={command:`create <queue-id>`,describe:`Creates a new consumer for a Queue`,builder:h,handler:async r=>{if(r.dryRun){o({command:`cf queues consumers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${r[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(r[`queue-id`]))}/consumers`,pathParams:{"queue-id":String(r[`queue-id`]??``)},bodyKind:`json`,body:r.body===void 0?l({dead_letter_queue:u(r[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:u(r[`script-name`],`script-name`,`text`),settings:{batch_size:r[`settings-batch-size`],max_concurrency:r[`settings-max-concurrency`],max_retries:r[`settings-max-retries`],max_wait_time_ms:r[`settings-max-wait-time-ms`],retry_delay:r[`settings-retry-delay`],visibility_timeout_ms:r[`settings-visibility-timeout-ms`]},type:u(r.type,`type`,`text`)}):c(r.body)});return}let p=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);a(await s(`Creating`,async()=>p.queues.consumers.create({body:e,account_id:m,queue_id:r[`queue-id`]})),{successLabel:`Created`});return}r.type===void 0&&(r.type=await f(`type`,`The type field`,[`worker`,`http_pull`])),r.type===`worker`&&r[`script-name`]===void 0&&(r[`script-name`]=await d(`script-name`,`Name of a Worker`,{question:`Enter value for --script-name`}));let h=l({dead_letter_queue:u(r[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:u(r[`script-name`],`script-name`,`text`),settings:{batch_size:r[`settings-batch-size`],max_concurrency:r[`settings-max-concurrency`],max_retries:r[`settings-max-retries`],max_wait_time_ms:r[`settings-max-wait-time-ms`],retry_delay:r[`settings-retry-delay`],visibility_timeout_ms:r[`settings-visibility-timeout-ms`]},type:u(r.type,`type`,`text`)});a(await s(`Creating`,async()=>p.queues.consumers.create({body:h,account_id:m,queue_id:r[`queue-id`]})),{successLabel:`Created`})}};function g(e){return e.positional(`consumer-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <consumer-id>`,describe:`Deletes the consumer for a queue.`,builder:g,handler:async r=>{if(r.dryRun){o({command:`cf queues consumers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${r[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(r[`queue-id`]))}/consumers/${r[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(r[`consumer-id`]))}`,pathParams:{"consumer-id":String(r[`consumer-id`]??``),"queue-id":String(r[`queue-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}a(await s(`Deleting`,async()=>c.queues.consumers.delete({account_id:l,queue_id:r[`queue-id`],consumer_id:r[`consumer-id`]})),{successLabel:`Deleted`})}};function v(e){return e.positional(`consumer-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <consumer-id>`,describe:`Fetches the consumer for a queue by consumer id`,builder:v,handler:async r=>{if(r.dryRun){o({command:`cf queues consumers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${r[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(r[`queue-id`]))}/consumers/${r[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(r[`consumer-id`]))}`,pathParams:{"consumer-id":String(r[`consumer-id`]??``),"queue-id":String(r[`queue-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.queues.consumers.get({account_id:l,queue_id:r[`queue-id`],consumer_id:r[`consumer-id`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Returns the consumers for a Queue`,builder:b,handler:async r=>{if(r.dryRun){o({command:`cf queues consumers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${r[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(r[`queue-id`]))}/consumers`,pathParams:{"queue-id":String(r[`queue-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.queues.consumers.list({account_id:l,queue_id:r[`queue-id`]})),{successLabel:`Loaded`})}};function S(e){return e.positional(`consumer-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dead-letter-queue`,{type:`string`,description:`The dead_letter_queue field`}).option(`script-name`,{type:`string`,description:`Name of a Worker`}).option(`settings-batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`settings-max-concurrency`,{type:`number`,description:"Maximum number of concurrent consumers that may consume from this Queue. Set to `null` to automatically opt in to the platform's maximum (recommended)."}).option(`settings-max-retries`,{type:`number`,description:`The maximum number of retries`}).option(`settings-max-wait-time-ms`,{type:`number`,description:`The number of milliseconds to wait for a batch to fill up before attempting to deliver it`}).option(`settings-retry-delay`,{type:`number`,description:`The number of seconds to delay before making the message available for another attempt.`}).option(`settings-visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).option(`type`,{type:`string`,description:`The type field`,choices:[`worker`,`http_pull`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating or updating a consumer`}).conflicts(`script-name`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-concurrency`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-wait-time-ms`,[`settings-visibility-timeout-ms`]).conflicts(`settings-visibility-timeout-ms`,[`script-name`,`settings-max-concurrency`,`settings-max-wait-time-ms`])}const C={command:`update <consumer-id>`,describe:`Updates the consumer for a queue, or creates one if it does not exist.`,builder:S,handler:async r=>{if(r.dryRun){o({command:`cf queues consumers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${r[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(r[`queue-id`]))}/consumers/${r[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(r[`consumer-id`]))}`,pathParams:{"consumer-id":String(r[`consumer-id`]??``),"queue-id":String(r[`queue-id`]??``)},bodyKind:`json`,body:r.body===void 0?l({dead_letter_queue:u(r[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:u(r[`script-name`],`script-name`,`text`),settings:{batch_size:r[`settings-batch-size`],max_concurrency:r[`settings-max-concurrency`],max_retries:r[`settings-max-retries`],max_wait_time_ms:r[`settings-max-wait-time-ms`],retry_delay:r[`settings-retry-delay`],visibility_timeout_ms:r[`settings-visibility-timeout-ms`]},type:u(r.type,`type`,`text`)}):c(r.body)});return}let p=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);a(await s(`Updating`,async()=>p.queues.consumers.update({body:e,account_id:m,queue_id:r[`queue-id`],consumer_id:r[`consumer-id`]})),{successLabel:`Updated`});return}r.type===void 0&&(r.type=await f(`type`,`The type field`,[`worker`,`http_pull`])),r.type===`worker`&&r[`script-name`]===void 0&&(r[`script-name`]=await d(`script-name`,`Name of a Worker`,{question:`Enter value for --script-name`}));let h=l({dead_letter_queue:u(r[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:u(r[`script-name`],`script-name`,`text`),settings:{batch_size:r[`settings-batch-size`],max_concurrency:r[`settings-max-concurrency`],max_retries:r[`settings-max-retries`],max_wait_time_ms:r[`settings-max-wait-time-ms`],retry_delay:r[`settings-retry-delay`],visibility_timeout_ms:r[`settings-visibility-timeout-ms`]},type:u(r.type,`type`,`text`)});a(await s(`Updating`,async()=>p.queues.consumers.update({body:h,account_id:m,queue_id:r[`queue-id`],consumer_id:r[`consumer-id`]})),{successLabel:`Updated`})}},w={command:`consumers`,describe:`Workers that automatically receive and process messages from a queue`,builder:e=>e.command(ee).command(_).command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.option(`queue-name`,{type:`string`,description:`The queue_name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const E={command:`create`,describe:`Create a new queue`,builder:T,handler:async r=>{if(r.dryRun){o({command:`cf queues create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({queue_name:u(r[`queue-name`],`queue-name`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.queues.create({...e,account_id:p})),{successLabel:`Created`});return}r[`queue-name`]===void 0&&(r[`queue-name`]=await d(`queue-name`,`The queue_name field`));let m=l({queue_name:u(r[`queue-name`],`queue-name`,`text`)});a(await s(`Creating`,async()=>f.queues.create({...m,account_id:p})),{successLabel:`Created`})}};function D(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const O={command:`delete <queue-id>`,describe:`Deletes a queue`,builder:D,handler:async r=>{if(r.dryRun){o({command:`cf queues delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${r[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(r[`queue-id`]))}`,pathParams:{"queue-id":String(r[`queue-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}a(await s(`Deleting`,async()=>c.queues.delete({account_id:l,queue_id:r[`queue-id`]})),{successLabel:`Deleted`})}};function k(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-name`,{type:`string`,description:`The queue_name field`}).option(`settings-delivery-delay`,{type:`number`,description:`Number of seconds to delay delivery of all messages to consumers.`}).option(`settings-delivery-paused`,{type:`boolean`,description:`Indicates if message delivery to consumers is currently paused.`}).option(`settings-message-retention-period`,{type:`number`,description:`Number of seconds after which an unconsumed message will be delayed.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const A={command:`edit <queue-id>`,describe:`Updates a Queue.`,builder:k,handler:async r=>{if(r.dryRun){o({command:`cf queues edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${r[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(r[`queue-id`]))}`,pathParams:{"queue-id":String(r[`queue-id`]??``)},bodyKind:`json`,body:r.body===void 0?l({queue_name:u(r[`queue-name`],`queue-name`,`text`),settings:{delivery_delay:r[`settings-delivery-delay`],delivery_paused:r[`settings-delivery-paused`],message_retention_period:r[`settings-message-retention-period`]}}):c(r.body)});return}let d=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>d.queues.edit({body:e,account_id:f,queue_id:r[`queue-id`]})),{successLabel:`Updated`});return}let p=l({queue_name:u(r[`queue-name`],`queue-name`,`text`),settings:{delivery_delay:r[`settings-delivery-delay`],delivery_paused:r[`settings-delivery-paused`],message_retention_period:r[`settings-message-retention-period`]}});a(await s(`Updating`,async()=>d.queues.edit({body:p,account_id:f,queue_id:r[`queue-id`]})),{successLabel:`Updated`})}};function j(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`get <queue-id>`,describe:`Get details about a specific queue.`,builder:j,handler:async r=>{if(r.dryRun){o({command:`cf queues get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${r[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(r[`queue-id`]))}`,pathParams:{"queue-id":String(r[`queue-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.queues.get({account_id:l,queue_id:r[`queue-id`]})),{successLabel:`Loaded`})}};function N(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`list`,describe:`Returns the queues owned by an account.`,builder:N,handler:async r=>{if(r.dryRun){o({command:`cf queues list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.queues.list({account_id:l})),{successLabel:`Loaded`})}};function F(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const I={command:`ack-preview <queue-id>`,describe:`Delete previewed messages from a Queue. Note that messages acknowledged this way aren't considered delivered, they are instantly deleted from this queue and do not affect metrics.`,builder:F,handler:async r=>{if(r.dryRun){o({command:`cf queues messages ack-preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${r[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(r[`queue-id`]))}/messages/preview/ack`,pathParams:{"queue-id":String(r[`queue-id`]??``)},bodyKind:`json`,body:r.body===void 0?void 0:c(r.body)});return}let l=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.queues.messages.ackPreview({...e,account_id:u,queue_id:r[`queue-id`]})),{successLabel:`Created`});return}a(await s(`Creating`,async()=>l.queues.messages.ackPreview({account_id:u,queue_id:r[`queue-id`]})),{successLabel:`Created`})}};function L(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={command:`ack <queue-id>`,describe:`Acknowledge + Retry messages from a Queue`,builder:L,handler:async r=>{if(r.dryRun){o({command:`cf queues messages ack`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${r[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(r[`queue-id`]))}/messages/ack`,pathParams:{"queue-id":String(r[`queue-id`]??``)},bodyKind:`json`,body:r.body===void 0?void 0:c(r.body)});return}let l=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.queues.messages.ack({...e,account_id:u,queue_id:r[`queue-id`]})),{successLabel:`Created`});return}a(await s(`Creating`,async()=>l.queues.messages.ack({account_id:u,queue_id:r[`queue-id`]})),{successLabel:`Created`})}};function z(e){return e.option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`delay-seconds`,{type:`number`,description:`The number of seconds to wait for attempting to deliver this batch to consumers`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`bulk-push`,describe:`Push a batch of message to a Queue`,builder:z,handler:async r=>{if(r.dryRun){o({command:`cf queues messages bulk-push`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${r[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(r[`queue-id`]))}/messages/batch`,pathParams:{"queue-id":String(r[`queue-id`]??``)},bodyKind:`json`,body:r.body===void 0?l({delay_seconds:r[`delay-seconds`]}):c(r.body)});return}let u=await i(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=c(r.body);a(await s(`Creating`,async()=>u.queues.messages.bulkPush({...e,account_id:d,queue_id:r[`queue-id`]})),{successLabel:`Created`});return}let f=l({delay_seconds:r[`delay-seconds`]});a(await s(`Creating`,async()=>u.queues.messages.bulkPush({...f,account_id:d,queue_id:r[`queue-id`]})),{successLabel:`Created`})}};function V(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const H={command:`extendLeases <queue-id>`,describe:"Extend the lease on a message. This creates a new lease ID on your message without incrementing the message's `attempts` counter.",builder:V,handler:async r=>{if(r.dryRun){o({command:`cf queues messages extendLeases`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${r[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(r[`queue-id`]))}/messages/extend`,pathParams:{"queue-id":String(r[`queue-id`]??``)},bodyKind:`json`,body:r.body===void 0?l({visibility_timeout_ms:r[`visibility-timeout-ms`]}):c(r.body)});return}let u=await i(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=c(r.body);a(await s(`Creating`,async()=>u.queues.messages.extendLeases({...e,account_id:d,queue_id:r[`queue-id`]})),{successLabel:`Created`});return}let f=l({visibility_timeout_ms:r[`visibility-timeout-ms`]});a(await s(`Creating`,async()=>u.queues.messages.extendLeases({...f,account_id:d,queue_id:r[`queue-id`]})),{successLabel:`Created`})}};function U(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const te={command:`peek <queue-id>`,describe:`Peek messages from a Queue without leasing them. Messages remain available for subsequent peek or pull operations.`,builder:U,handler:async r=>{if(r.dryRun){o({command:`cf queues messages peek`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${r[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(r[`queue-id`]))}/messages/peek`,pathParams:{"queue-id":String(r[`queue-id`]??``)},bodyKind:`json`,body:r.body===void 0?l({batch_size:r[`batch-size`]}):c(r.body)});return}let u=await i(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=c(r.body);a(await s(`Creating`,async()=>u.queues.messages.peek({...e,account_id:d,queue_id:r[`queue-id`]})),{successLabel:`Created`});return}let f=l({batch_size:r[`batch-size`]});a(await s(`Creating`,async()=>u.queues.messages.peek({...f,account_id:d,queue_id:r[`queue-id`]})),{successLabel:`Created`})}};function W(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const G={command:`preview <queue-id>`,describe:`Preview messages from a Queue without leasing them. Messages remain available for subsequent preview or pull operations.`,builder:W,handler:async r=>{if(r.dryRun){o({command:`cf queues messages preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${r[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(r[`queue-id`]))}/messages/preview`,pathParams:{"queue-id":String(r[`queue-id`]??``)},bodyKind:`json`,body:r.body===void 0?l({batch_size:r[`batch-size`]}):c(r.body)});return}let u=await i(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=c(r.body);a(await s(`Loading`,async()=>u.queues.messages.preview({...e,account_id:d,queue_id:r[`queue-id`]})),{successLabel:`Loaded`});return}let f=l({batch_size:r[`batch-size`]});a(await s(`Loading`,async()=>u.queues.messages.preview({...f,account_id:d,queue_id:r[`queue-id`]})),{successLabel:`Loaded`})}};function K(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const q={command:`pull <queue-id>`,describe:`Pull a batch of messages from a Queue`,builder:K,handler:async r=>{if(r.dryRun){o({command:`cf queues messages pull`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${r[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(r[`queue-id`]))}/messages/pull`,pathParams:{"queue-id":String(r[`queue-id`]??``)},bodyKind:`json`,body:r.body===void 0?l({batch_size:r[`batch-size`],visibility_timeout_ms:r[`visibility-timeout-ms`]}):c(r.body)});return}let u=await i(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=c(r.body);a(await s(`Creating`,async()=>u.queues.messages.pull({...e,account_id:d,queue_id:r[`queue-id`]})),{successLabel:`Created`});return}let f=l({batch_size:r[`batch-size`],visibility_timeout_ms:r[`visibility-timeout-ms`]});a(await s(`Creating`,async()=>u.queues.messages.pull({...f,account_id:d,queue_id:r[`queue-id`]})),{successLabel:`Created`})}};function J(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Y={command:`purge <queue-id>`,describe:`Delete peeked messages from a Queue by their ref. Purged messages aren't considered delivered, they are instantly deleted from this queue and do not affect metrics.`,builder:J,handler:async l=>{if(l.dryRun){o({command:`cf queues messages purge`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${l[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(l[`queue-id`]))}/messages/purge`,pathParams:{"queue-id":String(l[`queue-id`]??``)},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let u=await i(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=c(l.body);a(await s(`Creating`,async()=>u.queues.messages.purge({...e,account_id:d,queue_id:l[`queue-id`]})),{successLabel:`Created`});return}a(await s(`Creating`,async()=>r(u,`POST`,`/accounts/${d}/queues/${encodeURIComponent(String(l[`queue-id`]))}/messages/purge`)),{successLabel:`Created`})}};function X(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`delay-seconds`,{type:`number`,description:`The number of seconds to wait for attempting to deliver this message to consumers`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Z={command:`push <queue-id>`,describe:`Push a message to a Queue`,builder:X,handler:async r=>{if(r.dryRun){o({command:`cf queues messages push`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${r[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(r[`queue-id`]))}/messages`,pathParams:{"queue-id":String(r[`queue-id`]??``)},bodyKind:`json`,body:r.body===void 0?l({delay_seconds:r[`delay-seconds`]}):c(r.body)});return}let u=await i(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=c(r.body);a(await s(`Creating`,async()=>u.queues.messages.push({body:e,account_id:d,queue_id:r[`queue-id`]})),{successLabel:`Created`});return}let f=l({delay_seconds:r[`delay-seconds`]});a(await s(`Creating`,async()=>u.queues.messages.push({body:f,account_id:d,queue_id:r[`queue-id`]})),{successLabel:`Created`})}},Q={command:`messages`,describe:`Push messages to a queue and pull or acknowledge them from consumers`,builder:e=>e.command(R).command(I).command(B).command(H).command(te).command(G).command(q).command(Y).command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ne(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`get <queue-id>`,describe:`Return best-effort metrics for a queue. Values may be approximate due to the distributed nature of queues.`,builder:ne,handler:async r=>{if(r.dryRun){o({command:`cf queues metrics get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${r[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(r[`queue-id`]))}/metrics`,pathParams:{"queue-id":String(r[`queue-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.queues.metrics.get({account_id:l,queue_id:r[`queue-id`]})),{successLabel:`Loaded`})}},ie={command:`metrics`,describe:`Operations for metrics`,builder:e=>e.command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ae(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`delete-messages-permanently`,{type:`boolean`,description:`Confimation that all messages will be deleted permanently.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const oe={command:`start <queue-id>`,describe:`Deletes all messages from the Queue.`,builder:ae,handler:async r=>{if(r.dryRun){o({command:`cf queues purge start`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${r[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(r[`queue-id`]))}/purge`,pathParams:{"queue-id":String(r[`queue-id`]??``)},bodyKind:`json`,body:r.body===void 0?l({delete_messages_permanently:r[`delete-messages-permanently`]}):c(r.body)});return}let u=await i(r),d=r.local?e:await t();if(r.accountId=d,!await p({force:!!r.force,message:`This operation drops every message in the queue.`})){process.stderr.write(`Aborted.
|
|
5
5
|
`);return}if(r.body){let e=c(r.body);a(await s(`Deleting`,async()=>u.queues.purge.start({...e,account_id:d,queue_id:r[`queue-id`]})),{successLabel:`Deleted`});return}let f=l({delete_messages_permanently:r[`delete-messages-permanently`]});a(await s(`Deleting`,async()=>u.queues.purge.start({...f,account_id:d,queue_id:r[`queue-id`]})),{successLabel:`Deleted`})}};function se(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ce={command:`status <queue-id>`,describe:`Get details about a Queue's purge status.`,builder:se,handler:async r=>{if(r.dryRun){o({command:`cf queues purge status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/queues/${r[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(r[`queue-id`]))}/purge`,pathParams:{"queue-id":String(r[`queue-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.queues.purge.status({account_id:l,queue_id:r[`queue-id`]})),{successLabel:`Loaded`})}},le={command:`purge`,describe:`Remove all pending messages from a queue`,builder:e=>e.command(oe).command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ue(e){return e.option(`destination-queue-id`,{type:`string`,description:`ID of the target queue`}).option(`destination-type`,{type:`string`,description:`Type of destination`,choices:[`queues.queue`]}).option(`enabled`,{type:`boolean`,description:`Whether the subscription is active`}).option(`events`,{type:`string`,array:!0,description:`List of event types this subscription handles`}).option(`name`,{type:`string`,description:`Name of the subscription`}).option(`source-type`,{type:`string`,description:`Type of source`,choices:[`images`,`kv`,`r2`,`superSlurper`,`vectorize`,`workersAi.model`,`workersBuilds.worker`,`workers.script`,`workflows.workflow`]}).option(`source-model-name`,{type:`string`,description:`Name of the Workers AI model`}).option(`source-worker-name`,{type:`string`,description:`Name of the worker`}).option(`source-script-tag`,{type:`string`,description:`Tag of the Worker script`}).option(`source-workflow-name`,{type:`string`,description:`Name of the workflow`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`source-model-name`,[`source-worker-name`,`source-script-tag`,`source-workflow-name`]).conflicts(`source-worker-name`,[`source-model-name`,`source-script-tag`,`source-workflow-name`]).conflicts(`source-script-tag`,[`source-model-name`,`source-worker-name`,`source-workflow-name`]).conflicts(`source-workflow-name`,[`source-model-name`,`source-worker-name`,`source-script-tag`]).check(e=>{if([`destination-queue-id`,`destination-type`].some(t=>e[t]!==void 0)){let t=[`destination-queue-id`,`destination-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --destination-* flag is set`)}return!0})}const de={command:`create`,describe:`Create a new event subscription for a queue`,builder:ue,handler:async r=>{if(r.dryRun){o({command:`cf queues subscriptions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/event_subscriptions/subscriptions`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({destination:{queue_id:u(r[`destination-queue-id`],`destination-queue-id`,`text`),type:u(r[`destination-type`],`destination-type`,`text`)},enabled:r.enabled,events:r.events,name:u(r.name,`name`,`text`),source:{type:u(r[`source-type`],`source-type`,`text`),model_name:u(r[`source-model-name`],`source-model-name`,`text`),worker_name:u(r[`source-worker-name`],`source-worker-name`,`text`),script_tag:u(r[`source-script-tag`],`source-script-tag`,`text`),workflow_name:u(r[`source-workflow-name`],`source-workflow-name`,`text`)}}):c(r.body)});return}let d=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Creating`,async()=>d.queues.subscriptions.create({...e,account_id:f})),{successLabel:`Created`});return}let p=l({destination:{queue_id:u(r[`destination-queue-id`],`destination-queue-id`,`text`),type:u(r[`destination-type`],`destination-type`,`text`)},enabled:r.enabled,events:r.events,name:u(r.name,`name`,`text`),source:{type:u(r[`source-type`],`source-type`,`text`),model_name:u(r[`source-model-name`],`source-model-name`,`text`),worker_name:u(r[`source-worker-name`],`source-worker-name`,`text`),script_tag:u(r[`source-script-tag`],`source-script-tag`,`text`),workflow_name:u(r[`source-workflow-name`],`source-workflow-name`,`text`)}});a(await s(`Creating`,async()=>d.queues.subscriptions.create({...p,account_id:f})),{successLabel:`Created`})}};function fe(e){return e.positional(`subscription-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const pe={command:`delete <subscription-id>`,describe:`Delete an existing event subscription`,builder:fe,handler:async r=>{if(r.dryRun){o({command:`cf queues subscriptions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/event_subscriptions/subscriptions/${r[`subscription-id`]==null?`<subscription-id>`:encodeURIComponent(String(r[`subscription-id`]))}`,pathParams:{"subscription-id":String(r[`subscription-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n}from"./oauth-B0ETkNcX.mjs";import{a as r,r as i}from"./auth-MQEamPN9.mjs";import{t as a}from"./output-DrpYYfnB.mjs";import{n as o,t as s}from"./progress-CsHIt3Tp.mjs";import{n as c,r as l,t as u}from"./body-parser-C-c9gfH1.mjs";import{n as d,t as f}from"./input-validation-Bav2M9F-.mjs";import{a as p,i as m,n as h}from"./prompt-DdegNPpg.mjs";import{n as g,t as _}from"./raw-fetch-CteyTOM2.mjs";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}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const te={command:`delete <bucket-name>`,describe:`Delete the CORS policy 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 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 h({force:!!c.force})){process.stderr.write(`Aborted.
|
|
3
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 v(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 y={command:`get <bucket-name>`,describe:`Get the CORS policy for a bucket.`,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 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 b(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(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`update <bucket-name>`,describe:`Set the CORS policy for a bucket.`,builder:b,handler:async l=>{let u={};if(l[`cf-r2-jurisdiction`]!==void 0&&(u[`cf-r2-jurisdiction`]=String(l[`cf-r2-jurisdiction`])),l.dryRun){o({command:`cf r2 buckets cors update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${l[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(l[`bucket-name`]))}/cors`,pathParams:{"bucket-name":String(l[`bucket-name`]??``)},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let d=await i(l),f=l.local?e:await t();if(l.accountId=f,l.body){let e=c(l.body);a(await s(`Updating`,async()=>r(d,`PUT`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/cors`,{body:e,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Updated`});return}a(await s(`Updating`,async()=>r(d,`PUT`,`/accounts/${f}/r2/buckets/${encodeURIComponent(String(l[`bucket-name`]))}/cors`,{headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Updated`})}},S={command:`cors`,describe:`Operations for buckets.cors`,builder:e=>e.command(te).command(y).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function C(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 w={command:`create`,describe:`Creates a new R2 bucket.`,builder:C,handler:async f=>{let m={};if(f[`cf-r2-jurisdiction`]!==void 0&&(m[`cf-r2-jurisdiction`]=String(f[`cf-r2-jurisdiction`])),f.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:f.body===void 0?u({locationHint:d(f[`location-hint`],`location-hint`,`text`),name:d(f.name,`name`,`text`),storageClass:d(f[`storage-class`],`storage-class`,`text`)}):c(f.body)});return}let h=await i(f),g=f.local?e:await t();if(f.accountId=g,f.body){let e=c(f.body);a(await s(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/r2/buckets`,{body:e,headers:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`});return}f.name===void 0&&(f.name=await p(`name`,`Name of the bucket.`));let _={};f[`location-hint`]!==void 0&&l(_,[`locationHint`],d(f[`location-hint`],`location-hint`,`text`)),f.name!==void 0&&l(_,[`name`],d(f.name,`name`,`text`)),f[`storage-class`]!==void 0&&l(_,[`storageClass`],d(f[`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(m).length>0?m:void 0})),{successLabel:`Created`})}};function T(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 E={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:T,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 D(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 O={command:`delete <bucket-name>`,describe:`Deletes an existing R2 bucket.`,builder:D,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 h({force:!!c.force})){process.stderr.write(`Aborted.
|
|
4
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 k(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 A={command:`create <bucket-name>`,describe:`Register a new custom domain for an existing R2 bucket.`,builder:k,handler:async f=>{let m={};if(f[`cf-r2-jurisdiction`]!==void 0&&(m[`cf-r2-jurisdiction`]=String(f[`cf-r2-jurisdiction`])),f.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/${f[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(f[`bucket-name`]))}/domains/custom`,pathParams:{"bucket-name":String(f[`bucket-name`]??``)},bodyKind:`json`,body:f.body===void 0?u({ciphers:f.ciphers,domain:d(f.domain,`domain`,`text`),enabled:f.enabled,minTLS:d(f[`min-tls`],`min-tls`,`text`),zoneId:d(f[`zone-id`],`zone-id`,`text`)}):c(f.body)});return}let h=await i(f),g=f.local?e:await t();if(f.accountId=g,f.body){let e=c(f.body);a(await s(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/domains/custom`,{body:e,headers:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`});return}if(f.domain===void 0&&(f.domain=await p(`domain`,`Name of the custom domain to be added.`)),f.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);f[`zone-id`]===void 0&&(f[`zone-id`]=await p(`zone-id`,`Zone ID of the custom domain.`));let _={};f.ciphers!==void 0&&l(_,[`ciphers`],f.ciphers),f.domain!==void 0&&l(_,[`domain`],d(f.domain,`domain`,`text`)),f.enabled!==void 0&&l(_,[`enabled`],f.enabled),f[`min-tls`]!==void 0&&l(_,[`minTLS`],d(f[`min-tls`],`min-tls`,`text`)),f[`zone-id`]!==void 0&&l(_,[`zoneId`],d(f[`zone-id`],`zone-id`,`text`)),a(await s(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/domains/custom`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(m).length>0?m:void 0})),{successLabel:`Created`})}};function j(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 M={command:`delete <domain>`,describe:`Remove custom domain registration from an existing R2 bucket.`,builder:j,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 h({force:!!c.force})){process.stderr.write(`Aborted.
|
|
5
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 N(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 P={command:`get <domain>`,describe:`Get the configuration for a custom domain on an existing R2 bucket.`,builder:N,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 F(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 I={command:`list`,describe:`Gets a list of all custom domains registered with an existing R2 bucket.`,builder:F,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 L(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 R={command:`update <domain>`,describe:`Edit the configuration for a custom domain on an existing R2 bucket.`,builder:L,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 domains custom 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`]))}/domains/custom/${f.domain==null?`<domain>`:encodeURIComponent(String(f.domain))}`,pathParams:{"bucket-name":String(f[`bucket-name`]??``),domain:String(f.domain??``)},bodyKind:`json`,body:f.body===void 0?u({ciphers:f.ciphers,enabled:f.enabled,minTLS:d(f[`min-tls`],`min-tls`,`text`)}):c(f.body)});return}let m=await i(f),h=f.local?e:await t();if(f.accountId=h,f.body){let e=c(f.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(f.domain))}`,{body:e,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`});return}let g={};f.ciphers!==void 0&&l(g,[`ciphers`],f.ciphers),f.enabled!==void 0&&l(g,[`enabled`],f.enabled),f[`min-tls`]!==void 0&&l(g,[`minTLS`],d(f[`min-tls`],`min-tls`,`text`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/domains/custom/${encodeURIComponent(String(f.domain))}`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}},z={command:`custom`,describe:`Operations for buckets.domains.custom`,builder:e=>e.command(A).command(M).command(P).command(I).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(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 V={command:`list`,describe:`Gets state of public access over the bucket's R2-managed (r2.dev) domain.`,builder:B,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 H(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 U={command:`update <bucket-name>`,describe:`Updates state of public access over the bucket's R2-managed (r2.dev) domain.`,builder:H,handler:async d=>{let f={};if(d[`cf-r2-jurisdiction`]!==void 0&&(f[`cf-r2-jurisdiction`]=String(d[`cf-r2-jurisdiction`])),d.dryRun){o({command:`cf r2 buckets domains managed update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2/buckets/${d[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(d[`bucket-name`]))}/domains/managed`,pathParams:{"bucket-name":String(d[`bucket-name`]??``)},bodyKind:`json`,body:d.body===void 0?u({enabled:d.enabled}):c(d.body)});return}let p=await i(d),m=d.local?e:await t();if(d.accountId=m,d.body){let e=c(d.body);a(await s(`Updating`,async()=>r(p,`PUT`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/domains/managed`,{body:e,headers:Object.keys(f).length>0?f:void 0})),{successLabel:`Updated`});return}if(d.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let h={};d.enabled!==void 0&&l(h,[`enabled`],d.enabled),a(await s(`Updating`,async()=>r(p,`PUT`,`/accounts/${m}/r2/buckets/${encodeURIComponent(String(d[`bucket-name`]))}/domains/managed`,{body:Object.keys(h).length>0?h:void 0,headers:Object.keys(f).length>0?f:void 0})),{successLabel:`Updated`})}},W={command:`managed`,describe:`Operations for buckets.domains.managed`,builder:e=>e.command(V).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},G={command:`domains`,describe:`Operations for buckets.domains`,builder:e=>e.command(z).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(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 q={command:`edit <bucket-name>`,describe:`Updates properties of an existing R2 bucket.`,builder:K,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 J(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 Y={command:`delete <queue-id>`,describe:`Delete an event notification rule. **If no body is provided, all rules for specified queue will be deleted**.`,builder:J,handler:async d=>{let f={};if(d[`cf-r2-jurisdiction`]!==void 0&&(f[`cf-r2-jurisdiction`]=String(d[`cf-r2-jurisdiction`])),d.dryRun){o({command:`cf r2 buckets event-notifications delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/event_notifications/r2/${d[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(d[`bucket-name`]))}/configuration/queues/${d[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(d[`queue-id`]))}`,pathParams:{"queue-id":String(d[`queue-id`]??``),"bucket-name":String(d[`bucket-name`]??``)},bodyKind:`json`,body:d.body===void 0?u({ruleIds:d[`rule-ids`]}):c(d.body)});return}let p=await i(d),m=d.local?e:await t();if(d.accountId=m,!await h({force:!!d.force})){process.stderr.write(`Aborted.
|
|
@@ -18,7 +18,7 @@ token from the [R2 dashboard](https://dash.cloudflare.com/?to=/:account/r2/api-t
|
|
|
18
18
|
|
|
19
19
|
Sippy will use this token when writing objects to R2, so it is
|
|
20
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 Ye={command:`update <bucket-name>`,describe:`Sets configuration for Sippy for an existing R2 bucket.`,builder:Je,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 sippy 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`]))}/sippy`,pathParams:{"bucket-name":String(f[`bucket-name`]??``)},bodyKind:`json`,body:f.body===void 0?u({destination:{accessKeyId:d(f[`destination-access-key-id`],`destination-access-key-id`,`text`),provider:d(f[`destination-provider`],`destination-provider`,`text`),secretAccessKey:d(f[`destination-secret-access-key`],`destination-secret-access-key`,`text`)},source:{accessKeyId:d(f[`source-access-key-id`],`source-access-key-id`,`text`),bucket:d(f[`source-bucket`],`source-bucket`,`text`),provider:d(f[`source-provider`],`source-provider`,`text`),region:d(f[`source-region`],`source-region`,`text`),secretAccessKey:d(f[`source-secret-access-key`],`source-secret-access-key`,`text`),clientEmail:d(f[`source-client-email`],`source-client-email`,`text`),privateKey:d(f[`source-private-key`],`source-private-key`,`text`),bucketUrl:d(f[`source-bucket-url`],`source-bucket-url`,`text`),accountKey:d(f[`source-account-key`],`source-account-key`,`text`),accountName:d(f[`source-account-name`],`source-account-name`,`text`),container:d(f[`source-container`],`source-container`,`text`),sasToken:d(f[`source-sas-token`],`source-sas-token`,`text`)}}):c(f.body)});return}let m=await i(f),h=f.local?e:await t();if(f.accountId=h,f.body){let e=c(f.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/sippy`,{body:e,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`});return}let g={};f[`destination-access-key-id`]!==void 0&&l(g,[`destination`,`accessKeyId`],d(f[`destination-access-key-id`],`destination-access-key-id`,`text`)),f[`destination-provider`]!==void 0&&l(g,[`destination`,`provider`],d(f[`destination-provider`],`destination-provider`,`text`)),f[`destination-secret-access-key`]!==void 0&&l(g,[`destination`,`secretAccessKey`],d(f[`destination-secret-access-key`],`destination-secret-access-key`,`text`)),f[`source-access-key-id`]!==void 0&&l(g,[`source`,`accessKeyId`],d(f[`source-access-key-id`],`source-access-key-id`,`text`)),f[`source-bucket`]!==void 0&&l(g,[`source`,`bucket`],d(f[`source-bucket`],`source-bucket`,`text`)),f[`source-provider`]!==void 0&&l(g,[`source`,`provider`],d(f[`source-provider`],`source-provider`,`text`)),f[`source-region`]!==void 0&&l(g,[`source`,`region`],d(f[`source-region`],`source-region`,`text`)),f[`source-secret-access-key`]!==void 0&&l(g,[`source`,`secretAccessKey`],d(f[`source-secret-access-key`],`source-secret-access-key`,`text`)),f[`source-client-email`]!==void 0&&l(g,[`source`,`clientEmail`],d(f[`source-client-email`],`source-client-email`,`text`)),f[`source-private-key`]!==void 0&&l(g,[`source`,`privateKey`],d(f[`source-private-key`],`source-private-key`,`text`)),f[`source-bucket-url`]!==void 0&&l(g,[`source`,`bucketUrl`],d(f[`source-bucket-url`],`source-bucket-url`,`text`)),f[`source-account-key`]!==void 0&&l(g,[`source`,`accountKey`],d(f[`source-account-key`],`source-account-key`,`text`)),f[`source-account-name`]!==void 0&&l(g,[`source`,`accountName`],d(f[`source-account-name`],`source-account-name`,`text`)),f[`source-container`]!==void 0&&l(g,[`source`,`container`],d(f[`source-container`],`source-container`,`text`)),f[`source-sas-token`]!==void 0&&l(g,[`source`,`sasToken`],d(f[`source-sas-token`],`source-sas-token`,`text`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/sippy`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}},Xe={command:`sippy`,describe:`Operations for buckets.sippy`,builder:e=>e.command(Ge).command(qe).command(Ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ze={command:`buckets`,describe:`Create and configure R2 buckets including CORS, lifecycle, custom domains, event notifications, and object locks`,builder:e=>e.command(w).command(E).command(O).command(q).command(se).command(ye).command(S).command(G).command(ae).command(fe).command(_e).command(we).command(ke).command(Me).command(Ue).command(Xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Qe(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`,`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 $e={command:`source`,describe:`Check whether tokens are valid against the source bucket`,builder:Qe,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?u({bucket:d(r.bucket,`bucket`,`text`),endpoint:d(r.endpoint,`endpoint`,`text`),keys:r.keys,pathPrefix:d(r[`path-prefix`],`path-prefix`,`text`),region:d(r.region,`region`,`text`),secret:{accessKeyId:d(r[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:d(r[`secret-secret-access-key`],`secret-secret-access-key`,`text`),clientEmail:d(r[`secret-client-email`],`secret-client-email`,`text`),privateKey:d(r[`secret-private-key`],`secret-private-key`,`text`)},vendor:d(r.vendor,`vendor`,`text`),jurisdiction:d(r.jurisdiction,`jurisdiction`,`text`)}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.r2.superSlurper.connectivityPrecheck.source({body:e,account_id:f})),{successLabel:`Updated`});return}r.bucket===void 0&&(r.bucket=await p(`bucket`,`The bucket field`)),r.vendor===void 0&&(r.vendor=await m(`vendor`,`The vendor field`,[`s3`,`gcs`,`r2`]));let h=u({bucket:d(r.bucket,`bucket`,`text`),endpoint:d(r.endpoint,`endpoint`,`text`),keys:r.keys,pathPrefix:d(r[`path-prefix`],`path-prefix`,`text`),region:d(r.region,`region`,`text`),secret:{accessKeyId:d(r[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:d(r[`secret-secret-access-key`],`secret-secret-access-key`,`text`),clientEmail:d(r[`secret-client-email`],`secret-client-email`,`text`),privateKey:d(r[`secret-private-key`],`secret-private-key`,`text`)},vendor:d(r.vendor,`vendor`,`text`),jurisdiction:d(r.jurisdiction,`jurisdiction`,`text`)});a(await s(`Updating`,async()=>l.r2.superSlurper.connectivityPrecheck.source({body:h,account_id:f})),{successLabel:`Updated`})}};function et(e){return e.option(`bucket`,{type:`string`,description:`The bucket field`}).option(`jurisdiction`,{type:`string`,description:`The jurisdiction field`,choices:[`default`,`eu`,`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 tt={command:`target`,describe:`Check whether tokens are valid against the target bucket`,builder:et,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?u({bucket:d(r.bucket,`bucket`,`text`),jurisdiction:d(r.jurisdiction,`jurisdiction`,`text`),secret:{accessKeyId:d(r[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:d(r[`secret-secret-access-key`],`secret-secret-access-key`,`text`)},vendor:d(r.vendor,`vendor`,`text`)}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.r2.superSlurper.connectivityPrecheck.target({body:e,account_id:f})),{successLabel:`Updated`});return}r.bucket===void 0&&(r.bucket=await p(`bucket`,`The bucket field`)),r[`secret-access-key-id`]===void 0&&(r[`secret-access-key-id`]=await p(`secret-access-key-id`,`The secret.accessKeyId field`)),r[`secret-secret-access-key`]===void 0&&(r[`secret-secret-access-key`]=await p(`secret-secret-access-key`,`The secret.secretAccessKey field`,{kind:`secret`})),r.vendor===void 0&&(r.vendor=await m(`vendor`,`The vendor field`,[`r2`]));let h=u({bucket:d(r.bucket,`bucket`,`text`),jurisdiction:d(r.jurisdiction,`jurisdiction`,`text`),secret:{accessKeyId:d(r[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:d(r[`secret-secret-access-key`],`secret-secret-access-key`,`text`)},vendor:d(r.vendor,`vendor`,`text`)});a(await s(`Updating`,async()=>l.r2.superSlurper.connectivityPrecheck.target({body:h,account_id:f})),{successLabel:`Updated`})}},nt={command:`connectivity-precheck`,describe:`Operations for super-slurper.connectivity-precheck`,builder:e=>e.command($e).command(tt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function rt(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 it={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:rt,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 h({force:!!r.force,message:`This operation stops every running migration job.`})){process.stderr.write(`Aborted.
|
|
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 Ye={command:`update <bucket-name>`,describe:`Sets configuration for Sippy for an existing R2 bucket.`,builder:Je,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 sippy 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`]))}/sippy`,pathParams:{"bucket-name":String(f[`bucket-name`]??``)},bodyKind:`json`,body:f.body===void 0?u({destination:{accessKeyId:d(f[`destination-access-key-id`],`destination-access-key-id`,`text`),provider:d(f[`destination-provider`],`destination-provider`,`text`),secretAccessKey:d(f[`destination-secret-access-key`],`destination-secret-access-key`,`text`)},source:{accessKeyId:d(f[`source-access-key-id`],`source-access-key-id`,`text`),bucket:d(f[`source-bucket`],`source-bucket`,`text`),provider:d(f[`source-provider`],`source-provider`,`text`),region:d(f[`source-region`],`source-region`,`text`),secretAccessKey:d(f[`source-secret-access-key`],`source-secret-access-key`,`text`),clientEmail:d(f[`source-client-email`],`source-client-email`,`text`),privateKey:d(f[`source-private-key`],`source-private-key`,`text`),bucketUrl:d(f[`source-bucket-url`],`source-bucket-url`,`text`),accountKey:d(f[`source-account-key`],`source-account-key`,`text`),accountName:d(f[`source-account-name`],`source-account-name`,`text`),container:d(f[`source-container`],`source-container`,`text`),sasToken:d(f[`source-sas-token`],`source-sas-token`,`text`)}}):c(f.body)});return}let m=await i(f),h=f.local?e:await t();if(f.accountId=h,f.body){let e=c(f.body);a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/sippy`,{body:e,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`});return}let g={};f[`destination-access-key-id`]!==void 0&&l(g,[`destination`,`accessKeyId`],d(f[`destination-access-key-id`],`destination-access-key-id`,`text`)),f[`destination-provider`]!==void 0&&l(g,[`destination`,`provider`],d(f[`destination-provider`],`destination-provider`,`text`)),f[`destination-secret-access-key`]!==void 0&&l(g,[`destination`,`secretAccessKey`],d(f[`destination-secret-access-key`],`destination-secret-access-key`,`text`)),f[`source-access-key-id`]!==void 0&&l(g,[`source`,`accessKeyId`],d(f[`source-access-key-id`],`source-access-key-id`,`text`)),f[`source-bucket`]!==void 0&&l(g,[`source`,`bucket`],d(f[`source-bucket`],`source-bucket`,`text`)),f[`source-provider`]!==void 0&&l(g,[`source`,`provider`],d(f[`source-provider`],`source-provider`,`text`)),f[`source-region`]!==void 0&&l(g,[`source`,`region`],d(f[`source-region`],`source-region`,`text`)),f[`source-secret-access-key`]!==void 0&&l(g,[`source`,`secretAccessKey`],d(f[`source-secret-access-key`],`source-secret-access-key`,`text`)),f[`source-client-email`]!==void 0&&l(g,[`source`,`clientEmail`],d(f[`source-client-email`],`source-client-email`,`text`)),f[`source-private-key`]!==void 0&&l(g,[`source`,`privateKey`],d(f[`source-private-key`],`source-private-key`,`text`)),f[`source-bucket-url`]!==void 0&&l(g,[`source`,`bucketUrl`],d(f[`source-bucket-url`],`source-bucket-url`,`text`)),f[`source-account-key`]!==void 0&&l(g,[`source`,`accountKey`],d(f[`source-account-key`],`source-account-key`,`text`)),f[`source-account-name`]!==void 0&&l(g,[`source`,`accountName`],d(f[`source-account-name`],`source-account-name`,`text`)),f[`source-container`]!==void 0&&l(g,[`source`,`container`],d(f[`source-container`],`source-container`,`text`)),f[`source-sas-token`]!==void 0&&l(g,[`source`,`sasToken`],d(f[`source-sas-token`],`source-sas-token`,`text`)),a(await s(`Updating`,async()=>r(m,`PUT`,`/accounts/${h}/r2/buckets/${encodeURIComponent(String(f[`bucket-name`]))}/sippy`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(p).length>0?p:void 0})),{successLabel:`Updated`})}},Xe={command:`sippy`,describe:`Operations for buckets.sippy`,builder:e=>e.command(Ge).command(qe).command(Ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ze={command:`buckets`,describe:`Create and configure R2 buckets including CORS, lifecycle, custom domains, event notifications, and object locks`,builder:e=>e.command(w).command(E).command(O).command(q).command(se).command(ye).command(S).command(G).command(ae).command(fe).command(_e).command(we).command(ke).command(Me).command(Ue).command(Xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Qe(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 $e={command:`source`,describe:`Check whether tokens are valid against the source bucket`,builder:Qe,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?u({bucket:d(r.bucket,`bucket`,`text`),endpoint:d(r.endpoint,`endpoint`,`text`),keys:r.keys,pathPrefix:d(r[`path-prefix`],`path-prefix`,`text`),region:d(r.region,`region`,`text`),secret:{accessKeyId:d(r[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:d(r[`secret-secret-access-key`],`secret-secret-access-key`,`text`),clientEmail:d(r[`secret-client-email`],`secret-client-email`,`text`),privateKey:d(r[`secret-private-key`],`secret-private-key`,`text`)},vendor:d(r.vendor,`vendor`,`text`),jurisdiction:d(r.jurisdiction,`jurisdiction`,`text`)}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.r2.superSlurper.connectivityPrecheck.source({body:e,account_id:f})),{successLabel:`Updated`});return}r.bucket===void 0&&(r.bucket=await p(`bucket`,`The bucket field`)),r.vendor===void 0&&(r.vendor=await m(`vendor`,`The vendor field`,[`s3`,`gcs`,`r2`]));let h=u({bucket:d(r.bucket,`bucket`,`text`),endpoint:d(r.endpoint,`endpoint`,`text`),keys:r.keys,pathPrefix:d(r[`path-prefix`],`path-prefix`,`text`),region:d(r.region,`region`,`text`),secret:{accessKeyId:d(r[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:d(r[`secret-secret-access-key`],`secret-secret-access-key`,`text`),clientEmail:d(r[`secret-client-email`],`secret-client-email`,`text`),privateKey:d(r[`secret-private-key`],`secret-private-key`,`text`)},vendor:d(r.vendor,`vendor`,`text`),jurisdiction:d(r.jurisdiction,`jurisdiction`,`text`)});a(await s(`Updating`,async()=>l.r2.superSlurper.connectivityPrecheck.source({body:h,account_id:f})),{successLabel:`Updated`})}};function et(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 tt={command:`target`,describe:`Check whether tokens are valid against the target bucket`,builder:et,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?u({bucket:d(r.bucket,`bucket`,`text`),jurisdiction:d(r.jurisdiction,`jurisdiction`,`text`),secret:{accessKeyId:d(r[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:d(r[`secret-secret-access-key`],`secret-secret-access-key`,`text`)},vendor:d(r.vendor,`vendor`,`text`)}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.r2.superSlurper.connectivityPrecheck.target({body:e,account_id:f})),{successLabel:`Updated`});return}r.bucket===void 0&&(r.bucket=await p(`bucket`,`The bucket field`)),r[`secret-access-key-id`]===void 0&&(r[`secret-access-key-id`]=await p(`secret-access-key-id`,`The secret.accessKeyId field`)),r[`secret-secret-access-key`]===void 0&&(r[`secret-secret-access-key`]=await p(`secret-secret-access-key`,`The secret.secretAccessKey field`,{kind:`secret`})),r.vendor===void 0&&(r.vendor=await m(`vendor`,`The vendor field`,[`r2`]));let h=u({bucket:d(r.bucket,`bucket`,`text`),jurisdiction:d(r.jurisdiction,`jurisdiction`,`text`),secret:{accessKeyId:d(r[`secret-access-key-id`],`secret-access-key-id`,`text`),secretAccessKey:d(r[`secret-secret-access-key`],`secret-secret-access-key`,`text`)},vendor:d(r.vendor,`vendor`,`text`)});a(await s(`Updating`,async()=>l.r2.superSlurper.connectivityPrecheck.target({body:h,account_id:f})),{successLabel:`Updated`})}},nt={command:`connectivity-precheck`,describe:`Operations for super-slurper.connectivity-precheck`,builder:e=>e.command($e).command(tt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function rt(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 it={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:rt,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 h({force:!!r.force,message:`This operation stops every running migration job.`})){process.stderr.write(`Aborted.
|
|
22
22
|
`);return}a(await s(`Deleting`,async()=>c.r2.superSlurper.jobs.abortAll({account_id:l})),{successLabel:`Deleted`})}};function at(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 ot={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:at,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 h({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 st(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`,`fedramp`]}).option(`target-bucket`,{type:`string`,description:`The target.bucket field`}).option(`target-jurisdiction`,{type:`string`,description:`The target.jurisdiction field`,choices:[`default`,`eu`,`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 ct={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:st,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?u({overwrite:r.overwrite,source:{bucket:d(r[`source-bucket`],`source-bucket`,`text`),endpoint:d(r[`source-endpoint`],`source-endpoint`,`text`),keys:r[`source-keys`],pathPrefix:d(r[`source-path-prefix`],`source-path-prefix`,`text`),region:d(r[`source-region`],`source-region`,`text`),secret:{accessKeyId:d(r[`source-secret-access-key-id`],`source-secret-access-key-id`,`text`),secretAccessKey:d(r[`source-secret-secret-access-key`],`source-secret-secret-access-key`,`text`),clientEmail:d(r[`source-secret-client-email`],`source-secret-client-email`,`text`),privateKey:d(r[`source-secret-private-key`],`source-secret-private-key`,`text`)},vendor:d(r[`source-vendor`],`source-vendor`,`text`),jurisdiction:d(r[`source-jurisdiction`],`source-jurisdiction`,`text`)},target:{bucket:d(r[`target-bucket`],`target-bucket`,`text`),jurisdiction:d(r[`target-jurisdiction`],`target-jurisdiction`,`text`),secret:{accessKeyId:d(r[`target-secret-access-key-id`],`target-secret-access-key-id`,`text`),secretAccessKey:d(r[`target-secret-secret-access-key`],`target-secret-secret-access-key`,`text`)},vendor:d(r[`target-vendor`],`target-vendor`,`text`)}}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.r2.superSlurper.jobs.create({...e,account_id:f})),{successLabel:`Created`});return}let p=u({overwrite:r.overwrite,source:{bucket:d(r[`source-bucket`],`source-bucket`,`text`),endpoint:d(r[`source-endpoint`],`source-endpoint`,`text`),keys:r[`source-keys`],pathPrefix:d(r[`source-path-prefix`],`source-path-prefix`,`text`),region:d(r[`source-region`],`source-region`,`text`),secret:{accessKeyId:d(r[`source-secret-access-key-id`],`source-secret-access-key-id`,`text`),secretAccessKey:d(r[`source-secret-secret-access-key`],`source-secret-secret-access-key`,`text`),clientEmail:d(r[`source-secret-client-email`],`source-secret-client-email`,`text`),privateKey:d(r[`source-secret-private-key`],`source-secret-private-key`,`text`)},vendor:d(r[`source-vendor`],`source-vendor`,`text`),jurisdiction:d(r[`source-jurisdiction`],`source-jurisdiction`,`text`)},target:{bucket:d(r[`target-bucket`],`target-bucket`,`text`),jurisdiction:d(r[`target-jurisdiction`],`target-jurisdiction`,`text`),secret:{accessKeyId:d(r[`target-secret-access-key-id`],`target-secret-access-key-id`,`text`),secretAccessKey:d(r[`target-secret-secret-access-key`],`target-secret-secret-access-key`,`text`)},vendor:d(r[`target-vendor`],`target-vendor`,`text`)}});a(await s(`Creating`,async()=>l.r2.superSlurper.jobs.create({...p,account_id:f})),{successLabel:`Created`})}};function lt(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 ut={command:`delete <job-id>`,describe:`Deletes a completed, aborted, or errored R2 Super Slurper migration job. Active jobs cannot be deleted.`,builder:lt,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 h({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 dt(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 ft={command:`get <job-id>`,describe:`Retrieves detailed status and configuration for a specific R2 Super Slurper migration job.`,builder:dt,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 pt(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 mt={command:`list`,describe:`Lists all R2 Super Slurper migration jobs for the account with their status.`,builder:pt,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 ht(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 gt={command:`list`,describe:`Gets log entries for an R2 Super Slurper migration job, showing migration status changes, errors, etc.`,builder:ht,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`})}},_t={command:`logs`,describe:`Operations for super-slurper.jobs.logs`,builder:e=>e.command(gt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function vt(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 yt={command:`pause <job-id>`,describe:`Pauses a running R2 Super Slurper migration job. The job can be resumed later to continue transferring.`,builder:vt,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 $(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 bt={command:`progress <job-id>`,describe:`Retrieves current progress metrics for an R2 Super Slurper migration job`,builder:$,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 xt(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 St={command:`resume <job-id>`,describe:`Resumes a paused R2 Super Slurper migration job, continuing the transfer from where it stopped.`,builder:xt,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`})}},Ct={command:`jobs`,describe:`Operations for super-slurper.jobs`,builder:e=>e.command(ot).command(it).command(ct).command(ut).command(ft).command(mt).command(yt).command(bt).command(St).command(_t).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},wt={command:`super-slurper`,describe:`
|
|
23
|
+
`);return}a(await s(`Deleting`,async()=>c.r2.superSlurper.jobs.abort({account_id:l,job_id:r[`job-id`]})),{successLabel:`Deleted`})}};function st(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 ct={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:st,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?u({overwrite:r.overwrite,source:{bucket:d(r[`source-bucket`],`source-bucket`,`text`),endpoint:d(r[`source-endpoint`],`source-endpoint`,`text`),keys:r[`source-keys`],pathPrefix:d(r[`source-path-prefix`],`source-path-prefix`,`text`),region:d(r[`source-region`],`source-region`,`text`),secret:{accessKeyId:d(r[`source-secret-access-key-id`],`source-secret-access-key-id`,`text`),secretAccessKey:d(r[`source-secret-secret-access-key`],`source-secret-secret-access-key`,`text`),clientEmail:d(r[`source-secret-client-email`],`source-secret-client-email`,`text`),privateKey:d(r[`source-secret-private-key`],`source-secret-private-key`,`text`)},vendor:d(r[`source-vendor`],`source-vendor`,`text`),jurisdiction:d(r[`source-jurisdiction`],`source-jurisdiction`,`text`)},target:{bucket:d(r[`target-bucket`],`target-bucket`,`text`),jurisdiction:d(r[`target-jurisdiction`],`target-jurisdiction`,`text`),secret:{accessKeyId:d(r[`target-secret-access-key-id`],`target-secret-access-key-id`,`text`),secretAccessKey:d(r[`target-secret-secret-access-key`],`target-secret-secret-access-key`,`text`)},vendor:d(r[`target-vendor`],`target-vendor`,`text`)}}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.r2.superSlurper.jobs.create({...e,account_id:f})),{successLabel:`Created`});return}let p=u({overwrite:r.overwrite,source:{bucket:d(r[`source-bucket`],`source-bucket`,`text`),endpoint:d(r[`source-endpoint`],`source-endpoint`,`text`),keys:r[`source-keys`],pathPrefix:d(r[`source-path-prefix`],`source-path-prefix`,`text`),region:d(r[`source-region`],`source-region`,`text`),secret:{accessKeyId:d(r[`source-secret-access-key-id`],`source-secret-access-key-id`,`text`),secretAccessKey:d(r[`source-secret-secret-access-key`],`source-secret-secret-access-key`,`text`),clientEmail:d(r[`source-secret-client-email`],`source-secret-client-email`,`text`),privateKey:d(r[`source-secret-private-key`],`source-secret-private-key`,`text`)},vendor:d(r[`source-vendor`],`source-vendor`,`text`),jurisdiction:d(r[`source-jurisdiction`],`source-jurisdiction`,`text`)},target:{bucket:d(r[`target-bucket`],`target-bucket`,`text`),jurisdiction:d(r[`target-jurisdiction`],`target-jurisdiction`,`text`),secret:{accessKeyId:d(r[`target-secret-access-key-id`],`target-secret-access-key-id`,`text`),secretAccessKey:d(r[`target-secret-secret-access-key`],`target-secret-secret-access-key`,`text`)},vendor:d(r[`target-vendor`],`target-vendor`,`text`)}});a(await s(`Creating`,async()=>l.r2.superSlurper.jobs.create({...p,account_id:f})),{successLabel:`Created`})}};function lt(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 ut={command:`delete <job-id>`,describe:`Deletes a completed, aborted, or errored R2 Super Slurper migration job. Active jobs cannot be deleted.`,builder:lt,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 h({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 dt(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 ft={command:`get <job-id>`,describe:`Retrieves detailed status and configuration for a specific R2 Super Slurper migration job.`,builder:dt,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 pt(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 mt={command:`list`,describe:`Lists all R2 Super Slurper migration jobs for the account with their status.`,builder:pt,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 ht(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 gt={command:`list`,describe:`Gets log entries for an R2 Super Slurper migration job, showing migration status changes, errors, etc.`,builder:ht,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`})}},_t={command:`logs`,describe:`Operations for super-slurper.jobs.logs`,builder:e=>e.command(gt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function vt(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 yt={command:`pause <job-id>`,describe:`Pauses a running R2 Super Slurper migration job. The job can be resumed later to continue transferring.`,builder:vt,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 $(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 bt={command:`progress <job-id>`,describe:`Retrieves current progress metrics for an R2 Super Slurper migration job`,builder:$,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 xt(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 St={command:`resume <job-id>`,describe:`Resumes a paused R2 Super Slurper migration job, continuing the transfer from where it stopped.`,builder:xt,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`})}},Ct={command:`jobs`,describe:`Operations for super-slurper.jobs`,builder:e=>e.command(ot).command(it).command(ct).command(ut).command(ft).command(mt).command(yt).command(bt).command(St).command(_t).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},wt={command:`super-slurper`,describe:`Migrate data from external S3-compatible storage into R2 buckets with resumable transfer jobs`,builder:e=>e.command(nt).command(Ct).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Tt(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 Et={command:`create`,describe:`Creates temporary access credentials on a bucket that can be optionally scoped to prefixes or objects.`,builder:Tt,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?u({bucket:d(r.bucket,`bucket`,`text`),objects:r.objects,parentAccessKeyId:d(r[`parent-access-key-id`],`parent-access-key-id`,`text`),permission:d(r.permission,`permission`,`text`),prefixes:r.prefixes,ttlSeconds:r[`ttl-seconds`]}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.r2.temporaryCredentials.create({...e,account_id:f})),{successLabel:`Created`});return}if(r.bucket===void 0&&(r.bucket=await p(`bucket`,`Name of the R2 bucket.`)),r[`parent-access-key-id`]===void 0&&(r[`parent-access-key-id`]=await p(`parent-access-key-id`,`The parent access key id to use for signing.`)),r.permission===void 0&&(r.permission=await m(`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 h=u({bucket:d(r.bucket,`bucket`,`text`),objects:r.objects,parentAccessKeyId:d(r[`parent-access-key-id`],`parent-access-key-id`,`text`),permission:d(r.permission,`permission`,`text`),prefixes:r.prefixes,ttlSeconds:r[`ttl-seconds`]});a(await s(`Creating`,async()=>l.r2.temporaryCredentials.create({...h,account_id:f})),{successLabel:`Created`})}},Dt={command:`temporary-credentials`,describe:`Generate short-lived S3-compatible credentials scoped to specific buckets and operations`,builder:e=>e.command(Et).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ot={command:`r2`,describe:`S3-compatible object storage with zero egress fees — buckets, lifecycle rules, event notifications, and data migration`,builder:e=>e.command(Ze).command(wt).command(Dt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ot as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n}from"./oauth-B0ETkNcX.mjs";import{r}from"./auth-MQEamPN9.mjs";import{t as i}from"./output-DrpYYfnB.mjs";import{n as a,t as o}from"./progress-CsHIt3Tp.mjs";import{n as s,t as c}from"./body-parser-C-c9gfH1.mjs";import{n as l}from"./input-validation-Bav2M9F-.mjs";import{a as u,n as d}from"./prompt-DdegNPpg.mjs";function f(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`token`,{type:`string`,description:`Provides the Cloudflare API token for accessing R2.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Contains request to store catalog credentials.`})}const p={command:`create <bucket-name>`,describe:`Store authentication credentials for a catalog. These credentials are used to authenticate with R2 storage when performing catalog operations.`,builder:f,handler:async d=>{if(d.dryRun){a({command:`cf r2-data-catalog credentials create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${d[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(d[`bucket-name`]))}/credential`,pathParams:{"bucket-name":String(d[`bucket-name`]??``)},bodyKind:`json`,body:d.body===void 0?c({token:l(d.token,`token`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.r2DataCatalog.credentials.create({...e,account_id:p,bucket_name:d[`bucket-name`]})),{successLabel:`Created`});return}d.token===void 0&&(d.token=await u(`token`,`Provides the Cloudflare API token for accessing R2.`));let m=c({token:l(d.token,`token`,`text`)});i(await o(`Creating`,async()=>f.r2DataCatalog.credentials.create({...m,account_id:p,bucket_name:d[`bucket-name`]})),{successLabel:`Created`})}},m={command:`credentials`,describe:`Catalog access credentials for external query engines (Spark, Trino, etc.)`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`force`,{type:`boolean`,description:`Remove child metadata before deleting the catalog.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`delete <bucket-name>`,describe:`Removes the catalog from the control plane without deleting R2 bucket objects. Set force=true to remove catalog namespaces, tables, views, and maintenance metadata. Force deletion is limited to a configured catalog object count.`,builder:h,handler:async s=>{let c={force:s.force};if(s.dryRun){a({command:`cf r2-data-catalog delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${s[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(s[`bucket-name`]))}/delete`,pathParams:{"bucket-name":String(s[`bucket-name`]??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();if(s.accountId=u,!await d({force:!!s.force,message:`This removes catalog metadata. R2 bucket objects are retained.`})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}i(await o(`Deleting`,async()=>l.r2DataCatalog.delete({account_id:u,bucket_name:s[`bucket-name`],...c})),{successLabel:`Deleted`})}};function _(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name to disable as catalog.`,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 v={command:`disable <bucket-name>`,describe:`Disable an R2 bucket as a catalog. This operation deactivates the catalog but preserves existing metadata and data files. The catalog can be re-enabled later.`,builder:_,handler:async s=>{if(s.dryRun){a({command:`cf r2-data-catalog disable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${s[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(s[`bucket-name`]))}/disable`,pathParams:{"bucket-name":String(s[`bucket-name`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force,message:`This operation turns off the data catalog for the bucket. Existing namespace or table state remains, but writes stop.`})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}i(await o(`Deleting`,async()=>c.r2DataCatalog.disable({account_id:l,bucket_name:s[`bucket-name`]})),{successLabel:`Deleted`})}};function y(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name to enable as catalog.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`enable <bucket-name>`,describe:`Enable an R2 bucket as an Apache Iceberg catalog. This operation creates the necessary catalog infrastructure and activates the bucket for storing Iceberg metadata and data files.`,builder:y,handler:async s=>{if(s.dryRun){a({command:`cf r2-data-catalog enable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${s[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(s[`bucket-name`]))}/enable`,pathParams:{"bucket-name":String(s[`bucket-name`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Creating`,async()=>c.r2DataCatalog.enable({account_id:l,bucket_name:s[`bucket-name`]})),{successLabel:`Created`})}};function x(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get <bucket-name>`,describe:`Retrieve detailed information about a specific R2 catalog by bucket name. Returns catalog status, maintenance configuration, and credential status.`,builder:x,handler:async s=>{if(s.dryRun){a({command:`cf r2-data-catalog get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${s[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(s[`bucket-name`]))}`,pathParams:{"bucket-name":String(s[`bucket-name`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.r2DataCatalog.get({account_id:l,bucket_name:s[`bucket-name`]})),{successLabel:`Loaded`})}};function C(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`list`,describe:`Returns a list of R2 buckets that have been enabled as Apache Iceberg catalogs for the specified account. Each catalog represents an R2 bucket configured to store Iceberg metadata and data files.`,builder:C,handler:async s=>{if(s.dryRun){a({command:`cf r2-data-catalog list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.r2DataCatalog.list({account_id:l})),{successLabel:`Loaded`})}};function T(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get <bucket-name>`,describe:`Retrieve the maintenance configuration for a specific catalog, including compaction settings and credential status.`,builder:T,handler:async s=>{if(s.dryRun){a({command:`cf r2-data-catalog maintenance-configs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${s[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(s[`bucket-name`]))}/maintenance-configs`,pathParams:{"bucket-name":String(s[`bucket-name`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.r2DataCatalog.maintenanceConfigs.get({account_id:l,bucket_name:s[`bucket-name`]})),{successLabel:`Loaded`})}};function D(e){return e.positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`snapshot-expiration-max-snapshot-age`,{type:`string`,description:`Updates the maximum age for snapshots optionally.`}).option(`snapshot-expiration-min-snapshots-to-keep`,{type:`number`,description:`Updates the minimum number of snapshots to retain optionally.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Contains request to update catalog maintenance configuration.`})}const O={command:`update <bucket-name>`,describe:`Update the maintenance configuration for a catalog. This allows you to enable or disable compaction and adjust target file sizes for optimization.`,builder:D,handler:async u=>{if(u.dryRun){a({command:`cf r2-data-catalog maintenance-configs update`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/r2-catalog/${u[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(u[`bucket-name`]))}/maintenance-configs`,pathParams:{"bucket-name":String(u[`bucket-name`]??``)},bodyKind:`json`,body:u.body===void 0?c({snapshot_expiration:{max_snapshot_age:l(u[`snapshot-expiration-max-snapshot-age`],`snapshot-expiration-max-snapshot-age`,`text`),min_snapshots_to_keep:u[`snapshot-expiration-min-snapshots-to-keep`]}}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.r2DataCatalog.maintenanceConfigs.update({...e,account_id:f,bucket_name:u[`bucket-name`]})),{successLabel:`Created`});return}let p=c({snapshot_expiration:{max_snapshot_age:l(u[`snapshot-expiration-max-snapshot-age`],`snapshot-expiration-max-snapshot-age`,`text`),min_snapshots_to_keep:u[`snapshot-expiration-min-snapshots-to-keep`]}});i(await o(`Creating`,async()=>d.r2DataCatalog.maintenanceConfigs.update({...p,account_id:f,bucket_name:u[`bucket-name`]})),{successLabel:`Created`})}},k={command:`maintenance-configs`,describe:`Table maintenance settings — compaction schedules and snapshot expiration policies`,builder:e=>e.command(E).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.option(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`page-token`,{type:`string`,description:`Opaque pagination token from a previous response.
|
|
5
5
|
Use this to fetch the next page of results.`}).option(`page-size`,{type:`number`,description:`Maximum number of namespaces to return per page.
|