cf 1.0.0-beta.14 → 1.0.0-beta.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/dist/_meta/commands.json +3409 -621
- package/dist/_meta/hand-written-commands.json +33 -0
- package/dist/_meta/schemas.json +2160 -246
- package/dist/abuse-reports-CnQBtN1G.mjs +24 -0
- package/dist/{access-k1QjF5rE.mjs → access-BzmXSwzj.mjs} +1 -1
- package/dist/account-tags-2qPWbW17.mjs +15 -0
- package/dist/accounts-B0Byg-AV.mjs +132 -0
- package/dist/acm-DgAu0cnk.mjs +15 -0
- package/dist/addressing-J1oa0ML2.mjs +105 -0
- package/dist/agent-memory-4KGou-tm.mjs +34 -0
- package/dist/ai-WY7wVQfA.mjs +31 -0
- package/dist/ai-audit-D38HaEoZ.mjs +6 -0
- package/dist/ai-gateway-C0gIipT8.mjs +80 -0
- package/dist/ai-search-ClwnPU-9.mjs +79 -0
- package/dist/ai-security-BIsvFPYV.mjs +10 -0
- package/dist/alerting-MHhv28oO.mjs +56 -0
- package/dist/analytics-BfBz7bqB.mjs +17 -0
- package/dist/analytics_engine-CXVdBF1n.mjs +4 -0
- package/dist/api-eMuS5GI1.mjs +3 -0
- package/dist/api-security-DUCfcdC1.mjs +154 -0
- package/dist/argo-CUlzI4v3.mjs +14 -0
- package/dist/artifacts-BLfWGzBg.mjs +43 -0
- package/dist/audit-logs-CsfIm2QS.mjs +4 -0
- package/dist/auth-8Sm4uLGM.mjs +2 -0
- package/dist/auth-C6u9qIGO.mjs +2 -0
- package/dist/auth-CGRemu5W.mjs +2 -0
- package/dist/{auth-token-Dop0wLCw.mjs → auth-token-DkkYg4DP.mjs} +1 -1
- package/dist/{autoconfig-RQ3HS4m1.mjs → autoconfig-B0ESZ8DJ.mjs} +2 -2
- package/dist/basin-catalog-CrKRYJ0b.mjs +46 -0
- package/dist/billing-NxehgXrR.mjs +23 -0
- package/dist/blocks-Bat9A8V_.mjs +5 -0
- package/dist/bot-management-C993iQKL.mjs +9 -0
- package/dist/botnet-feed-CZ4vYk5y.mjs +11 -0
- package/dist/brand-protection-ADVgIi0l.mjs +27 -0
- package/dist/browser-run-CEptKZYl.mjs +42 -0
- package/dist/build-Bm6kGyzo.mjs +2 -0
- package/dist/{build-CCe7IrWT.mjs → build-sBpqm9ga.mjs} +1 -1
- package/dist/builds-DqtiTH7p.mjs +71 -0
- package/dist/cache-hX5QxmI0.mjs +45 -0
- package/dist/certificate-authorities-BOcybjc1.mjs +6 -0
- package/dist/cf-Bq4pA4n6.mjs +18 -0
- package/dist/{chunk-TAK63GWY-DdMktrgc.mjs → chunk-2HLTAS5V-D7COzUOd.mjs} +2 -2
- package/dist/chunk-2K52M2W5-CYxfQXUq.mjs +363 -0
- package/dist/{chunk-DSGVRFIS-CPI5cYtB.mjs → chunk-DSGVRFIS-C5SqiTOz.mjs} +1 -1
- package/dist/{cli-ht4q6i2y.mjs → cli-R8h3OKZI.mjs} +1 -1
- package/dist/client-certificates-Bez_ArKE.mjs +13 -0
- package/dist/client-side-security-CSmA50Bv.mjs +63 -0
- package/dist/cloud-connector-0Wivqi7S.mjs +6 -0
- package/dist/{cloudflared-D83U8Yn3.mjs → cloudflared-By8BzYXc.mjs} +1 -1
- package/dist/cloudforce-one-J-rU6k1U.mjs +405 -0
- package/dist/{command-9VAc7b30.mjs → command-0BOb1pgV.mjs} +1 -1
- package/dist/{command-CyJQ40fc.mjs → command-BCJN-ZM2.mjs} +1 -1
- package/dist/{command-OHov3PEc.mjs → command-BG-kLOnS.mjs} +1 -1
- package/dist/{command-B_Ixlz8Q.mjs → command-BIsI-mMX.mjs} +1 -1
- package/dist/{command-SmWD-MeI.mjs → command-BKDbbA-L.mjs} +1 -1
- package/dist/command-BWQIKu6I.mjs +2 -0
- package/dist/{command-Ckb9FufU.mjs → command-Bdy69UFU.mjs} +1 -1
- package/dist/{command-CtVUNm__.mjs → command-Bgb-3yPg.mjs} +1 -1
- package/dist/{command-DtgJilOK.mjs → command-C6w1OdoC.mjs} +1 -1
- package/dist/{command-BtDY_MKv.mjs → command-CKW6UhTh.mjs} +1 -1
- package/dist/{command-Bpzp8Mz2.mjs → command-DCQgsd2U.mjs} +1 -1
- package/dist/{command-DjEJaOwV.mjs → command-DIs-Nqtl.mjs} +1 -1
- package/dist/command-DPn5ANHs.mjs +2 -0
- package/dist/{command-CUNMrMou.mjs → command-DZfKHiru.mjs} +1 -1
- package/dist/{command-DXaRn1ls.mjs → command-DppVezAB.mjs} +1 -1
- package/dist/{completions-CuqAO3N_.mjs → completions-CpNGTlUX.mjs} +1 -1
- package/dist/config.mjs +0 -0
- package/dist/connector-interrupts-CH-DaLuo.mjs +6 -0
- package/dist/connector-telemetry-events-X3Fod9nl.mjs +6 -0
- package/dist/connector-telemetry-snapshots-D-WR4npQ.mjs +6 -0
- package/dist/connectors-CORKD31m.mjs +15 -0
- package/dist/containers-BboUbx3k.mjs +78 -0
- package/dist/containers-Di3_Vopq.mjs +376 -0
- package/dist/content-scan-DXGREAXa.mjs +14 -0
- package/dist/{context-BBLtgdR1.mjs → context-A6T-NKPI.mjs} +2 -2
- package/dist/{cps-C5phNoVU.mjs → cps-1BoOLtTq.mjs} +3 -3
- package/dist/create-OXylMu6m.mjs +2 -0
- package/dist/csamScanner-CHfbfeup.mjs +10 -0
- package/dist/ct-alerting-DlH4ILQo.mjs +5 -0
- package/dist/custom-certificates-zJqJZ2Th.mjs +17 -0
- package/dist/custom-csrs-DoLIGqYL.mjs +11 -0
- package/dist/custom-hostnames-YfV-aoAK.mjs +27 -0
- package/dist/custom-nameservers-BV43gmgt.mjs +9 -0
- package/dist/custom-pages-CoOU1Cdx.mjs +21 -0
- package/dist/{d1-EQMUlHTJ.mjs → d1-DujBmzLa.mjs} +31 -31
- package/dist/dcv-delegation-CPLsVYOl.mjs +4 -0
- package/dist/delegate.mjs +0 -0
- package/dist/deploy-context-tEhwEXnA.mjs +56 -0
- package/dist/{deploy-input-BCjcuP6u.mjs → deploy-input-BqJ7GVZ-.mjs} +1 -1
- package/dist/{deploy-B22sEVHd.mjs → deploy-wNujfGUJ.mjs} +1 -1
- package/dist/{dev-ClhhXuNU.mjs → dev-EtnMYA7K.mjs} +1 -1
- package/dist/diagnostics-B3TYPVRi.mjs +15 -0
- package/dist/{dist-DmRM6WSZ.mjs → dist-DZRTPMMA.mjs} +4 -4
- package/dist/dls-CWm1HRF0.mjs +17 -0
- package/dist/dns-CjAFU7Z9.mjs +144 -0
- package/dist/dns-firewall-BooBP9ap.mjs +71 -0
- package/dist/docs-C5XB7HdG.mjs +3 -0
- package/dist/{dotenv-DpXaxfho.mjs → dotenv-usOKkeW7.mjs} +3 -3
- package/dist/{dry-run-DRj2_uV3.mjs → dry-run-C2KjGX10.mjs} +1 -1
- package/dist/durable-objects-CSrMQDCE.mjs +6 -0
- package/dist/email-auth-Bp1Mui-n.mjs +6 -0
- package/dist/email-routing-CVF6SwQt.mjs +45 -0
- package/dist/email-security-mYZtazae.mjs +158 -0
- package/dist/email-sending-BqaKU_Xu.mjs +47 -0
- package/dist/error-sanitization-CIQOep3I.mjs +2 -0
- package/dist/error-sanitization-pOyzm2F1.mjs +2 -0
- package/dist/fieldExtractors-CAGZVmYg.mjs +9 -0
- package/dist/firewall-DgTDsYOt.mjs +36 -0
- package/dist/flagship-Db3PxxyZ.mjs +28 -0
- package/dist/fraud-BEOQczy8.mjs +22 -0
- package/dist/get-By1q8YlI.mjs +2 -0
- package/dist/get-CRKvqCu6.mjs +2 -0
- package/dist/get-iPUHxD1r.mjs +2 -0
- package/dist/google-tag-gateway-DjLQ9wo0.mjs +6 -0
- package/dist/healthchecks-C3ScnKss.mjs +22 -0
- package/dist/{hostnames-DvaUSzsj.mjs → hostnames-DU0k-xO9.mjs} +6 -6
- package/dist/hyperdrive-IpCCLCRd.mjs +37 -0
- package/dist/iam-96CYM8Vw.mjs +52 -0
- package/dist/images-AB9EgZgT.mjs +71 -0
- package/dist/index.mjs +1 -1
- package/dist/{init-Da8pe296.mjs → init-D2nPoW4f.mjs} +2 -2
- package/dist/intel-BKb4RLvS.mjs +76 -0
- package/dist/ips-z9APCV_b.mjs +4 -0
- package/dist/k2-Bv-HiJ29.mjs +11 -0
- package/dist/keyless-certificates-ChgSGHq4.mjs +13 -0
- package/dist/keys-BhngDsDa.mjs +4 -0
- package/dist/kv-CB5MQVGP.mjs +15 -0
- package/dist/{lazy-command-CDWwCsD2.mjs → lazy-command-CaZ1kdlW.mjs} +1 -1
- package/dist/leaked-credential-checks-Bsi2WpSU.mjs +18 -0
- package/dist/{load-balancers-Bu9pd2SV.mjs → load-balancers-0gXZNCeI.mjs} +40 -40
- package/dist/{local-BcPM4I0s.mjs → local-Dil4fTWX.mjs} +1 -1
- package/dist/local-DxWDQDnG.mjs +2 -0
- package/dist/{local-runtime-BHKyRlCP.mjs → local-runtime-B7TKFu6E.mjs} +1 -1
- package/dist/login-CiQGR8ha.mjs +5 -0
- package/dist/login-Ik98G4K6.mjs +2 -0
- package/dist/logo-matches-DmoF5Otu.mjs +6 -0
- package/dist/logos-BL6ohIMH.mjs +7 -0
- package/dist/logpush-UVopW68t.mjs +46 -0
- package/dist/logs-BVfxiEiM.mjs +36 -0
- package/dist/magic-cloud-networking-B5S3aM6f.mjs +71 -0
- package/dist/magic-network-monitoring-CDSJPP47.mjs +36 -0
- package/dist/magic-transit-TcDTKM43.mjs +386 -0
- package/dist/managed-defense-C88HL0pg.mjs +18 -0
- package/dist/managed-transforms-Ja41Tahl.mjs +9 -0
- package/dist/matches-BL_Y-9Yq.mjs +6 -0
- package/dist/mcp-BWp5Q09R.mjs +32 -0
- package/dist/mesh-lFPLRWhV.mjs +26 -0
- package/dist/{migrate-CZNq63Uj.mjs → migrate-6e5mJ79R.mjs} +1 -1
- package/dist/monetization-BIc4Bwo2.mjs +20 -0
- package/dist/mtls-certificates-CVBw-Jli.mjs +13 -0
- package/dist/network-Wig0qbaC.mjs +50 -0
- package/dist/network-interconnects-C16z1HuQ.mjs +72 -0
- package/dist/o11y-Bhy4qDRm.mjs +93 -0
- package/dist/oauth-CfEedDZi.mjs +4 -0
- package/dist/oauth-clients-eXjmK5yf.mjs +16 -0
- package/dist/{oauth-n8um6MFk.mjs → oauth-oWaW7ICv.mjs} +1 -1
- package/dist/oauth-scopes-DZWn50EA.mjs +4 -0
- package/dist/organization-QdAQTrKa.mjs +71 -0
- package/dist/organizations-CgAQYdK5.mjs +4 -0
- package/dist/origin-ca-certificates-BklXqp8X.mjs +11 -0
- package/dist/origin-post-quantum-encryption-Dg16ueT4.mjs +6 -0
- package/dist/origin-tls-client-auth-d8bDU5zU.mjs +30 -0
- package/dist/output-Co4xdFf6.mjs +2 -0
- package/dist/page-rules-CgMkC6YR.mjs +39 -0
- package/dist/{pages-Bn0Sg1ay.mjs → pages-CkBtOOf8.mjs} +29 -29
- package/dist/path-DRw6Y-nd.mjs +2 -0
- package/dist/pay-per-crawl-CnGXOWyz.mjs +38 -0
- package/dist/pay-per-use-HbfxpATr.mjs +33 -0
- package/dist/pipelines-CnO9CCs0.mjs +44 -0
- package/dist/precursor-Bc55XJdQ.mjs +4 -0
- package/dist/previews-C7vZrajd.mjs +7 -0
- package/dist/progress-D5po7ScB.mjs +2 -0
- package/dist/prompt-BAJpE3jV.mjs +4 -0
- package/dist/queries-BJAH4B74.mjs +9 -0
- package/dist/queues-D4G8vvwi.mjs +57 -0
- package/dist/r2-CJ8rD6Jb.mjs +128 -0
- package/dist/{radar-CdvQL4xm.mjs → radar-DgaxOdcd.mjs} +150 -150
- package/dist/raw-fetch-yY-wX5Xx.mjs +2 -0
- package/dist/realtime-DU09m7L7.mjs +172 -0
- package/dist/registrar-Cj7OfvGs.mjs +43 -0
- package/dist/registrar-sandbox-CA0Mua-j.mjs +56 -0
- package/dist/{registry-PI6sO95I.mjs → registry-CRnk93ur.mjs} +1 -1
- package/dist/reporting-3kDVF5c8.mjs +14 -0
- package/dist/{request-headers-D8L95bEQ.mjs → request-headers-D_eQn93b.mjs} +1 -1
- package/dist/request-tracers-VBD4R3s3.mjs +4 -0
- package/dist/resolve-BpgXeklt.mjs +2 -0
- package/dist/resolve-C3FmNlSO.mjs +2 -0
- package/dist/resource-sharing-BtUF3psS.mjs +40 -0
- package/dist/resource-tagging--90INP8_.mjs +4 -0
- package/dist/rules-CcwPngVo.mjs +18 -0
- package/dist/rulesets-CfdruY82.mjs +37 -0
- package/dist/rum-RLkdfSL7.mjs +30 -0
- package/dist/run-CUNhH5CQ.mjs +2 -0
- package/dist/{run-CW2Cgi0S.mjs → run-DASYqJsY.mjs} +1 -1
- package/dist/{schema-elj12WOx.mjs → schema-S3pUZwpI.mjs} +1 -1
- package/dist/{schema-flags-BTItUu1K.mjs → schema-flags-CShtn7ya.mjs} +1 -1
- package/dist/scim-BZYsTPIL.mjs +18 -0
- package/dist/secrets-store-C_-FkSH_.mjs +24 -0
- package/dist/security-insights-BVBEaZmD.mjs +40 -0
- package/dist/security-txt--IoHrHee.mjs +9 -0
- package/dist/session-Cq3YNLoI.mjs +2 -0
- package/dist/shared-zNQNv1im.mjs +2 -0
- package/dist/smart-shield-CByC4_60.mjs +24 -0
- package/dist/snippets-DB-jiZAV.mjs +20 -0
- package/dist/{spawn-D07wH-MH.mjs → spawn-DQttFH05.mjs} +1 -1
- package/dist/{spectrum-B6qkjR_Z.mjs → spectrum-Bs2g1BmK.mjs} +14 -14
- package/dist/speed-Bq4evEnJ.mjs +24 -0
- package/dist/sql-XGci7hZC.mjs +4 -0
- package/dist/src-GiuwAT55.mjs +125 -0
- package/dist/ssl-KJTLW1NR.mjs +45 -0
- package/dist/{startup-profile-CrtCP-6-.mjs → startup-profile-BOaseXnO.mjs} +1 -1
- package/dist/startup-profile-BwEZFVGS.mjs +2 -0
- package/dist/{state-DIiIGEtR.mjs → state-Boubf1X6.mjs} +1 -1
- package/dist/state-CODDG9Nx.mjs +2 -0
- package/dist/stream-BotgYspF.mjs +102 -0
- package/dist/submit-C5VytaHP.mjs +4 -0
- package/dist/{tags-CX23P4jg.mjs → tags-3Hq-B9qp.mjs} +2 -2
- package/dist/{telemetry-ZlCi5Xhc.mjs → telemetry-3FJOXl_C.mjs} +1 -1
- package/dist/telemetry-BhKfwxyh.mjs +2 -0
- package/dist/tenant-BgX5onPc.mjs +10 -0
- package/dist/tenant-custom-nameservers-BVG8v1Xo.mjs +9 -0
- package/dist/theme-BGHWSKCw.mjs +6 -0
- package/dist/{tools-CSc5DmFi.mjs → tools-BCCRUENY.mjs} +1 -1
- package/dist/{tunnels-NzYpsfi_.mjs → tunnels-CThOI3qH.mjs} +15 -15
- package/dist/turnstile-BgZaUx-g.mjs +33 -0
- package/dist/ui-BtIBQeaG.mjs +2 -0
- package/dist/update-check-Yy7Ivq2V.mjs +2 -0
- package/dist/{update-check-HFkPml6x.mjs → update-check-jb89ih_g.mjs} +1 -1
- package/dist/update-check-worker.mjs +1 -1
- package/dist/url-info-DQERN0Xq.mjs +4 -0
- package/dist/url-normalization-Cb1hofqv.mjs +9 -0
- package/dist/url-scanner-gHgx1bW7.mjs +16 -0
- package/dist/{user-rXca0J9M.mjs → user-CdKzIuSi.mjs} +58 -58
- package/dist/values-EwA8Sx0w.mjs +4 -0
- package/dist/vectorize-DejgIJIv.mjs +32 -0
- package/dist/version-B6MnUIqV.mjs +2 -0
- package/dist/{waiting-rooms-DrA3-0bw.mjs → waiting-rooms-BNR1HvAP.mjs} +25 -25
- package/dist/web-assets-iglnzkTV.mjs +64 -0
- package/dist/web3-JBUU6IVt.mjs +28 -0
- package/dist/workers-CDp4kLTJ.mjs +40 -0
- package/dist/workers-builds-CSb9Dglt.mjs +14 -0
- package/dist/workers-for-platforms-D4srNZvt.mjs +40 -0
- package/dist/workers-vpc-LPC8TadH.mjs +13 -0
- package/dist/workflows-DN_VqWJC.mjs +52 -0
- package/dist/{wrangler-migration-C6FKHER1.mjs → wrangler-migration-DxTB5yPT.mjs} +1 -1
- package/dist/zaraz-DDErl5yc.mjs +22 -0
- package/dist/zero-trust-M88XX3uD.mjs +957 -0
- package/dist/zone-BsGvedmN.mjs +4 -0
- package/dist/zones-l_sRKrVl.mjs +124 -0
- package/package.json +15 -18
- package/dist/Page-BShsqCXr.mjs +0 -2
- package/dist/abuse-reports-CVv52Q2w.mjs +0 -24
- package/dist/account-tags-RhvWOkOf.mjs +0 -15
- package/dist/accounts--3lrEkmu.mjs +0 -125
- package/dist/acm-BJxINEcu.mjs +0 -15
- package/dist/addressing-BqByG9JW.mjs +0 -105
- package/dist/agent-memory-D4dQMGbh.mjs +0 -34
- package/dist/ai-CRkQ4pjC.mjs +0 -31
- package/dist/ai-audit-fMSn4c5L.mjs +0 -6
- package/dist/ai-gateway-CbhvQK4L.mjs +0 -80
- package/dist/ai-search-CvVSnOA0.mjs +0 -79
- package/dist/ai-security-Z_qpI92I.mjs +0 -10
- package/dist/alerting-CpbCB8br.mjs +0 -56
- package/dist/analytics-DkY9dOP1.mjs +0 -17
- package/dist/analytics_engine-DE_jvlx_.mjs +0 -4
- package/dist/api-security-BHnOU5MM.mjs +0 -154
- package/dist/argo-DhC5L_aN.mjs +0 -14
- package/dist/args-CfbYkeXd.mjs +0 -2
- package/dist/artifacts-CrIupY7P.mjs +0 -43
- package/dist/audit-logs-BjeBxTox.mjs +0 -4
- package/dist/auth-BNYfOMl0.mjs +0 -2
- package/dist/auth-CAWalgW0.mjs +0 -2
- package/dist/auth-DOwC01PW.mjs +0 -2
- package/dist/banner-D03JEqRs.mjs +0 -2
- package/dist/basin-catalog-DZ7QV-_N.mjs +0 -46
- package/dist/billing-BFyte9fL.mjs +0 -23
- package/dist/bot-management-DXcbV3am.mjs +0 -9
- package/dist/botnet-feed-bGGp_cwX.mjs +0 -11
- package/dist/brand-protection-DN36XkxH.mjs +0 -27
- package/dist/browser-run-hHD1RT43.mjs +0 -42
- package/dist/build-BhpWYgNm.mjs +0 -2
- package/dist/builds-6aO61R9R.mjs +0 -71
- package/dist/cache-C5YJpMqi.mjs +0 -45
- package/dist/certificate-authorities-CbqDAktQ.mjs +0 -6
- package/dist/cf-oRSQKirD.mjs +0 -18
- package/dist/chunk-NDZDTP46-Civns3WA.mjs +0 -361
- package/dist/cli-types-9oYmRTHJ.mjs +0 -2
- package/dist/client-certificates-balaN_my.mjs +0 -13
- package/dist/client-side-security-3_4Ermmg.mjs +0 -63
- package/dist/cloud-connector-avx27sLw.mjs +0 -6
- package/dist/cloudforce-one-CXdeqJ9l.mjs +0 -405
- package/dist/command-DPX9sJVi.mjs +0 -2
- package/dist/command-OWe3v69l.mjs +0 -2
- package/dist/connector-interrupts-ftd10Du-.mjs +0 -6
- package/dist/connector-telemetry-events-TwDZYdEM.mjs +0 -6
- package/dist/connector-telemetry-snapshots-CZxkOuC3.mjs +0 -6
- package/dist/connectors-6lVSr-fd.mjs +0 -15
- package/dist/containers-Dqs_ZnO2.mjs +0 -78
- package/dist/containers-ncw3bd3a.mjs +0 -376
- package/dist/content-scan-BWFbqfQ0.mjs +0 -14
- package/dist/csamScanner-BwZNZu0A.mjs +0 -10
- package/dist/ct-alerting-DPp3qLqO.mjs +0 -5
- package/dist/custom-certificates-pfpZcr06.mjs +0 -17
- package/dist/custom-csrs-DrvGRAkl.mjs +0 -11
- package/dist/custom-hostnames-wGtmFbz1.mjs +0 -27
- package/dist/custom-nameservers-HTG6MPKv.mjs +0 -9
- package/dist/custom-pages-DqEHBSVt.mjs +0 -21
- package/dist/dcv-delegation-D6nj0Z5N.mjs +0 -4
- package/dist/deploy-context-DmG9rgPO.mjs +0 -56
- package/dist/diagnostics-tqHjq-Pl.mjs +0 -15
- package/dist/dls-BEHj4X9T.mjs +0 -17
- package/dist/dns-firewall-zwbkutyf.mjs +0 -71
- package/dist/dns-n4mfYBZg.mjs +0 -144
- package/dist/durable-objects-CQ2dHhho.mjs +0 -6
- package/dist/email-auth-DOi6yOt3.mjs +0 -6
- package/dist/email-routing-WcSPt22u.mjs +0 -45
- package/dist/email-security-BXu3OGay.mjs +0 -158
- package/dist/email-sending-B9zTlIjt.mjs +0 -47
- package/dist/error-sanitization-DE_zSrXw.mjs +0 -2
- package/dist/error-sanitization-DOCQ9Ykh.mjs +0 -2
- package/dist/errors-_sob7Ihu.mjs +0 -3
- package/dist/fieldExtractors-B37m2lKW.mjs +0 -9
- package/dist/firewall-CRtYO0Ha.mjs +0 -36
- package/dist/flagship-DvTFZSay.mjs +0 -28
- package/dist/fraud-uSyibsit.mjs +0 -22
- package/dist/google-tag-gateway-BFXiiokq.mjs +0 -6
- package/dist/healthchecks-27u7b7Jb.mjs +0 -22
- package/dist/hyperdrive-BzJvPdu6.mjs +0 -37
- package/dist/iam-Dl3cU9GI.mjs +0 -52
- package/dist/images-C2OkI1j7.mjs +0 -71
- package/dist/intel-DoB1g_K7.mjs +0 -76
- package/dist/ips-BRt68epr.mjs +0 -4
- package/dist/k2-_eq5ZY2t.mjs +0 -11
- package/dist/keyless-certificates-DaO2yqYu.mjs +0 -13
- package/dist/keys-7BQ3Zq6Y.mjs +0 -4
- package/dist/kv-BTYCXKML.mjs +0 -15
- package/dist/leaked-credential-checks-CPHOK_dE.mjs +0 -18
- package/dist/local-BundUuDT.mjs +0 -2
- package/dist/login-BBYC_BtH.mjs +0 -2
- package/dist/login-D2uoWhWh.mjs +0 -5
- package/dist/logo-matches-Bc1DQ4-g.mjs +0 -6
- package/dist/logos-X5B8z7Iv.mjs +0 -7
- package/dist/logpush-C2ENi1et.mjs +0 -46
- package/dist/logs-BKDz7kBW.mjs +0 -36
- package/dist/magic-cloud-networking-B60Gld8A.mjs +0 -71
- package/dist/magic-network-monitoring-CxXI3Y-H.mjs +0 -36
- package/dist/magic-transit-ZCSaCbl8.mjs +0 -386
- package/dist/managed-defense-DrxMb7xi.mjs +0 -18
- package/dist/managed-transforms-AI7KrRU1.mjs +0 -9
- package/dist/matches-rPMLS3Ip.mjs +0 -6
- package/dist/mcp-DXUMvEWt.mjs +0 -32
- package/dist/mesh-MmBCQ37q.mjs +0 -26
- package/dist/monetization-DQE5VtUO.mjs +0 -20
- package/dist/mtls-certificates-DwkEb-Hy.mjs +0 -13
- package/dist/network-BcfobxQY.mjs +0 -50
- package/dist/network-interconnects-BU3tN_Ab.mjs +0 -72
- package/dist/o11y-BBv7nedp.mjs +0 -93
- package/dist/oauth-BUr8bPwo.mjs +0 -9
- package/dist/oauth-clients-qWVImhHE.mjs +0 -16
- package/dist/oauth-scopes-CdeIgJIx.mjs +0 -4
- package/dist/organization-CJeOVWH7.mjs +0 -71
- package/dist/organizations-BpfoqZcG.mjs +0 -4
- package/dist/origin-ca-certificates-Bimf07RF.mjs +0 -11
- package/dist/origin-post-quantum-encryption-CM-If38w.mjs +0 -6
- package/dist/origin-tls-client-auth-BPwYPhc9.mjs +0 -30
- package/dist/output-BOe-3AQG.mjs +0 -2
- package/dist/page-rules-DOeekMrj.mjs +0 -39
- package/dist/pay-per-crawl-qJpseNNx.mjs +0 -38
- package/dist/pay-per-use-C1MWKJ4O.mjs +0 -33
- package/dist/pipelines-rCwXQw6S.mjs +0 -44
- package/dist/precursor-Bk8Pp6jT.mjs +0 -4
- package/dist/previews-BEheHO3T.mjs +0 -4
- package/dist/progress-CQqDtgmF.mjs +0 -2
- package/dist/prompt-C8FyienX.mjs +0 -3
- package/dist/queries-DJ8looyq.mjs +0 -9
- package/dist/queues-BBH9Q-Tt.mjs +0 -57
- package/dist/r2-CdJKpP2w.mjs +0 -128
- package/dist/raw-fetch-DbXN3SlE.mjs +0 -2
- package/dist/realtime-onrXppzh.mjs +0 -172
- package/dist/registrar-CbEBc5IE.mjs +0 -43
- package/dist/registrar-sandbox-BJhn1HFT.mjs +0 -56
- package/dist/reporting-bXZY6obP.mjs +0 -14
- package/dist/request-tracers-CihskC2A.mjs +0 -4
- package/dist/resolve-CaTBV-c6.mjs +0 -2
- package/dist/resolve-DCGSzUDQ.mjs +0 -2
- package/dist/resource-sharing-DDqcCHVs.mjs +0 -40
- package/dist/resource-tagging-D63RpBce.mjs +0 -4
- package/dist/rules-CAW0-Wde.mjs +0 -18
- package/dist/rulesets-CPir63Qc.mjs +0 -37
- package/dist/rum-BfwTcuup.mjs +0 -30
- package/dist/run-DEynXvCc.mjs +0 -2
- package/dist/scim-CtZ1FeQE.mjs +0 -18
- package/dist/secrets-store-BIuBYUJT.mjs +0 -24
- package/dist/security-insights-DfUus0bs.mjs +0 -40
- package/dist/security-txt-CgZOsAIZ.mjs +0 -9
- package/dist/session-BcM8Vyyx.mjs +0 -2
- package/dist/shared-CpS23WwR.mjs +0 -2
- package/dist/smart-shield-ClgB7r-9.mjs +0 -24
- package/dist/snippets-DLO3iFAg.mjs +0 -20
- package/dist/speed-DX5X2EIR.mjs +0 -24
- package/dist/sql-CF044HDW.mjs +0 -4
- package/dist/src-BMATTZU_.mjs +0 -125
- package/dist/ssl-CM-rChEC.mjs +0 -45
- package/dist/startup-profile-D662WI9s.mjs +0 -2
- package/dist/state-D7uNYnoi.mjs +0 -2
- package/dist/stream-5EmUOQvy.mjs +0 -102
- package/dist/submit-lEAaRSMR.mjs +0 -4
- package/dist/telemetry-0Y5hAtCX.mjs +0 -2
- package/dist/tenant-DnI7QziH.mjs +0 -10
- package/dist/tenant-custom-nameservers-MR0dlcGm.mjs +0 -9
- package/dist/theme-CQ_TYifs.mjs +0 -6
- package/dist/turnstile-M7sKCEz3.mjs +0 -33
- package/dist/ui-YmjF66Ct.mjs +0 -5
- package/dist/update-check-aTutXNRd.mjs +0 -2
- package/dist/url-info-Dos9VOXV.mjs +0 -4
- package/dist/url-normalization-CZbFOq_v.mjs +0 -9
- package/dist/url-scanner-B7quLPGW.mjs +0 -16
- package/dist/values-D-rrZrDa.mjs +0 -4
- package/dist/vectorize-D2tf_oA8.mjs +0 -32
- package/dist/version-BGnqDvNR.mjs +0 -2
- package/dist/web-assets-DQAfvPT9.mjs +0 -64
- package/dist/web3-MI0GQDnu.mjs +0 -28
- package/dist/workers-By6Pf8fv.mjs +0 -40
- package/dist/workers-builds-6YsWsCmC.mjs +0 -14
- package/dist/workers-for-platforms-DL8fC1qR.mjs +0 -40
- package/dist/workers-vpc-BYx6sbgd.mjs +0 -13
- package/dist/workflows-ByQLnV0E.mjs +0 -52
- package/dist/zaraz-CgbpmA85.mjs +0 -22
- package/dist/zero-trust-CpjTkkWt.mjs +0 -837
- package/dist/zone-DnKIe6po.mjs +0 -4
- package/dist/zones--5ZzsDmQ.mjs +0 -124
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-Dil4fTWX.mjs";import{i as n,n as r}from"./auth-C6u9qIGO.mjs";import{a as i,i as a,t as o}from"./context-A6T-NKPI.mjs";import{t as s}from"./output-Co4xdFf6.mjs";import{t as c}from"./dry-run-C2KjGX10.mjs";import{t as l}from"./progress-D5po7ScB.mjs";import{t as u}from"./run-DASYqJsY.mjs";import"./telemetry-BhKfwxyh.mjs";import{n as d,r as f,t as p}from"./body-parser-DkHKPkJ7.mjs";import{n as m,t as h}from"./input-validation-D7z60HJH.mjs";import{a as g,i as _,n as v}from"./prompt-BAJpE3jV.mjs";var y={method:`GET`,path:t=>e`/accounts/${t.account_id}/pay-per-use/enabled-domains`,query:[`cursor`,`per_page`],errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,500:`InternalServerError`}};function ee(e){return e.usage(`$0 pay-per-use enabled-domains list
|
|
3
|
+
|
|
4
|
+
Returns publisher domains associated with the requesting Pay Per Use operator through an accepted price agreement. License expiration is the earlier non-null boundary from the price agreement and publisher zone lifecycles. A future expiration remains active and is exposed to the operator. After expiration, the license remains listed as expired for one calendar month before it is omitted; an active agreement for the same domain takes precedence. The requesting account must be an active Pay Per Use operator.`).option(`cursor`,{type:`string`,description:`Opaque, account-bound cursor returned by the previous page. Cursors expire after one hour; restart pagination without a cursor after receiving a 400 response for an expired cursor.`}).option(`per-page`,{type:`number`,description:`Maximum number of domains to return`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const te={command:`list`,describe:`List enabled Pay Per Use domains`,builder:ee,handler:async e=>u({command:`pay-per-use enabled-domains list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={cursor:e.cursor,per_page:e[`per-page`]};if(e.dryRun){let e=await i();c({command:`cf pay-per-use enabled-domains list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/pay-per-use/enabled-domains`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(y,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})},ne={command:`enabled-domains`,describe:`Operations for enabled-domains`,builder:e=>e.command(te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var b={method:`GET`,path:t=>e`/accounts/${t.account_id}/pay-per-use/operator/configuration`,errors:{403:`ForbiddenError`,404:`NotFoundError`}};function x(e){return e.usage(`$0 pay-per-use operator get-configuration
|
|
5
|
+
|
|
6
|
+
Gets the pay-per-use operator configuration for an account, including its read-only non-billable classification timestamp.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get-configuration`,describe:`Get pay-per-use operator configuration`,builder:x,handler:async e=>u({command:`pay-per-use operator get-configuration`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await i();c({command:`cf pay-per-use operator get-configuration`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/pay-per-use/operator/configuration`,pathParams:{},bodyKind:`none`});return}let n=await r(e),a=e.local?t:await o();e.accountId=a;let u=await l(`Loading`,async()=>n.send(b,{account_id:a}));s(u,{successLabel:`Loaded`})})};var C={method:`PUT`,path:t=>e`/accounts/${t.account_id}/pay-per-use/operator/configuration`,body:`json`,errors:{400:`BadRequestError`,403:`ForbiddenError`,409:`ConflictError`}};function w(e){return e.usage(`$0 pay-per-use operator set-configuration
|
|
7
|
+
|
|
8
|
+
Creates or updates the pay-per-use operator configuration for an account. Creating an enabled configuration or re-enabling a disabled billable operator requires completed Stripe onboarding, while non-billable operators do not; an already-enabled operator is not affected by later Stripe status changes. A Cloudflare-verified operator's name and default price cannot be changed.`).option(`default-price-usd-microcents`,{type:`number`,description:`Default price in microcents. 1 USD = 100,000,000 microcents. Must be a multiple of 100,000 ($0.001) between $0.001 and $9,999.999.`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Pay-per-use operator configuration`})}const T={command:`set-configuration`,describe:`Set pay-per-use operator configuration`,builder:w,handler:async e=>u({command:`pay-per-use operator set-configuration`,classification:{safeFlags:[`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf pay-per-use operator set-configuration`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/pay-per-use/operator/configuration`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({default_price_usd_microcents:e[`default-price-usd-microcents`],enabled:e.enabled,name:m(e.name,`name`,`text`)}):d(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=d(e.body),r=await l(`Updating`,async()=>n.send(C,{body:t,account_id:a}));s(r,{successLabel:`Updated`});return}if(e[`default-price-usd-microcents`]===void 0)throw Error(`--default-price-usd-microcents is required (or pass --body with this field set).`);if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);e.name===void 0&&(e.name=await g(`name`,`The name field`));let u=p({default_price_usd_microcents:e[`default-price-usd-microcents`],enabled:e.enabled,name:m(e.name,`name`,`text`)}),f=await l(`Updating`,async()=>n.send(C,{body:u,account_id:a}));s(f,{successLabel:`Updated`})})};var E={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/pay-per-use/operator/configuration`,body:`json`,errors:{400:`BadRequestError`,403:`ForbiddenError`,404:`NotFoundError`,409:`ConflictError`}};function D(e){return e.usage(`$0 pay-per-use operator update-configuration
|
|
9
|
+
|
|
10
|
+
Updates one or more fields of an existing pay-per-use operator configuration. Re-enabling a disabled billable operator requires completed Stripe onboarding, while non-billable operators do not; an already-enabled operator is not affected by later Stripe status changes. A Cloudflare-verified operator's name and default price cannot be changed.`).option(`default-price-usd-microcents`,{type:`number`,description:`Default price in microcents. 1 USD = 100,000,000 microcents. Must be a multiple of 100,000 ($0.001) between $0.001 and $9,999.999.`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Pay-per-use operator configuration update`})}const O={command:`update-configuration`,describe:`Update pay-per-use operator configuration`,builder:D,handler:async e=>u({command:`pay-per-use operator update-configuration`,classification:{safeFlags:[`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf pay-per-use operator update-configuration`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/pay-per-use/operator/configuration`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({default_price_usd_microcents:e[`default-price-usd-microcents`],enabled:e.enabled,name:m(e.name,`name`,`text`)}):d(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=d(e.body),r=await l(`Updating`,async()=>n.send(E,{body:t,account_id:a}));s(r,{successLabel:`Updated`});return}let u=p({default_price_usd_microcents:e[`default-price-usd-microcents`],enabled:e.enabled,name:m(e.name,`name`,`text`)}),f=await l(`Updating`,async()=>n.send(E,{body:u,account_id:a}));s(f,{successLabel:`Updated`})})},k={command:`operator`,describe:`Operations for operator`,builder:e=>e.command(S).command(T).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var A={method:`GET`,path:t=>e`/zones/${t.zone_id}/pay-per-use/operators`,query:[`page`,`per_page`],errors:{400:`BadRequestError`,403:`ForbiddenError`,404:`NotFoundError`}};function j(e){return e.usage(`$0 pay-per-use pricing list-operators
|
|
11
|
+
|
|
12
|
+
Lists a paginated set of enabled pay-per-use operators with verified names, matching billing classification, and their prices for a zone.`).option(`page`,{type:`number`,description:`Page number.`}).option(`per-page`,{type:`number`,description:`Results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`list-operators`,describe:`List pay-per-use operators`,builder:j,handler:async e=>u({command:`pay-per-use pricing list-operators`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={page:e.page,per_page:e[`per-page`]};if(e.dryRun){c({command:`cf pay-per-use pricing list-operators`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/pay-per-use/operators`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await r(e),i=await a({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i;let o=await l(`Loading`,async()=>n.send(A,{zone_id:i,...t}));s(o,{successLabel:`Loaded`})})};var N={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/pay-per-use/operators/${t.operator_id}/price`,errors:{400:`BadRequestError`,403:`ForbiddenError`,404:`NotFoundError`}};function P(e){return e.usage(`$0 pay-per-use pricing opt-out-operator-price <operator-id>
|
|
13
|
+
|
|
14
|
+
Opts a zone out by scheduling the current accepted pay-per-use operator price to expire at the start of the next UTC month. Use the withdraw action for a pending proposal.`).positional(`operator-id`,{type:`string`,description:`Stable pay-per-use operator 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 F={command:`opt-out-operator-price <operator-id>`,describe:`Opt out of a pay-per-use operator price`,builder:P,handler:async e=>u({command:`pay-per-use pricing opt-out-operator-price`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){c({command:`cf pay-per-use pricing opt-out-operator-price`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/pay-per-use/operators/${e[`operator-id`]==null?`<operator-id>`:encodeURIComponent(String(e[`operator-id`]))}/price`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"operator-id":String(e[`operator-id`]??``)},bodyKind:`none`});return}let t=await r(e),n=await a({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await v({force:!!e.force})){process.stderr.write(`Aborted.
|
|
15
|
+
`);return}let i=await l(`Deleting`,async()=>t.send(N,{zone_id:n,operator_id:e[`operator-id`]}));s(i,{successLabel:`Deleted`})})};var I={method:`POST`,path:t=>e`/zones/${t.zone_id}/pay-per-use/operators/${t.operator_id}/price`,body:`json`,errors:{400:`BadRequestError`,403:`ForbiddenError`,404:`NotFoundError`,409:`ConflictError`}};function L(e){return e.usage(`$0 pay-per-use pricing set-operator-price <operator-id>
|
|
16
|
+
|
|
17
|
+
Proposes a required price, withdraws a pending proposal, accepts an operator's default pay-per-use price, or resumes an accepted price before its scheduled expiry. Propose, accept_default, and resume require an enabled operator with a verified name, an enabled publisher zone, and matching billing classifications.`).positional(`operator-id`,{type:`string`,description:`Stable pay-per-use operator identifier.`,demandOption:!0}).option(`action`,{type:`string`,description:`The action field`,choices:[`propose`,`withdraw`,`accept_default`,`resume`]}).coerce(`action`,e=>m(e,`action`,`text`)).option(`price-usd-microcents`,{type:`number`,description:`Price in microcents. Must be a multiple of 100,000 ($0.001) between $0.001 and $9,999.999.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Pay-per-use publisher price action`})}const R={command:`set-operator-price <operator-id>`,describe:`Set a pay-per-use operator price`,builder:L,handler:async e=>u({command:`pay-per-use pricing set-operator-price`,classification:{safeFlags:[`action`,`dry-run`]}},e,async()=>{if(e.dryRun){c({command:`cf pay-per-use pricing set-operator-price`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/pay-per-use/operators/${e[`operator-id`]==null?`<operator-id>`:encodeURIComponent(String(e[`operator-id`]))}/price`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"operator-id":String(e[`operator-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({action:e.action,price_usd_microcents:e[`price-usd-microcents`]}):d(e.body)});return}let t=await r(e),n=await a({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=d(e.body),i=await l(`Creating`,async()=>t.send(I,{body:r,zone_id:n,operator_id:e[`operator-id`]}));s(i,{successLabel:`Created`});return}if(e.action===void 0&&(e.action=await _(`action`,`The action field`,[`propose`,`withdraw`,`accept_default`,`resume`])),e.action===`propose`&&e[`price-usd-microcents`]===void 0)throw Error(`--price-usd-microcents is required (or pass --body with this field set).`);let i=p({action:e.action,price_usd_microcents:e[`price-usd-microcents`]}),o=await l(`Creating`,async()=>t.send(I,{body:i,zone_id:n,operator_id:e[`operator-id`]}));s(o,{successLabel:`Created`})})},z={command:`pricing`,describe:`Operations for pricing`,builder:e=>e.command(M).command(F).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var B={method:`POST`,path:t=>e`/accounts/${t.account_id}/pay-per-use/proposals`,body:`json`,errors:{400:`BadRequestError`,403:`ForbiddenError`,404:`NotFoundError`,409:`ConflictError`}};function V(e){return e.usage(`$0 pay-per-use proposals decide
|
|
18
|
+
|
|
19
|
+
Accepts or rejects the pending pay-per-use price proposal identified by price_id in the request body. Acceptance requires an enabled operator with a verified name, an enabled publisher zone, and matching billing classifications; rejection remains available for cleanup.`).option(`action`,{type:`string`,description:`The action field`,choices:[`accept`,`reject`]}).coerce(`action`,e=>m(e,`action`,`text`)).option(`price-id`,{type:`number`,description:`Pending pay-per-use price id returned in the operator proposal queue.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Pay-per-use operator proposal decision`})}const H={command:`decide`,describe:`Decide a pay-per-use price proposal`,builder:V,handler:async e=>u({command:`pay-per-use proposals decide`,classification:{safeFlags:[`action`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf pay-per-use proposals decide`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/pay-per-use/proposals`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({action:e.action,price_id:e[`price-id`]}):d(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=d(e.body),r=await l(`Creating`,async()=>n.send(B,{body:t,account_id:a}));s(r,{successLabel:`Created`});return}if(e.action===void 0&&(e.action=await _(`action`,`The action field`,[`accept`,`reject`])),e[`price-id`]===void 0)throw Error(`--price-id is required (or pass --body with this field set).`);let u=p({action:e.action,price_id:e[`price-id`]}),f=await l(`Creating`,async()=>n.send(B,{body:u,account_id:a}));s(f,{successLabel:`Created`})})};var U={method:`GET`,path:t=>e`/accounts/${t.account_id}/pay-per-use/proposals`,query:[`page`,`per_page`],errors:{400:`BadRequestError`,403:`ForbiddenError`,404:`NotFoundError`}};function re(e){return e.usage(`$0 pay-per-use proposals list
|
|
20
|
+
|
|
21
|
+
Lists a paginated set of outstanding pay-per-use publisher price proposals for an operator. Listing remains available while the operator is disabled or its name is unverified so proposals can be rejected.`).option(`page`,{type:`number`,description:`Page number.`}).option(`per-page`,{type:`number`,description:`Results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`list`,describe:`List pay-per-use price proposals`,builder:re,handler:async e=>u({command:`pay-per-use proposals list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={page:e.page,per_page:e[`per-page`]};if(e.dryRun){let e=await i();c({command:`cf pay-per-use proposals list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/pay-per-use/proposals`,pathParams:{},query:n,bodyKind:`none`});return}let a=await r(e),u=e.local?t:await o();e.accountId=u;let d=await l(`Loading`,async()=>a.send(U,{account_id:u,...n}));s(d,{successLabel:`Loaded`})})},G={command:`proposals`,describe:`Operations for proposals`,builder:e=>e.command(H).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.usage(`$0 pay-per-use usage-reports submit
|
|
22
|
+
|
|
23
|
+
Validates and submits a usage report for an active Pay Per Use participant. The complete report is rejected if any item is invalid.`).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`})}const q={command:`submit`,describe:`Submit a participant usage report`,builder:K,handler:async e=>u({command:`pay-per-use usage-reports submit`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf pay-per-use usage-reports submit`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/pay-per-use/usage-reports`,pathParams:{},bodyKind:`octet-stream`,body:e.body});return}let a=await r(e),u=e.local?t:await o();if(e.accountId=u,e.file){let t=h(e.file),r=await l(`Creating`,async()=>n(a,`POST`,`/accounts/${u}/pay-per-use/usage-reports`,{body:t,headers:{"Content-Type":`application/jsonl`}}));s(r,{successLabel:`Created`});return}if(e.body){let t=m(e.body,`body`,`binary`),r=await l(`Creating`,async()=>n(a,`POST`,`/accounts/${u}/pay-per-use/usage-reports`,{body:t,headers:{"Content-Type":`application/jsonl`}}));s(r,{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},J={command:`usage-reports`,describe:`Operations for usage-reports`,builder:e=>e.command(q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Y={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/pay-per-use/usage-stats`,query:[`since`,`until`,`page`,`per_page`],errors:{400:`BadRequestError`,403:`ForbiddenError`,500:`InternalServerError`}};function X(e){return e.usage(`$0 pay-per-use usage-stats get-account
|
|
24
|
+
|
|
25
|
+
Returns reported usage and the full gross value across all Pay Per Use zones in a publisher account or zone over an explicit UTC range of at most 31 days. Usage from every domain and snapshotted price is summed by buyer. Ranges up to and including 7 days use hourly data points; longer ranges use daily data points. Because source data is aggregated hourly, both requested bounds are rounded down to the selected UTC interval and the resolved bounds are returned in the response. The resolved range must contain at least one complete interval. Empty periods are omitted. Buyers and their data points are paginated, while totals cover every buyer in the range. Values are raw usage counts and USD microcents; total_price_usd_microcents is the full value before the publisher revenue share.`).option(`since`,{type:`string`,description:`Requested inclusive beginning of the statistics range as an RFC3339 timestamp. Rounded down to the selected UTC interval.`,demandOption:!0}).option(`until`,{type:`string`,description:`Requested exclusive end of the statistics range as an RFC3339 timestamp. Rounded down to the selected UTC interval. The requested duration from since cannot exceed 31 days.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number.`}).option(`per-page`,{type:`number`,description:`Results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`get-account`,describe:`Get pay-per-use usage statistics`,builder:X,handler:async e=>u({command:`pay-per-use usage-stats get-account`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let n={since:e.since,until:e.until,page:e.page,per_page:e[`per-page`]};if(e.dryRun){let t=e.zone===void 0?await i():void 0,r=e.zone===void 0?`accounts`:`zones`,a=e.zone??t??`<account-id>`;c({command:`cf pay-per-use usage-stats get-account`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${r}/${a}/pay-per-use/usage-stats`,pathParams:{"account-or-zone":String(r),"account-or-zone-id":String(a)},query:n,bodyKind:`none`});return}let u=await r(e),d=e.zone===void 0?`accounts`:`zones`,f=d===`zones`?await a({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await o();d===`zones`?e.zoneId=f:e.accountId=f;let p=await l(`Loading`,async()=>u.send(Y,{account_or_zone:d,account_or_zone_id:f,...n}));s(p,{successLabel:`Loaded`})})},ae={command:`usage-stats`,describe:`Operations for usage-stats`,builder:e=>e.command(ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var oe={method:`GET`,path:t=>e`/zones/${t.zone_id}/pay-per-use/can_be_enabled`,errors:{403:`ForbiddenError`}};function se(e){return e.usage(`$0 pay-per-use zones get-can-be-enabled
|
|
26
|
+
|
|
27
|
+
Gets whether pay-per-use can be enabled for a zone and the current zone-level grace period.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ce={command:`get-can-be-enabled`,describe:`Get pay-per-use zone eligibility`,builder:se,handler:async e=>u({command:`pay-per-use zones get-can-be-enabled`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){c({command:`cf pay-per-use zones get-can-be-enabled`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/pay-per-use/can_be_enabled`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await r(e),n=await a({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n;let i=await l(`Loading`,async()=>t.send(oe,{zone_id:n}));s(i,{successLabel:`Loaded`})})};var Z={method:`GET`,path:t=>e`/zones/${t.zone_id}/pay-per-use/configuration`,errors:{403:`ForbiddenError`}};function le(e){return e.usage(`$0 pay-per-use zones get-configuration
|
|
28
|
+
|
|
29
|
+
Gets the pay-per-use configuration, zone-level grace period, and read-only non-billable classification timestamp for a zone.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ue={command:`get-configuration`,describe:`Get pay-per-use zone configuration`,builder:le,handler:async e=>u({command:`pay-per-use zones get-configuration`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){c({command:`cf pay-per-use zones get-configuration`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/pay-per-use/configuration`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await r(e),n=await a({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n;let i=await l(`Loading`,async()=>t.send(Z,{zone_id:n}));s(i,{successLabel:`Loaded`})})};var Q={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/pay-per-use/zones_can_be_enabled`,body:`json`,errors:{400:`BadRequestError`,403:`ForbiddenError`}};function de(e){return e.usage(`$0 pay-per-use zones set-can-be-enabled
|
|
30
|
+
|
|
31
|
+
Sets pay-per-use eligibility for a list of account zones. An omitted can_be_enabled value leaves that zone unchanged. Revoking eligibility disables the zone immediately while existing accepted licenses remain active until the start of the next UTC month.`).option(`zones`,{type:`string`,description:`The zones field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Pay-per-use zone eligibility updates`})}const fe={command:`set-can-be-enabled`,describe:`Set pay-per-use zone eligibility`,builder:de,handler:async e=>u({command:`pay-per-use zones set-can-be-enabled`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();c({command:`cf pay-per-use zones set-can-be-enabled`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/pay-per-use/zones_can_be_enabled`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({zones:f(e.zones,`zones`)}):d(e.body)});return}let n=await r(e),a=e.local?t:await o();if(e.accountId=a,e.body){let t=d(e.body),r=await l(`Updating`,async()=>n.send(Q,{body:t,account_id:a}));s(r,{successLabel:`Updated`});return}if(e.zones===void 0)throw Error(`--zones is required (or pass --body with this field set).`);let u=p({zones:f(e.zones,`zones`)}),m=await l(`Updating`,async()=>n.send(Q,{body:u,account_id:a}));s(m,{successLabel:`Updated`})})};var $={method:`PATCH`,path:t=>e`/zones/${t.zone_id}/pay-per-use/configuration`,body:`json`,errors:{400:`BadRequestError`,403:`ForbiddenError`,404:`NotFoundError`,409:`ConflictError`}};function pe(e){return e.usage(`$0 pay-per-use zones update-configuration
|
|
32
|
+
|
|
33
|
+
Enables or disables an existing pay-per-use zone configuration. Omitting enabled leaves the zone unchanged. Enabling a disabled billable zone requires completed publisher Stripe onboarding, while non-billable zones do not; an already-enabled zone is not affected by later Stripe status changes. Disabling starts a disabled period immediately while existing accepted licenses remain active until the start of the next UTC month; re-enabling before expiry clears the schedule and restores those licenses.`).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Pay-per-use zone configuration update`})}const me={command:`update-configuration`,describe:`Update pay-per-use zone configuration`,builder:pe,handler:async e=>u({command:`pay-per-use zones update-configuration`,classification:{safeFlags:[`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){c({command:`cf pay-per-use zones update-configuration`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/pay-per-use/configuration`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({enabled:e.enabled}):d(e.body)});return}let t=await r(e),n=await a({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=d(e.body),i=await l(`Updating`,async()=>t.send($,{body:r,zone_id:n}));s(i,{successLabel:`Updated`});return}let i=p({enabled:e.enabled}),o=await l(`Updating`,async()=>t.send($,{body:i,zone_id:n}));s(o,{successLabel:`Updated`})})},he={command:`zones`,describe:`Operations for zones`,builder:e=>e.command(ce).command(ue).command(fe).command(me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ge={command:`pay-per-use`,describe:`pay-per-use`,builder:e=>e.command(ne).command(k).command(z).command(G).command(J).command(ae).command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{ge as default};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-Dil4fTWX.mjs";import{n}from"./auth-C6u9qIGO.mjs";import{a as r,t as i}from"./context-A6T-NKPI.mjs";import{t as a}from"./output-Co4xdFf6.mjs";import{t as o}from"./dry-run-C2KjGX10.mjs";import{t as s}from"./progress-D5po7ScB.mjs";import{t as c}from"./run-DASYqJsY.mjs";import"./telemetry-BhKfwxyh.mjs";import{n as l,r as u,t as d}from"./body-parser-DkHKPkJ7.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{a as p,i as m,n as h}from"./prompt-BAJpE3jV.mjs";var g={method:`POST`,path:t=>e`/accounts/${t.account_id}/pipelines/v1/pipelines`,body:`json`};function _(e){return e.usage(`$0 pipelines create
|
|
3
|
+
|
|
4
|
+
Create a new Pipeline.`).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 v={command:`create`,describe:`Create Pipeline`,builder:_,handler:async e=>c({command:`pipelines create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf pipelines create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/pipelines/v1/pipelines`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({name:f(e.name,`name`,`text`),sql:f(e.sql,`sql`,`text`)}):l(e.body)});return}let c=await n(e),u=e.local?t:await i();if(e.accountId=u,e.body){let t=l(e.body),n=await s(`Creating`,async()=>c.send(g,{body:t,account_id:u}));a(n,{successLabel:`Created`});return}e.name===void 0&&(e.name=await p(`name`,`Specifies the name of the Pipeline.`)),e.sql===void 0&&(e.sql=await p(`sql`,`Specifies SQL for the Pipeline processing flow.`));let m=d({name:f(e.name,`name`,`text`),sql:f(e.sql,`sql`,`text`)}),h=await s(`Creating`,async()=>c.send(g,{body:m,account_id:u}));a(h,{successLabel:`Created`})})};var y={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/pipelines/v1/pipelines/${t.pipeline_id}`};function b(e){return e.usage(`$0 pipelines delete <pipeline-id>
|
|
5
|
+
|
|
6
|
+
Delete Pipeline in Account.`).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 ee={command:`delete <pipeline-id>`,describe:`Delete Pipeline`,builder:b,handler:async e=>c({command:`pipelines delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf pipelines delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/pipelines/v1/pipelines/${e[`pipeline-id`]==null?`<pipeline-id>`:encodeURIComponent(String(e[`pipeline-id`]))}`,pathParams:{"pipeline-id":String(e[`pipeline-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await h({force:!!e.force})){process.stderr.write(`Aborted.
|
|
7
|
+
`);return}let u=await s(`Deleting`,async()=>c.send(y,{account_id:l,pipeline_id:e[`pipeline-id`]}));a(u,{successLabel:`Deleted`})})};var te={method:`GET`,path:t=>e`/accounts/${t.account_id}/pipelines/v1/pipelines/${t.pipeline_id}`};function ne(e){return e.usage(`$0 pipelines get <pipeline-id>
|
|
8
|
+
|
|
9
|
+
Get Pipeline details.`).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 re={command:`get <pipeline-id>`,describe:`Get Pipeline Details`,builder:ne,handler:async e=>c({command:`pipelines get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf pipelines get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/pipelines/v1/pipelines/${e[`pipeline-id`]==null?`<pipeline-id>`:encodeURIComponent(String(e[`pipeline-id`]))}`,pathParams:{"pipeline-id":String(e[`pipeline-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(te,{account_id:l,pipeline_id:e[`pipeline-id`]}));a(u,{successLabel:`Loaded`})})};var x={method:`POST`,path:t=>e`/accounts/${t.account_id}/pipelines`,body:`json`};function S(e){return e.usage(`$0 pipelines legacy-create
|
|
10
|
+
|
|
11
|
+
[DEPRECATED] Create a new pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`).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`}).coerce(`destination-compression-type`,e=>f(e,`destination-compression-type`,`text`)).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`]}).coerce(`destination-format`,e=>f(e,`destination-format`,`text`)).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`]}).coerce(`destination-type`,e=>f(e,`destination-type`,`text`)).option(`name`,{type:`string`,description:`Defines the name of the pipeline.`}).option(`source`,{type:`string`,description:`The source field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`legacy-create`,describe:`[DEPRECATED] Create Pipeline`,builder:S,handler:async e=>c({command:`pipelines legacy-create`,classification:{safeFlags:[`destination-compression-type`,`destination-format`,`destination-type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf pipelines legacy-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/pipelines`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({destination:{batch:{max_bytes:e[`destination-batch-max-bytes`],max_duration_s:e[`destination-batch-max-duration-s`],max_rows:e[`destination-batch-max-rows`]},compression:{type:e[`destination-compression-type`]},credentials:{access_key_id:f(e[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:f(e[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:f(e[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:e[`destination-format`],path:{bucket:f(e[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:f(e[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:f(e[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:e[`destination-type`]},name:f(e.name,`name`,`text`),source:u(e.source,`source`)}):l(e.body)});return}let c=await n(e),h=e.local?t:await i();if(e.accountId=h,e.body){let t=l(e.body),n=await s(`Creating`,async()=>c.send(x,{body:t,account_id:h}));a(n,{successLabel:`Created`});return}if(e[`destination-credentials-access-key-id`]===void 0&&(e[`destination-credentials-access-key-id`]=await p(`destination-credentials-access-key-id`,`Specifies the R2 Bucket Access Key Id.`)),e[`destination-credentials-endpoint`]===void 0&&(e[`destination-credentials-endpoint`]=await p(`destination-credentials-endpoint`,`Specifies the R2 Endpoint.`)),e[`destination-credentials-secret-access-key`]===void 0&&(e[`destination-credentials-secret-access-key`]=await p(`destination-credentials-secret-access-key`,`Specifies the R2 Bucket Secret Access Key.`)),e[`destination-format`]===void 0&&(e[`destination-format`]=await m(`destination-format`,`Specifies the format of data to deliver.`,[`json`])),e[`destination-path-bucket`]===void 0&&(e[`destination-path-bucket`]=await p(`destination-path-bucket`,`Specifies the R2 Bucket to store files.`)),e[`destination-type`]===void 0&&(e[`destination-type`]=await m(`destination-type`,`Specifies the type of destination.`,[`r2`])),e.name===void 0&&(e.name=await p(`name`,`Defines the name of the pipeline.`)),e.source===void 0)throw Error(`--source is required (or pass --body with this field set).`);let g=d({destination:{batch:{max_bytes:e[`destination-batch-max-bytes`],max_duration_s:e[`destination-batch-max-duration-s`],max_rows:e[`destination-batch-max-rows`]},compression:{type:e[`destination-compression-type`]},credentials:{access_key_id:f(e[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:f(e[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:f(e[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:e[`destination-format`],path:{bucket:f(e[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:f(e[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:f(e[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:e[`destination-type`]},name:f(e.name,`name`,`text`),source:u(e.source,`source`)}),_=await s(`Creating`,async()=>c.send(x,{body:g,account_id:h}));a(_,{successLabel:`Created`})})};var w={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/pipelines/${t.pipeline_name}`,response:!1};function T(e){return e.usage(`$0 pipelines legacy-delete <pipeline-name>
|
|
12
|
+
|
|
13
|
+
[DEPRECATED] Delete a pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`).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 E={command:`legacy-delete <pipeline-name>`,describe:`[DEPRECATED] Delete Pipeline`,builder:T,handler:async e=>c({command:`pipelines legacy-delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf pipelines legacy-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/pipelines/${e[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(e[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(e[`pipeline-name`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await h({force:!!e.force})){process.stderr.write(`Aborted.
|
|
14
|
+
`);return}let u=await s(`Deleting`,async()=>c.send(w,{account_id:l,pipeline_name:e[`pipeline-name`]}));a(u,{successLabel:`Deleted`})})};var D={method:`GET`,path:t=>e`/accounts/${t.account_id}/pipelines/${t.pipeline_name}`,errors:{404:`NotFoundError`}};function O(e){return e.usage(`$0 pipelines legacy-get <pipeline-name>
|
|
15
|
+
|
|
16
|
+
[DEPRECATED] Get configuration of a pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`).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 k={command:`legacy-get <pipeline-name>`,describe:`[DEPRECATED] Get Pipeline`,builder:O,handler:async e=>c({command:`pipelines legacy-get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf pipelines legacy-get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/pipelines/${e[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(e[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(e[`pipeline-name`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(D,{account_id:l,pipeline_name:e[`pipeline-name`]}));a(u,{successLabel:`Loaded`})})};var A={method:`GET`,path:t=>e`/accounts/${t.account_id}/pipelines`,query:[`search`,`page`,`per_page`]};function j(e){return e.usage(`$0 pipelines legacy-list
|
|
17
|
+
|
|
18
|
+
[DEPRECATED] List, filter, and paginate pipelines in an account. Use the new /pipelines/v1/pipelines endpoint instead.`).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 M={command:`legacy-list`,describe:`[DEPRECATED] List Pipelines`,builder:j,handler:async e=>c({command:`pipelines legacy-list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={search:e.search,page:e.page,per_page:e[`per-page`]};if(e.dryRun){let e=await r();o({command:`cf pipelines legacy-list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/pipelines`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(A,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})};var N={method:`PUT`,path:t=>e`/accounts/${t.account_id}/pipelines/${t.pipeline_name}`,body:`json`};function P(e){return e.usage(`$0 pipelines legacy-update <pipeline-name>
|
|
19
|
+
|
|
20
|
+
[DEPRECATED] Update an existing pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`).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`]}).coerce(`destination-compression-type`,e=>f(e,`destination-compression-type`,`text`)).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`]}).coerce(`destination-format`,e=>f(e,`destination-format`,`text`)).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`]}).coerce(`destination-type`,e=>f(e,`destination-type`,`text`)).option(`name`,{type:`string`,description:`Defines the name of the pipeline.`}).option(`source`,{type:`string`,description:`The source field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const F={command:`legacy-update <pipeline-name>`,describe:`[DEPRECATED] Update Pipeline`,builder:P,handler:async e=>c({command:`pipelines legacy-update`,classification:{safeFlags:[`destination-compression-type`,`destination-format`,`destination-type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf pipelines legacy-update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/pipelines/${e[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(e[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(e[`pipeline-name`]??``)},bodyKind:`json`,body:e.body===void 0?d({destination:{batch:{max_bytes:e[`destination-batch-max-bytes`],max_duration_s:e[`destination-batch-max-duration-s`],max_rows:e[`destination-batch-max-rows`]},compression:{type:e[`destination-compression-type`]},credentials:{access_key_id:f(e[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:f(e[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:f(e[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:e[`destination-format`],path:{bucket:f(e[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:f(e[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:f(e[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:e[`destination-type`]},name:f(e.name,`name`,`text`),source:u(e.source,`source`)}):l(e.body)});return}let c=await n(e),h=e.local?t:await i();if(e.accountId=h,e.body){let t=l(e.body),n=await s(`Updating`,async()=>c.send(N,{body:t,account_id:h,pipeline_name:e[`pipeline-name`]}));a(n,{successLabel:`Updated`});return}if(e[`destination-credentials-access-key-id`]===void 0&&(e[`destination-credentials-access-key-id`]=await p(`destination-credentials-access-key-id`,`Specifies the R2 Bucket Access Key Id.`)),e[`destination-credentials-endpoint`]===void 0&&(e[`destination-credentials-endpoint`]=await p(`destination-credentials-endpoint`,`Specifies the R2 Endpoint.`)),e[`destination-credentials-secret-access-key`]===void 0&&(e[`destination-credentials-secret-access-key`]=await p(`destination-credentials-secret-access-key`,`Specifies the R2 Bucket Secret Access Key.`)),e[`destination-format`]===void 0&&(e[`destination-format`]=await m(`destination-format`,`Specifies the format of data to deliver.`,[`json`])),e[`destination-path-bucket`]===void 0&&(e[`destination-path-bucket`]=await p(`destination-path-bucket`,`Specifies the R2 Bucket to store files.`)),e[`destination-type`]===void 0&&(e[`destination-type`]=await m(`destination-type`,`Specifies the type of destination.`,[`r2`])),e.name===void 0&&(e.name=await p(`name`,`Defines the name of the pipeline.`)),e.source===void 0)throw Error(`--source is required (or pass --body with this field set).`);let g=d({destination:{batch:{max_bytes:e[`destination-batch-max-bytes`],max_duration_s:e[`destination-batch-max-duration-s`],max_rows:e[`destination-batch-max-rows`]},compression:{type:e[`destination-compression-type`]},credentials:{access_key_id:f(e[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:f(e[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:f(e[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:e[`destination-format`],path:{bucket:f(e[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:f(e[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:f(e[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:e[`destination-type`]},name:f(e.name,`name`,`text`),source:u(e.source,`source`)}),_=await s(`Updating`,async()=>c.send(N,{body:g,account_id:h,pipeline_name:e[`pipeline-name`]}));a(_,{successLabel:`Updated`})})};var I={method:`GET`,path:t=>e`/accounts/${t.account_id}/pipelines/v1/pipelines`,query:[`page`,`per_page`,`name`]};function L(e){return e.usage(`$0 pipelines list
|
|
21
|
+
|
|
22
|
+
List/Filter Pipelines in Account.`).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 R={command:`list`,describe:`List Pipelines`,builder:L,handler:async e=>c({command:`pipelines list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={page:e.page,per_page:e[`per-page`],name:e.name};if(e.dryRun){let e=await r();o({command:`cf pipelines list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/pipelines/v1/pipelines`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(I,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})};var z={method:`POST`,path:t=>e`/accounts/${t.account_id}/pipelines/v1/sinks`,body:`json`};function B(e){return e.usage(`$0 pipelines sinks create
|
|
23
|
+
|
|
24
|
+
Create a new Sink.`).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`]}).coerce(`config-file-naming-strategy`,e=>f(e,`config-file-naming-strategy`,`text`)).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`]}).coerce(`format-decimal-encoding`,e=>f(e,`format-decimal-encoding`,`text`)).option(`format-timestamp-format`,{type:`string`,description:`The format.timestamp_format field`,choices:[`rfc3339`,`unix_millis`]}).coerce(`format-timestamp-format`,e=>f(e,`format-timestamp-format`,`text`)).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`]}).coerce(`format-compression`,e=>f(e,`format-compression`,`text`)).option(`format-type`,{type:`string`,description:`The format.type field`,choices:[`json`,`parquet`]}).coerce(`format-type`,e=>f(e,`format-type`,`text`)).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`,`basin_catalog`]}).coerce(`type`,e=>f(e,`type`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`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 V={command:`create`,describe:`Create Sink`,builder:B,handler:async e=>c({command:`pipelines sinks create`,classification:{safeFlags:[`config-file-naming-strategy`,`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`,`format-compression`,`format-type`,`schema-inferred`,`type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf pipelines sinks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/pipelines/v1/sinks`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({config:{account_id:f(e[`config-account-id`],`config-account-id`,`text`),bucket:f(e[`config-bucket`],`config-bucket`,`text`),credentials:{access_key_id:f(e[`config-credentials-access-key-id`],`config-credentials-access-key-id`,`text`),secret_access_key:f(e[`config-credentials-secret-access-key`],`config-credentials-secret-access-key`,`text`)},file_naming:{prefix:f(e[`config-file-naming-prefix`],`config-file-naming-prefix`,`text`),strategy:e[`config-file-naming-strategy`],suffix:f(e[`config-file-naming-suffix`],`config-file-naming-suffix`,`text`)},jurisdiction:f(e[`config-jurisdiction`],`config-jurisdiction`,`text`),partitioning:{time_pattern:f(e[`config-partitioning-time-pattern`],`config-partitioning-time-pattern`,`text`)},path:f(e[`config-path`],`config-path`,`text`),rolling_policy:{file_size_bytes:e[`config-rolling-policy-file-size-bytes`],inactivity_seconds:e[`config-rolling-policy-inactivity-seconds`],interval_seconds:e[`config-rolling-policy-interval-seconds`]},namespace:f(e[`config-namespace`],`config-namespace`,`text`),table_name:f(e[`config-table-name`],`config-table-name`,`text`),token:f(e[`config-token`],`config-token`,`text`)},format:{decimal_encoding:e[`format-decimal-encoding`],timestamp_format:e[`format-timestamp-format`],unstructured:e[`format-unstructured`],compression:e[`format-compression`],type:e[`format-type`],row_group_bytes:e[`format-row-group-bytes`]},name:f(e.name,`name`,`text`),schema:{inferred:e[`schema-inferred`]},type:e.type}):l(e.body),sensitiveBodyPaths:[[`config`,`credentials`,`secret_access_key`],[`config`,`token`]]});return}let c=await n(e),u=e.local?t:await i();if(e.accountId=u,e.body){let t=l(e.body),n=await s(`Creating`,async()=>c.send(z,{body:t,account_id:u}));a(n,{successLabel:`Created`});return}e.name===void 0&&(e.name=await p(`name`,`Defines the name of the Sink.`)),e.type===void 0&&(e.type=await m(`type`,`Specifies the type of sink.`,[`r2`,`r2_data_catalog`,`basin_catalog`]));let h=d({config:{account_id:f(e[`config-account-id`],`config-account-id`,`text`),bucket:f(e[`config-bucket`],`config-bucket`,`text`),credentials:{access_key_id:f(e[`config-credentials-access-key-id`],`config-credentials-access-key-id`,`text`),secret_access_key:f(e[`config-credentials-secret-access-key`],`config-credentials-secret-access-key`,`text`)},file_naming:{prefix:f(e[`config-file-naming-prefix`],`config-file-naming-prefix`,`text`),strategy:e[`config-file-naming-strategy`],suffix:f(e[`config-file-naming-suffix`],`config-file-naming-suffix`,`text`)},jurisdiction:f(e[`config-jurisdiction`],`config-jurisdiction`,`text`),partitioning:{time_pattern:f(e[`config-partitioning-time-pattern`],`config-partitioning-time-pattern`,`text`)},path:f(e[`config-path`],`config-path`,`text`),rolling_policy:{file_size_bytes:e[`config-rolling-policy-file-size-bytes`],inactivity_seconds:e[`config-rolling-policy-inactivity-seconds`],interval_seconds:e[`config-rolling-policy-interval-seconds`]},namespace:f(e[`config-namespace`],`config-namespace`,`text`),table_name:f(e[`config-table-name`],`config-table-name`,`text`),token:f(e[`config-token`],`config-token`,`text`)},format:{decimal_encoding:e[`format-decimal-encoding`],timestamp_format:e[`format-timestamp-format`],unstructured:e[`format-unstructured`],compression:e[`format-compression`],type:e[`format-type`],row_group_bytes:e[`format-row-group-bytes`]},name:f(e.name,`name`,`text`),schema:{inferred:e[`schema-inferred`]},type:e.type}),g=await s(`Creating`,async()=>c.send(z,{body:h,account_id:u}));a(g,{successLabel:`Created`})})};var H={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/pipelines/v1/sinks/${t.sink_id}`};function U(e){return e.usage(`$0 pipelines sinks delete <sink-id>
|
|
25
|
+
|
|
26
|
+
Delete Sink in Account.`).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 W={command:`delete <sink-id>`,describe:`Delete Sink`,builder:U,handler:async e=>c({command:`pipelines sinks delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf pipelines sinks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/pipelines/v1/sinks/${e[`sink-id`]==null?`<sink-id>`:encodeURIComponent(String(e[`sink-id`]))}`,pathParams:{"sink-id":String(e[`sink-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await h({force:!!e.force})){process.stderr.write(`Aborted.
|
|
27
|
+
`);return}let u=await s(`Deleting`,async()=>c.send(H,{account_id:l,sink_id:e[`sink-id`]}));a(u,{successLabel:`Deleted`})})};var ie={method:`GET`,path:t=>e`/accounts/${t.account_id}/pipelines/v1/sinks/${t.sink_id}`};function G(e){return e.usage(`$0 pipelines sinks get <sink-id>
|
|
28
|
+
|
|
29
|
+
Get Sink Details.`).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 K={command:`get <sink-id>`,describe:`Get Sink Details`,builder:G,handler:async e=>c({command:`pipelines sinks get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf pipelines sinks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/pipelines/v1/sinks/${e[`sink-id`]==null?`<sink-id>`:encodeURIComponent(String(e[`sink-id`]))}`,pathParams:{"sink-id":String(e[`sink-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(ie,{account_id:l,sink_id:e[`sink-id`]}));a(u,{successLabel:`Loaded`})})};var q={method:`GET`,path:t=>e`/accounts/${t.account_id}/pipelines/v1/sinks`,query:[`pipeline_id`,`name`,`page`,`per_page`]};function J(e){return e.usage(`$0 pipelines sinks list
|
|
30
|
+
|
|
31
|
+
List/Filter Sinks in Account.`).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 Y={command:`list`,describe:`List Sinks`,builder:J,handler:async e=>c({command:`pipelines sinks list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={pipeline_id:e[`pipeline-id`],name:e.name,page:e.page,per_page:e[`per-page`]};if(e.dryRun){let e=await r();o({command:`cf pipelines sinks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/pipelines/v1/sinks`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(q,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})},ae={command:`sinks`,describe:`Destinations where pipeline data is written — R2 buckets, HTTP endpoints, or other storage`,builder:e=>e.command(V).command(W).command(K).command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var X={method:`POST`,path:t=>e`/accounts/${t.account_id}/pipelines/v1/streams`,body:`json`};function oe(e){return e.usage(`$0 pipelines streams create
|
|
32
|
+
|
|
33
|
+
Create a new Stream.`).option(`format-decimal-encoding`,{type:`string`,description:`The format.decimal_encoding field`,choices:[`number`,`string`,`bytes`]}).coerce(`format-decimal-encoding`,e=>f(e,`format-decimal-encoding`,`text`)).option(`format-timestamp-format`,{type:`string`,description:`The format.timestamp_format field`,choices:[`rfc3339`,`unix_millis`]}).coerce(`format-timestamp-format`,e=>f(e,`format-timestamp-format`,`text`)).option(`format-unstructured`,{type:`boolean`,description:`The format.unstructured field`}).option(`format-type`,{type:`string`,description:`The format.type field`,choices:[`json`,`parquet`]}).coerce(`format-type`,e=>f(e,`format-type`,`text`)).option(`format-compression`,{type:`string`,description:`The format.compression field`,choices:[`uncompressed`,`snappy`,`gzip`,`zstd`,`lz4`]}).coerce(`format-compression`,e=>f(e,`format-compression`,`text`)).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 se={command:`create`,describe:`Create Stream`,builder:oe,handler:async e=>c({command:`pipelines streams create`,classification:{safeFlags:[`format-decimal-encoding`,`format-timestamp-format`,`format-unstructured`,`format-type`,`format-compression`,`http-authentication`,`http-enabled`,`schema-inferred`,`worker-binding-enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf pipelines streams create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/pipelines/v1/streams`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({format:{decimal_encoding:e[`format-decimal-encoding`],timestamp_format:e[`format-timestamp-format`],unstructured:e[`format-unstructured`],type:e[`format-type`],compression:e[`format-compression`],row_group_bytes:e[`format-row-group-bytes`]},http:{authentication:e[`http-authentication`],cors:{origins:e[`http-cors-origins`]},enabled:e[`http-enabled`]},name:f(e.name,`name`,`text`),schema:{inferred:e[`schema-inferred`]},worker_binding:{enabled:e[`worker-binding-enabled`]}}):l(e.body)});return}let c=await n(e),u=e.local?t:await i();if(e.accountId=u,e.body){let t=l(e.body),n=await s(`Creating`,async()=>c.send(X,{body:t,account_id:u}));a(n,{successLabel:`Created`});return}e.name===void 0&&(e.name=await p(`name`,`Specifies the name of the Stream.`));let m=d({format:{decimal_encoding:e[`format-decimal-encoding`],timestamp_format:e[`format-timestamp-format`],unstructured:e[`format-unstructured`],type:e[`format-type`],compression:e[`format-compression`],row_group_bytes:e[`format-row-group-bytes`]},http:{authentication:e[`http-authentication`],cors:{origins:e[`http-cors-origins`]},enabled:e[`http-enabled`]},name:f(e.name,`name`,`text`),schema:{inferred:e[`schema-inferred`]},worker_binding:{enabled:e[`worker-binding-enabled`]}}),h=await s(`Creating`,async()=>c.send(X,{body:m,account_id:u}));a(h,{successLabel:`Created`})})};var ce={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/pipelines/v1/streams/${t.stream_id}`};function le(e){return e.usage(`$0 pipelines streams delete <stream-id>
|
|
34
|
+
|
|
35
|
+
Delete Stream in Account.`).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 ue={command:`delete <stream-id>`,describe:`Delete Stream`,builder:le,handler:async e=>c({command:`pipelines streams delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf pipelines streams delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/pipelines/v1/streams/${e[`stream-id`]==null?`<stream-id>`:encodeURIComponent(String(e[`stream-id`]))}`,pathParams:{"stream-id":String(e[`stream-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await h({force:!!e.force})){process.stderr.write(`Aborted.
|
|
36
|
+
`);return}let u=await s(`Deleting`,async()=>c.send(ce,{account_id:l,stream_id:e[`stream-id`]}));a(u,{successLabel:`Deleted`})})};var de={method:`GET`,path:t=>e`/accounts/${t.account_id}/pipelines/v1/streams/${t.stream_id}`};function fe(e){return e.usage(`$0 pipelines streams get <stream-id>
|
|
37
|
+
|
|
38
|
+
Get Stream Details.`).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 pe={command:`get <stream-id>`,describe:`Get Stream Details`,builder:fe,handler:async e=>c({command:`pipelines streams get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf pipelines streams get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/pipelines/v1/streams/${e[`stream-id`]==null?`<stream-id>`:encodeURIComponent(String(e[`stream-id`]))}`,pathParams:{"stream-id":String(e[`stream-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(de,{account_id:l,stream_id:e[`stream-id`]}));a(u,{successLabel:`Loaded`})})};var me={method:`GET`,path:t=>e`/accounts/${t.account_id}/pipelines/v1/streams`,query:[`pipeline_id`,`name`,`page`,`per_page`]};function he(e){return e.usage(`$0 pipelines streams list
|
|
39
|
+
|
|
40
|
+
List/Filter Streams in Account.`).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 Z={command:`list`,describe:`List Streams`,builder:he,handler:async e=>c({command:`pipelines streams list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={pipeline_id:e[`pipeline-id`],name:e.name,page:e.page,per_page:e[`per-page`]};if(e.dryRun){let e=await r();o({command:`cf pipelines streams list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/pipelines/v1/streams`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(me,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})};var Q={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/pipelines/v1/streams/${t.stream_id}`,body:`json`};function ge(e){return e.usage(`$0 pipelines streams update <stream-id>
|
|
41
|
+
|
|
42
|
+
Update a Stream.`).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 _e={command:`update <stream-id>`,describe:`Update Stream`,builder:ge,handler:async e=>c({command:`pipelines streams update`,classification:{safeFlags:[`http-authentication`,`http-enabled`,`worker-binding-enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf pipelines streams update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/pipelines/v1/streams/${e[`stream-id`]==null?`<stream-id>`:encodeURIComponent(String(e[`stream-id`]))}`,pathParams:{"stream-id":String(e[`stream-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({http:{authentication:e[`http-authentication`],cors:{origins:e[`http-cors-origins`]},enabled:e[`http-enabled`]},worker_binding:{enabled:e[`worker-binding-enabled`]}}):l(e.body)});return}let c=await n(e),u=e.local?t:await i();if(e.accountId=u,e.body){let t=l(e.body),n=await s(`Updating`,async()=>c.send(Q,{body:t,account_id:u,stream_id:e[`stream-id`]}));a(n,{successLabel:`Updated`});return}let f=d({http:{authentication:e[`http-authentication`],cors:{origins:e[`http-cors-origins`]},enabled:e[`http-enabled`]},worker_binding:{enabled:e[`worker-binding-enabled`]}}),p=await s(`Updating`,async()=>c.send(Q,{body:f,account_id:u,stream_id:e[`stream-id`]}));a(p,{successLabel:`Updated`})})},ve={command:`streams`,describe:`Inbound data streams that feed events into a pipeline for processing`,builder:e=>e.command(se).command(ue).command(pe).command(Z).command(_e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var $={method:`POST`,path:t=>e`/accounts/${t.account_id}/pipelines/v1/validate_sql`,body:`json`,errors:{422:`UnprocessableEntityError`}};function ye(e){return e.usage(`$0 pipelines validate-sql
|
|
43
|
+
|
|
44
|
+
Validates that the Pipelines SQL is correct.`).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 be={command:`validate-sql`,describe:`Validate SQL`,builder:ye,handler:async e=>c({command:`pipelines validate-sql`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf pipelines validate-sql`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/pipelines/v1/validate_sql`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({sql:f(e.sql,`sql`,`text`)}):l(e.body)});return}let c=await n(e),u=e.local?t:await i();if(e.accountId=u,e.body){let t=l(e.body),n=await s(`Creating`,async()=>c.send($,{body:t,account_id:u}));a(n,{successLabel:`Created`});return}e.sql===void 0&&(e.sql=await p(`sql`,`Specifies SQL to validate.`));let m=d({sql:f(e.sql,`sql`,`text`)}),h=await s(`Creating`,async()=>c.send($,{body:m,account_id:u}));a(h,{successLabel:`Created`})})},xe={command:`pipelines`,describe:`Ingest, transform, and route event streams into R2, analytics, or other destinations in real time`,builder:e=>e.command(v).command(ee).command(re).command(C).command(E).command(k).command(M).command(F).command(R).command(be).command(ae).command(ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{xe as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-C6u9qIGO.mjs";import{i as n}from"./context-A6T-NKPI.mjs";import{t as r}from"./output-Co4xdFf6.mjs";import{t as i}from"./dry-run-C2KjGX10.mjs";import{t as a}from"./progress-D5po7ScB.mjs";import{t as o}from"./run-DASYqJsY.mjs";import"./telemetry-BhKfwxyh.mjs";import{n as s,r as c,t as l}from"./body-parser-DkHKPkJ7.mjs";import{n as u}from"./input-validation-D7z60HJH.mjs";var d={method:`GET`,path:t=>e`/zones/${t.zone_id}/precursor`};function f(e){return e.usage("$0 precursor get\n\nRetrieve a zone's Precursor configuration: the zone-level `default_mode` and the ordered list of `enforcement_rules`.").option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`get`,describe:`Get Zone Precursor Config`,builder:f,handler:async e=>o({command:`precursor get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf precursor get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/precursor`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});e.zoneId=s;let c=await a(`Loading`,async()=>o.send(d,{zone_id:s}));r(c,{successLabel:`Loaded`})})};var m={method:`PUT`,path:t=>e`/zones/${t.zone_id}/precursor`,body:`json`};function h(e){return e.usage("$0 precursor update\n\nUpdates 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.").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`]}).coerce(`default-mode`,e=>u(e,`default-mode`,`text`)).option(`enforcement-rules`,{type:`string`,description:`The ordered list of enforcement rules for the zone. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`update`,describe:`Update Zone Precursor Config`,builder:h,handler:async e=>o({command:`precursor update`,classification:{safeFlags:[`default-mode`,`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf precursor update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/precursor`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({default_mode:e[`default-mode`],enforcement_rules:c(e[`enforcement-rules`],`enforcement-rules`)}):s(e.body)});return}let o=await t(e),u=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=u,e.body){let t=s(e.body),n=await a(`Updating`,async()=>o.send(m,{body:t,zone_id:u}));r(n,{successLabel:`Updated`});return}let d=l({default_mode:e[`default-mode`],enforcement_rules:c(e[`enforcement-rules`],`enforcement-rules`)}),f=await a(`Updating`,async()=>o.send(m,{body:d,zone_id:u}));r(f,{successLabel:`Updated`})})},_={command:`precursor`,describe:`Precursor settings for a zone`,builder:e=>e.command(p).command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{_ as default};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{r as e}from"./dotenv-usOKkeW7.mjs";import{J as t,K as n,rt as r}from"./dist-DZRTPMMA.mjs";import{t as i}from"./hand-written-dry-run-B82fRl2N.mjs";import{t as a}from"./local-Dil4fTWX.mjs";import{i as o,n as s}from"./auth-C6u9qIGO.mjs";import{l as c,p as l}from"./interactive-BW9T1D1q.mjs";import{a as u,t as d}from"./context-A6T-NKPI.mjs";import{C as f,_ as p,d as m,f as h,l as g,r as _,t as v,x as y,y as b}from"./deploy-context-tEhwEXnA.mjs";import{t as x}from"./auth-token-DkkYg4DP.mjs";import{t as S}from"./output-Co4xdFf6.mjs";import{t as C}from"./dry-run-C2KjGX10.mjs";import{t as w}from"./progress-D5po7ScB.mjs";import{n as T,t as E}from"./run-DASYqJsY.mjs";import"./telemetry-BhKfwxyh.mjs";import{n as D}from"./prompt-BAJpE3jV.mjs";import{a as O,l as k,n as A,o as j,r as M,t as N}from"./containers-Di3_Vopq.mjs";import{a as P,i as F,n as I,o as L,r as R,s as z}from"./build-sBpqm9ga.mjs";import{t as B}from"./deploy-input-BqJ7GVZ-.mjs";import{readBuildOutput as V}from"@cloudflare/build-output-utils";function H(e){return e.usage(`$0 previews delete <name>
|
|
3
|
+
|
|
4
|
+
Delete a Preview.`).positional(`name`,{type:`string`,description:`Identifier for the Preview, which can be ID, slug, or URL-encoded name.`,demandOption:!0}).option(`worker`,{type:`string`,description:`Identifier for the Worker, which can be ID or name.`,demandOption:!0}).option(`delete-with-references`,{type:`boolean`,description:`If true, delete the Preview even when other Workers still reference it. Service bindings in those Workers may be left broken. Durable Object namespaces implemented by the deleted Preview are deleted even if other Workers reference them.`}).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 <name>`,describe:`Delete Preview`,builder:H,handler:async e=>E({command:`previews delete`,classification:{safeFlags:[`delete-with-references`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let t={force:e[`delete-with-references`]};if(e.dryRun){let n=await u();C({command:`cf previews delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/workers/workers/${e.worker==null?`<worker>`:encodeURIComponent(String(e.worker))}/previews/${e.name==null?`<name>`:encodeURIComponent(String(e.name))}`,pathParams:{worker:String(e.worker??``),name:String(e.name??``)},query:t,bodyKind:`none`});return}let n=await s(e),r=e.local?a:await d();if(e.accountId=r,!await D({force:!!e.force,message:`This operation permanently deletes the Preview.`})){process.stderr.write(`Aborted.
|
|
5
|
+
`);return}let i=await w(`Deleting`,async()=>o(n,`DELETE`,`/accounts/${r}/workers/workers/${encodeURIComponent(String(e.worker))}/previews/${encodeURIComponent(String(e.name))}`,{query:t}));S(i,{successLabel:`Deleted`})})};function W(e){return{getNormalizedContainerOptions:async t=>e.standard.normalized.map(e=>({...e,name:t.containers?.find(({class_name:t})=>t===e.class_name)?.name??e.name})),deployPreviewContainers:async(t,n,i,a,o)=>G(o.quiet,async()=>{let s=/* @__PURE__ */ new Map;for(let e of Object.values(i.env??{}))e.type===`durable_object_namespace`&&e.class_name&&e.namespace_id&&e.script_name===void 0&&s.set(e.class_name,e.namespace_id);let c;for(let r of n){let n=s.get(r.class_name);if(n||=(c??=await b(t,a),c.find(e=>e.class===r.class_name&&e.preview?.id===i.preview_id)?.id),!n)throw Error(`Could not find a Preview Durable Object namespace for Container class "${r.class_name}".`);let l=await K(r,e,i.id,a,t,o.localImageReferences?.get(r.class_name));await g({imageRef:l,durable_object_namespace_id:n},r,t,a)}await m(e.standard.builtImages.filter(({container:e})=>!o.localImageReferences?.has(e.class_name)),r())})}}async function G(e,t){if(!e)return t();let n=c();l(`error`);try{return await t()}finally{l(n)}}async function K(e,t,n,i,a,o){if(o!==void 0)return f({pathToDocker:r(),sourceTag:o,targetTag:o,accountId:i,complianceConfig:a,containerConfig:`dockerfile`in e?e:void 0,cleanupSourceTag:!1});let s=t.standard.builtImages.find(({container:t})=>t.class_name===e.class_name);if(s)return y(s,n,r(),i,a);if(`image_uri`in e)return{newTag:e.image_uri};throw Error(`Container "${e.name}" has no Build Output image to deploy.`)}function q(e){return e.positional(`preview-name`,{type:`string`,description:`Preview name. Defaults to the current CI or Git branch; required if no branch is available.`}).option(`prebuilt`,{type:`boolean`,description:`Use existing Preview Build Output Specification files without building`,default:!1}).option(`worker`,R)}function J(e){return{type:`preview`,version:1,preview_id:e.preview.id,preview_name:e.preview.name,preview_slug:e.preview.slug,preview_urls:e.preview.urls,deployment_id:e.deployment.id,deployment_urls:e.deployment.urls}}async function Y(t){let n=t[`preview-name`],r=n??O();if(!r||!n&&r===`HEAD`)throw Error(`We couldn't determine a Preview name from CI or Git. The name is optional when a branch is available. Otherwise, run:
|
|
6
|
+
|
|
7
|
+
cf previews deploy PREVIEW_NAME`);return t.prebuilt||await I(t.mode,{output:t.quiet?`silent`:`stderr`,worker:t.worker},{isPreview:!0}),e(t,()=>X(t,r))}async function X(e,r){let i=await V(process.cwd());M(i.rootConfig),L(e.mode,i.rootConfig.buildContext.mode);let a=P(i.workers,e.worker),{wranglerConfig:o,builtConfig:s}=F(a,i.rootConfig),c=await x(),l=i.rootConfig.accountId??await d({isPreview:!0,skipProjectSettings:!0,complianceRegion:t(o)}),u=v(c);k({...u,logger:{...u.logger,log:()=>{},info:()=>{}}}),p({logger:{...u.logger,debug:()=>{},debugWithSanitization:()=>{},log:()=>{},info:()=>{}},fetchResult:u.fetchResult,fetchPagedListResult:u.fetchPagedListResult});let f=new Set(Object.values(s.exports??{}).filter(A).map(({container:e})=>e)),m=i.containers?.filter(({config:e})=>f.has(e.name))??[],g=N(m,o,{accountId:l}),y=g.source;if(y?.some(e=>e.scheduling_policy===`durable_object`))throw new z(`Preview deployments do not support Durable Object-managed Containers (schedulingPolicy: "durable-object").`);return y&&y.length>0&&h(l,c,n(o)),j(l,{name:r,json:!0},{workerConfig:s,rootConfig:i.rootConfig,containers:m.filter(({config:e})=>y?.some(({name:t})=>t===e.name)).map(({config:e})=>e),buildResult:a.bundleDir?B(a,s):void 0,assets:a.assetsDir?{directory:a.assetsDir}:void 0},{...W(g),verifyContainersScope:async()=>{await _.listApplications()}})}var Z=T({command:`deploy [preview-name]`,describe:`Deploy a Worker Preview`,builder:q,handler:async e=>{if(e.local)throw Error(`--local is not supported by cf previews deploy.`);let t=await Y(e);S(J(t),{quiet:e.quiet})}},{command:`previews deploy`,classification:{safeFlags:[`prebuilt`]}});const Q={command:`previews`,describe:`Manage Worker Previews`,builder:e=>e.command(U).command(i(Z,`preview`)).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Q as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./theme-BGHWSKCw.mjs";import{r as t,t as n}from"./session-Cq3YNLoI.mjs";import{n as r}from"./version-B6MnUIqV.mjs";import{a as i}from"./dist-uRuGmkMB.mjs";const a={Hidden:0,Normal:1,Error:2,Indeterminate:3,Warning:4},o=new class{cleanupRegistered=!1;get isDisabled(){return process.env.CF_NO_OSC_PROGRESS===`1`||process.env.CF_QUIET===`1`||t()}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(a.Indeterminate))}clear(){this.isSupported&&process.stderr.write(`\x1b]9;4;${a.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`)}},s=[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`];function c(){return!(!e()||!process.stdout.isTTY||process.env.CF_QUIET===`1`)}async function l(e,t){if(!c())return t();n(r);let a=i({frames:[...s],indicator:`timer`,delay:80});o.setIndeterminate(),a.start(e);try{let n=await t();return o.clear(),a.stop(e),n}catch(t){throw o.clear(),a.error(e),t}}export{l as t};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{r as e}from"./theme-BGHWSKCw.mjs";import{t}from"./session-Cq3YNLoI.mjs";import{t as n}from"./cli-exit-CstFZ1eJ.mjs";import{n as r}from"./version-B6MnUIqV.mjs";import{i,o as a,r as o,s,t as c}from"./dist-uRuGmkMB.mjs";import{n as l}from"./interactive-BW9T1D1q.mjs";function u(e){return e.replace(/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/gu,` `)}function d(){t(r)}async function f(){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 p(e,t,r){let i=r?.kind??`text`;if(l()){if(i===`secret`){let t=await f();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 c=`Enter value for --${e}`,u=t||r?.question||c,p=e=>e&&e.length>0?r?.validate?.(e):`Value cannot be empty`;d();let m=i===`secret`?await o({message:u,mask:`•`,validate:p}):await a({message:u,validate:p});if(s(m)||typeof m!=`string`)throw new n(130,{cancelled:!0});return m}async function m(e,t,r,a={}){let o=u(e),c=r.map(u);if(l())throw Error(`--${o} is required (one of: ${c.join(`, `)}). Pass --${o} <value> or run interactively.`);let f=`Select value for --${o}`,p=u(t||f);d();let m=await i({message:p,options:r.map(e=>({value:e,label:u((Object.hasOwn(a,e)?a[e]:void 0)??e)}))});if(s(m)||typeof m!=`string`)throw new n(130,{cancelled:!0});return m}async function h(e,t){if(l())throw Error(`--${e} is required and must be true. Pass --${e} or run interactively.`);d();let r=await c({message:t||`Confirm --${e}`,initialValue:!1});if(s(r))throw new n(130,{cancelled:!0});return r===!0}async function g(e,{defaultValue:t=!0,fallbackValue:r=!0}={}){if(l())return process.stderr.write(`? ${e}\n Using fallback value in non-interactive context: ${r?`yes`:`no`}\n`),r;d();let i=await c({message:e,initialValue:t});if(s(i))throw new n(130,{cancelled:!0});return i===!0}async function _(t={}){if(t.force===!0)return!0;let r=t.message?`${t.message} Continue?`:`This permanently deletes the resource. Continue?`;if(l())throw process.stderr.write(`${e.warning(`?`)} ${r}\n ${e.muted(`(non-interactive; pass --force to confirm)`)}\nAborted.
|
|
4
|
+
`),new n(1);d();let i=await c({message:r,initialValue:!1});if(s(i))throw new n(130,{cancelled:!0});return i===!0}export{p as a,m as i,_ as n,u as o,h as r,g as t};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-Dil4fTWX.mjs";import{n}from"./auth-C6u9qIGO.mjs";import{a as r,t as i}from"./context-A6T-NKPI.mjs";import{t as a}from"./output-Co4xdFf6.mjs";import{t as o}from"./dry-run-C2KjGX10.mjs";import{t as s}from"./progress-D5po7ScB.mjs";import{t as c}from"./run-DASYqJsY.mjs";import"./telemetry-BhKfwxyh.mjs";import{n as l,r as u,t as d}from"./body-parser-DkHKPkJ7.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{n as p}from"./prompt-BAJpE3jV.mjs";var m={method:`POST`,path:t=>e`/accounts/${t.account_id}/brand-protection/queries/bulk`,body:`json`,response:!1,errors:{422:`UnprocessableEntityError`}};function h(e){return e.usage(`$0 queries bulk create
|
|
3
|
+
|
|
4
|
+
Return a success message after creating new saved string queries in bulk`).option(`queries`,{type:`string`,description:`The queries field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`create`,describe:`Create new saved string queries in bulk`,builder:h,handler:async e=>c({command:`queries bulk create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf queries bulk create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/brand-protection/queries/bulk`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({queries:u(e.queries,`queries`)}):l(e.body)});return}let c=await n(e),f=e.local?t:await i();if(e.accountId=f,e.body){let t=l(e.body),n=await s(`Creating`,async()=>c.send(m,{body:t,account_id:f}));a(n,{successLabel:`Created`});return}let p=d({queries:u(e.queries,`queries`)}),h=await s(`Creating`,async()=>c.send(m,{body:p,account_id:f}));a(h,{successLabel:`Created`})})},_={command:`bulk`,describe:`Operations for bulk`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var v={method:`POST`,path:t=>e`/accounts/${t.account_id}/brand-protection/queries`,query:[`id`],body:`json`,response:!1,errors:{422:`UnprocessableEntityError`}};function y(e){return e.usage(`$0 queries create
|
|
5
|
+
|
|
6
|
+
Return a success message after creating new saved string queries`).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 b={command:`create`,describe:`Create new saved string queries`,builder:y,handler:async e=>c({command:`queries create`,classification:{safeFlags:[`scan`,`dry-run`]}},e,async()=>{let c={id:e.id};if(e.dryRun){let t=await r();o({command:`cf queries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/brand-protection/queries`,pathParams:{},query:c,bodyKind:`json`,body:e.body===void 0?d({max_time:f(e[`max-time`],`max-time`,`text`),min_time:f(e[`min-time`],`min-time`,`text`),scan:e.scan,tag:f(e.tag,`tag`,`text`)}):l(e.body)});return}let u=await n(e),p=e.local?t:await i();if(e.accountId=p,e.body){let t=l(e.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let n=await s(`Creating`,async()=>u.send(v,{body:t,account_id:p,...c}));a(n,{successLabel:`Created`});return}let m=d({max_time:f(e[`max-time`],`max-time`,`text`),min_time:f(e[`min-time`],`min-time`,`text`),scan:e.scan,tag:f(e.tag,`tag`,`text`)});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let h=await s(`Creating`,async()=>u.send(v,{body:m,account_id:p,...c}));a(h,{successLabel:`Created`})})};var x={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/brand-protection/queries`,query:[`id`,`tag`,`scan`],response:!1,errors:{422:`UnprocessableEntityError`}};function S(e){return e.usage(`$0 queries delete
|
|
7
|
+
|
|
8
|
+
Return a success message after deleting saved string queries by ID`).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 C={command:`delete`,describe:`Delete saved string queries by ID`,builder:S,handler:async e=>c({command:`queries delete`,classification:{safeFlags:[`scan`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let c={id:e.id,tag:e.tag,scan:e.scan};if(e.dryRun){let e=await r();o({command:`cf queries delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/brand-protection/queries`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();if(e.accountId=u,!await p({force:!!e.force})){process.stderr.write(`Aborted.
|
|
9
|
+
`);return}let d=await s(`Deleting`,async()=>l.send(x,{account_id:u,...c}));a(d,{successLabel:`Deleted`})})},w={command:`queries`,describe:`queries`,builder:e=>e.command(b).command(C).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-Dil4fTWX.mjs";import{n}from"./auth-C6u9qIGO.mjs";import{a as r,t as i}from"./context-A6T-NKPI.mjs";import{t as a}from"./output-Co4xdFf6.mjs";import{t as o}from"./dry-run-C2KjGX10.mjs";import{t as s}from"./progress-D5po7ScB.mjs";import{t as c}from"./run-DASYqJsY.mjs";import"./telemetry-BhKfwxyh.mjs";import{n as l,r as u,t as d}from"./body-parser-DkHKPkJ7.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{a as p,i as m,n as h}from"./prompt-BAJpE3jV.mjs";var g={method:`POST`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/consumers`,body:`json`};function _(e){return e.usage(`$0 queues consumers create <queue-id>
|
|
3
|
+
|
|
4
|
+
Creates a consumer for a Queue.`).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`]}).coerce(`type`,e=>f(e,`type`,`text`)).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:`Create a Queue Consumer`,builder:_,handler:async e=>c({command:`queues consumers create`,classification:{safeFlags:[`type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf queues consumers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/consumers`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({dead_letter_queue:f(e[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:f(e[`script-name`],`script-name`,`text`),settings:{batch_size:e[`settings-batch-size`],max_concurrency:e[`settings-max-concurrency`],max_retries:e[`settings-max-retries`],max_wait_time_ms:e[`settings-max-wait-time-ms`],retry_delay:e[`settings-retry-delay`],visibility_timeout_ms:e[`settings-visibility-timeout-ms`]},type:e.type}):l(e.body)});return}let c=await n(e),u=e.local?t:await i();if(e.accountId=u,e.body){let t=l(e.body),n=await s(`Creating`,async()=>c.send(g,{body:t,account_id:u,queue_id:e[`queue-id`]}));a(n,{successLabel:`Created`});return}e.type===void 0&&(e.type=await m(`type`,`The type field`,[`worker`,`http_pull`])),e.type===`worker`&&e[`script-name`]===void 0&&(e[`script-name`]=await p(`script-name`,`Name of a Worker`,{question:`Enter value for --script-name`}));let h=d({dead_letter_queue:f(e[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:f(e[`script-name`],`script-name`,`text`),settings:{batch_size:e[`settings-batch-size`],max_concurrency:e[`settings-max-concurrency`],max_retries:e[`settings-max-retries`],max_wait_time_ms:e[`settings-max-wait-time-ms`],retry_delay:e[`settings-retry-delay`],visibility_timeout_ms:e[`settings-visibility-timeout-ms`]},type:e.type}),_=await s(`Creating`,async()=>c.send(g,{body:h,account_id:u,queue_id:e[`queue-id`]}));a(_,{successLabel:`Created`})})};var te={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/consumers/${t.consumer_id}`};function v(e){return e.usage(`$0 queues consumers delete <consumer-id>
|
|
5
|
+
|
|
6
|
+
Deletes a consumer from a Queue.`).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 y={command:`delete <consumer-id>`,describe:`Delete Queue Consumer`,builder:v,handler:async e=>c({command:`queues consumers delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf queues consumers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/consumers/${e[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(e[`consumer-id`]))}`,pathParams:{"consumer-id":String(e[`consumer-id`]??``),"queue-id":String(e[`queue-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await h({force:!!e.force})){process.stderr.write(`Aborted.
|
|
7
|
+
`);return}let u=await s(`Deleting`,async()=>c.send(te,{account_id:l,queue_id:e[`queue-id`],consumer_id:e[`consumer-id`]}));a(u,{successLabel:`Deleted`})})};var b={method:`GET`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/consumers/${t.consumer_id}`};function x(e){return e.usage(`$0 queues consumers get <consumer-id>
|
|
8
|
+
|
|
9
|
+
Returns a Queue consumer by identifier.`).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 ne={command:`get <consumer-id>`,describe:`Get Queue Consumer`,builder:x,handler:async e=>c({command:`queues consumers get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf queues consumers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/consumers/${e[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(e[`consumer-id`]))}`,pathParams:{"consumer-id":String(e[`consumer-id`]??``),"queue-id":String(e[`queue-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(b,{account_id:l,queue_id:e[`queue-id`],consumer_id:e[`consumer-id`]}));a(u,{successLabel:`Loaded`})})};var re={method:`GET`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/consumers`};function ie(e){return e.usage(`$0 queues consumers list
|
|
10
|
+
|
|
11
|
+
Returns the consumers configured for a Queue.`).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 ae={command:`list`,describe:`List Queue Consumers`,builder:ie,handler:async e=>c({command:`queues consumers list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf queues consumers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/consumers`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(re,{account_id:l,queue_id:e[`queue-id`]}));a(u,{successLabel:`Loaded`})})};var S={method:`PUT`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/consumers/${t.consumer_id}`,body:`json`};function oe(e){return e.usage(`$0 queues consumers update <consumer-id>
|
|
12
|
+
|
|
13
|
+
Replaces a Queue consumer, or creates it if it does not exist.`).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`]}).coerce(`type`,e=>f(e,`type`,`text`)).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 se={command:`update <consumer-id>`,describe:`Update Queue Consumer`,builder:oe,handler:async e=>c({command:`queues consumers update`,classification:{safeFlags:[`type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf queues consumers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/consumers/${e[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(e[`consumer-id`]))}`,pathParams:{"consumer-id":String(e[`consumer-id`]??``),"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({dead_letter_queue:f(e[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:f(e[`script-name`],`script-name`,`text`),settings:{batch_size:e[`settings-batch-size`],max_concurrency:e[`settings-max-concurrency`],max_retries:e[`settings-max-retries`],max_wait_time_ms:e[`settings-max-wait-time-ms`],retry_delay:e[`settings-retry-delay`],visibility_timeout_ms:e[`settings-visibility-timeout-ms`]},type:e.type}):l(e.body)});return}let c=await n(e),u=e.local?t:await i();if(e.accountId=u,e.body){let t=l(e.body),n=await s(`Updating`,async()=>c.send(S,{body:t,account_id:u,queue_id:e[`queue-id`],consumer_id:e[`consumer-id`]}));a(n,{successLabel:`Updated`});return}e.type===void 0&&(e.type=await m(`type`,`The type field`,[`worker`,`http_pull`])),e.type===`worker`&&e[`script-name`]===void 0&&(e[`script-name`]=await p(`script-name`,`Name of a Worker`,{question:`Enter value for --script-name`}));let h=d({dead_letter_queue:f(e[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:f(e[`script-name`],`script-name`,`text`),settings:{batch_size:e[`settings-batch-size`],max_concurrency:e[`settings-max-concurrency`],max_retries:e[`settings-max-retries`],max_wait_time_ms:e[`settings-max-wait-time-ms`],retry_delay:e[`settings-retry-delay`],visibility_timeout_ms:e[`settings-visibility-timeout-ms`]},type:e.type}),g=await s(`Updating`,async()=>c.send(S,{body:h,account_id:u,queue_id:e[`queue-id`],consumer_id:e[`consumer-id`]}));a(g,{successLabel:`Updated`})})},ce={command:`consumers`,describe:`Workers that automatically receive and process messages from a queue`,builder:e=>e.command(ee).command(y).command(ne).command(ae).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var C={method:`POST`,path:t=>e`/accounts/${t.account_id}/queues`,body:`json`};function w(e){return e.usage(`$0 queues create
|
|
14
|
+
|
|
15
|
+
Creates a Queue in the account.`).option(`jurisdiction`,{type:`string`,description:`The jurisdiction field`,choices:[`eu`,`us`,`fedramp`]}).coerce(`jurisdiction`,e=>f(e,`jurisdiction`,`text`)).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 T={command:`create`,describe:`Create Queue`,builder:w,handler:async e=>c({command:`queues create`,classification:{safeFlags:[`jurisdiction`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf queues create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({jurisdiction:e.jurisdiction,queue_name:f(e[`queue-name`],`queue-name`,`text`)}):l(e.body)});return}let c=await n(e),u=e.local?t:await i();if(e.accountId=u,e.body){let t=l(e.body),n=await s(`Creating`,async()=>c.send(C,{body:t,account_id:u}));a(n,{successLabel:`Created`});return}e[`queue-name`]===void 0&&(e[`queue-name`]=await p(`queue-name`,`The queue_name field`));let m=d({jurisdiction:e.jurisdiction,queue_name:f(e[`queue-name`],`queue-name`,`text`)}),h=await s(`Creating`,async()=>c.send(C,{body:m,account_id:u}));a(h,{successLabel:`Created`})})};var E={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}`};function D(e){return e.usage(`$0 queues delete <queue-id>
|
|
16
|
+
|
|
17
|
+
Deletes a Queue.`).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:`Delete Queue`,builder:D,handler:async e=>c({command:`queues delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf queues delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await h({force:!!e.force})){process.stderr.write(`Aborted.
|
|
18
|
+
`);return}let u=await s(`Deleting`,async()=>c.send(E,{account_id:l,queue_id:e[`queue-id`]}));a(u,{successLabel:`Deleted`})})};var k={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}`,body:`json`};function A(e){return e.usage(`$0 queues edit <queue-id>
|
|
19
|
+
|
|
20
|
+
Updates part of a Queue's configuration.`).positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`jurisdiction`,{type:`string`,description:`The jurisdiction field`,choices:[`eu`,`us`,`fedramp`]}).coerce(`jurisdiction`,e=>f(e,`jurisdiction`,`text`)).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 j={command:`edit <queue-id>`,describe:`Update Queue`,builder:A,handler:async e=>c({command:`queues edit`,classification:{safeFlags:[`jurisdiction`,`settings-delivery-paused`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf queues edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({jurisdiction:e.jurisdiction,queue_name:f(e[`queue-name`],`queue-name`,`text`),settings:{delivery_delay:e[`settings-delivery-delay`],delivery_paused:e[`settings-delivery-paused`],message_retention_period:e[`settings-message-retention-period`]}}):l(e.body)});return}let c=await n(e),u=e.local?t:await i();if(e.accountId=u,e.body){let t=l(e.body),n=await s(`Updating`,async()=>c.send(k,{body:t,account_id:u,queue_id:e[`queue-id`]}));a(n,{successLabel:`Updated`});return}let p=d({jurisdiction:e.jurisdiction,queue_name:f(e[`queue-name`],`queue-name`,`text`),settings:{delivery_delay:e[`settings-delivery-delay`],delivery_paused:e[`settings-delivery-paused`],message_retention_period:e[`settings-message-retention-period`]}}),m=await s(`Updating`,async()=>c.send(k,{body:p,account_id:u,queue_id:e[`queue-id`]}));a(m,{successLabel:`Updated`})})};var M={method:`GET`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}`};function N(e){return e.usage(`$0 queues get <queue-id>
|
|
21
|
+
|
|
22
|
+
Returns details about a specific Queue.`).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 P={command:`get <queue-id>`,describe:`Get Queue`,builder:N,handler:async e=>c({command:`queues get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf queues get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(M,{account_id:l,queue_id:e[`queue-id`]}));a(u,{successLabel:`Loaded`})})};var F={method:`GET`,path:t=>e`/accounts/${t.account_id}/queues`};function I(e){return e.usage(`$0 queues list
|
|
23
|
+
|
|
24
|
+
Returns the queues owned by an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`list`,describe:`List Queues`,builder:I,handler:async e=>c({command:`queues list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await r();o({command:`cf queues list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/queues`,pathParams:{},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(F,{account_id:l}));a(u,{successLabel:`Loaded`})})};var R={method:`POST`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/messages/ack`,body:`json`};function z(e){return e.usage(`$0 queues messages ack <queue-id>
|
|
25
|
+
|
|
26
|
+
Acknowledges successfully processed Queue messages and retries messages that were not processed successfully.`).positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`acks`,{type:`string`,description:`The acks field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`retries`,{type:`string`,description:`The retries field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`ack <queue-id>`,describe:`Acknowledge + Retry Queue Messages`,builder:z,handler:async e=>c({command:`queues messages ack`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf queues messages ack`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/messages/ack`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({acks:u(e.acks,`acks`),retries:u(e.retries,`retries`)}):l(e.body)});return}let c=await n(e),f=e.local?t:await i();if(e.accountId=f,e.body){let t=l(e.body),n=await s(`Creating`,async()=>c.send(R,{body:t,account_id:f,queue_id:e[`queue-id`]}));a(n,{successLabel:`Created`});return}let p=d({acks:u(e.acks,`acks`),retries:u(e.retries,`retries`)}),m=await s(`Creating`,async()=>c.send(R,{body:p,account_id:f,queue_id:e[`queue-id`]}));a(m,{successLabel:`Created`})})};var V={method:`POST`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/messages/batch`,body:`json`};function H(e){return e.usage(`$0 queues messages bulk-push
|
|
27
|
+
|
|
28
|
+
Pushes a batch of messages to a Queue.`).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(`messages`,{type:`string`,description:`The messages field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const U={command:`bulk-push`,describe:`Push Message Batch`,builder:H,handler:async e=>c({command:`queues messages bulk-push`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf queues messages bulk-push`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/messages/batch`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({delay_seconds:e[`delay-seconds`],messages:u(e.messages,`messages`)}):l(e.body)});return}let c=await n(e),f=e.local?t:await i();if(e.accountId=f,e.body){let t=l(e.body),n=await s(`Creating`,async()=>c.send(V,{body:t,account_id:f,queue_id:e[`queue-id`]}));a(n,{successLabel:`Created`});return}let p=d({delay_seconds:e[`delay-seconds`],messages:u(e.messages,`messages`)}),m=await s(`Creating`,async()=>c.send(V,{body:p,account_id:f,queue_id:e[`queue-id`]}));a(m,{successLabel:`Created`})})};var W={method:`POST`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/messages/extend`,body:`json`};function G(e){return e.usage(`$0 queues messages extend-leases <queue-id>
|
|
29
|
+
|
|
30
|
+
Extends message leases without incrementing the messages' \`attempts\` counters. Each message receives a new lease identifier.`).positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`extend`,{type:`string`,description:`The extend field. Provide as a JSON array of objects or @path/to/file.json.`}).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 le={command:`extend-leases <queue-id>`,describe:`Extend Message Leases`,builder:G,handler:async e=>c({command:`queues messages extend-leases`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf queues messages extend-leases`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/messages/extend`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({extend:u(e.extend,`extend`),visibility_timeout_ms:e[`visibility-timeout-ms`]}):l(e.body)});return}let c=await n(e),f=e.local?t:await i();if(e.accountId=f,e.body){let t=l(e.body),n=await s(`Creating`,async()=>c.send(W,{body:t,account_id:f,queue_id:e[`queue-id`]}));a(n,{successLabel:`Created`});return}let p=d({extend:u(e.extend,`extend`),visibility_timeout_ms:e[`visibility-timeout-ms`]}),m=await s(`Creating`,async()=>c.send(W,{body:p,account_id:f,queue_id:e[`queue-id`]}));a(m,{successLabel:`Created`})})};var K={method:`POST`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/messages/peek`,body:`json`};function ue(e){return e.usage(`$0 queues messages peek <queue-id>
|
|
31
|
+
|
|
32
|
+
Peek messages from a Queue without leasing them. Each message includes a ref that can be passed to the purge endpoint, and remains available for subsequent peek or pull operations until it is purged.`).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 de={command:`peek <queue-id>`,describe:`Peek Queue Messages`,builder:ue,handler:async e=>c({command:`queues messages peek`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf queues messages peek`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/messages/peek`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({batch_size:e[`batch-size`]}):l(e.body)});return}let c=await n(e),u=e.local?t:await i();if(e.accountId=u,e.body){let t=l(e.body),n=await s(`Creating`,async()=>c.send(K,{body:t,account_id:u,queue_id:e[`queue-id`]}));a(n,{successLabel:`Created`});return}let f=d({batch_size:e[`batch-size`]}),p=await s(`Creating`,async()=>c.send(K,{body:f,account_id:u,queue_id:e[`queue-id`]}));a(p,{successLabel:`Created`})})};var q={method:`POST`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/messages/pull`,body:`json`};function fe(e){return e.usage(`$0 queues messages pull <queue-id>
|
|
33
|
+
|
|
34
|
+
Pulls a batch of messages from a Queue for an HTTP pull consumer.`).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 pe={command:`pull <queue-id>`,describe:`Pull Queue Messages`,builder:fe,handler:async e=>c({command:`queues messages pull`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf queues messages pull`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/messages/pull`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({batch_size:e[`batch-size`],visibility_timeout_ms:e[`visibility-timeout-ms`]}):l(e.body)});return}let c=await n(e),u=e.local?t:await i();if(e.accountId=u,e.body){let t=l(e.body),n=await s(`Creating`,async()=>c.send(q,{body:t,account_id:u,queue_id:e[`queue-id`]}));a(n,{successLabel:`Created`});return}let f=d({batch_size:e[`batch-size`],visibility_timeout_ms:e[`visibility-timeout-ms`]}),p=await s(`Creating`,async()=>c.send(q,{body:f,account_id:u,queue_id:e[`queue-id`]}));a(p,{successLabel:`Created`})})};var J={method:`POST`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/messages/purge`,body:`json`};function me(e){return e.usage(`$0 queues messages purge <queue-id>
|
|
35
|
+
|
|
36
|
+
Delete messages from a Queue by using refs returned by the peek endpoint. Purging messages does not count as delivery and does not affect metrics.`).positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`refs`,{type:`string`,description:`The refs field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const he={command:`purge <queue-id>`,describe:`Purge Peeked Queue Messages`,builder:me,handler:async e=>c({command:`queues messages purge`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf queues messages purge`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/messages/purge`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({refs:u(e.refs,`refs`)}):l(e.body)});return}let c=await n(e),f=e.local?t:await i();if(e.accountId=f,!await h({force:!!e.force,message:`This operation permanently deletes the selected messages from the Queue.`})){process.stderr.write(`Aborted.
|
|
37
|
+
`);return}if(e.body){let t=l(e.body),n=await s(`Deleting`,async()=>c.send(J,{body:t,account_id:f,queue_id:e[`queue-id`]}));a(n,{successLabel:`Deleted`});return}if(e.refs===void 0)throw Error(`--refs is required (or pass --body with this field set).`);let p=d({refs:u(e.refs,`refs`)}),m=await s(`Deleting`,async()=>c.send(J,{body:p,account_id:f,queue_id:e[`queue-id`]}));a(m,{successLabel:`Deleted`})})};var Y={method:`POST`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/messages`,body:`json`};function ge(e){return e.usage(`$0 queues messages push <queue-id>
|
|
38
|
+
|
|
39
|
+
Pushes a message to a Queue.`).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 _e={command:`push <queue-id>`,describe:`Push Message`,builder:ge,handler:async e=>c({command:`queues messages push`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf queues messages push`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/messages`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({delay_seconds:e[`delay-seconds`]}):l(e.body)});return}let c=await n(e),u=e.local?t:await i();if(e.accountId=u,e.body){let t=l(e.body),n=await s(`Creating`,async()=>c.send(Y,{body:t,account_id:u,queue_id:e[`queue-id`]}));a(n,{successLabel:`Created`});return}let f=d({delay_seconds:e[`delay-seconds`]}),p=await s(`Creating`,async()=>c.send(Y,{body:f,account_id:u,queue_id:e[`queue-id`]}));a(p,{successLabel:`Created`})})},ve={command:`messages`,describe:`Push messages to a queue and pull or acknowledge them from consumers`,builder:e=>e.command(B).command(U).command(le).command(de).command(pe).command(he).command(_e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var ye={method:`GET`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/metrics`};function be(e){return e.usage(`$0 queues metrics get <queue-id>
|
|
40
|
+
|
|
41
|
+
Returns best-effort metrics for a Queue. Values may be approximate due to the distributed nature of Queues.`).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 xe={command:`get <queue-id>`,describe:`Get Queue Metrics`,builder:be,handler:async e=>c({command:`queues metrics get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf queues metrics get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/metrics`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(ye,{account_id:l,queue_id:e[`queue-id`]}));a(u,{successLabel:`Loaded`})})},Se={command:`metrics`,describe:`Operations for metrics`,builder:e=>e.command(xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var X={method:`POST`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/purge`,body:`json`};function Ce(e){return e.usage(`$0 queues purge start <queue-id>
|
|
42
|
+
|
|
43
|
+
Starts a purge that deletes all messages from a Queue.`).positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`delete-messages-permanently`,{type:`boolean`,description:`Confirms that all messages will be permanently deleted.`}).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 we={command:`start <queue-id>`,describe:`Purge Queue`,builder:Ce,handler:async e=>c({command:`queues purge start`,classification:{safeFlags:[`delete-messages-permanently`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf queues purge start`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/purge`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({delete_messages_permanently:e[`delete-messages-permanently`]}):l(e.body)});return}let c=await n(e),u=e.local?t:await i();if(e.accountId=u,!await h({force:!!e.force,message:`This operation drops every message in the queue.`})){process.stderr.write(`Aborted.
|
|
44
|
+
`);return}if(e.body){let t=l(e.body),n=await s(`Deleting`,async()=>c.send(X,{body:t,account_id:u,queue_id:e[`queue-id`]}));a(n,{successLabel:`Deleted`});return}let f=d({delete_messages_permanently:e[`delete-messages-permanently`]}),p=await s(`Deleting`,async()=>c.send(X,{body:f,account_id:u,queue_id:e[`queue-id`]}));a(p,{successLabel:`Deleted`})})};var Te={method:`GET`,path:t=>e`/accounts/${t.account_id}/queues/${t.queue_id}/purge`};function Ee(e){return e.usage(`$0 queues purge status <queue-id>
|
|
45
|
+
|
|
46
|
+
Returns the status of a Queue purge operation.`).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 De={command:`status <queue-id>`,describe:`Get Queue Purge Status`,builder:Ee,handler:async e=>c({command:`queues purge status`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf queues purge status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/queues/${e[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(e[`queue-id`]))}/purge`,pathParams:{"queue-id":String(e[`queue-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(Te,{account_id:l,queue_id:e[`queue-id`]}));a(u,{successLabel:`Loaded`})})},Oe={command:`purge`,describe:`Remove all pending messages from a queue`,builder:e=>e.command(we).command(De).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Z={method:`POST`,path:t=>e`/accounts/${t.account_id}/event_subscriptions/subscriptions`,body:`json`,errors:{400:`BadRequestError`,404:`NotFoundError`,405:`MethodNotAllowedError`}};function ke(e){return e.usage(`$0 queues subscriptions create
|
|
47
|
+
|
|
48
|
+
Creates an event subscription for a Queue.`).option(`destination-queue-id`,{type:`string`,description:`ID of the target queue`}).option(`destination-type`,{type:`string`,description:`Type of destination`,choices:[`queues.queue`]}).coerce(`destination-type`,e=>f(e,`destination-type`,`text`)).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`]}).coerce(`source-type`,e=>f(e,`source-type`,`text`)).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 Ae={command:`create`,describe:`Create Event Subscription`,builder:ke,handler:async e=>c({command:`queues subscriptions create`,classification:{safeFlags:[`destination-type`,`enabled`,`source-type`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf queues subscriptions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/event_subscriptions/subscriptions`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({destination:{queue_id:f(e[`destination-queue-id`],`destination-queue-id`,`text`),type:e[`destination-type`]},enabled:e.enabled,events:e.events,name:f(e.name,`name`,`text`),source:{type:e[`source-type`],model_name:f(e[`source-model-name`],`source-model-name`,`text`),worker_name:f(e[`source-worker-name`],`source-worker-name`,`text`),script_tag:f(e[`source-script-tag`],`source-script-tag`,`text`),workflow_name:f(e[`source-workflow-name`],`source-workflow-name`,`text`)}}):l(e.body)});return}let c=await n(e),u=e.local?t:await i();if(e.accountId=u,e.body){let t=l(e.body),n=await s(`Creating`,async()=>c.send(Z,{body:t,account_id:u}));a(n,{successLabel:`Created`});return}let p=d({destination:{queue_id:f(e[`destination-queue-id`],`destination-queue-id`,`text`),type:e[`destination-type`]},enabled:e.enabled,events:e.events,name:f(e.name,`name`,`text`),source:{type:e[`source-type`],model_name:f(e[`source-model-name`],`source-model-name`,`text`),worker_name:f(e[`source-worker-name`],`source-worker-name`,`text`),script_tag:f(e[`source-script-tag`],`source-script-tag`,`text`),workflow_name:f(e[`source-workflow-name`],`source-workflow-name`,`text`)}}),m=await s(`Creating`,async()=>c.send(Z,{body:p,account_id:u}));a(m,{successLabel:`Created`})})};var je={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/event_subscriptions/subscriptions/${t.subscription_id}`};function Me(e){return e.usage(`$0 queues subscriptions delete <subscription-id>
|
|
49
|
+
|
|
50
|
+
Deletes an existing Queue event subscription.`).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 Ne={command:`delete <subscription-id>`,describe:`Delete Event Subscription`,builder:Me,handler:async e=>c({command:`queues subscriptions delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf queues subscriptions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/event_subscriptions/subscriptions/${e[`subscription-id`]==null?`<subscription-id>`:encodeURIComponent(String(e[`subscription-id`]))}`,pathParams:{"subscription-id":String(e[`subscription-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await h({force:!!e.force})){process.stderr.write(`Aborted.
|
|
51
|
+
`);return}let u=await s(`Deleting`,async()=>c.send(je,{account_id:l,subscription_id:e[`subscription-id`]}));a(u,{successLabel:`Deleted`})})};var Pe={method:`GET`,path:t=>e`/accounts/${t.account_id}/event_subscriptions/subscriptions/${t.subscription_id}`,errors:{404:`NotFoundError`}};function Fe(e){return e.usage(`$0 queues subscriptions get <subscription-id>
|
|
52
|
+
|
|
53
|
+
Returns an existing Queue event subscription.`).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 Q={command:`get <subscription-id>`,describe:`Get Event Subscription`,builder:Fe,handler:async e=>c({command:`queues subscriptions get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf queues subscriptions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/event_subscriptions/subscriptions/${e[`subscription-id`]==null?`<subscription-id>`:encodeURIComponent(String(e[`subscription-id`]))}`,pathParams:{"subscription-id":String(e[`subscription-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(Pe,{account_id:l,subscription_id:e[`subscription-id`]}));a(u,{successLabel:`Loaded`})})};var Ie={method:`GET`,path:t=>e`/accounts/${t.account_id}/event_subscriptions/subscriptions`,query:[`page`,`per_page`,`order`,`direction`]};function Le(e){return e.usage(`$0 queues subscriptions list
|
|
54
|
+
|
|
55
|
+
Returns a paginated list of Queue event subscriptions with optional sorting and filtering.`).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 Re={command:`list`,describe:`List Event Subscriptions`,builder:Le,handler:async e=>c({command:`queues subscriptions list`,classification:{safeFlags:[`order`,`direction`,`dry-run`]}},e,async()=>{let c={page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction};if(e.dryRun){let e=await r();o({command:`cf queues subscriptions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/event_subscriptions/subscriptions`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(Ie,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})};var $={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/event_subscriptions/subscriptions/${t.subscription_id}`,body:`json`,errors:{400:`BadRequestError`,404:`NotFoundError`}};function ze(e){return e.usage(`$0 queues subscriptions update <subscription-id>
|
|
56
|
+
|
|
57
|
+
Updates an existing Queue event subscription.`).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`]}).coerce(`destination-type`,e=>f(e,`destination-type`,`text`)).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 Be={command:`update <subscription-id>`,describe:`Update Event Subscription`,builder:ze,handler:async e=>c({command:`queues subscriptions update`,classification:{safeFlags:[`destination-type`,`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf queues subscriptions update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/event_subscriptions/subscriptions/${e[`subscription-id`]==null?`<subscription-id>`:encodeURIComponent(String(e[`subscription-id`]))}`,pathParams:{"subscription-id":String(e[`subscription-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({destination:{queue_id:f(e[`destination-queue-id`],`destination-queue-id`,`text`),type:e[`destination-type`]},enabled:e.enabled,events:e.events,name:f(e.name,`name`,`text`)}):l(e.body)});return}let c=await n(e),u=e.local?t:await i();if(e.accountId=u,e.body){let t=l(e.body),n=await s(`Updating`,async()=>c.send($,{body:t,account_id:u,subscription_id:e[`subscription-id`]}));a(n,{successLabel:`Updated`});return}let p=d({destination:{queue_id:f(e[`destination-queue-id`],`destination-queue-id`,`text`),type:e[`destination-type`]},enabled:e.enabled,events:e.events,name:f(e.name,`name`,`text`)}),m=await s(`Updating`,async()=>c.send($,{body:p,account_id:u,subscription_id:e[`subscription-id`]}));a(m,{successLabel:`Updated`})})},Ve={command:`subscriptions`,describe:`Manage queue subscriptions for event-driven message routing`,builder:e=>e.command(Ae).command(Ne).command(Q).command(Re).command(Be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},He={command:`queues`,describe:`Reliable message queuing between Workers — produce, consume, and batch-process messages at scale`,builder:e=>e.command(T).command(O).command(j).command(P).command(L).command(ce).command(ve).command(Se).command(Oe).command(Ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{He as default};
|