cf 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -5
- package/dist/_meta/agent-context.json +12 -4
- package/dist/_meta/commands.json +2249 -262
- package/dist/_meta/hand-written-commands.json +784 -0
- package/dist/_meta/schemas.json +1882 -155
- package/dist/{abuse-reports-CGF4zcKf.mjs → abuse-reports-sDBTV0qZ.mjs} +2 -2
- package/dist/{access-lhLJo1v2.mjs → access-DcNzuCue.mjs} +1 -1
- package/dist/account-BX90zXn5.mjs +2 -0
- package/dist/{account-tags-B88TotoH.mjs → account-tags-Bz3JG5hI.mjs} +4 -4
- package/dist/{accounts-BSIAT_iP.mjs → accounts-DCuW3xyZ.mjs} +12 -12
- package/dist/{acm-VULm1djv.mjs → acm-zjfShZLS.mjs} +1 -1
- package/dist/{addressing-BHPBIkRY.mjs → addressing-DORQ64Ux.mjs} +11 -11
- package/dist/{agent-context-KBy48G1b.mjs → agent-context-BgPR_aQr.mjs} +1 -1
- package/dist/agent-memory-C0hAUMeC.mjs +6 -0
- package/dist/ai-BpEBGMT2.mjs +5 -0
- package/dist/ai-audit-DnU3vn3E.mjs +2 -0
- package/dist/ai-gateway-COOrr_Yw.mjs +13 -0
- package/dist/ai-search-DKbN9Tyd.mjs +7 -0
- package/dist/ai-security-C_I5lo58.mjs +4 -0
- package/dist/{alerting-Bl8OqViR.mjs → alerting-4T8gmZs-.mjs} +1 -1
- package/dist/analytics-Bxh4TCP7.mjs +3 -0
- package/dist/analytics_engine-fV56bjVN.mjs +2 -0
- package/dist/{api-security-4FVrD4n8.mjs → api-security-COk_i184.mjs} +20 -20
- package/dist/argo-DIRfvxvv.mjs +2 -0
- package/dist/{artifacts-CVDGnr2V.mjs → artifacts-BBfXNfUg.mjs} +1 -1
- package/dist/audit-logs-BlOrlAWe.mjs +2 -0
- package/dist/{auth-MQEamPN9.mjs → auth-D3X9HYhD.mjs} +3 -3
- package/dist/auth-DPhNN3Ly.mjs +5 -0
- package/dist/billing-B9e4PnvN.mjs +3 -0
- package/dist/body-parser-BshbixEq.mjs +2 -0
- package/dist/bot-management-D2JVeS-V.mjs +5 -0
- package/dist/botnet-feed-BTzTYs5d.mjs +3 -0
- package/dist/brand-protection-C5Q6Gpw9.mjs +3 -0
- package/dist/{browser-extension-BtpCbh-2.mjs → browser-extension-u5uA0Lwk.mjs} +1 -1
- package/dist/browser-run-CHGOCTdG.mjs +4 -0
- package/dist/build-D0FhOj40.mjs +8 -0
- package/dist/{cache-VyWK1SjY.mjs → cache-C6V7PbQM.mjs} +1 -1
- package/dist/{calls-BxoRYxs4.mjs → calls-Bye8Tyy-.mjs} +1 -1
- package/dist/certificate-authorities-B-U_e6JJ.mjs +2 -0
- package/dist/cf-Ds4JFovl.mjs +18 -0
- package/dist/chunk-LQW53VED-22IYZovK.mjs +119 -0
- package/dist/chunk-QBZBEHZB-CKzQKcIp.mjs +2 -0
- package/dist/{client-certificates-DDUv8K0a.mjs → client-certificates-3RrC-6LG.mjs} +1 -1
- package/dist/{client-side-security-D4ysjwWT.mjs → client-side-security-DIdKvRMT.mjs} +1 -1
- package/dist/cloud-connector-CL1jPQud.mjs +2 -0
- package/dist/cloudforce-one-DULeqLkR.mjs +36 -0
- package/dist/command-C9VP3xaA.mjs +2 -0
- package/dist/{completions-BHE4pRjB.mjs → completions-CqgGKRAC.mjs} +3 -3
- package/dist/config.d.mts +1460 -1348
- package/dist/config.mjs +1 -1
- package/dist/connector-interrupts-CXlLObDv.mjs +2 -0
- package/dist/connector-telemetry-events-BrYX4ig4.mjs +2 -0
- package/dist/connector-telemetry-snapshots-BdeBQYcM.mjs +2 -0
- package/dist/{connectors-BqxYMMtQ.mjs → connectors-BQwyBJ4_.mjs} +1 -1
- package/dist/{containers-CKW081JA.mjs → containers-BrQtGiNp.mjs} +12 -8
- package/dist/{content-scan-Dgd7A8KF.mjs → content-scan-DNzhXYkY.mjs} +1 -1
- package/dist/{csamScanner-DYL37wLc.mjs → csamScanner-CFq5s1Q3.mjs} +1 -1
- package/dist/{ct-alerting-CkhSbfAs.mjs → ct-alerting-CH6UmsGQ.mjs} +1 -1
- package/dist/custom-certificates-DnG73Wg2.mjs +5 -0
- package/dist/custom-csrs-bhClr2SU.mjs +3 -0
- package/dist/{custom-hostnames-q_nsnlye.mjs → custom-hostnames-C0eiGvG9.mjs} +1 -1
- package/dist/custom-nameservers-CVMhhLm6.mjs +3 -0
- package/dist/custom-pages-DTINMR30.mjs +3 -0
- package/dist/d1-sKdExJYF.mjs +20 -0
- package/dist/data-security-mV3a6UfW.mjs +7 -0
- package/dist/dcv-delegation-dBu3jdRw.mjs +2 -0
- package/dist/delegate.mjs +1 -1
- package/dist/{deploy-CZ7bgNDu.mjs → deploy-BL59O1O1.mjs} +1 -1
- package/dist/deploy-input-Dz6q-__n.mjs +2 -0
- package/dist/{dev-V10MG-Bg.mjs → dev-BDaavgH1.mjs} +2 -2
- package/dist/{diagnostics-BTH-8nJH.mjs → diagnostics-CJV6qWUA.mjs} +1 -1
- package/dist/{directory-BlH6N6Qy.mjs → directory-B5zCMusW.mjs} +1 -1
- package/dist/{dispatch-namespaces-BCjH1JzB.mjs → dispatch-namespaces-Dg5lu5xX.mjs} +1 -1
- package/dist/dist-BHi7UhXO.mjs +72 -0
- package/dist/dist-BWpErtDM.mjs +384 -0
- package/dist/{dls-BF5iN78p.mjs → dls-t0hnIe_P.mjs} +1 -1
- package/dist/{dns-CeCTNqRk.mjs → dns-C8FC2hbh.mjs} +13 -13
- package/dist/{dns-firewall-B54MaLGm.mjs → dns-firewall-CuhhUm55.mjs} +1 -1
- package/dist/{dot-prop-6SRZBKHT-wIVDg_fl.mjs → dot-prop-6SRZBKHT-wwGHcwAa.mjs} +1 -1
- package/dist/dry-run-DL2V6yFm.mjs +2 -0
- package/dist/durable-objects-BLrgM3Cw.mjs +2 -0
- package/dist/email-auth-BmYrl0pO.mjs +2 -0
- package/dist/email-routing-CF3_Z957.mjs +6 -0
- package/dist/email-security-F7OYcMkZ.mjs +18 -0
- package/dist/email-sending-EyU3WvGQ.mjs +7 -0
- package/dist/fieldExtractors-Cno37T2m.mjs +3 -0
- package/dist/{firewall-CBPGJ43p.mjs → firewall-8YWWy4iB.mjs} +9 -9
- package/dist/flagship-C4x0l-8J.mjs +4 -0
- package/dist/{fraud-BIhS8pLf.mjs → fraud-HR_SdUx3.mjs} +1 -1
- package/dist/google-tag-gateway-BdcS0WnX.mjs +2 -0
- package/dist/{healthchecks-FiXIk-KP.mjs → healthchecks-4qOvjrTN.mjs} +1 -1
- package/dist/{hostnames-Bx0mykMR.mjs → hostnames-DehdYOMz.mjs} +1 -1
- package/dist/{hyperdrive-C8qCabBF.mjs → hyperdrive-3gD3hn70.mjs} +1 -1
- package/dist/iam-DR72hmii.mjs +6 -0
- package/dist/images-CeKc5JPh.mjs +8 -0
- package/dist/index.mjs +1 -1
- package/dist/{intel-B-9Z_sJs.mjs → intel-DtFix9WL.mjs} +1 -1
- package/dist/{interactive-DtsCYfrK.mjs → interactive-C7M55Wxx.mjs} +1 -1
- package/dist/ips-CtWCjXAN.mjs +2 -0
- package/dist/{keyless-certificates-THHvoXX3.mjs → keyless-certificates-Dk24yQFz.mjs} +1 -1
- package/dist/keys-BmhG6Kn1.mjs +2 -0
- package/dist/{kv-BFDUCnft.mjs → kv-BuVPAuZP.mjs} +1 -1
- package/dist/{leaked-credential-checks-DUlUCOoJ.mjs → leaked-credential-checks-XcZmt1I-.mjs} +1 -1
- package/dist/load-balancers-CylN-l7n.mjs +6 -0
- package/dist/{local-D-aVNu6A.mjs → local-Be3lg_9E.mjs} +1 -1
- package/dist/{local-runtime-Dh3keC5v.mjs → local-runtime-Ce7k598H.mjs} +1 -1
- package/dist/logexplorer-CvRPoKbj.mjs +17 -0
- package/dist/logo-matches-Heuft3yF.mjs +2 -0
- package/dist/logos-DRYjGBDq.mjs +3 -0
- package/dist/{logpush-BK34mMQs.mjs → logpush-Dve9jOMp.mjs} +1 -1
- package/dist/{logs-CLAqX9h2.mjs → logs-SC86FE89.mjs} +1 -1
- package/dist/{magic-cloud-networking-h_ozrC5S.mjs → magic-cloud-networking-DXzeqwX-.mjs} +4 -4
- package/dist/magic-network-monitoring-DW0Jl74i.mjs +4 -0
- package/dist/magic-transit-BK_3asH2.mjs +111 -0
- package/dist/managed-transforms-B6TV4qoE.mjs +3 -0
- package/dist/matches-Iss9Fo4R.mjs +2 -0
- package/dist/mcp-8wxXT6JU.mjs +4 -0
- package/dist/mesh-Bf9UAS4J.mjs +4 -0
- package/dist/{moq-qmuVPAO0.mjs → moq-ZKMFOeVz.mjs} +1 -1
- package/dist/mtls-certificates-DoWm6GiE.mjs +3 -0
- package/dist/{network-D74cSy3t.mjs → network-B1lBARU9.mjs} +1 -1
- package/dist/{network-interconnects-BJ0Nc48J.mjs → network-interconnects-CLYIFHfU.mjs} +1 -1
- package/dist/oauth-DuEONNgC.mjs +14 -0
- package/dist/{oauth-clients-Br-smLxQ.mjs → oauth-clients-DgiTzLzu.mjs} +1 -1
- package/dist/oauth-scopes-BOBRMxjm.mjs +2 -0
- package/dist/observability-Jya7-zkl.mjs +4 -0
- package/dist/{open-PBXRGS4R-R-qesf18.mjs → open-PBXRGS4R-CX8K4WYl.mjs} +3 -3
- package/dist/{organization-NX7yCZrq.mjs → organization-CYxYV4e0.mjs} +6 -6
- package/dist/organizations-SacGUW44.mjs +2 -0
- package/dist/origin-ca-certificates-Ph1bJGQ1.mjs +3 -0
- package/dist/origin-post-quantum-encryption-BBLiGAGB.mjs +2 -0
- package/dist/origin-tls-client-auth-DSDgTN2X.mjs +4 -0
- package/dist/{output-DrpYYfnB.mjs → output-Ccqw2WOb.mjs} +1 -1
- package/dist/page-rules-BqEyFR2c.mjs +27 -0
- package/dist/pages-CQ7ZVWk1.mjs +14 -0
- package/dist/pay-per-crawl-BMe_3_Qj.mjs +4 -0
- package/dist/pipelines-6De2Pe2C.mjs +6 -0
- package/dist/precursor-iwK-1P_d.mjs +4 -0
- package/dist/progress-BqQcF5QH.mjs +2 -0
- package/dist/project-settings-C_1-JI6Y.mjs +3 -0
- package/dist/prompt-B0sWIs9c.mjs +3 -0
- package/dist/{public-BwQqexwo-CNW_dPly.mjs → public-BYCVISMH-DnMJ5Jct.mjs} +1 -1
- package/dist/queries-c7zvnfEQ.mjs +3 -0
- package/dist/queues-BU6y16qS.mjs +6 -0
- package/dist/r2-Jo3QMahK.mjs +24 -0
- package/dist/{r2-data-catalog-Du7hN9jA.mjs → r2-data-catalog-B-tw-JdG.mjs} +1 -1
- package/dist/radar-DIYAMEof.mjs +2 -0
- package/dist/{rate-limits-yBF3qoYD.mjs → rate-limits-DewOcznT.mjs} +1 -1
- package/dist/raw-fetch-Cc-MjHeL.mjs +2 -0
- package/dist/{realtimekit-CIP7lP-a.mjs → realtimekit-cnZEVNDn.mjs} +1 -1
- package/dist/registrar-BsWr_aPM.mjs +23 -0
- package/dist/{registrar-sandbox-DiXg8p_1.mjs → registrar-sandbox-BlcpUyIH.mjs} +4 -4
- package/dist/{registry-Bck_zFkz.mjs → registry-jifR3_Y6.mjs} +1 -1
- package/dist/reporting--1AyTV7k.mjs +2 -0
- package/dist/request-tracers-C_VX7X6-.mjs +2 -0
- package/dist/{resource-sharing-D1pSDvtf.mjs → resource-sharing-Br5dqr3o.mjs} +1 -1
- package/dist/resource-tagging-C33U6T74.mjs +2 -0
- package/dist/rules-BfjzALMi.mjs +4 -0
- package/dist/rulesets-3i_1Vwt-.mjs +5 -0
- package/dist/rum-CjmIckiR.mjs +4 -0
- package/dist/{schema-B34Q9tLF.mjs → schema-1mwmslUV.mjs} +1 -1
- package/dist/schema-flags-llLJuFFw.mjs +5 -0
- package/dist/{scim-CcSyfKCH.mjs → scim-pApmzA5B.mjs} +1 -1
- package/dist/{secrets-store-DFmvtphu.mjs → secrets-store-DBC9WJau.mjs} +1 -1
- package/dist/security-center-Djm06dq-.mjs +2 -0
- package/dist/{security-txt-DqnFpjMI.mjs → security-txt-Ci7bP4zH.mjs} +1 -1
- package/dist/{share-BuwYUzOL.mjs → share-Dj-MNXrw.mjs} +4 -4
- package/dist/shared-BJvq4DkR.mjs +290 -0
- package/dist/smart-shield--8EpJjrF.mjs +4 -0
- package/dist/snippets-Dyz0PH60.mjs +4 -0
- package/dist/{spawn-O1RS01vr.mjs → spawn-C5Z7oWdp.mjs} +108 -112
- package/dist/{spectrum-b7N1ZRAm.mjs → spectrum-rAHWz8rH.mjs} +1 -1
- package/dist/{speed-cw31yFva.mjs → speed-BKepWBXj.mjs} +1 -1
- package/dist/src-gJma71Ec.mjs +108 -0
- package/dist/{ssl-CsEhRVTO.mjs → ssl-KdFiY3ev.mjs} +1 -1
- package/dist/startup-profile-GLNPHQ9U.mjs +17 -0
- package/dist/{state-Bb5Cbc_L.mjs → state-Cu3cItUg.mjs} +1 -1
- package/dist/{stream-DFOao6Gu.mjs → stream-CKJ6Tb0M.mjs} +13 -13
- package/dist/submit-BxbKKhBn.mjs +2 -0
- package/dist/tags-DA8dq9fx.mjs +2 -0
- package/dist/tenant-DLXw48hS.mjs +2 -0
- package/dist/tenant-custom-nameservers-9G93XuvU.mjs +3 -0
- package/dist/{tools-BHfBOZOU.mjs → tools-x8bj9E6b.mjs} +1 -1
- package/dist/{tunnel-DkMiNtVY.mjs → tunnel-CNQA5Flp.mjs} +1 -1
- package/dist/tunnels-CC10EOsU.mjs +2 -0
- package/dist/turnstile-CH58hnf4.mjs +23 -0
- package/dist/{ui-DE8CNn6c.mjs → ui-CmnnBm_O.mjs} +1 -1
- package/dist/url-info-BpCgdUtL.mjs +2 -0
- package/dist/{url-normalization-ClfFiruK.mjs → url-normalization-BzuynEy1.mjs} +1 -1
- package/dist/url-scanner-APIZbhB7.mjs +2 -0
- package/dist/user-2-NGebfI.mjs +12 -0
- package/dist/values-S_bNv819.mjs +2 -0
- package/dist/{vectorize-CVKu7lEt.mjs → vectorize-Bv7feLBC.mjs} +1 -1
- package/dist/waiting-rooms-Dk4LIpvm.mjs +11 -0
- package/dist/{web-assets-C2s9kzWf.mjs → web-assets-C1UmOyzD.mjs} +1 -1
- package/dist/web3-GnUocVYH.mjs +4 -0
- package/dist/workers-J1-PLwdl.mjs +28 -0
- package/dist/{workers-builds-B55-oXOa.mjs → workers-builds-DCHmWOMS.mjs} +1 -1
- package/dist/{workflows-B-kGHxFu.mjs → workflows-CArfEI2c.mjs} +1 -1
- package/dist/zaraz-mg2YlR3_.mjs +2 -0
- package/dist/{zero-trust-DV3sIOvu.mjs → zero-trust-DVdUPtj1.mjs} +67 -66
- package/dist/zone-DMAfrDJX.mjs +2 -0
- package/dist/zones-CNwxUi7I.mjs +21 -0
- package/package.json +10 -7
- package/dist/account-CYRm3yoN.mjs +0 -2
- package/dist/agent-memory-DDv_Gxr7.mjs +0 -6
- package/dist/ai-audit-BWZGvbca.mjs +0 -2
- package/dist/ai-gateway-jeB-sAgP.mjs +0 -13
- package/dist/ai-search-BmdskMjR.mjs +0 -7
- package/dist/ai-security-CsmfcaUx.mjs +0 -4
- package/dist/ai-viHB1tgI.mjs +0 -5
- package/dist/analytics-vOxw8Hy0.mjs +0 -3
- package/dist/analytics_engine-DO4-C0wD.mjs +0 -2
- package/dist/argo-CQfCgazW.mjs +0 -2
- package/dist/audit-logs-CzpwvQ6A.mjs +0 -2
- package/dist/auth-D0xZxAEa.mjs +0 -5
- package/dist/billing-aJgapeRm.mjs +0 -3
- package/dist/body-parser-C-c9gfH1.mjs +0 -2
- package/dist/bot-management-Y2q5d-pi.mjs +0 -5
- package/dist/botnet-feed-DANJqfmE.mjs +0 -3
- package/dist/brand-protection-CjpZWBjp.mjs +0 -3
- package/dist/browser-run-BFn9h2Tz.mjs +0 -4
- package/dist/build-DcflwvqN.mjs +0 -2
- package/dist/certificate-authorities-D7OAFxF_.mjs +0 -2
- package/dist/cf-C7DU4819.mjs +0 -18
- package/dist/chunk-LQW53VED-DLrXV-hE.mjs +0 -499
- package/dist/cloud-connector-Bhec6z2P.mjs +0 -2
- package/dist/cloudforce-one-J_hn9ss9.mjs +0 -36
- package/dist/connector-interrupts-Dycx8zFx.mjs +0 -2
- package/dist/connector-telemetry-events-BmxOSNtN.mjs +0 -2
- package/dist/connector-telemetry-snapshots-CdcqfKnH.mjs +0 -2
- package/dist/custom-certificates-BzAOnEoT.mjs +0 -5
- package/dist/custom-csrs-CgzG3pd3.mjs +0 -3
- package/dist/custom-nameservers-BUBmfhUe.mjs +0 -3
- package/dist/custom-pages-M7jA2Hit.mjs +0 -3
- package/dist/d1-BFvMd6-S.mjs +0 -20
- package/dist/data-security-Bji4Or_j.mjs +0 -7
- package/dist/dcv-delegation-BuoRQ1Yh.mjs +0 -2
- package/dist/deploy-input-CrvuoDGJ.mjs +0 -242
- package/dist/dist-CgrMkXFx.mjs +0 -72
- package/dist/durable-objects-D8FQORrL.mjs +0 -2
- package/dist/email-auth-DJK0Eb30.mjs +0 -2
- package/dist/email-routing-NpmiKIrl.mjs +0 -6
- package/dist/email-security-BLZ7WZ9Z.mjs +0 -18
- package/dist/email-sending-dn-353Nx.mjs +0 -7
- package/dist/fieldExtractors-ahysj57J.mjs +0 -3
- package/dist/flagship-BusjRNIb.mjs +0 -4
- package/dist/google-tag-gateway-TZZ3F1tV.mjs +0 -2
- package/dist/iam-Cj63Kjc6.mjs +0 -6
- package/dist/images-CBWXCDhy.mjs +0 -8
- package/dist/ips-qs9eGJnI.mjs +0 -2
- package/dist/keys-D7N0j4-x.mjs +0 -2
- package/dist/load-balancers-D2zbQ8fT.mjs +0 -6
- package/dist/logexplorer-CUsfZ_bS.mjs +0 -13
- package/dist/logo-matches-CJcthPHf.mjs +0 -2
- package/dist/logos-BS65zN8q.mjs +0 -3
- package/dist/magic-network-monitoring-C7tAPNKP.mjs +0 -4
- package/dist/magic-transit-BtsFePMx.mjs +0 -111
- package/dist/managed-transforms-Cm_KVCMB.mjs +0 -3
- package/dist/matches-InA1hwII.mjs +0 -2
- package/dist/mcp-mJ7bekNJ.mjs +0 -4
- package/dist/mesh-BK4S1Ezy.mjs +0 -4
- package/dist/mtls-certificates-CU4OAAXY.mjs +0 -3
- package/dist/oauth-B0ETkNcX.mjs +0 -15
- package/dist/oauth-scopes-D5bF11ju.mjs +0 -2
- package/dist/observability-BWE0Gg3V.mjs +0 -4
- package/dist/organizations-DLhiRt8g.mjs +0 -2
- package/dist/origin-ca-certificates-Ff4McZRQ.mjs +0 -3
- package/dist/origin-post-quantum-encryption-UuTr4_SW.mjs +0 -2
- package/dist/origin-tls-client-auth-DOJ1zlH3.mjs +0 -4
- package/dist/page-rules-BSz1gO-_.mjs +0 -18
- package/dist/pages-DVDogxPs.mjs +0 -14
- package/dist/pay-per-crawl-BrLXK7gT.mjs +0 -4
- package/dist/pipelines-BszRk4sM.mjs +0 -6
- package/dist/precursor-BPNjQr76.mjs +0 -4
- package/dist/progress-CsHIt3Tp.mjs +0 -2
- package/dist/prompt-DdegNPpg.mjs +0 -3
- package/dist/queries-JL1H1Biz.mjs +0 -3
- package/dist/queues-DpkYdRUE.mjs +0 -6
- package/dist/r2-CKozthw_.mjs +0 -24
- package/dist/radar-C-92vggG.mjs +0 -2
- package/dist/raw-fetch-CteyTOM2.mjs +0 -2
- package/dist/registrar-DKKN0M29.mjs +0 -21
- package/dist/reporting-fg_GKXe1.mjs +0 -2
- package/dist/request-tracers-CkMya96z.mjs +0 -2
- package/dist/resource-tagging-z48JGHCq.mjs +0 -2
- package/dist/rules-BTmNjDN-.mjs +0 -4
- package/dist/rulesets-CsoSM-17.mjs +0 -5
- package/dist/rum-DB4iO2q5.mjs +0 -4
- package/dist/schema-flags-iGoOriJt.mjs +0 -5
- package/dist/security-center-DFKeHq5c.mjs +0 -2
- package/dist/session-D6KHthHf.mjs +0 -2
- package/dist/shared-VppSAQf4.mjs +0 -2
- package/dist/smart-shield-D6X8L7p8.mjs +0 -4
- package/dist/snippets-DIpc9pb_.mjs +0 -4
- package/dist/src-D_HETJNy.mjs +0 -108
- package/dist/submit--xTzyNPy.mjs +0 -2
- package/dist/tags-efICDkah.mjs +0 -2
- package/dist/tenant-CerHuToJ.mjs +0 -2
- package/dist/tenant-custom-nameservers-C4otMBm2.mjs +0 -3
- package/dist/triggers-BEsiiKAf.mjs +0 -2
- package/dist/tunnels-D0J8lJoI.mjs +0 -2
- package/dist/turnstile-CFmtY5bn.mjs +0 -23
- package/dist/url-info-DBCeRWwb.mjs +0 -2
- package/dist/url-scanner-CNyvg65L.mjs +0 -2
- package/dist/user-bifVEQq5.mjs +0 -12
- package/dist/values-OxkdP1tV.mjs +0 -2
- package/dist/versions-BVL-Ludh.mjs +0 -2
- package/dist/waiting-rooms-CmRAl51T.mjs +0 -11
- package/dist/web3-y_cY91V_.mjs +0 -4
- package/dist/workers-jDcq14GH.mjs +0 -24
- package/dist/zaraz-27zwjLvv.mjs +0 -2
- package/dist/zone-BJix2KQ9.mjs +0 -2
- package/dist/zones-Bkj5i92c.mjs +0 -21
- /package/dist/{alerts-CRmjqOZi.mjs → alerts-15-IW4jE.mjs} +0 -0
- /package/dist/{autorag-BD7cu5NU.mjs → autorag-CFwRkEKw.mjs} +0 -0
- /package/dist/{brands-BhALBkX2.mjs → brands-BgT1vu9B.mjs} +0 -0
- /package/dist/{chunk-6EUZQHAF-B7bSMYLe.mjs → chunk-6EUZQHAF-C3w62dek.mjs} +0 -0
- /package/dist/{clear-BgF8No7D.mjs → clear-BlCK85Me.mjs} +0 -0
- /package/dist/{cli-types-BsTty22w.mjs → cli-types-DAYeL_Mj.mjs} +0 -0
- /package/dist/{connector-telemetry-events-latest-BY2556uL.mjs → connector-telemetry-events-latest-BbpcII3_.mjs} +0 -0
- /package/dist/{connector-telemetry-snapshots-latest-BHYdxUEF.mjs → connector-telemetry-snapshots-latest-DuCiimXl.mjs} +0 -0
- /package/dist/{domain-info-C50W5GhA.mjs → domain-info-C7LBxPBt.mjs} +0 -0
- /package/dist/{health-BFNZqiAm.mjs → health-DZFfafkX.mjs} +0 -0
- /package/dist/{input-validation-Bav2M9F-.mjs → input-validation-QDIYu7Vb.mjs} +0 -0
- /package/dist/{internal-BTeSewwB.mjs → internal-BKHC2D1Y.mjs} +0 -0
- /package/dist/{live-Dkiyu30_.mjs → live-DwCvDmaH.mjs} +0 -0
- /package/dist/{metadata-8AkOftcB.mjs → metadata-B5yfL0ln.mjs} +0 -0
- /package/dist/{rate-limit-analytics-Dz-Wv1T0.mjs → rate-limit-analytics-B8Vuu1sU.mjs} +0 -0
- /package/dist/{ready-TKOkKeRg.mjs → ready-D9H2zHHI.mjs} +0 -0
- /package/dist/{recent-submissions-3Asm6eIi.mjs → recent-submissions-BPo0J80d.mjs} +0 -0
- /package/dist/{refute-BVz9nMyd.mjs → refute-2W8NLCN4.mjs} +0 -0
- /package/dist/{resolve-CeBbH6Pq.mjs → resolve-B8CyM1mi.mjs} +0 -0
- /package/dist/{scan-logo-ZteA-PUV.mjs → scan-logo-D5x6F1Y0.mjs} +0 -0
- /package/dist/{scan-page-DWDSyzQ7.mjs → scan-page-CWhta3x7.mjs} +0 -0
- /package/dist/{search-DGNc37HK.mjs → search-DZmBQJL9.mjs} +0 -0
- /package/dist/{signed-url-B5Qpn2mn.mjs → signed-url-CQrmWgz5.mjs} +0 -0
- /package/dist/{submission-info-FjUolE6A.mjs → submission-info-C98A0bqq.mjs} +0 -0
- /package/dist/{theme-CeVf-5qG.mjs → theme-CrIBazAF.mjs} +0 -0
- /package/dist/{total-queries-NHJj1HGq.mjs → total-queries-BZoaFoDE.mjs} +0 -0
- /package/dist/{tracked-domains-CniKVHIp.mjs → tracked-domains-CNHogPHx.mjs} +0 -0
- /package/dist/{verify-DS1PWAJe.mjs → verify-4e4L9IRk.mjs} +0 -0
package/dist/pages-DVDogxPs.mjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
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,t as d}from"./input-validation-Bav2M9F-.mjs";import{a as f,i as p,n as m}from"./prompt-DdegNPpg.mjs";import{t as h}from"./cli-types-BsTty22w.mjs";function ee(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`config-deployments-enabled`,{type:`boolean`,description:`Whether to enable automatic deployments when pushing to the source repository.
|
|
3
|
-
When disabled, no deployments (production or preview) will be triggered automatically.
|
|
4
|
-
`}).option(`config-owner`,{type:`string`,description:`The owner of the repository.`}).option(`config-owner-id`,{type:`string`,description:`The owner ID of the repository.`}).option(`config-path-excludes`,{type:`string`,array:!0,description:"A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported."}).option(`config-path-includes`,{type:`string`,array:!0,description:"A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported."}).option(`config-pr-comments-enabled`,{type:`boolean`,description:`Whether to enable PR comments.`}).option(`config-preview-branch-excludes`,{type:`string`,array:!0,description:"A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`."}).option(`config-preview-branch-includes`,{type:`string`,array:!0,description:"A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`."}).option(`config-preview-deployment-setting`,{type:`string`,description:`Controls whether commits to preview branches trigger a preview deployment.`,choices:[`all`,`none`,`custom`]}).option(`config-production-branch`,{type:`string`,description:`The production branch of the repository.`}).option(`config-production-deployments-enabled`,{type:`boolean`,description:`Whether to trigger a production deployment on commits to the production branch.`}).option(`config-repo-id`,{type:`string`,description:`The ID of the repository.`}).option(`config-repo-name`,{type:`string`,description:`The name of the repository.`}).option(`type`,{type:`string`,description:`The source control management provider.`,choices:[`github`,`gitlab`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Configs for the project source control.`})}const g={command:`connect-source <project-name>`,describe:`Connect a Git repository source to an existing Pages project.`,builder:ee,handler:async r=>{if(r.dryRun){o({command:`cf pages projects connect-source`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/source`,pathParams:{"project-name":String(r[`project-name`]??``)},bodyKind:`json`,body:r.body===void 0?l({config:{deployments_enabled:r[`config-deployments-enabled`],owner:u(r[`config-owner`],`config-owner`,`text`),owner_id:u(r[`config-owner-id`],`config-owner-id`,`text`),path_excludes:r[`config-path-excludes`],path_includes:r[`config-path-includes`],pr_comments_enabled:r[`config-pr-comments-enabled`],preview_branch_excludes:r[`config-preview-branch-excludes`],preview_branch_includes:r[`config-preview-branch-includes`],preview_deployment_setting:u(r[`config-preview-deployment-setting`],`config-preview-deployment-setting`,`text`),production_branch:u(r[`config-production-branch`],`config-production-branch`,`text`),production_deployments_enabled:r[`config-production-deployments-enabled`],repo_id:u(r[`config-repo-id`],`config-repo-id`,`text`),repo_name:u(r[`config-repo-name`],`config-repo-name`,`text`)},type:u(r.type,`type`,`text`)}):c(r.body)});return}let d=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()=>d.pages.projects.connectSource({body:e,account_id:m,project_name:r[`project-name`]})),{successLabel:`Created`});return}if(r[`config-deployments-enabled`]===void 0)throw Error(`--config-deployments-enabled is required (or pass --body with this field set).`);if(r[`config-owner`]===void 0&&(r[`config-owner`]=await f(`config-owner`,`The owner of the repository.`)),r[`config-owner-id`]===void 0&&(r[`config-owner-id`]=await f(`config-owner-id`,`The owner ID of the repository.`)),r[`config-path-excludes`]===void 0)throw Error(`--config-path-excludes is required (or pass --body with this field set).`);if(r[`config-path-includes`]===void 0)throw Error(`--config-path-includes is required (or pass --body with this field set).`);if(r[`config-pr-comments-enabled`]===void 0)throw Error(`--config-pr-comments-enabled is required (or pass --body with this field set).`);if(r[`config-preview-branch-excludes`]===void 0)throw Error(`--config-preview-branch-excludes is required (or pass --body with this field set).`);if(r[`config-preview-branch-includes`]===void 0)throw Error(`--config-preview-branch-includes is required (or pass --body with this field set).`);if(r[`config-preview-deployment-setting`]===void 0&&(r[`config-preview-deployment-setting`]=await p(`config-preview-deployment-setting`,`Controls whether commits to preview branches trigger a preview deployment.`,[`all`,`none`,`custom`])),r[`config-production-branch`]===void 0&&(r[`config-production-branch`]=await f(`config-production-branch`,`The production branch of the repository.`)),r[`config-production-deployments-enabled`]===void 0)throw Error(`--config-production-deployments-enabled is required (or pass --body with this field set).`);r[`config-repo-id`]===void 0&&(r[`config-repo-id`]=await f(`config-repo-id`,`The ID of the repository.`)),r[`config-repo-name`]===void 0&&(r[`config-repo-name`]=await f(`config-repo-name`,`The name of the repository.`)),r.type===void 0&&(r.type=await p(`type`,`The source control management provider.`,[`github`,`gitlab`]));let h=l({config:{deployments_enabled:r[`config-deployments-enabled`],owner:u(r[`config-owner`],`config-owner`,`text`),owner_id:u(r[`config-owner-id`],`config-owner-id`,`text`),path_excludes:r[`config-path-excludes`],path_includes:r[`config-path-includes`],pr_comments_enabled:r[`config-pr-comments-enabled`],preview_branch_excludes:r[`config-preview-branch-excludes`],preview_branch_includes:r[`config-preview-branch-includes`],preview_deployment_setting:u(r[`config-preview-deployment-setting`],`config-preview-deployment-setting`,`text`),production_branch:u(r[`config-production-branch`],`config-production-branch`,`text`),production_deployments_enabled:r[`config-production-deployments-enabled`],repo_id:u(r[`config-repo-id`],`config-repo-id`,`text`),repo_name:u(r[`config-repo-name`],`config-repo-name`,`text`)},type:u(r.type,`type`,`text`)});a(await s(`Creating`,async()=>d.pages.projects.connectSource({body:h,account_id:m,project_name:r[`project-name`]})),{successLabel:`Created`})}};function _(e){return e.option(`build-config-build-caching`,{type:`boolean`,description:`Enable build caching for the project.`}).option(`build-config-build-command`,{type:`string`,description:`Command used to build project.`}).option(`build-config-destination-dir`,{type:`string`,description:`Output directory of the build.`}).option(`build-config-root-dir`,{type:`string`,description:`Directory to run the command.`}).option(`build-config-web-analytics-tag`,{type:`string`,description:`The classifying tag for analytics.`}).option(`build-config-web-analytics-token`,{type:`string`,description:`The auth token for analytics.`}).option(`deployment-configs-preview-always-use-latest-compatibility-date`,{type:`boolean`,description:`Whether to always use the latest compatibility date for Pages Functions.`}).option(`deployment-configs-preview-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`}).option(`deployment-configs-preview-compatibility-date`,{type:`string`,description:`Compatibility date used for Pages Functions.`}).option(`deployment-configs-preview-compatibility-flags`,{type:`string`,array:!0,description:`Compatibility flags used for Pages Functions.`}).option(`deployment-configs-preview-fail-open`,{type:`boolean`,description:`Whether to fail open when the deployment config cannot be applied.`}).option(`deployment-configs-preview-limits-cpu-ms`,{type:`number`,description:`CPU time limit in milliseconds.`}).option(`deployment-configs-preview-placement-mode`,{type:`string`,description:`Placement mode.`}).option(`deployment-configs-preview-usage-model`,{type:`string`,description:`The usage model for Pages Functions.`,choices:[`standard`,`bundled`,`unbound`]}).option(`deployment-configs-preview-wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration used for the deployment.`}).option(`deployment-configs-production-always-use-latest-compatibility-date`,{type:`boolean`,description:`Whether to always use the latest compatibility date for Pages Functions.`}).option(`deployment-configs-production-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`}).option(`deployment-configs-production-compatibility-date`,{type:`string`,description:`Compatibility date used for Pages Functions.`}).option(`deployment-configs-production-compatibility-flags`,{type:`string`,array:!0,description:`Compatibility flags used for Pages Functions.`}).option(`deployment-configs-production-fail-open`,{type:`boolean`,description:`Whether to fail open when the deployment config cannot be applied.`}).option(`deployment-configs-production-limits-cpu-ms`,{type:`number`,description:`CPU time limit in milliseconds.`}).option(`deployment-configs-production-placement-mode`,{type:`string`,description:`Placement mode.`}).option(`deployment-configs-production-usage-model`,{type:`string`,description:`The usage model for Pages Functions.`,choices:[`standard`,`bundled`,`unbound`]}).option(`deployment-configs-production-wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration used for the deployment.`}).option(`name`,{type:`string`,description:`Name of the project.`}).option(`production-branch`,{type:`string`,description:`Production branch of the project. Used to identify production deployments.`}).option(`source-config-deployments-enabled`,{type:`boolean`,description:`Whether to enable automatic deployments when pushing to the source repository.
|
|
5
|
-
When disabled, no deployments (production or preview) will be triggered automatically.
|
|
6
|
-
`}).option(`source-config-owner`,{type:`string`,description:`The owner of the repository.`}).option(`source-config-owner-id`,{type:`string`,description:`The owner ID of the repository.`}).option(`source-config-path-excludes`,{type:`string`,array:!0,description:"A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported."}).option(`source-config-path-includes`,{type:`string`,array:!0,description:"A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported."}).option(`source-config-pr-comments-enabled`,{type:`boolean`,description:`Whether to enable PR comments.`}).option(`source-config-preview-branch-excludes`,{type:`string`,array:!0,description:"A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`."}).option(`source-config-preview-branch-includes`,{type:`string`,array:!0,description:"A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`."}).option(`source-config-preview-deployment-setting`,{type:`string`,description:`Controls whether commits to preview branches trigger a preview deployment.`,choices:[`all`,`none`,`custom`]}).option(`source-config-production-branch`,{type:`string`,description:`The production branch of the repository.`}).option(`source-config-production-deployments-enabled`,{type:`boolean`,description:`Whether to trigger a production deployment on commits to the production branch.`}).option(`source-config-repo-id`,{type:`string`,description:`The ID of the repository.`}).option(`source-config-repo-name`,{type:`string`,description:`The name of the repository.`}).option(`source-type`,{type:`string`,description:`The source control management provider.`,choices:[`github`,`gitlab`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`deployment-configs-preview-always-use-latest-compatibility-date`,`deployment-configs-preview-build-image-major-version`,`deployment-configs-preview-compatibility-date`,`deployment-configs-preview-compatibility-flags`,`deployment-configs-preview-fail-open`,`deployment-configs-preview-limits-cpu-ms`,`deployment-configs-preview-placement-mode`,`deployment-configs-preview-usage-model`,`deployment-configs-preview-wrangler-config-hash`,`deployment-configs-production-always-use-latest-compatibility-date`,`deployment-configs-production-build-image-major-version`,`deployment-configs-production-compatibility-date`,`deployment-configs-production-compatibility-flags`,`deployment-configs-production-fail-open`,`deployment-configs-production-limits-cpu-ms`,`deployment-configs-production-placement-mode`,`deployment-configs-production-usage-model`,`deployment-configs-production-wrangler-config-hash`].some(t=>e[t]!==void 0)){let t=[`deployment-configs-preview-limits-cpu-ms`,`deployment-configs-preview-placement-mode`,`deployment-configs-production-limits-cpu-ms`,`deployment-configs-production-placement-mode`].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 --deployment_configs-* flag is set`)}return!0}).check(e=>{if([`source-config-deployments-enabled`,`source-config-owner`,`source-config-owner-id`,`source-config-path-excludes`,`source-config-path-includes`,`source-config-pr-comments-enabled`,`source-config-preview-branch-excludes`,`source-config-preview-branch-includes`,`source-config-preview-deployment-setting`,`source-config-production-branch`,`source-config-production-deployments-enabled`,`source-config-repo-id`,`source-config-repo-name`,`source-type`].some(t=>e[t]!==void 0)){let t=[`source-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 --source-* flag is set`)}return!0})}const v={command:`create`,describe:`Create a new project.`,builder:_,handler:async r=>{if(r.dryRun){o({command:`cf pages projects create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({build_config:{build_caching:r[`build-config-build-caching`],build_command:u(r[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:u(r[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:u(r[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:u(r[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:u(r[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)},deployment_configs:{preview:{always_use_latest_compatibility_date:r[`deployment-configs-preview-always-use-latest-compatibility-date`],build_image_major_version:r[`deployment-configs-preview-build-image-major-version`],compatibility_date:u(r[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`),compatibility_flags:r[`deployment-configs-preview-compatibility-flags`],fail_open:r[`deployment-configs-preview-fail-open`],limits:{cpu_ms:r[`deployment-configs-preview-limits-cpu-ms`]},placement:{mode:u(r[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:u(r[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:u(r[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)},production:{always_use_latest_compatibility_date:r[`deployment-configs-production-always-use-latest-compatibility-date`],build_image_major_version:r[`deployment-configs-production-build-image-major-version`],compatibility_date:u(r[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`),compatibility_flags:r[`deployment-configs-production-compatibility-flags`],fail_open:r[`deployment-configs-production-fail-open`],limits:{cpu_ms:r[`deployment-configs-production-limits-cpu-ms`]},placement:{mode:u(r[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:u(r[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:u(r[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:u(r.name,`name`,`text`),production_branch:u(r[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:r[`source-config-deployments-enabled`],owner:u(r[`source-config-owner`],`source-config-owner`,`text`),owner_id:u(r[`source-config-owner-id`],`source-config-owner-id`,`text`),path_excludes:r[`source-config-path-excludes`],path_includes:r[`source-config-path-includes`],pr_comments_enabled:r[`source-config-pr-comments-enabled`],preview_branch_excludes:r[`source-config-preview-branch-excludes`],preview_branch_includes:r[`source-config-preview-branch-includes`],preview_deployment_setting:u(r[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:u(r[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:r[`source-config-production-deployments-enabled`],repo_id:u(r[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:u(r[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:u(r[`source-type`],`source-type`,`text`)}}):c(r.body)});return}let d=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()=>d.pages.projects.create({...e,account_id:p})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await f(`name`,`Name of the project.`)),r[`production-branch`]===void 0&&(r[`production-branch`]=await f(`production-branch`,`Production branch of the project. Used to identify production deployments.`));let m=l({build_config:{build_caching:r[`build-config-build-caching`],build_command:u(r[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:u(r[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:u(r[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:u(r[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:u(r[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)},deployment_configs:{preview:{always_use_latest_compatibility_date:r[`deployment-configs-preview-always-use-latest-compatibility-date`],build_image_major_version:r[`deployment-configs-preview-build-image-major-version`],compatibility_date:u(r[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`),compatibility_flags:r[`deployment-configs-preview-compatibility-flags`],fail_open:r[`deployment-configs-preview-fail-open`],limits:{cpu_ms:r[`deployment-configs-preview-limits-cpu-ms`]},placement:{mode:u(r[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:u(r[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:u(r[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)},production:{always_use_latest_compatibility_date:r[`deployment-configs-production-always-use-latest-compatibility-date`],build_image_major_version:r[`deployment-configs-production-build-image-major-version`],compatibility_date:u(r[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`),compatibility_flags:r[`deployment-configs-production-compatibility-flags`],fail_open:r[`deployment-configs-production-fail-open`],limits:{cpu_ms:r[`deployment-configs-production-limits-cpu-ms`]},placement:{mode:u(r[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:u(r[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:u(r[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:u(r.name,`name`,`text`),production_branch:u(r[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:r[`source-config-deployments-enabled`],owner:u(r[`source-config-owner`],`source-config-owner`,`text`),owner_id:u(r[`source-config-owner-id`],`source-config-owner-id`,`text`),path_excludes:r[`source-config-path-excludes`],path_includes:r[`source-config-path-includes`],pr_comments_enabled:r[`source-config-pr-comments-enabled`],preview_branch_excludes:r[`source-config-preview-branch-excludes`],preview_branch_includes:r[`source-config-preview-branch-includes`],preview_deployment_setting:u(r[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:u(r[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:r[`source-config-production-deployments-enabled`],repo_id:u(r[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:u(r[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:u(r[`source-type`],`source-type`,`text`)}});a(await s(`Creating`,async()=>d.pages.projects.create({...m,account_id:p})),{successLabel:`Created`})}};function y(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,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 b={command:`delete <project-name>`,describe:`Delete a project by name.`,builder:y,handler:async r=>{if(r.dryRun){o({command:`cf pages projects delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}`,pathParams:{"project-name":String(r[`project-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await m({force:!!r.force})){process.stderr.write(`Aborted.
|
|
7
|
-
`);return}a(await s(`Deleting`,async()=>c.pages.projects.delete({account_id:l,project_name:r[`project-name`]})),{successLabel:`Deleted`})}};function x(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,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)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`branch`,{type:`string`,description:"The branch to build the new deployment from. The `HEAD` of the branch will be used. If omitted, the production branch will be used by default."}).option(`commit-dirty`,{type:`string`,description:`Boolean string indicating if the working directory has uncommitted changes.`}).option(`commit-hash`,{type:`string`,description:`Git commit SHA associated with this deployment.`}).option(`commit-message`,{type:`string`,description:`Git commit message associated with this deployment.`}).option(`manifest`,{type:`string`,description:`JSON string containing a manifest of files to deploy. Maps file paths to their content hashes. Required for direct upload deployments. Maximum 20,000 entries. `}).option(`pages-build-output-dir`,{type:`string`,description:`The build output directory path.`}).option(`wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration file used for this deployment.`})}const S={command:`create <project-name>`,describe:`Start a new deployment from production. The repository and account must have already been authorized on the Cloudflare Pages dashboard.`,builder:x,handler:async c=>{if(c.dryRun){o({command:`cf pages projects deployments create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${c[`project-name`]==null?`<project-name>`:encodeURIComponent(String(c[`project-name`]))}/deployments`,pathParams:{"project-name":String(c[`project-name`]??``)},bodyKind:`multipart`,body:{body:c.body,file:c.file,branch:c.branch,"commit-dirty":c[`commit-dirty`],"commit-hash":c[`commit-hash`],"commit-message":c[`commit-message`],manifest:c.manifest,"pages-build-output-dir":c[`pages-build-output-dir`],"wrangler-config-hash":c[`wrangler-config-hash`]}});return}let l=await i(c),f=c.local?e:await t();if(c.accountId=f,c.file!==void 0||c.body!==void 0||c.branch!==void 0||c[`commit-dirty`]!==void 0||c[`commit-hash`]!==void 0||c[`commit-message`]!==void 0||c.manifest!==void 0||c[`pages-build-output-dir`]!==void 0||c[`wrangler-config-hash`]!==void 0){let e=new FormData;if(c.file){let t=d(c.file);e.append(`_headers`,new Blob([t]),c.file.split(/[\\/]/).filter(Boolean).pop())}else c.body!==void 0&&e.append(`_headers`,c.body);c.branch!==void 0&&e.append(`branch`,String(u(c.branch,`branch`,`text`)??``)),c[`commit-dirty`]!==void 0&&e.append(`commit_dirty`,String(u(c[`commit-dirty`],`commit-dirty`,`text`)??``)),c[`commit-hash`]!==void 0&&e.append(`commit_hash`,String(u(c[`commit-hash`],`commit-hash`,`text`)??``)),c[`commit-message`]!==void 0&&e.append(`commit_message`,String(u(c[`commit-message`],`commit-message`,`text`)??``)),c.manifest!==void 0&&e.append(`manifest`,String(u(c.manifest,`manifest`,`text`)??``)),c[`pages-build-output-dir`]!==void 0&&e.append(`pages_build_output_dir`,String(u(c[`pages-build-output-dir`],`pages-build-output-dir`,`text`)??``)),c[`wrangler-config-hash`]!==void 0&&e.append(`wrangler_config_hash`,String(u(c[`wrangler-config-hash`],`wrangler-config-hash`,`text`)??``)),a(await s(`Creating`,async()=>r(l,`POST`,`/accounts/${f}/pages/projects/${encodeURIComponent(String(c[`project-name`]))}/deployments`,{body:e})),{successLabel:`Created`});return}if(c.body){let e=u(c.body,`body`,`binary`);a(await s(`Creating`,async()=>r(l,`POST`,`/accounts/${f}/pages/projects/${encodeURIComponent(String(c[`project-name`]))}/deployments`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}a(await s(`Creating`,async()=>l.pages.projects.deployments.create({account_id:f,project_name:c[`project-name`]})),{successLabel:`Created`})}};function C(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`force`,{type:`boolean`,description:`Allow deletion of aliased non-production deployments when a normal delete would be rejected.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`delete <deployment-id>`,describe:`Delete a deployment.`,builder:C,handler:async r=>{let c={force:r.force};if(r.dryRun){o({command:`cf pages projects deployments delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/deployments/${r[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(r[`deployment-id`]))}`,pathParams:{"deployment-id":String(r[`deployment-id`]??``),"project-name":String(r[`project-name`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();if(r.accountId=u,!await m({force:!!r.force})){process.stderr.write(`Aborted.
|
|
8
|
-
`);return}a(await s(`Deleting`,async()=>l.pages.projects.deployments.delete({account_id:u,project_name:r[`project-name`],deployment_id:r[`deployment-id`],...c})),{successLabel:`Deleted`})}};function T(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get <deployment-id>`,describe:`Fetch information about a deployment.`,builder:T,handler:async r=>{if(r.dryRun){o({command:`cf pages projects deployments get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/deployments/${r[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(r[`deployment-id`]))}`,pathParams:{"deployment-id":String(r[`deployment-id`]??``),"project-name":String(r[`project-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.pages.projects.deployments.get({account_id:l,project_name:r[`project-name`],deployment_id:r[`deployment-id`]})),{successLabel:`Loaded`})}};function D(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get <deployment-id>`,describe:`Fetch deployment logs for a project.`,builder:D,handler:async r=>{if(r.dryRun){o({command:`cf pages projects deployments history logs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/deployments/${r[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(r[`deployment-id`]))}/history/logs`,pathParams:{"deployment-id":String(r[`deployment-id`]??``),"project-name":String(r[`project-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.pages.projects.deployments.history.logs.get({account_id:l,project_name:r[`project-name`],deployment_id:r[`deployment-id`]})),{successLabel:`Loaded`})}},k={command:`logs`,describe:`Operations for projects.deployments.history.logs`,builder:e=>e.command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},A={command:`history`,describe:`Operations for projects.deployments.history`,builder:e=>e.command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`env`,{type:`string`,description:`What type of deployments to fetch.`,choices:[`production`,`preview`]}).option(`page`,{type:`number`,description:`Which page of deployments to fetch.`}).option(`per-page`,{type:`number`,description:`How many deployments to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`list`,describe:`Fetch a list of project deployments.`,builder:h(j),handler:async r=>{let c={env:r.env,page:r.page,per_page:r[`per-page`]};if(r.dryRun){o({command:`cf pages projects deployments list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/deployments`,pathParams:{"project-name":String(r[`project-name`]??``)},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.pages.projects.deployments.list({account_id:u,project_name:r[`project-name`],...c})),{successLabel:`Loaded`})}};function N(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`retry <deployment-id>`,describe:`Retry a previous deployment.`,builder:N,handler:async r=>{if(r.dryRun){o({command:`cf pages projects deployments retry`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/deployments/${r[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(r[`deployment-id`]))}/retry`,pathParams:{"deployment-id":String(r[`deployment-id`]??``),"project-name":String(r[`project-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.pages.projects.deployments.retry({account_id:l,project_name:r[`project-name`],deployment_id:r[`deployment-id`]})),{successLabel:`Created`})}};function F(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`rollback <deployment-id>`,describe:`Rollback the production deployment to a previous deployment. You can only rollback to succesful builds on production.`,builder:F,handler:async r=>{if(r.dryRun){o({command:`cf pages projects deployments rollback`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/deployments/${r[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(r[`deployment-id`]))}/rollback`,pathParams:{"deployment-id":String(r[`deployment-id`]??``),"project-name":String(r[`project-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.pages.projects.deployments.rollback({account_id:l,project_name:r[`project-name`],deployment_id:r[`deployment-id`]})),{successLabel:`Created`})}};function L(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,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:`create <deployment-id>`,describe:`Start a tail that receives logs and exception data.`,builder:L,handler:async r=>{if(r.dryRun){o({command:`cf pages projects deployments tails create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/deployments/${r[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(r[`deployment-id`]))}/tails`,pathParams:{"deployment-id":String(r[`deployment-id`]??``),"project-name":String(r[`project-name`]??``)},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.pages.projects.deployments.tails.create({...e,account_id:u,project_name:r[`project-name`],deployment_id:r[`deployment-id`]})),{successLabel:`Created`});return}a(await s(`Creating`,async()=>l.pages.projects.deployments.tails.create({account_id:u,project_name:r[`project-name`],deployment_id:r[`deployment-id`]})),{successLabel:`Created`})}};function z(e){return e.positional(`tail-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`deployment-id`,{type:`string`,description:`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 te={command:`delete <tail-id>`,describe:`Deletes a tail from a Pages deployment.`,builder:z,handler:async r=>{if(r.dryRun){o({command:`cf pages projects deployments tails delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/deployments/${r[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(r[`deployment-id`]))}/tails/${r[`tail-id`]==null?`<tail-id>`:encodeURIComponent(String(r[`tail-id`]))}`,pathParams:{"tail-id":String(r[`tail-id`]??``),"deployment-id":String(r[`deployment-id`]??``),"project-name":String(r[`project-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await m({force:!!r.force})){process.stderr.write(`Aborted.
|
|
9
|
-
`);return}a(await s(`Deleting`,async()=>c.pages.projects.deployments.tails.delete({account_id:l,project_name:r[`project-name`],deployment_id:r[`deployment-id`],tail_id:r[`tail-id`]})),{successLabel:`Deleted`})}},B={command:`tails`,describe:`Operations for projects.deployments.tails`,builder:e=>e.command(R).command(te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},V={command:`deployments`,describe:`Operations for projects.deployments`,builder:e=>e.command(S).command(w).command(E).command(M).command(P).command(I).command(A).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function H(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,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 U={command:`disconnect-source <project-name>`,describe:`Disconnect the Git repository source from an existing Pages project.`,builder:H,handler:async r=>{if(r.dryRun){o({command:`cf pages projects disconnect-source`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/source`,pathParams:{"project-name":String(r[`project-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await m({force:!!r.force})){process.stderr.write(`Aborted.
|
|
10
|
-
`);return}a(await s(`Deleting`,async()=>c.pages.projects.disconnectSource({account_id:l,project_name:r[`project-name`]})),{successLabel:`Deleted`})}};function W(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`name`,{type:`string`,description:`The domain name.`}).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:`create <project-name>`,describe:`Add a new domain for the Pages project.`,builder:W,handler:async r=>{if(r.dryRun){o({command:`cf pages projects domains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/domains`,pathParams:{"project-name":String(r[`project-name`]??``)},bodyKind:`json`,body:r.body===void 0?l({name:u(r.name,`name`,`text`)}):c(r.body)});return}let d=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()=>d.pages.projects.domains.create({...e,account_id:p,project_name:r[`project-name`]})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await f(`name`,`The domain name.`));let m=l({name:u(r.name,`name`,`text`)});a(await s(`Creating`,async()=>d.pages.projects.domains.create({...m,account_id:p,project_name:r[`project-name`]})),{successLabel:`Created`})}};function K(e){return e.positional(`domain-name`,{type:`string`,description:`The domain name.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,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 q={command:`delete <domain-name>`,describe:`Delete a Pages project's domain.`,builder:K,handler:async r=>{if(r.dryRun){o({command:`cf pages projects domains delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/domains/${r[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(r[`domain-name`]))}`,pathParams:{"domain-name":String(r[`domain-name`]??``),"project-name":String(r[`project-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await m({force:!!r.force})){process.stderr.write(`Aborted.
|
|
11
|
-
`);return}a(await s(`Deleting`,async()=>c.pages.projects.domains.delete({account_id:l,project_name:r[`project-name`],domain_name:r[`domain-name`]})),{successLabel:`Deleted`})}};function J(e){return e.positional(`domain-name`,{type:`string`,description:`The domain name.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`edit <domain-name>`,describe:`Retry the validation status of a single domain.`,builder:J,handler:async r=>{if(r.dryRun){o({command:`cf pages projects domains edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/domains/${r[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(r[`domain-name`]))}`,pathParams:{"domain-name":String(r[`domain-name`]??``),"project-name":String(r[`project-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Updating`,async()=>c.pages.projects.domains.edit({account_id:l,project_name:r[`project-name`],domain_name:r[`domain-name`]})),{successLabel:`Updated`})}};function X(e){return e.positional(`domain-name`,{type:`string`,description:`The domain name.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`get <domain-name>`,describe:`Fetch a single domain.`,builder:X,handler:async r=>{if(r.dryRun){o({command:`cf pages projects domains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/domains/${r[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(r[`domain-name`]))}`,pathParams:{"domain-name":String(r[`domain-name`]??``),"project-name":String(r[`project-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.pages.projects.domains.get({account_id:l,project_name:r[`project-name`],domain_name:r[`domain-name`]})),{successLabel:`Loaded`})}};function Q(e){return e.option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`list`,describe:`Fetch a list of all domains associated with a Pages project.`,builder:Q,handler:async r=>{if(r.dryRun){o({command:`cf pages projects domains list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/domains`,pathParams:{"project-name":String(r[`project-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.pages.projects.domains.list({account_id:l,project_name:r[`project-name`]})),{successLabel:`Loaded`})}},re={command:`domains`,describe:`Operations for projects.domains`,builder:e=>e.command(G).command(q).command(Y).command(Z).command(ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ie(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`build-config-build-caching`,{type:`boolean`,description:`Enable build caching for the project.`}).option(`build-config-build-command`,{type:`string`,description:`Command used to build project.`}).option(`build-config-destination-dir`,{type:`string`,description:`Output directory of the build.`}).option(`build-config-root-dir`,{type:`string`,description:`Directory to run the command.`}).option(`build-config-web-analytics-tag`,{type:`string`,description:`The classifying tag for analytics.`}).option(`build-config-web-analytics-token`,{type:`string`,description:`The auth token for analytics.`}).option(`deployment-configs-preview-always-use-latest-compatibility-date`,{type:`boolean`,description:`Whether to always use the latest compatibility date for Pages Functions.`}).option(`deployment-configs-preview-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`}).option(`deployment-configs-preview-compatibility-date`,{type:`string`,description:`Compatibility date used for Pages Functions.`}).option(`deployment-configs-preview-compatibility-flags`,{type:`string`,array:!0,description:`Compatibility flags used for Pages Functions.`}).option(`deployment-configs-preview-fail-open`,{type:`boolean`,description:`Whether to fail open when the deployment config cannot be applied.`}).option(`deployment-configs-preview-limits-cpu-ms`,{type:`number`,description:`CPU time limit in milliseconds.`}).option(`deployment-configs-preview-placement-mode`,{type:`string`,description:`Placement mode.`}).option(`deployment-configs-preview-usage-model`,{type:`string`,description:`The usage model for Pages Functions.`,choices:[`standard`,`bundled`,`unbound`]}).option(`deployment-configs-preview-wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration used for the deployment.`}).option(`deployment-configs-production-always-use-latest-compatibility-date`,{type:`boolean`,description:`Whether to always use the latest compatibility date for Pages Functions.`}).option(`deployment-configs-production-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`}).option(`deployment-configs-production-compatibility-date`,{type:`string`,description:`Compatibility date used for Pages Functions.`}).option(`deployment-configs-production-compatibility-flags`,{type:`string`,array:!0,description:`Compatibility flags used for Pages Functions.`}).option(`deployment-configs-production-fail-open`,{type:`boolean`,description:`Whether to fail open when the deployment config cannot be applied.`}).option(`deployment-configs-production-limits-cpu-ms`,{type:`number`,description:`CPU time limit in milliseconds.`}).option(`deployment-configs-production-placement-mode`,{type:`string`,description:`Placement mode.`}).option(`deployment-configs-production-usage-model`,{type:`string`,description:`The usage model for Pages Functions.`,choices:[`standard`,`bundled`,`unbound`]}).option(`deployment-configs-production-wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration used for the deployment.`}).option(`name`,{type:`string`,description:`Name of the project.`}).option(`production-branch`,{type:`string`,description:`Production branch of the project. Used to identify production deployments.`}).option(`source-config-deployments-enabled`,{type:`boolean`,description:`Whether to enable automatic deployments when pushing to the source repository.
|
|
12
|
-
When disabled, no deployments (production or preview) will be triggered automatically.
|
|
13
|
-
`}).option(`source-config-owner`,{type:`string`,description:`The owner of the repository.`}).option(`source-config-owner-id`,{type:`string`,description:`The owner ID of the repository.`}).option(`source-config-path-excludes`,{type:`string`,array:!0,description:"A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported."}).option(`source-config-path-includes`,{type:`string`,array:!0,description:"A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported."}).option(`source-config-pr-comments-enabled`,{type:`boolean`,description:`Whether to enable PR comments.`}).option(`source-config-preview-branch-excludes`,{type:`string`,array:!0,description:"A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`."}).option(`source-config-preview-branch-includes`,{type:`string`,array:!0,description:"A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`."}).option(`source-config-preview-deployment-setting`,{type:`string`,description:`Controls whether commits to preview branches trigger a preview deployment.`,choices:[`all`,`none`,`custom`]}).option(`source-config-production-branch`,{type:`string`,description:`The production branch of the repository.`}).option(`source-config-production-deployments-enabled`,{type:`boolean`,description:`Whether to trigger a production deployment on commits to the production branch.`}).option(`source-config-repo-id`,{type:`string`,description:`The ID of the repository.`}).option(`source-config-repo-name`,{type:`string`,description:`The name of the repository.`}).option(`source-type`,{type:`string`,description:`The source control management provider.`,choices:[`github`,`gitlab`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`deployment-configs-preview-always-use-latest-compatibility-date`,`deployment-configs-preview-build-image-major-version`,`deployment-configs-preview-compatibility-date`,`deployment-configs-preview-compatibility-flags`,`deployment-configs-preview-fail-open`,`deployment-configs-preview-limits-cpu-ms`,`deployment-configs-preview-placement-mode`,`deployment-configs-preview-usage-model`,`deployment-configs-preview-wrangler-config-hash`,`deployment-configs-production-always-use-latest-compatibility-date`,`deployment-configs-production-build-image-major-version`,`deployment-configs-production-compatibility-date`,`deployment-configs-production-compatibility-flags`,`deployment-configs-production-fail-open`,`deployment-configs-production-limits-cpu-ms`,`deployment-configs-production-placement-mode`,`deployment-configs-production-usage-model`,`deployment-configs-production-wrangler-config-hash`].some(t=>e[t]!==void 0)){let t=[`deployment-configs-preview-limits-cpu-ms`,`deployment-configs-preview-placement-mode`,`deployment-configs-production-limits-cpu-ms`,`deployment-configs-production-placement-mode`].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 --deployment_configs-* flag is set`)}return!0}).check(e=>{if([`source-config-deployments-enabled`,`source-config-owner`,`source-config-owner-id`,`source-config-path-excludes`,`source-config-path-includes`,`source-config-pr-comments-enabled`,`source-config-preview-branch-excludes`,`source-config-preview-branch-includes`,`source-config-preview-deployment-setting`,`source-config-production-branch`,`source-config-production-deployments-enabled`,`source-config-repo-id`,`source-config-repo-name`,`source-type`].some(t=>e[t]!==void 0)){let t=[`source-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 --source-* flag is set`)}return!0})}const ae={command:`edit <project-name>`,describe:`Set new attributes for an existing project. Modify environment variables. To delete an environment variable, set the key to null.`,builder:ie,handler:async r=>{if(r.dryRun){o({command:`cf pages projects edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}`,pathParams:{"project-name":String(r[`project-name`]??``)},bodyKind:`json`,body:r.body===void 0?l({build_config:{build_caching:r[`build-config-build-caching`],build_command:u(r[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:u(r[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:u(r[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:u(r[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:u(r[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)},deployment_configs:{preview:{always_use_latest_compatibility_date:r[`deployment-configs-preview-always-use-latest-compatibility-date`],build_image_major_version:r[`deployment-configs-preview-build-image-major-version`],compatibility_date:u(r[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`),compatibility_flags:r[`deployment-configs-preview-compatibility-flags`],fail_open:r[`deployment-configs-preview-fail-open`],limits:{cpu_ms:r[`deployment-configs-preview-limits-cpu-ms`]},placement:{mode:u(r[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:u(r[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:u(r[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)},production:{always_use_latest_compatibility_date:r[`deployment-configs-production-always-use-latest-compatibility-date`],build_image_major_version:r[`deployment-configs-production-build-image-major-version`],compatibility_date:u(r[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`),compatibility_flags:r[`deployment-configs-production-compatibility-flags`],fail_open:r[`deployment-configs-production-fail-open`],limits:{cpu_ms:r[`deployment-configs-production-limits-cpu-ms`]},placement:{mode:u(r[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:u(r[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:u(r[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:u(r.name,`name`,`text`),production_branch:u(r[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:r[`source-config-deployments-enabled`],owner:u(r[`source-config-owner`],`source-config-owner`,`text`),owner_id:u(r[`source-config-owner-id`],`source-config-owner-id`,`text`),path_excludes:r[`source-config-path-excludes`],path_includes:r[`source-config-path-includes`],pr_comments_enabled:r[`source-config-pr-comments-enabled`],preview_branch_excludes:r[`source-config-preview-branch-excludes`],preview_branch_includes:r[`source-config-preview-branch-includes`],preview_deployment_setting:u(r[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:u(r[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:r[`source-config-production-deployments-enabled`],repo_id:u(r[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:u(r[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:u(r[`source-type`],`source-type`,`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(`Updating`,async()=>d.pages.projects.edit({...e,account_id:f,project_name:r[`project-name`]})),{successLabel:`Updated`});return}let p=l({build_config:{build_caching:r[`build-config-build-caching`],build_command:u(r[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:u(r[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:u(r[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:u(r[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:u(r[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)},deployment_configs:{preview:{always_use_latest_compatibility_date:r[`deployment-configs-preview-always-use-latest-compatibility-date`],build_image_major_version:r[`deployment-configs-preview-build-image-major-version`],compatibility_date:u(r[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`),compatibility_flags:r[`deployment-configs-preview-compatibility-flags`],fail_open:r[`deployment-configs-preview-fail-open`],limits:{cpu_ms:r[`deployment-configs-preview-limits-cpu-ms`]},placement:{mode:u(r[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:u(r[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:u(r[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)},production:{always_use_latest_compatibility_date:r[`deployment-configs-production-always-use-latest-compatibility-date`],build_image_major_version:r[`deployment-configs-production-build-image-major-version`],compatibility_date:u(r[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`),compatibility_flags:r[`deployment-configs-production-compatibility-flags`],fail_open:r[`deployment-configs-production-fail-open`],limits:{cpu_ms:r[`deployment-configs-production-limits-cpu-ms`]},placement:{mode:u(r[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:u(r[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:u(r[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:u(r.name,`name`,`text`),production_branch:u(r[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:r[`source-config-deployments-enabled`],owner:u(r[`source-config-owner`],`source-config-owner`,`text`),owner_id:u(r[`source-config-owner-id`],`source-config-owner-id`,`text`),path_excludes:r[`source-config-path-excludes`],path_includes:r[`source-config-path-includes`],pr_comments_enabled:r[`source-config-pr-comments-enabled`],preview_branch_excludes:r[`source-config-preview-branch-excludes`],preview_branch_includes:r[`source-config-preview-branch-includes`],preview_deployment_setting:u(r[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:u(r[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:r[`source-config-production-deployments-enabled`],repo_id:u(r[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:u(r[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:u(r[`source-type`],`source-type`,`text`)}});a(await s(`Updating`,async()=>d.pages.projects.edit({...p,account_id:f,project_name:r[`project-name`]})),{successLabel:`Updated`})}};function oe(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $={command:`get-upload-token <project-name>`,describe:`Get a short-lived JWT for Pages Direct Upload asset operations.`,builder:oe,handler:async r=>{if(r.dryRun){o({command:`cf pages projects get-upload-token`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/upload-token`,pathParams:{"project-name":String(r[`project-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.pages.projects.getUploadToken({account_id:l,project_name:r[`project-name`]})),{successLabel:`Loaded`})}};function se(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ce={command:`get <project-name>`,describe:`Fetch a project by name.`,builder:se,handler:async r=>{if(r.dryRun){o({command:`cf pages projects get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}`,pathParams:{"project-name":String(r[`project-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.pages.projects.get({account_id:l,project_name:r[`project-name`]})),{successLabel:`Loaded`})}};function le(e){return e.option(`page`,{type:`number`,description:`Which page of projects to fetch.`}).option(`per-page`,{type:`number`,description:`How many projects to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ue={command:`list`,describe:`Fetch a list of all user projects.`,builder:le,handler:async r=>{let c={page:r.page,per_page:r[`per-page`]};if(r.dryRun){o({command:`cf pages projects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects`,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.pages.projects.list({account_id:u,...c})),{successLabel:`Loaded`})}};function de(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,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 fe={command:`purge-build-cache <project-name>`,describe:`Purge all cached build artifacts for a Pages project`,builder:de,handler:async r=>{if(r.dryRun){o({command:`cf pages projects purge-build-cache`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pages/projects/${r[`project-name`]==null?`<project-name>`:encodeURIComponent(String(r[`project-name`]))}/purge_build_cache`,pathParams:{"project-name":String(r[`project-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await m({force:!!r.force,message:`This operation purges the build cache for a Pages project.`})){process.stderr.write(`Aborted.
|
|
14
|
-
`);return}a(await s(`Deleting`,async()=>c.pages.projects.purgeBuildCache({account_id:l,project_name:r[`project-name`]})),{successLabel:`Deleted`})}},pe={command:`projects`,describe:`Pages projects, deployments, build logs, and custom domain bindings`,builder:e=>e.command(g).command(v).command(b).command(U).command(ae).command(ce).command($).command(ue).command(fe).command(V).command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},me={command:`pages`,describe:`Full-stack application hosting with Git-integrated builds, preview deployments, and custom domains`,builder:e=>e.command(pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{me as default};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n,h as r}from"./oauth-B0ETkNcX.mjs";import{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"./prompt-DdegNPpg.mjs";import{t as d}from"./cli-types-BsTty22w.mjs";function f(e){return e.option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`price-usd-microcents`,{type:`number`,description:`Price in microcents 1 USD = 100,000,000 microcents. Must be 0 or a multiple of 100,000 $0.001. Range: $0.001–$9,999.999.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Data for setting flag on zones`})}const p={command:`create`,describe:`Creates the pay-per-crawl config for a zone.`,builder:f,handler:async e=>{if(e.dryRun){o({command:`cf pay-per-crawl config create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/pay-per-crawl/configuration`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({enabled:e.enabled,price_usd_microcents:e[`price-usd-microcents`]}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Creating`,async()=>t.payPerCrawl.config.create({body:r,zone_id:n})),{successLabel:`Created`});return}let u=l({enabled:e.enabled,price_usd_microcents:e[`price-usd-microcents`]});a(await s(`Creating`,async()=>t.payPerCrawl.config.create({body:u,zone_id:n})),{successLabel:`Created`})}};function m(e){return e.option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`price-usd-microcents`,{type:`number`,description:`Price in microcents 1 USD = 100,000,000 microcents. Must be 0 or a multiple of 100,000 $0.001. Range: $0.001–$9,999.999.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Data for setting flag on zones`})}const h={command:`edit`,describe:`Changes the pay-per-crawl config for a zone.`,builder:m,handler:async e=>{if(e.dryRun){o({command:`cf pay-per-crawl config edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/pay-per-crawl/configuration`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({enabled:e.enabled,price_usd_microcents:e[`price-usd-microcents`]}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Updating`,async()=>t.payPerCrawl.config.edit({body:r,zone_id:n})),{successLabel:`Updated`});return}let u=l({enabled:e.enabled,price_usd_microcents:e[`price-usd-microcents`]});a(await s(`Updating`,async()=>t.payPerCrawl.config.edit({body:u,zone_id:n})),{successLabel:`Updated`})}};function g(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get`,describe:`Gets the pay-per-crawl config for a zone including the bot configuration.`,builder:g,handler:async e=>{if(e.dryRun){o({command:`cf pay-per-crawl config get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/pay-per-crawl/configuration`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.payPerCrawl.config.get({zone_id:n})),{successLabel:`Loaded`})}},v={command:`config`,describe:`Operations for config`,builder:e=>e.command(p).command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`create`,describe:`Creates the stripe config for a crawler.`,builder:y,handler:async r=>{if(r.dryRun){o({command:`cf pay-per-crawl crawler stripe create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-per-crawl/crawler/stripe`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.payPerCrawl.crawler.stripe.create({account_id:l})),{successLabel:`Created`})}};function x(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 S={command:`delete`,describe:`Deletes the stripe config for a crawler.`,builder:x,handler:async r=>{if(r.dryRun){o({command:`cf pay-per-crawl crawler stripe delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-per-crawl/crawler/stripe`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await u({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}a(await s(`Deleting`,async()=>c.payPerCrawl.crawler.stripe.delete({account_id:l})),{successLabel:`Deleted`})}};function C(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`get`,describe:`Gets the stripe config for a crawler.`,builder:C,handler:async r=>{if(r.dryRun){o({command:`cf pay-per-crawl crawler stripe get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-per-crawl/crawler/stripe`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.payPerCrawl.crawler.stripe.get({account_id:l})),{successLabel:`Loaded`})}},T={command:`stripe`,describe:`Operations for crawler.stripe`,builder:e=>e.command(b).command(S).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},E={command:`crawler`,describe:`Operations for crawler`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function D(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`list`,describe:`Lists the crawlers known to pay-per-crawl.`,builder:D,handler:async r=>{if(r.dryRun){o({command:`cf pay-per-crawl crawlers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-per-crawl/crawlers`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.payPerCrawl.crawlers.list({account_id:l})),{successLabel:`Loaded`})}},k={command:`crawlers`,describe:`Operations for crawlers`,builder:e=>e.command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`create`,describe:`Creates the stripe config for a publisher.`,builder:A,handler:async r=>{if(r.dryRun){o({command:`cf pay-per-crawl publisher stripe create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-per-crawl/publisher/stripe`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.payPerCrawl.publisher.stripe.create({account_id:l})),{successLabel:`Created`})}};function M(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 N={command:`delete`,describe:`Deletes the stripe config for a publisher.`,builder:M,handler:async r=>{if(r.dryRun){o({command:`cf pay-per-crawl publisher stripe delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-per-crawl/publisher/stripe`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await u({force:!!r.force})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}a(await s(`Deleting`,async()=>c.payPerCrawl.publisher.stripe.delete({account_id:l})),{successLabel:`Deleted`})}};function ee(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get`,describe:`Gets the stripe config for a publisher.`,builder:ee,handler:async r=>{if(r.dryRun){o({command:`cf pay-per-crawl publisher stripe get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-per-crawl/publisher/stripe`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.payPerCrawl.publisher.stripe.get({account_id:l})),{successLabel:`Loaded`})}},F={command:`stripe`,describe:`Operations for publisher.stripe`,builder:e=>e.command(j).command(N).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},I={command:`publisher`,describe:`Operations for publisher`,builder:e=>e.command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`get-signature-link`,describe:`Gets a download link for the account's signed pay-per-crawl terms.`,builder:L,handler:async r=>{if(r.dryRun){o({command:`cf pay-per-crawl terms get-signature-link`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-per-crawl/signature_link`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.payPerCrawl.terms.getSignatureLink({account_id:l})),{successLabel:`Loaded`})}};function z(e){return e.option(`remote`,{type:`boolean`,description:`Refresh the signature status from Ironclad.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`get-signature`,describe:`Gets the account's pay-per-crawl terms signature status.`,builder:z,handler:async r=>{let c={remote:r.remote};if(r.dryRun){o({command:`cf pay-per-crawl terms get-signature`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-per-crawl/terms/signature`,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.payPerCrawl.terms.getSignature({account_id:u,...c})),{successLabel:`Loaded`})}};function V(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get`,describe:`Gets the pay-per-crawl terms and conditions contract.`,builder:V,handler:async r=>{if(r.dryRun){o({command:`cf pay-per-crawl terms get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-per-crawl/terms`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.payPerCrawl.terms.get({account_id:l})),{successLabel:`Loaded`})}};function U(e){return e.option(`event-type`,{type:`string`,description:`The terms activity to record.`,choices:[`agreed`,`displayed`],demandOption:!0}).option(`vid`,{type:`string`,description:`Ironclad contract version ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`send-signature-event`,describe:`Records that an account displayed or agreed to the pay-per-crawl terms.`,builder:d(U),handler:async r=>{let c={event_type:r[`event-type`],vid:r.vid};if(r.dryRun){o({command:`cf pay-per-crawl terms send-signature-event`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-per-crawl/terms/signature`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Creating`,async()=>l.payPerCrawl.terms.sendSignatureEvent({account_id:u,...c})),{successLabel:`Created`})}},G={command:`terms`,describe:`Operations for terms`,builder:e=>e.command(H).command(B).command(R).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`get-can-be-enabled`,describe:`Gets whether pay-per-crawl can be enabled for a zone.`,builder:K,handler:async e=>{if(e.dryRun){o({command:`cf pay-per-crawl zones get-can-be-enabled`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/pay-per-crawl/can_be_enabled`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.payPerCrawl.zones.getCanBeEnabled({zone_id:n})),{successLabel:`Loaded`})}};function J(e){return e.option(`zones`,{type:`string`,array:!0,description:`The zones field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Zone IDs to check for pay-per-crawl eligibility`})}const Y={command:`query-can-be-enabled`,describe:`Provided a list of pay-per-crawl configured zones this method will return whether they can enable PPC or not.`,builder:J,handler:async r=>{if(r.dryRun){o({command:`cf pay-per-crawl zones query-can-be-enabled`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-per-crawl/zones_can_be_enabled/query`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({zones:r.zones}):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.payPerCrawl.zones.queryCanBeEnabled({...e,account_id:d})),{successLabel:`Created`});return}let f=l({zones:r.zones});a(await s(`Creating`,async()=>u.payPerCrawl.zones.queryCanBeEnabled({...f,account_id:d})),{successLabel:`Created`})}};function X(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Data for setting flag on zones`})}const Z={command:`set-can-be-enabled`,describe:`Allows an account admin to set the can_be_enabled setting on a list of zones.`,builder:X,handler:async r=>{if(r.dryRun){o({command:`cf pay-per-crawl zones set-can-be-enabled`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-per-crawl/zones_can_be_enabled`,pathParams:{},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(`Updating`,async()=>l.payPerCrawl.zones.setCanBeEnabled({body:e,account_id:u})),{successLabel:`Updated`});return}if(r.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},Q={command:`zones`,describe:`Operations for zones`,builder:e=>e.command(q).command(Y).command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},$={command:`pay-per-crawl`,describe:`pay-per-crawl`,builder:e=>e.command(v).command(E).command(k).command(I).command(G).command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{$ as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
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,i as d,n as f}from"./prompt-DdegNPpg.mjs";function p(e){return e.option(`name`,{type:`string`,description:`Specifies the name of the Pipeline.`}).option(`sql`,{type:`string`,description:`Specifies SQL for the Pipeline processing flow.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`create`,describe:`Create a new Pipeline.`,builder:p,handler:async d=>{if(d.dryRun){a({command:`cf pipelines create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/pipelines`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({name:l(d.name,`name`,`text`),sql:l(d.sql,`sql`,`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.pipelines.create({...e,account_id:p})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await u(`name`,`Specifies the name of the Pipeline.`)),d.sql===void 0&&(d.sql=await u(`sql`,`Specifies SQL for the Pipeline processing flow.`));let m=c({name:l(d.name,`name`,`text`),sql:l(d.sql,`sql`,`text`)});i(await o(`Creating`,async()=>f.pipelines.create({...m,account_id:p})),{successLabel:`Created`})}};function h(e){return e.positional(`pipeline-id`,{type:`string`,description:`Specifies the public ID of the pipeline.`,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 g={command:`delete <pipeline-id>`,describe:`Delete Pipeline in Account.`,builder:h,handler:async s=>{if(s.dryRun){a({command:`cf pipelines delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/pipelines/${s[`pipeline-id`]==null?`<pipeline-id>`:encodeURIComponent(String(s[`pipeline-id`]))}`,pathParams:{"pipeline-id":String(s[`pipeline-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}i(await o(`Deleting`,async()=>c.pipelines.delete({account_id:l,pipeline_id:s[`pipeline-id`]})),{successLabel:`Deleted`})}};function _(e){return e.positional(`pipeline-id`,{type:`string`,description:`Specifies the public ID of the pipeline.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <pipeline-id>`,describe:`Get Pipeline details.`,builder:_,handler:async s=>{if(s.dryRun){a({command:`cf pipelines get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/pipelines/${s[`pipeline-id`]==null?`<pipeline-id>`:encodeURIComponent(String(s[`pipeline-id`]))}`,pathParams:{"pipeline-id":String(s[`pipeline-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.pipelines.get({account_id:l,pipeline_id:s[`pipeline-id`]})),{successLabel:`Loaded`})}};function y(e){return e.option(`destination-batch-max-bytes`,{type:`number`,description:`Specifies rough maximum size of files.`,default:1e8}).option(`destination-batch-max-duration-s`,{type:`number`,description:`Specifies duration to wait to aggregate batches files.`,default:300}).option(`destination-batch-max-rows`,{type:`number`,description:`Specifies rough maximum number of rows per file.`,default:1e7}).option(`destination-compression-type`,{type:`string`,description:`Specifies the desired compression algorithm and format.`,choices:[`none`,`gzip`,`deflate`],default:`gzip`}).option(`destination-credentials-access-key-id`,{type:`string`,description:`Specifies the R2 Bucket Access Key Id.`}).option(`destination-credentials-endpoint`,{type:`string`,description:`Specifies the R2 Endpoint.`}).option(`destination-credentials-secret-access-key`,{type:`string`,description:`Specifies the R2 Bucket Secret Access Key.`}).option(`destination-format`,{type:`string`,description:`Specifies the format of data to deliver.`,choices:[`json`]}).option(`destination-path-bucket`,{type:`string`,description:`Specifies the R2 Bucket to store files.`}).option(`destination-path-filepath`,{type:`string`,description:`Specifies the name pattern for directory.`}).option(`destination-path-prefix`,{type:`string`,description:`Specifies the base directory within the bucket.`}).option(`destination-type`,{type:`string`,description:`Specifies the type of destination.`,choices:[`r2`]}).option(`name`,{type:`string`,description:`Defines the name of the pipeline.`}).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:`legacy-create`,describe:`[DEPRECATED] Create a new pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:y,handler:async f=>{if(f.dryRun){a({command:`cf pipelines legacy-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({destination:{batch:{max_bytes:f[`destination-batch-max-bytes`],max_duration_s:f[`destination-batch-max-duration-s`],max_rows:f[`destination-batch-max-rows`]},compression:{type:l(f[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:l(f[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:l(f[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:l(f[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:l(f[`destination-format`],`destination-format`,`text`),path:{bucket:l(f[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:l(f[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:l(f[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:l(f[`destination-type`],`destination-type`,`text`)},name:l(f.name,`name`,`text`)}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Creating`,async()=>p.pipelines.legacyCreate({...e,account_id:m})),{successLabel:`Created`});return}f[`destination-credentials-access-key-id`]===void 0&&(f[`destination-credentials-access-key-id`]=await u(`destination-credentials-access-key-id`,`Specifies the R2 Bucket Access Key Id.`)),f[`destination-credentials-endpoint`]===void 0&&(f[`destination-credentials-endpoint`]=await u(`destination-credentials-endpoint`,`Specifies the R2 Endpoint.`)),f[`destination-credentials-secret-access-key`]===void 0&&(f[`destination-credentials-secret-access-key`]=await u(`destination-credentials-secret-access-key`,`Specifies the R2 Bucket Secret Access Key.`)),f[`destination-format`]===void 0&&(f[`destination-format`]=await d(`destination-format`,`Specifies the format of data to deliver.`,[`json`])),f[`destination-path-bucket`]===void 0&&(f[`destination-path-bucket`]=await u(`destination-path-bucket`,`Specifies the R2 Bucket to store files.`)),f[`destination-type`]===void 0&&(f[`destination-type`]=await d(`destination-type`,`Specifies the type of destination.`,[`r2`])),f.name===void 0&&(f.name=await u(`name`,`Defines the name of the pipeline.`));let h=c({destination:{batch:{max_bytes:f[`destination-batch-max-bytes`],max_duration_s:f[`destination-batch-max-duration-s`],max_rows:f[`destination-batch-max-rows`]},compression:{type:l(f[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:l(f[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:l(f[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:l(f[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:l(f[`destination-format`],`destination-format`,`text`),path:{bucket:l(f[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:l(f[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:l(f[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:l(f[`destination-type`],`destination-type`,`text`)},name:l(f.name,`name`,`text`)});i(await o(`Creating`,async()=>p.pipelines.legacyCreate({...h,account_id:m})),{successLabel:`Created`})}};function x(e){return e.positional(`pipeline-name`,{type:`string`,description:`Defines the name of the pipeline.`,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 S={command:`legacy-delete <pipeline-name>`,describe:`[DEPRECATED] Delete a pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:x,handler:async s=>{if(s.dryRun){a({command:`cf pipelines legacy-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/${s[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(s[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(s[`pipeline-name`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}i(await o(`Deleting`,async()=>c.pipelines.legacyDelete({account_id:l,pipeline_name:s[`pipeline-name`]})),{successLabel:`Deleted`})}};function C(e){return e.positional(`pipeline-name`,{type:`string`,description:`Defines the name of the pipeline.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`legacy-get <pipeline-name>`,describe:`[DEPRECATED] Get configuration of a pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:C,handler:async s=>{if(s.dryRun){a({command:`cf pipelines legacy-get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/${s[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(s[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(s[`pipeline-name`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.pipelines.legacyGet({account_id:l,pipeline_name:s[`pipeline-name`]})),{successLabel:`Loaded`})}};function T(e){return e.option(`search`,{type:`string`,description:`Specifies the prefix of pipeline name to search.`}).option(`page`,{type:`string`,description:`Specifies which page to retrieve.`}).option(`per-page`,{type:`string`,description:`Specifies the number of pipelines per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`legacy-list`,describe:`[DEPRECATED] List, filter, and paginate pipelines in an account. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:T,handler:async s=>{let c={search:s.search,page:s.page,per_page:s[`per-page`]};if(s.dryRun){a({command:`cf pipelines legacy-list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.pipelines.legacyList({account_id:u,...c})),{successLabel:`Loaded`})}};function D(e){return e.positional(`pipeline-name`,{type:`string`,description:`Defines the name of the pipeline.`,demandOption:!0}).option(`destination-batch-max-bytes`,{type:`number`,description:`Specifies rough maximum size of files.`}).option(`destination-batch-max-duration-s`,{type:`number`,description:`Specifies duration to wait to aggregate batches files.`}).option(`destination-batch-max-rows`,{type:`number`,description:`Specifies rough maximum number of rows per file.`}).option(`destination-compression-type`,{type:`string`,description:`Specifies the desired compression algorithm and format.`,choices:[`none`,`gzip`,`deflate`]}).option(`destination-credentials-access-key-id`,{type:`string`,description:`Specifies the R2 Bucket Access Key Id.`}).option(`destination-credentials-endpoint`,{type:`string`,description:`Specifies the R2 Endpoint.`}).option(`destination-credentials-secret-access-key`,{type:`string`,description:`Specifies the R2 Bucket Secret Access Key.`}).option(`destination-format`,{type:`string`,description:`Specifies the format of data to deliver.`,choices:[`json`]}).option(`destination-path-bucket`,{type:`string`,description:`Specifies the R2 Bucket to store files.`}).option(`destination-path-filepath`,{type:`string`,description:`Specifies the name pattern for directory.`}).option(`destination-path-prefix`,{type:`string`,description:`Specifies the base directory within the bucket.`}).option(`destination-type`,{type:`string`,description:`Specifies the type of destination.`,choices:[`r2`]}).option(`name`,{type:`string`,description:`Defines the name of the pipeline.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const O={command:`legacy-update <pipeline-name>`,describe:`[DEPRECATED] Update an existing pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:D,handler:async f=>{if(f.dryRun){a({command:`cf pipelines legacy-update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/${f[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(f[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(f[`pipeline-name`]??``)},bodyKind:`json`,body:f.body===void 0?c({destination:{batch:{max_bytes:f[`destination-batch-max-bytes`],max_duration_s:f[`destination-batch-max-duration-s`],max_rows:f[`destination-batch-max-rows`]},compression:{type:l(f[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:l(f[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:l(f[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:l(f[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:l(f[`destination-format`],`destination-format`,`text`),path:{bucket:l(f[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:l(f[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:l(f[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:l(f[`destination-type`],`destination-type`,`text`)},name:l(f.name,`name`,`text`)}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Updating`,async()=>p.pipelines.legacyUpdate({...e,account_id:m,pipeline_name:f[`pipeline-name`]})),{successLabel:`Updated`});return}f[`destination-credentials-access-key-id`]===void 0&&(f[`destination-credentials-access-key-id`]=await u(`destination-credentials-access-key-id`,`Specifies the R2 Bucket Access Key Id.`)),f[`destination-credentials-endpoint`]===void 0&&(f[`destination-credentials-endpoint`]=await u(`destination-credentials-endpoint`,`Specifies the R2 Endpoint.`)),f[`destination-credentials-secret-access-key`]===void 0&&(f[`destination-credentials-secret-access-key`]=await u(`destination-credentials-secret-access-key`,`Specifies the R2 Bucket Secret Access Key.`)),f[`destination-format`]===void 0&&(f[`destination-format`]=await d(`destination-format`,`Specifies the format of data to deliver.`,[`json`])),f[`destination-path-bucket`]===void 0&&(f[`destination-path-bucket`]=await u(`destination-path-bucket`,`Specifies the R2 Bucket to store files.`)),f[`destination-type`]===void 0&&(f[`destination-type`]=await d(`destination-type`,`Specifies the type of destination.`,[`r2`])),f.name===void 0&&(f.name=await u(`name`,`Defines the name of the pipeline.`));let h=c({destination:{batch:{max_bytes:f[`destination-batch-max-bytes`],max_duration_s:f[`destination-batch-max-duration-s`],max_rows:f[`destination-batch-max-rows`]},compression:{type:l(f[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:l(f[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:l(f[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:l(f[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:l(f[`destination-format`],`destination-format`,`text`),path:{bucket:l(f[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:l(f[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:l(f[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:l(f[`destination-type`],`destination-type`,`text`)},name:l(f.name,`name`,`text`)});i(await o(`Updating`,async()=>p.pipelines.legacyUpdate({...h,account_id:m,pipeline_name:f[`pipeline-name`]})),{successLabel:`Updated`})}};function k(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`name`,{type:`string`,description:`Filters pipelines by name (case-insensitive substring).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`List/Filter Pipelines in Account.`,builder:k,handler:async s=>{let c={page:s.page,per_page:s[`per-page`],name:s.name};if(s.dryRun){a({command:`cf pipelines list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/pipelines`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.pipelines.list({account_id:u,...c})),{successLabel:`Loaded`})}};function j(e){return e.option(`config-account-id`,{type:`string`,description:`Cloudflare Account ID for the bucket`}).option(`config-bucket`,{type:`string`,description:`R2 Bucket to write to`}).option(`config-credentials-access-key-id`,{type:`string`,description:`Cloudflare Account ID for the bucket`}).option(`config-credentials-secret-access-key`,{type:`string`,description:`Cloudflare Account ID for the bucket`}).option(`config-file-naming-prefix`,{type:`string`,description:`The prefix to use in file name. i.e prefix-<uuid>.parquet`}).option(`config-file-naming-strategy`,{type:`string`,description:`Filename generation strategy.`,choices:[`serial`,`uuid`,`uuid_v7`,`ulid`]}).option(`config-file-naming-suffix`,{type:`string`,description:`This will overwrite the default file suffix. i.e .parquet, use with caution`}).option(`config-jurisdiction`,{type:`string`,description:`Jurisdiction this bucket is hosted in`}).option(`config-partitioning-time-pattern`,{type:`string`,description:`The pattern of the date string`}).option(`config-path`,{type:`string`,description:`Subpath within the bucket to write to`}).option(`config-rolling-policy-file-size-bytes`,{type:`number`,description:`Files will be rolled after reaching this number of bytes`}).option(`config-rolling-policy-inactivity-seconds`,{type:`number`,description:`Number of seconds of inactivity to wait before rolling over to a new file`}).option(`config-rolling-policy-interval-seconds`,{type:`number`,description:`Number of seconds to wait before rolling over to a new file`}).option(`config-namespace`,{type:`string`,description:`Table namespace`}).option(`config-table-name`,{type:`string`,description:`Table name`}).option(`config-token`,{type:`string`,description:`Authentication token`}).option(`format-decimal-encoding`,{type:`string`,description:`The format.decimal_encoding field`,choices:[`number`,`string`,`bytes`]}).option(`format-timestamp-format`,{type:`string`,description:`The format.timestamp_format field`,choices:[`rfc3339`,`unix_millis`]}).option(`format-unstructured`,{type:`boolean`,description:`The format.unstructured field`}).option(`format-compression`,{type:`string`,description:`Specifies the compression applied to JSON sink output.`,choices:[`uncompressed`,`gzip`,`snappy`,`zstd`,`lz4`]}).option(`format-type`,{type:`string`,description:`The format.type field`,choices:[`json`,`parquet`]}).option(`format-row-group-bytes`,{type:`number`,description:`The format.row_group_bytes field`}).option(`name`,{type:`string`,description:`Defines the name of the Sink.`}).option(`schema-inferred`,{type:`boolean`,description:`The schema.inferred field`}).option(`type`,{type:`string`,description:`Specifies the type of sink.`,choices:[`r2`,`r2_data_catalog`]}).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(`config-credentials-access-key-id`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-credentials-secret-access-key`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-file-naming-prefix`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-file-naming-strategy`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-file-naming-suffix`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-jurisdiction`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-partitioning-time-pattern`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-path`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-namespace`,[`config-credentials-access-key-id`,`config-credentials-secret-access-key`,`config-file-naming-prefix`,`config-file-naming-strategy`,`config-file-naming-suffix`,`config-jurisdiction`,`config-partitioning-time-pattern`,`config-path`]).conflicts(`config-table-name`,[`config-credentials-access-key-id`,`config-credentials-secret-access-key`,`config-file-naming-prefix`,`config-file-naming-strategy`,`config-file-naming-suffix`,`config-jurisdiction`,`config-partitioning-time-pattern`,`config-path`]).implies(`config-table-name`,[`config-token`]).conflicts(`config-token`,[`config-credentials-access-key-id`,`config-credentials-secret-access-key`,`config-file-naming-prefix`,`config-file-naming-strategy`,`config-file-naming-suffix`,`config-jurisdiction`,`config-partitioning-time-pattern`,`config-path`]).implies(`config-token`,[`config-table-name`]).conflicts(`format-decimal-encoding`,[`format-row-group-bytes`]).conflicts(`format-timestamp-format`,[`format-row-group-bytes`]).conflicts(`format-unstructured`,[`format-row-group-bytes`]).conflicts(`format-row-group-bytes`,[`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`]).check(e=>{if([`config-account-id`,`config-bucket`,`config-credentials-access-key-id`,`config-credentials-secret-access-key`,`config-file-naming-prefix`,`config-file-naming-strategy`,`config-file-naming-suffix`,`config-jurisdiction`,`config-partitioning-time-pattern`,`config-path`,`config-rolling-policy-file-size-bytes`,`config-rolling-policy-inactivity-seconds`,`config-rolling-policy-interval-seconds`,`config-namespace`,`config-table-name`,`config-token`].some(t=>e[t]!==void 0)){let t={"config-credentials-access-key-id":[`config-namespace`,`config-table-name`,`config-token`],"config-credentials-secret-access-key":[`config-namespace`,`config-table-name`,`config-token`]},n=[`config-account-id`,`config-bucket`,`config-credentials-access-key-id`,`config-credentials-secret-access-key`].filter(n=>e[n]===void 0&&!(t[n]??[]).some(t=>e[t]!==void 0));if(n.length>0)throw Error(`${n.map(e=>`--`+e).join(`, `)} ${n.length===1?`is`:`are`} required when any --config-* flag is set`)}return!0}).check(e=>{if([`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`,`format-compression`,`format-type`,`format-row-group-bytes`].some(t=>e[t]!==void 0)){let t=[`format-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 --format-* flag is set`)}return!0})}const M={command:`create`,describe:`Create a new Sink.`,builder:j,handler:async f=>{if(f.dryRun){a({command:`cf pipelines sinks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/sinks`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({config:{account_id:l(f[`config-account-id`],`config-account-id`,`text`),bucket:l(f[`config-bucket`],`config-bucket`,`text`),credentials:{access_key_id:l(f[`config-credentials-access-key-id`],`config-credentials-access-key-id`,`text`),secret_access_key:l(f[`config-credentials-secret-access-key`],`config-credentials-secret-access-key`,`text`)},file_naming:{prefix:l(f[`config-file-naming-prefix`],`config-file-naming-prefix`,`text`),strategy:l(f[`config-file-naming-strategy`],`config-file-naming-strategy`,`text`),suffix:l(f[`config-file-naming-suffix`],`config-file-naming-suffix`,`text`)},jurisdiction:l(f[`config-jurisdiction`],`config-jurisdiction`,`text`),partitioning:{time_pattern:l(f[`config-partitioning-time-pattern`],`config-partitioning-time-pattern`,`text`)},path:l(f[`config-path`],`config-path`,`text`),rolling_policy:{file_size_bytes:f[`config-rolling-policy-file-size-bytes`],inactivity_seconds:f[`config-rolling-policy-inactivity-seconds`],interval_seconds:f[`config-rolling-policy-interval-seconds`]},namespace:l(f[`config-namespace`],`config-namespace`,`text`),table_name:l(f[`config-table-name`],`config-table-name`,`text`),token:l(f[`config-token`],`config-token`,`text`)},format:{decimal_encoding:l(f[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:l(f[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:f[`format-unstructured`],compression:l(f[`format-compression`],`format-compression`,`text`),type:l(f[`format-type`],`format-type`,`text`),row_group_bytes:f[`format-row-group-bytes`]},name:l(f.name,`name`,`text`),schema:{inferred:f[`schema-inferred`]},type:l(f.type,`type`,`text`)}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Creating`,async()=>p.pipelines.sinks.create({...e,account_id:m})),{successLabel:`Created`});return}f.name===void 0&&(f.name=await u(`name`,`Defines the name of the Sink.`)),f.type===void 0&&(f.type=await d(`type`,`Specifies the type of sink.`,[`r2`,`r2_data_catalog`]));let h=c({config:{account_id:l(f[`config-account-id`],`config-account-id`,`text`),bucket:l(f[`config-bucket`],`config-bucket`,`text`),credentials:{access_key_id:l(f[`config-credentials-access-key-id`],`config-credentials-access-key-id`,`text`),secret_access_key:l(f[`config-credentials-secret-access-key`],`config-credentials-secret-access-key`,`text`)},file_naming:{prefix:l(f[`config-file-naming-prefix`],`config-file-naming-prefix`,`text`),strategy:l(f[`config-file-naming-strategy`],`config-file-naming-strategy`,`text`),suffix:l(f[`config-file-naming-suffix`],`config-file-naming-suffix`,`text`)},jurisdiction:l(f[`config-jurisdiction`],`config-jurisdiction`,`text`),partitioning:{time_pattern:l(f[`config-partitioning-time-pattern`],`config-partitioning-time-pattern`,`text`)},path:l(f[`config-path`],`config-path`,`text`),rolling_policy:{file_size_bytes:f[`config-rolling-policy-file-size-bytes`],inactivity_seconds:f[`config-rolling-policy-inactivity-seconds`],interval_seconds:f[`config-rolling-policy-interval-seconds`]},namespace:l(f[`config-namespace`],`config-namespace`,`text`),table_name:l(f[`config-table-name`],`config-table-name`,`text`),token:l(f[`config-token`],`config-token`,`text`)},format:{decimal_encoding:l(f[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:l(f[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:f[`format-unstructured`],compression:l(f[`format-compression`],`format-compression`,`text`),type:l(f[`format-type`],`format-type`,`text`),row_group_bytes:f[`format-row-group-bytes`]},name:l(f.name,`name`,`text`),schema:{inferred:f[`schema-inferred`]},type:l(f.type,`type`,`text`)});i(await o(`Creating`,async()=>p.pipelines.sinks.create({...h,account_id:m})),{successLabel:`Created`})}};function N(e){return e.positional(`sink-id`,{type:`string`,description:`Specifies the publid ID of the sink.`,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 P={command:`delete <sink-id>`,describe:`Delete Sink in Account.`,builder:N,handler:async s=>{if(s.dryRun){a({command:`cf pipelines sinks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/sinks/${s[`sink-id`]==null?`<sink-id>`:encodeURIComponent(String(s[`sink-id`]))}`,pathParams:{"sink-id":String(s[`sink-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}i(await o(`Deleting`,async()=>c.pipelines.sinks.delete({account_id:l,sink_id:s[`sink-id`]})),{successLabel:`Deleted`})}};function F(e){return e.positional(`sink-id`,{type:`string`,description:`Specifies the publid ID of the sink.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`get <sink-id>`,describe:`Get Sink Details.`,builder:F,handler:async s=>{if(s.dryRun){a({command:`cf pipelines sinks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/sinks/${s[`sink-id`]==null?`<sink-id>`:encodeURIComponent(String(s[`sink-id`]))}`,pathParams:{"sink-id":String(s[`sink-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.pipelines.sinks.get({account_id:l,sink_id:s[`sink-id`]})),{successLabel:`Loaded`})}};function L(e){return e.option(`pipeline-id`,{type:`string`,description:`Pipeline ID`}).option(`name`,{type:`string`,description:`Filters sinks by name (case-insensitive substring).`}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`list`,describe:`List/Filter Sinks in Account.`,builder:L,handler:async s=>{let c={pipeline_id:s[`pipeline-id`],name:s.name,page:s.page,per_page:s[`per-page`]};if(s.dryRun){a({command:`cf pipelines sinks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/sinks`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.pipelines.sinks.list({account_id:u,...c})),{successLabel:`Loaded`})}},z={command:`sinks`,describe:`Destinations where pipeline data is written — R2 buckets, HTTP endpoints, or other storage`,builder:e=>e.command(M).command(P).command(I).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.option(`format-decimal-encoding`,{type:`string`,description:`The format.decimal_encoding field`,choices:[`number`,`string`,`bytes`]}).option(`format-timestamp-format`,{type:`string`,description:`The format.timestamp_format field`,choices:[`rfc3339`,`unix_millis`]}).option(`format-unstructured`,{type:`boolean`,description:`The format.unstructured field`}).option(`format-type`,{type:`string`,description:`The format.type field`,choices:[`json`,`parquet`]}).option(`format-compression`,{type:`string`,description:`The format.compression field`,choices:[`uncompressed`,`snappy`,`gzip`,`zstd`,`lz4`]}).option(`format-row-group-bytes`,{type:`number`,description:`The format.row_group_bytes field`}).option(`http-authentication`,{type:`boolean`,description:`Indicates that authentication is required for the HTTP endpoint.`}).option(`http-cors-origins`,{type:`string`,array:!0,description:`The http.cors.origins field`}).option(`http-enabled`,{type:`boolean`,description:`Indicates that the HTTP endpoint is enabled.`}).option(`name`,{type:`string`,description:`Specifies the name of the Stream.`}).option(`schema-inferred`,{type:`boolean`,description:`The schema.inferred field`}).option(`worker-binding-enabled`,{type:`boolean`,description:`Indicates that the worker binding is enabled.`}).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(`format-decimal-encoding`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-timestamp-format`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-unstructured`,[`format-compression`,`format-row-group-bytes`]).conflicts(`format-compression`,[`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`]).conflicts(`format-row-group-bytes`,[`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`]).check(e=>{if([`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`,`format-type`,`format-compression`,`format-row-group-bytes`].some(t=>e[t]!==void 0)){let t=[`format-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 --format-* flag is set`)}return!0}).check(e=>{if([`http-authentication`,`http-cors-origins`,`http-enabled`].some(t=>e[t]!==void 0)){let t=[`http-authentication`,`http-enabled`].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 --http-* flag is set`)}return!0}).check(e=>{if([`worker-binding-enabled`].some(t=>e[t]!==void 0)){let t=[`worker-binding-enabled`].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 --worker_binding-* flag is set`)}return!0})}const V={command:`create`,describe:`Create a new Stream.`,builder:B,handler:async d=>{if(d.dryRun){a({command:`cf pipelines streams create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/streams`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({format:{decimal_encoding:l(d[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:l(d[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:d[`format-unstructured`],type:l(d[`format-type`],`format-type`,`text`),compression:l(d[`format-compression`],`format-compression`,`text`),row_group_bytes:d[`format-row-group-bytes`]},http:{authentication:d[`http-authentication`],cors:{origins:d[`http-cors-origins`]},enabled:d[`http-enabled`]},name:l(d.name,`name`,`text`),schema:{inferred:d[`schema-inferred`]},worker_binding:{enabled:d[`worker-binding-enabled`]}}):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.pipelines.streams.create({...e,account_id:p})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await u(`name`,`Specifies the name of the Stream.`));let m=c({format:{decimal_encoding:l(d[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:l(d[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:d[`format-unstructured`],type:l(d[`format-type`],`format-type`,`text`),compression:l(d[`format-compression`],`format-compression`,`text`),row_group_bytes:d[`format-row-group-bytes`]},http:{authentication:d[`http-authentication`],cors:{origins:d[`http-cors-origins`]},enabled:d[`http-enabled`]},name:l(d.name,`name`,`text`),schema:{inferred:d[`schema-inferred`]},worker_binding:{enabled:d[`worker-binding-enabled`]}});i(await o(`Creating`,async()=>f.pipelines.streams.create({...m,account_id:p})),{successLabel:`Created`})}};function H(e){return e.positional(`stream-id`,{type:`string`,description:`Specifies the public ID of the stream.`,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 U={command:`delete <stream-id>`,describe:`Delete Stream in Account.`,builder:H,handler:async s=>{if(s.dryRun){a({command:`cf pipelines streams delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/streams/${s[`stream-id`]==null?`<stream-id>`:encodeURIComponent(String(s[`stream-id`]))}`,pathParams:{"stream-id":String(s[`stream-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force})){process.stderr.write(`Aborted.
|
|
6
|
-
`);return}i(await o(`Deleting`,async()=>c.pipelines.streams.delete({account_id:l,stream_id:s[`stream-id`]})),{successLabel:`Deleted`})}};function W(e){return e.positional(`stream-id`,{type:`string`,description:`Specifies the public ID of the stream.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`get <stream-id>`,describe:`Get Stream Details.`,builder:W,handler:async s=>{if(s.dryRun){a({command:`cf pipelines streams get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/streams/${s[`stream-id`]==null?`<stream-id>`:encodeURIComponent(String(s[`stream-id`]))}`,pathParams:{"stream-id":String(s[`stream-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.pipelines.streams.get({account_id:l,stream_id:s[`stream-id`]})),{successLabel:`Loaded`})}};function K(e){return e.option(`pipeline-id`,{type:`string`,description:`Specifies the public ID of the pipeline.`}).option(`name`,{type:`string`,description:`Filters streams by name (case-insensitive substring).`}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`list`,describe:`List/Filter Streams in Account.`,builder:K,handler:async s=>{let c={pipeline_id:s[`pipeline-id`],name:s.name,page:s.page,per_page:s[`per-page`]};if(s.dryRun){a({command:`cf pipelines streams list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/streams`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.pipelines.streams.list({account_id:u,...c})),{successLabel:`Loaded`})}};function J(e){return e.positional(`stream-id`,{type:`string`,description:`Specifies the public ID of the stream.`,demandOption:!0}).option(`http-authentication`,{type:`boolean`,description:`Indicates that authentication is required for the HTTP endpoint.`}).option(`http-cors-origins`,{type:`string`,array:!0,description:`The http.cors.origins field`}).option(`http-enabled`,{type:`boolean`,description:`Indicates that the HTTP endpoint is enabled.`}).option(`worker-binding-enabled`,{type:`boolean`,description:`Indicates that the worker binding is enabled.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`http-authentication`,`http-cors-origins`,`http-enabled`].some(t=>e[t]!==void 0)){let t=[`http-authentication`,`http-enabled`].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 --http-* flag is set`)}return!0}).check(e=>{if([`worker-binding-enabled`].some(t=>e[t]!==void 0)){let t=[`worker-binding-enabled`].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 --worker_binding-* flag is set`)}return!0})}const Y={command:`update <stream-id>`,describe:`Update a Stream.`,builder:J,handler:async l=>{if(l.dryRun){a({command:`cf pipelines streams update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/streams/${l[`stream-id`]==null?`<stream-id>`:encodeURIComponent(String(l[`stream-id`]))}`,pathParams:{"stream-id":String(l[`stream-id`]??``)},bodyKind:`json`,body:l.body===void 0?c({http:{authentication:l[`http-authentication`],cors:{origins:l[`http-cors-origins`]},enabled:l[`http-enabled`]},worker_binding:{enabled:l[`worker-binding-enabled`]}}):s(l.body)});return}let u=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=s(l.body);i(await o(`Updating`,async()=>u.pipelines.streams.update({...e,account_id:d,stream_id:l[`stream-id`]})),{successLabel:`Updated`});return}let f=c({http:{authentication:l[`http-authentication`],cors:{origins:l[`http-cors-origins`]},enabled:l[`http-enabled`]},worker_binding:{enabled:l[`worker-binding-enabled`]}});i(await o(`Updating`,async()=>u.pipelines.streams.update({...f,account_id:d,stream_id:l[`stream-id`]})),{successLabel:`Updated`})}},X={command:`streams`,describe:`Inbound data streams that feed events into a pipeline for processing`,builder:e=>e.command(V).command(U).command(G).command(q).command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Z(e){return e.option(`sql`,{type:`string`,description:`Specifies SQL to validate.`}).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:`validate-sql`,describe:`Validates that the Pipelines SQL is correct.`,builder:Z,handler:async d=>{if(d.dryRun){a({command:`cf pipelines validate-sql`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pipelines/v1/validate_sql`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({sql:l(d.sql,`sql`,`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.pipelines.validateSql({...e,account_id:p})),{successLabel:`Created`});return}d.sql===void 0&&(d.sql=await u(`sql`,`Specifies SQL to validate.`));let m=c({sql:l(d.sql,`sql`,`text`)});i(await o(`Creating`,async()=>f.pipelines.validateSql({...m,account_id:p})),{successLabel:`Created`})}},$={command:`pipelines`,describe:`Ingest, transform, and route event streams into R2, analytics, or other destinations in real time`,builder:e=>e.command(m).command(g).command(v).command(b).command(S).command(w).command(E).command(O).command(A).command(Q).command(z).command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{$ as default};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
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
|
-
not match a more specific enforcement rule.
|
|
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};
|
|
@@ -1,2 +0,0 @@
|
|
|
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};
|
package/dist/prompt-DdegNPpg.mjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
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
|
-
`)?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 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
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
|
-
`);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};
|
package/dist/queues-DpkYdRUE.mjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
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
|
-
`);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
|
-
`);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
|
-
`);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.
|
|
6
|
-
`);return}a(await s(`Deleting`,async()=>c.queues.subscriptions.delete({account_id:l,subscription_id:r[`subscription-id`]})),{successLabel:`Deleted`})}};function $(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})}const me={command:`get <subscription-id>`,describe:`Get details about an existing event subscription`,builder:$,handler:async r=>{if(r.dryRun){o({command:`cf queues subscriptions get`,method:`GET`,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();r.accountId=l,a(await s(`Loading`,async()=>c.queues.subscriptions.get({account_id:l,subscription_id:r[`subscription-id`]})),{successLabel:`Loaded`})}};function he(e){return e.option(`page`,{type:`number`,description:`Page number for pagination`}).option(`per-page`,{type:`number`,description:`Number of items per page`}).option(`order`,{type:`string`,description:`Field to sort by`,choices:[`created_at`,`name`,`enabled`,`source`]}).option(`direction`,{type:`string`,description:`Sort direction`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ge={command:`list`,describe:`Get a paginated list of event subscriptions with optional sorting and filtering`,builder:m(he),handler:async r=>{let c={page:r.page,per_page:r[`per-page`],order:r.order,direction:r.direction};if(r.dryRun){o({command:`cf queues subscriptions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/event_subscriptions/subscriptions`,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.queues.subscriptions.list({account_id:u,...c})),{successLabel:`Loaded`})}};function _e(e){return e.positional(`subscription-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`destination-queue-id`,{type:`string`,description:`ID of the target queue`}).option(`destination-type`,{type:`string`,description:`Type of destination`,choices:[`queues.queue`]}).option(`enabled`,{type:`boolean`,description:`Whether the subscription is active`}).option(`events`,{type:`string`,array:!0,description:`List of event types this subscription handles`}).option(`name`,{type:`string`,description:`Name of the subscription`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{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 ve={command:`update <subscription-id>`,describe:`Update an existing event subscription`,builder:_e,handler:async r=>{if(r.dryRun){o({command:`cf queues subscriptions update`,method:`PATCH`,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:`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`)}):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.subscriptions.update({...e,account_id:f,subscription_id:r[`subscription-id`]})),{successLabel:`Updated`});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`)});a(await s(`Updating`,async()=>d.queues.subscriptions.update({...p,account_id:f,subscription_id:r[`subscription-id`]})),{successLabel:`Updated`})}},ye={command:`subscriptions`,describe:`Manage queue subscriptions for event-driven message routing`,builder:e=>e.command(de).command(pe).command(me).command(ge).command(ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function be(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 xe={command:`update <queue-id>`,describe:`Updates a Queue. Note that this endpoint does not support partial updates. If successful, the Queue's configuration is overwritten with the supplied configuration.`,builder:be,handler:async r=>{if(r.dryRun){o({command:`cf queues 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`]))}`,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.update({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.update({body:p,account_id:f,queue_id:r[`queue-id`]})),{successLabel:`Updated`})}},Se={command:`queues`,describe:`Reliable message queuing between Workers — produce, consume, and batch-process messages at scale`,builder:e=>e.command(E).command(O).command(A).command(M).command(P).command(xe).command(w).command(Q).command(ie).command(le).command(ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Se as default};
|