cf 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_meta/agent-context.json +78 -41
- package/dist/_meta/commands.json +19888 -21071
- package/dist/_meta/schemas.json +14305 -15328
- package/dist/abuse-reports-BsF9JZPW.mjs +8 -0
- package/dist/account-D8mYiWxQ.mjs +2 -0
- package/dist/accounts-CJci1Oez.mjs +23 -0
- package/dist/acm-CmCd985Q.mjs +3 -0
- package/dist/addressing-R7p6TRBe.mjs +12 -0
- package/dist/{agent-context-CKb6w43K.mjs → agent-context-Bzl5PGW-.mjs} +1 -1
- package/dist/ai-BzJg0RIX.mjs +3 -0
- package/dist/ai-audit-B0vJNOZG.mjs +2 -0
- package/dist/ai-gateway-D3vJR3My.mjs +10 -0
- package/dist/ai-search-CNg7W7U4.mjs +7 -0
- package/dist/alerting-_sdM0B0S.mjs +6 -0
- package/dist/alerts-dpT6Qsdu.mjs +2 -0
- package/dist/{analytics-CwFrx-Dr.mjs → analytics-BFBJhDrP.mjs} +1 -1
- package/dist/analytics_engine-CWhFvyeK.mjs +2 -0
- package/dist/{api-gateway-D9PMVVqL.mjs → api-gateway-D4AIEtUq.mjs} +10 -10
- package/dist/argo-Bjk6nFfs.mjs +2 -0
- package/dist/artifacts-Ba4b3iOa.mjs +4 -0
- package/dist/{audit-logs-BvQ9uwuy.mjs → audit-logs-BE0T5All.mjs} +1 -1
- package/dist/{auth-DX9KnJ0P.mjs → auth-CZ0E51rF.mjs} +3 -3
- package/dist/auth-D_zyQbDR.mjs +5 -0
- package/dist/autorag-Cnpp8PAG.mjs +2 -0
- package/dist/billing-Dz6Zj8Eq.mjs +2 -0
- package/dist/bot-management-pFwIbFi-.mjs +5 -0
- package/dist/botnet-feed-BY9uGChY.mjs +3 -0
- package/dist/brand-protection-DkPAk2Cz.mjs +3 -0
- package/dist/brands-CGpk9nZB.mjs +2 -0
- package/dist/browser-extension-D9P6Yv8i.mjs +3 -0
- package/dist/browser-run-DhHtz4y3.mjs +4 -0
- package/dist/build-CWuStmDi.mjs +2 -0
- package/dist/{cache-CeN5t6_W.mjs → cache-DVhkiIGK.mjs} +4 -4
- package/dist/calls-95zjvIcO.mjs +4 -0
- package/dist/certificate-authorities-BowBqbVq.mjs +2 -0
- package/dist/cf-BLT7uKJF.mjs +18 -0
- package/dist/chunk-2SIGYDH3-qXx_zE6v.mjs +397 -0
- package/dist/clear-DXx8WBAN.mjs +2 -0
- package/dist/client-certificates-D6mE4vJu.mjs +3 -0
- package/dist/cloud-connector-DmwsjeFN.mjs +2 -0
- package/dist/cloudforce-one-CG3TT7IN.mjs +23 -0
- package/dist/{completions-Bvzav4Mj.mjs → completions-DMc_PlIw.mjs} +2 -2
- package/dist/connectivity-DJkE3crz.mjs +3 -0
- package/dist/connector-interrupts-DTgQ7onV.mjs +2 -0
- package/dist/connector-telemetry-events-D0rTHDou.mjs +2 -0
- package/dist/connector-telemetry-snapshots--0QmD3z6.mjs +2 -0
- package/dist/connectors-zWaZTi2A.mjs +3 -0
- package/dist/content-scanning-CGvGf04y.mjs +4 -0
- package/dist/ct-alerting-ebSPSWNC.mjs +3 -0
- package/dist/{custom-certificates-CfRj7QZb.mjs → custom-certificates-CWUrPYLP.mjs} +4 -4
- package/dist/custom-csrs-CRtdrF9R.mjs +4 -0
- package/dist/{custom-hostnames-CcK7_17e.mjs → custom-hostnames-CVQSksqq.mjs} +4 -4
- package/dist/custom-nameservers-BRwbIdsX.mjs +3 -0
- package/dist/custom-pages-Ci8sTQX7.mjs +4 -0
- package/dist/d1-78Ym1P6D.mjs +4 -0
- package/dist/data-security-zmFoMwRU.mjs +6 -0
- package/dist/{dcv-delegation-BYsNl3qc.mjs → dcv-delegation-Dd4FZ2IG.mjs} +1 -1
- package/dist/{deploy-BzlPv3ro.mjs → deploy-CVvkZFjR.mjs} +1 -1
- package/dist/{dev-IOg-_s5_.mjs → dev-DSslyDXx.mjs} +1 -1
- package/dist/diagnostics-B8Ev5m_o.mjs +3 -0
- package/dist/dispatch-namespaces-Dm5vGeEP.mjs +7 -0
- package/dist/dist-BH-4NQOV.mjs +134 -0
- package/dist/dns-D7VAaCyO.mjs +29 -0
- package/dist/dns-firewall-ByLCsf0q.mjs +57 -0
- package/dist/domain-info-CRvKc2Lg.mjs +2 -0
- package/dist/durable-objects-BIpvyu9m.mjs +2 -0
- package/dist/email-auth-Cx--s8W4.mjs +2 -0
- package/dist/email-routing-CiDbivcN.mjs +10 -0
- package/dist/email-security-BYeAuSc6.mjs +12 -0
- package/dist/email-sending-Dg2rSmHH.mjs +4 -0
- package/dist/{filters-DKs-wEzt.mjs → filters-DZ8YnQ90.mjs} +3 -3
- package/dist/firewall-DEd1hs_I.mjs +11 -0
- package/dist/flagship-DVw7xGoP.mjs +4 -0
- package/dist/{fraud-D8WmLKyH.mjs → fraud-BbGS3FZs.mjs} +2 -2
- package/dist/google-tag-gateway-CBnRGYQR.mjs +2 -0
- package/dist/{healthchecks-BBtW8vRh.mjs → healthchecks-Da9N3ix4.mjs} +3 -3
- package/dist/{hostnames-Bh2IFxIw.mjs → hostnames-mimZu2tB.mjs} +2 -2
- package/dist/hyperdrive-BNdvxOos.mjs +21 -0
- package/dist/iam-DGQ-OgRl.mjs +6 -0
- package/dist/images-CI6Iy9ho.mjs +7 -0
- package/dist/index.mjs +1 -1
- package/dist/intel-BDB-aRtU.mjs +3 -0
- package/dist/internal-Czlp5Ekb.mjs +2 -0
- package/dist/{ips-BE7JbAnc.mjs → ips-B9UuPvsY.mjs} +1 -1
- package/dist/keyless-certificates-Ua9uJgPt.mjs +3 -0
- package/dist/kv-BHerx4dZ.mjs +5 -0
- package/dist/leaked-credential-checks-B8Vunj9h.mjs +3 -0
- package/dist/live-Ce7dZW7p.mjs +2 -0
- package/dist/load-balancers-DSjS5WKw.mjs +6 -0
- package/dist/logexplorer-DBIfTlRP.mjs +24 -0
- package/dist/logo-matches-C00iGpzW.mjs +2 -0
- package/dist/logos-CJLhx1go.mjs +3 -0
- package/dist/logpush-Cr1U-eK-.mjs +5 -0
- package/dist/logs-DMvtchc6.mjs +3 -0
- package/dist/magic-cloud-networking-FQfO8QWH.mjs +5 -0
- package/dist/magic-network-monitoring-CDd70fJQ.mjs +4 -0
- package/dist/magic-transit-DiKiPUax.mjs +110 -0
- package/dist/managed-transforms-fPVUTrAv.mjs +3 -0
- package/dist/matches-B0yHbQ2I.mjs +2 -0
- package/dist/moq-UgBawOXe.mjs +13 -0
- package/dist/mtls-certificates-xKUbC5EL.mjs +3 -0
- package/dist/network-interconnects-BJzOE2ny.mjs +41 -0
- package/dist/oauth-DBJ5GSFk.mjs +40 -0
- package/dist/observability-B-1y36QS.mjs +4 -0
- package/dist/organization-Dq3PClZ7.mjs +41 -0
- package/dist/organizations-AhsQkHyX.mjs +2 -0
- package/dist/origin-ca-certificates-CRgF0UyU.mjs +3 -0
- package/dist/origin-post-quantum-encryption-BXTx7DPa.mjs +2 -0
- package/dist/{origin-tls-client-auth-B30_2_dO.mjs → origin-tls-client-auth-BDw5q-6G.mjs} +3 -3
- package/dist/{page-rules-zQJGmTCd.mjs → page-rules-DqYQ23eg.mjs} +5 -5
- package/dist/{page-shield-CxQk5k9X.mjs → page-shield-DKdlZOLO.mjs} +5 -5
- package/dist/pages-BsXF11Kv.mjs +11 -0
- package/dist/pay-per-crawl-BGAwuAP3.mjs +2 -0
- package/dist/pipelines-D_QhSnGW.mjs +6 -0
- package/dist/progress-O88q63Bk.mjs +2 -0
- package/dist/{prompt-q3B7sM2A.mjs → prompt-DTAWiEm2.mjs} +1 -1
- package/dist/queries-CAE95-OH.mjs +3 -0
- package/dist/queues-BBz35Mqd.mjs +6 -0
- package/dist/r2-Zp99S5xF.mjs +21 -0
- package/dist/r2-data-catalog-BeVLZwrE.mjs +16 -0
- package/dist/radar-Cij-XVQJ.mjs +2 -0
- package/dist/rate-limit-analytics-CGviSPnJ.mjs +2 -0
- package/dist/rate-limits-DSdToIWv.mjs +5 -0
- package/dist/raw-fetch-DgezeshQ.mjs +2 -0
- package/dist/ready-DMpJvyaz.mjs +2 -0
- package/dist/realtime-kit-9rJcapfM.mjs +18 -0
- package/dist/recent-submissions-LS5IM-bm.mjs +2 -0
- package/dist/refute-BGTpr5sy.mjs +2 -0
- package/dist/registrar-CXViZlah.mjs +83 -0
- package/dist/registrar-sandbox-CvQyjXLJ.mjs +83 -0
- package/dist/request-tracers-DATfBnE9.mjs +2 -0
- package/dist/{resolve-DGD57PFH.mjs → resolve-Bs2sMRYS.mjs} +1 -1
- package/dist/resource-sharing-Cmhn6ghR.mjs +3 -0
- package/dist/resource-tagging-BTn05AOj.mjs +16 -0
- package/dist/rules-ens3OHme.mjs +4 -0
- package/dist/rulesets-bkreZRao.mjs +8 -0
- package/dist/rum-CpgXFcwl.mjs +4 -0
- package/dist/scan-logo-DUDIZJ2A.mjs +2 -0
- package/dist/scan-page-BqoQTk3R.mjs +2 -0
- package/dist/{schema-D8o6HcCr.mjs → schema-DCF4yEp_.mjs} +1 -1
- package/dist/{schema-validation-BWNDnnIT.mjs → schema-validation-Ca6o94ts.mjs} +5 -5
- package/dist/scim-C4oT8TMc.mjs +4 -0
- package/dist/sdk-pQ5kaGUX.mjs +3 -0
- package/dist/search-C4T5riPh.mjs +2 -0
- package/dist/secrets-store-CWEuiDNo.mjs +7 -0
- package/dist/security-center-BOvm7xy6.mjs +2 -0
- package/dist/{security-txt-CVpmJo29.mjs → security-txt-BCAUBctN.mjs} +2 -2
- package/dist/session-B1ARgLG7.mjs +2 -0
- package/dist/share-DhmVspmL.mjs +5 -0
- package/dist/{shared-DQI8NGja.mjs → shared-Bod3-Exx.mjs} +332 -332
- package/dist/signed-url-DA509wgp.mjs +2 -0
- package/dist/{smart-shield-BreBC1Ap.mjs → smart-shield-DZm4fn6z.mjs} +2 -2
- package/dist/{snippets-BAJoWMSJ.mjs → snippets-oQ0u26-z.mjs} +3 -3
- package/dist/{spawn-pmGERpdB.mjs → spawn-ChG5Xi9Z.mjs} +1 -1
- package/dist/{spectrum-DnIRLY95.mjs → spectrum-Cnkee5Ww.mjs} +6 -6
- package/dist/speed-DqNnvLBD.mjs +4 -0
- package/dist/{src-BQ1dr9xR.mjs → src-By-zTCHz.mjs} +9 -9
- package/dist/ssl-tS3CYZsZ.mjs +15 -0
- package/dist/state-OsdDJvdj.mjs +2 -0
- package/dist/stream-Bud9Os5V.mjs +14 -0
- package/dist/submission-info-DfIXmu-M.mjs +2 -0
- package/dist/submit-BtP8she2.mjs +2 -0
- package/dist/tenant-CMwHa-tU.mjs +2 -0
- package/dist/{token-validation-DUvtXWur.mjs → token-validation-BYC7HTok.mjs} +5 -5
- package/dist/{tools-CQtA5-cr.mjs → tools-Dru4l8yh.mjs} +1 -1
- package/dist/total-queries-DdLBNJzd.mjs +2 -0
- package/dist/tracked-domains-BbaY-IuY.mjs +2 -0
- package/dist/turnstile-CP4nScaL.mjs +23 -0
- package/dist/{ui-BrNwNHX9.mjs → ui-BNoF0KpD.mjs} +2 -2
- package/dist/url-info-Chs9h7Y-.mjs +2 -0
- package/dist/url-normalization-XYxW5Gj0.mjs +3 -0
- package/dist/url-scanner-D4pYNlO-.mjs +2 -0
- package/dist/user-DtefniLc.mjs +11 -0
- package/dist/vectorize-BeAY2g-7.mjs +4 -0
- package/dist/verify-D7J3F_NZ.mjs +2 -0
- package/dist/{versions-NUXxCr0s.mjs → versions-dMW3bLVv.mjs} +1 -1
- package/dist/waiting-rooms-K78HeeTg.mjs +11 -0
- package/dist/{web3-n3GW50u-.mjs → web3-Dhw79l4S.mjs} +3 -3
- package/dist/workers-builds-CuOAB3u4.mjs +7 -0
- package/dist/workers-l3zMNOU6.mjs +20 -0
- package/dist/workflows-rb7RYBKP.mjs +6 -0
- package/dist/{zaraz-9l7KuLqh.mjs → zaraz-CHecMYuo.mjs} +1 -1
- package/dist/zero-trust-DAZoa-Aj.mjs +117 -0
- package/dist/zone-BnnqJwW-.mjs +2 -0
- package/dist/zones-DpI2YikF.mjs +21 -0
- package/package.json +1 -1
- package/dist/abuse-reports-DUs4SKVx.mjs +0 -8
- package/dist/accounts-BIY8wNGA.mjs +0 -22
- package/dist/acm-SqcV8o5o.mjs +0 -3
- package/dist/addressing-CygRm0pN.mjs +0 -12
- package/dist/ai-BAmEAjN3.mjs +0 -2
- package/dist/ai-gateway-BENwPvvB.mjs +0 -8
- package/dist/ai-search-Bv_Whw3E.mjs +0 -7
- package/dist/ai_gateway-C6WP9oBH.mjs +0 -4
- package/dist/alerting-D_qWrsoY.mjs +0 -6
- package/dist/analytics_engine-BjV6XLyG.mjs +0 -2
- package/dist/argo-DwYGbyld.mjs +0 -2
- package/dist/artifacts-DKAjY_n4.mjs +0 -4
- package/dist/auth-TYwGydWg.mjs +0 -5
- package/dist/billing-CRTlRU88.mjs +0 -2
- package/dist/bot-management-DgW--8wM.mjs +0 -5
- package/dist/botnet-feed-CIX6ZORT.mjs +0 -3
- package/dist/brand-protection-ZikBtl0y.mjs +0 -3
- package/dist/browser-rendering-D_ZQVWn8.mjs +0 -4
- package/dist/build-Bgw8TV1p.mjs +0 -134
- package/dist/calls-Cv0ieVg4.mjs +0 -4
- package/dist/certificate-authorities-BzZnWCac.mjs +0 -2
- package/dist/client-certificates-BFuzeBrj.mjs +0 -3
- package/dist/cloud-connector-D5h8Dzzg.mjs +0 -2
- package/dist/cloudforce-one-aqDCIBMp.mjs +0 -21
- package/dist/config-B5k-XbwS.mjs +0 -2
- package/dist/connectivity-CjkXmEhO.mjs +0 -3
- package/dist/connector-interrupts-B7eSface.mjs +0 -2
- package/dist/connector-telemetry-events-F3Co8HUf.mjs +0 -2
- package/dist/connector-telemetry-snapshots-CQY8XMUg.mjs +0 -2
- package/dist/connectors-YYu_Vx3H.mjs +0 -3
- package/dist/content-scanning-BorfRGKT.mjs +0 -4
- package/dist/context-C-WbewL6.mjs +0 -2
- package/dist/custom-nameservers-BkKx0THn.mjs +0 -3
- package/dist/custom-pages-DamGVA75.mjs +0 -4
- package/dist/d1-sK0O5THv.mjs +0 -4
- package/dist/data-security-DsWpoWiS.mjs +0 -6
- package/dist/diagnostics-CH7T2WR3.mjs +0 -3
- package/dist/dispatch-namespaces-Bgj9XCRx.mjs +0 -7
- package/dist/dist-C6zxsVdY.mjs +0 -306
- package/dist/dns-firewall-VmQf3UVP.mjs +0 -57
- package/dist/dns-o7hUPMCG.mjs +0 -29
- package/dist/durable-objects-DgrTbvoF.mjs +0 -2
- package/dist/email-routing-owCvAEpf.mjs +0 -10
- package/dist/email-security-Dng3DVuf.mjs +0 -8
- package/dist/email-sending-bExMH4lu.mjs +0 -3
- package/dist/firewall-BLaTtX3r.mjs +0 -11
- package/dist/google-tag-gateway-DyCY43k0.mjs +0 -2
- package/dist/hyperdrive-DJm1eD-M.mjs +0 -18
- package/dist/iam-apCCcy7R.mjs +0 -6
- package/dist/images-Cxe45OHm.mjs +0 -7
- package/dist/intel-8V4h6H46.mjs +0 -3
- package/dist/keyless-certificates-CfJmXccT.mjs +0 -3
- package/dist/kv-Dz6then8.mjs +0 -5
- package/dist/leaked-credential-checks-BJ-zQMlx.mjs +0 -3
- package/dist/load-balancers-ilsGgudX.mjs +0 -6
- package/dist/logpush-BH14TtuA.mjs +0 -4
- package/dist/logs-B8-mkf_I.mjs +0 -3
- package/dist/magic-cloud-networking-DylCXoG4.mjs +0 -5
- package/dist/magic-network-monitoring-DnyrZy77.mjs +0 -4
- package/dist/magic-transit-B-kU5e3s.mjs +0 -89
- package/dist/managed-transforms-GC9Pq5dg.mjs +0 -3
- package/dist/mtls-certificates-BRlhWw_G.mjs +0 -3
- package/dist/network-interconnects-DuyoFD9_.mjs +0 -36
- package/dist/oauth-B5k80sip.mjs +0 -61
- package/dist/observability-9APhqFHo.mjs +0 -4
- package/dist/organizations-Dy3kiV_z.mjs +0 -41
- package/dist/origin-ca-certificates-2rwPoQdG.mjs +0 -3
- package/dist/origin-post-quantum-encryption-BnBLTvEO.mjs +0 -2
- package/dist/pages-5DKLs7CQ.mjs +0 -11
- package/dist/pipelines-DfGE44xo.mjs +0 -6
- package/dist/progress-CL8I-7YK.mjs +0 -2
- package/dist/queues-BoenUGIw.mjs +0 -6
- package/dist/r2-Cq_JCjK0.mjs +0 -21
- package/dist/r2-data-catalog-eLxltWdO.mjs +0 -14
- package/dist/radar-YNOCio6T.mjs +0 -2
- package/dist/rate-limits-CcAF3tMl.mjs +0 -5
- package/dist/raw-fetch-bIXC9D1m.mjs +0 -2
- package/dist/realtime-kit-4bCGviO5.mjs +0 -18
- package/dist/registrar-CfHlaOOf.mjs +0 -46
- package/dist/request-tracers-DlHawg5l.mjs +0 -2
- package/dist/resource-sharing-7FhuboJE.mjs +0 -5
- package/dist/resource-tagging-divcugVb.mjs +0 -16
- package/dist/rules-CAXkege8.mjs +0 -4
- package/dist/rulesets-CBsdc8IV.mjs +0 -8
- package/dist/rum-D0hHPNl9.mjs +0 -4
- package/dist/scim-CWLli4fi.mjs +0 -3
- package/dist/sdk-DhIhH6GB.mjs +0 -5
- package/dist/secrets-store-B7_HkE8I.mjs +0 -25
- package/dist/security-center-BQT21oiM.mjs +0 -2
- package/dist/session-B8r8LNQN.mjs +0 -93
- package/dist/speed-UYEVue28.mjs +0 -4
- package/dist/ssl-D3Pixs8M.mjs +0 -15
- package/dist/stream-BUsuOfQh.mjs +0 -14
- package/dist/tenants-BdWJTtcg.mjs +0 -2
- package/dist/turnstile-CAKVnS1L.mjs +0 -23
- package/dist/url-normalization-DA-RAxs4.mjs +0 -3
- package/dist/url-scanner-DmYu43f7.mjs +0 -2
- package/dist/user-Bah4wGGN.mjs +0 -10
- package/dist/vectorize-DhvVG2By.mjs +0 -4
- package/dist/waiting-rooms-DoOkT4Mu.mjs +0 -11
- package/dist/workers-D6IaQ_F0.mjs +0 -18
- package/dist/workers-builds-DYi0OMMU.mjs +0 -7
- package/dist/workflows-DrdXUQ2g.mjs +0 -4
- package/dist/zero-trust-D6V9GH2W.mjs +0 -118
- package/dist/zero_trust-BzXKAX_x.mjs +0 -3
- package/dist/zones-0MTkuaFk.mjs +0 -21
- /package/dist/{body-parser-DWSy7uZ8.mjs → body-parser-BO6mfo_W.mjs} +0 -0
- /package/dist/{cli-types-DGgEbf8K.mjs → cli-types-CFw6Xygp.mjs} +0 -0
- /package/dist/{input-validation-_fMCApaH.mjs → input-validation-BwUR9z8e.mjs} +0 -0
- /package/dist/{lib-4PQI6yRW.mjs → lib-Og5sB51C.mjs} +0 -0
- /package/dist/{local-CYc9q7l2.mjs → local-C6TLPAT6.mjs} +0 -0
- /package/dist/{metadata-MPDDi08e.mjs → metadata-Cnyws6iO.mjs} +0 -0
- /package/dist/{open-YWOUIZ5Y-3jqSKAB1.mjs → open-YWOUIZ5Y-CFRcYALi.mjs} +0 -0
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{O as e,P as t}from"./oauth-B5k80sip.mjs";import{n}from"./auth-DX9KnJ0P.mjs";import{n as r,t as i}from"./body-parser-DWSy7uZ8.mjs";import{t as a}from"./output-B6fBFRqe.mjs";import{n as o,t as s}from"./progress-CL8I-7YK.mjs";import{n as c}from"./input-validation-_fMCApaH.mjs";import{t as l}from"./local-CYc9q7l2.mjs";import{r as u,t as d}from"./prompt-q3B7sM2A.mjs";import{t as f}from"./cli-types-DGgEbf8K.mjs";function p(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`list`,describe:`Retrieve a list of the organizations that "contain" this account or are managing it. The returned list will be in order from "root" to "leaf", where the "leaf" will be the organization that _immediately_ contains the specified account.`,builder:p,handler:async r=>{if(r.dryRun){o({command:`cf organizations account-organizations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/organizations`,pathParams:{},bodyKind:`none`});return}let i=await n(r),c=r.local?l:await e();r.accountId=c,a(await s(`Loading`,async()=>i.organizations.accountOrganizations.list({account_id:c})),{successLabel:`Loaded`})}},h={command:`account-organizations`,describe:`Operations for account-organizations`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.option(`name`,{type:`string`,description:`The name field`}).option(`parent-id`,{type:`string`,description:`The parent.id field`}).option(`profile-business-address`,{type:`string`,description:`The profile.business_address field`}).option(`profile-business-email`,{type:`string`,description:`The profile.business_email field`}).option(`profile-business-name`,{type:`string`,description:`The profile.business_name field`}).option(`profile-business-phone`,{type:`string`,description:`The profile.business_phone field`}).option(`profile-external-metadata`,{type:`string`,description:`The profile.external_metadata field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`References an Organization in the Cloudflare data model.`}).check(e=>{if([`parent-id`].some(t=>e[t]!==void 0)){let t=[`parent-id`].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 --parent-* flag is set`)}return!0}).check(e=>{if([`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].some(t=>e[t]!==void 0)){let t=[`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].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 --profile-* flag is set`)}return!0})}const _={command:`create`,describe:`Create a new organization for a user. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:g,handler:async e=>{if(e.dryRun){o({command:`cf organizations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/organizations`,pathParams:{},bodyKind:`json`,body:e.body===void 0?i({name:c(e.name,`name`,`text`),parent:{id:c(e[`parent-id`],`parent-id`,`text`)},profile:{business_address:c(e[`profile-business-address`],`profile-business-address`,`text`),business_email:c(e[`profile-business-email`],`profile-business-email`,`text`),business_name:c(e[`profile-business-name`],`profile-business-name`,`text`),business_phone:c(e[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:c(e[`profile-external-metadata`],`profile-external-metadata`,`text`)}}):r(e.body)});return}let t=await n(e);if(e.body){let n=r(e.body);a(await s(`Creating`,async()=>t.organizations.create({...n})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await u(`name`,`The name field`));let l=i({name:c(e.name,`name`,`text`),parent:{id:c(e[`parent-id`],`parent-id`,`text`)},profile:{business_address:c(e[`profile-business-address`],`profile-business-address`,`text`),business_email:c(e[`profile-business-email`],`profile-business-email`,`text`),business_name:c(e[`profile-business-name`],`profile-business-name`,`text`),business_phone:c(e[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:c(e[`profile-external-metadata`],`profile-external-metadata`,`text`)}});a(await s(`Creating`,async()=>t.organizations.create({...l})),{successLabel:`Created`})}};function v(e){return e.positional(`organization-id`,{type:`string`,description:`The ID of the organization to delete.`,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 <organization-id>`,describe:`Delete an organization. The organization MUST be empty before deleting. It must not contain any sub-organizations, accounts, members or users. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/) **Access Control:** Restricted to enterprise organizations.`,builder:v,handler:async e=>{if(e.dryRun){o({command:`cf organizations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`none`});return}let t=await n(e);if(!await d({force:!!e.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}a(await s(`Deleting`,async()=>t.organizations.delete({organization_id:e[`organization-id`]})),{successLabel:`Deleted`})}};function b(e){return e.positional(`organization-id`,{type:`string`,description:`The ID of the organization to retrieve.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get <organization-id>`,describe:`Retrieve the details of a certain organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:b,handler:async e=>{if(e.dryRun){o({command:`cf organizations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`none`});return}let t=await n(e);a(await s(`Loading`,async()=>t.organizations.get({organization_id:e[`organization-id`]})),{successLabel:`Loaded`})}};function S(e){return e.option(`id`,{type:`string`,description:`Only return organizations with the specified IDs (ex. id=foo&id=bar). Send multiple elements
|
|
4
|
-
by repeating the query value.`}).option(`name`,{type:`string`,description:`(case-sensitive) Filter the list of organizations to where the name is equal to a
|
|
5
|
-
particular string.`}).option(`name-starts-with`,{type:`string`,description:`(case-insensitive) Filter the list of organizations to where the name starts with a
|
|
6
|
-
particular string.`}).option(`name-ends-with`,{type:`string`,description:`(case-insensitive) Filter the list of organizations to where the name ends with a particular
|
|
7
|
-
string.`}).option(`name-contains`,{type:`string`,description:`(case-insensitive) Filter the list of organizations to where the name contains a particular
|
|
8
|
-
string.`}).option(`containing-account`,{type:`string`,description:`Filter the list of organizations to the ones that contain this particular
|
|
9
|
-
account.`}).option(`containing-user`,{type:`string`,description:`Filter the list of organizations to the ones that contain this particular
|
|
10
|
-
user.
|
|
11
|
-
|
|
12
|
-
IMPORTANT: Just because an organization "contains" a user is not a
|
|
13
|
-
representation of any authorization or privilege to manage any resources
|
|
14
|
-
therein. An organization "containing" a user simply means the user is managed by
|
|
15
|
-
that organization.`}).option(`containing-organization`,{type:`string`,description:`Filter the list of organizations to the ones that contain this particular
|
|
16
|
-
organization.`}).option(`parent-id`,{type:`string`,description:`Filter the list of organizations to the ones that are a sub-organization
|
|
17
|
-
of the specified organization.
|
|
18
|
-
|
|
19
|
-
"null" is a valid value to provide for this parameter. It means "where
|
|
20
|
-
an organization has no parent (i.e. it is a 'root' organization)."`}).option(`page-token`,{type:`string`,description:`An opaque token returned from the last list response that when
|
|
21
|
-
provided will retrieve the next page.
|
|
22
|
-
|
|
23
|
-
Parameters used to filter the retrieved list must remain in subsequent
|
|
24
|
-
requests with a page token.`}).option(`page-size`,{type:`number`,description:`The amount of items to return. Defaults to 10.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`list`,describe:`Retrieve a list of organizations a particular user has access to. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:f(S),handler:async e=>{let t={id:e.id,name:e.name,"name.startsWith":e[`name-starts-with`],"name.endsWith":e[`name-ends-with`],"name.contains":e[`name-contains`],"containing.account":e[`containing-account`],"containing.user":e[`containing-user`],"containing.organization":e[`containing-organization`],"parent.id":e[`parent-id`],page_token:e[`page-token`],page_size:e[`page-size`]};if(e.dryRun){o({command:`cf organizations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations`,pathParams:{},query:t,bodyKind:`none`});return}let r=await n(e);a(await s(`Loading`,async()=>r.organizations.list(t)),{successLabel:`Loaded`})}};function w(e){return e.positional(`organization-id`,{type:`string`,description:`The unique id that identifies the organization.`,demandOption:!0}).option(`action-result`,{type:`string`,description:`Filters by whether the action was successful or not.`}).option(`action-type`,{type:`string`,description:`Filters by the action type.`}).option(`actor-context`,{type:`string`,description:`Filters by the actor context.`}).option(`actor-email`,{type:`string`,description:`Filters by the actor's email address.`}).option(`actor-id`,{type:`string`,description:`Filters by the actor's user ID.`}).option(`actor-ip-address`,{type:`string`,description:`The IP address where the action was initiated.`}).option(`actor-token-id`,{type:`string`,description:`Filters by the API token ID when the actor context is an api_token or oauth.`}).option(`actor-token-name`,{type:`string`,description:`Filters by the API token name when the actor context is an api_token or oauth.`}).option(`actor-type`,{type:`string`,description:`Filters by the actor type.`}).option(`id`,{type:`string`,description:`Finds a specific log by its ID.`}).option(`raw-cf-ray-id`,{type:`string`,description:`Filters by the response CF Ray ID.`}).option(`raw-method`,{type:`string`,description:`The HTTP method for the API call.`}).option(`raw-status-code`,{type:`string`,description:`The response status code that was returned.`}).option(`raw-uri`,{type:`string`,description:`Filters by the request URI.`}).option(`resource-id`,{type:`string`,description:`Filters by the resource ID.`}).option(`resource-product`,{type:`string`,description:`Filters audit logs by the Cloudflare product associated with the changed resource.`}).option(`resource-type`,{type:`string`,description:`Filters audit logs based on the unique type of resource changed by the action.`}).option(`resource-scope`,{type:`string`,description:`Filters by the resource scope, specifying whether the resource is associated with an organization.`}).option(`action-result-not`,{type:`string`,description:`Filters out audit logs by whether the action was successful or not.`}).option(`action-type-not`,{type:`string`,description:`Filters out audit logs by the action type.`}).option(`actor-context-not`,{type:`string`,description:`Filters out audit logs by the actor context.`}).option(`actor-email-not`,{type:`string`,description:`Filters out audit logs by the actor's email address.`}).option(`actor-id-not`,{type:`string`,description:`Filters out audit logs by the actor's user ID.`}).option(`actor-ip-address-not`,{type:`string`,description:`Filters out audit logs IP address where the action was initiated.`}).option(`actor-token-id-not`,{type:`string`,description:`Filters out audit logs by the API token ID when the actor context is an api_token or oauth.`}).option(`actor-token-name-not`,{type:`string`,description:`Filters out audit logs by the API token name when the actor context is an api_token or oauth.`}).option(`actor-type-not`,{type:`string`,description:`Filters out audit logs by the actor type.`}).option(`id-not`,{type:`string`,description:`Filters out audit logs by their IDs.`}).option(`raw-cf-ray-id-not`,{type:`string`,description:`Filters out audit logs by the response CF Ray ID.`}).option(`raw-method-not`,{type:`string`,description:`Filters out audit logs by the HTTP method for the API call.`}).option(`raw-status-code-not`,{type:`string`,description:`Filters out audit logs by the response status code that was returned.`}).option(`raw-uri-not`,{type:`string`,description:`Filters out audit logs by the request URI.`}).option(`resource-id-not`,{type:`string`,description:`Filters out audit logs by the resource ID.`}).option(`resource-product-not`,{type:`string`,description:`Filters out audit logs by the Cloudflare product associated with the changed resource.`}).option(`resource-type-not`,{type:`string`,description:`Filters out audit logs based on the unique type of resource changed by the action.`}).option(`resource-scope-not`,{type:`string`,description:`Filters out audit logs by the resource scope, specifying whether the resource is associated with an organization.`}).option(`since`,{type:`string`,description:`Limits the returned results to logs newer than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`before`,{type:`string`,description:`Limits the returned results to logs older than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`direction`,{type:`string`,description:`Sets sorting order.`,choices:[`desc`,`asc`]}).option(`limit`,{type:`number`,description:`The number limits the objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit.`}).option(`cursor`,{type:`string`,description:`The cursor is an opaque token used to paginate through large sets of records. It indicates the position from which to continue when requesting the next set of records. A valid cursor value can be obtained from the cursor object in the result_info structure of a previous response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get <organization-id>`,describe:`Gets a list of audit logs for an organization.`,builder:f(w),handler:async e=>{let t={action_result:e[`action-result`],action_type:e[`action-type`],actor_context:e[`actor-context`],actor_email:e[`actor-email`],actor_id:e[`actor-id`],actor_ip_address:e[`actor-ip-address`],actor_token_id:e[`actor-token-id`],actor_token_name:e[`actor-token-name`],actor_type:e[`actor-type`],id:e.id,raw_cf_ray_id:e[`raw-cf-ray-id`],raw_method:e[`raw-method`],raw_status_code:e[`raw-status-code`],raw_uri:e[`raw-uri`],resource_id:e[`resource-id`],resource_product:e[`resource-product`],resource_type:e[`resource-type`],resource_scope:e[`resource-scope`],"action_result.not":e[`action-result-not`],"action_type.not":e[`action-type-not`],"actor_context.not":e[`actor-context-not`],"actor_email.not":e[`actor-email-not`],"actor_id.not":e[`actor-id-not`],"actor_ip_address.not":e[`actor-ip-address-not`],"actor_token_id.not":e[`actor-token-id-not`],"actor_token_name.not":e[`actor-token-name-not`],"actor_type.not":e[`actor-type-not`],"id.not":e[`id-not`],"raw_cf_ray_id.not":e[`raw-cf-ray-id-not`],"raw_method.not":e[`raw-method-not`],"raw_status_code.not":e[`raw-status-code-not`],"raw_uri.not":e[`raw-uri-not`],"resource_id.not":e[`resource-id-not`],"resource_product.not":e[`resource-product-not`],"resource_type.not":e[`resource-type-not`],"resource_scope.not":e[`resource-scope-not`],since:e.since,before:e.before,direction:e.direction,limit:e.limit,cursor:e.cursor};if(e.dryRun){o({command:`cf organizations logs audit get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/logs/audit`,pathParams:{"organization-id":String(e[`organization-id`]??``)},query:t,bodyKind:`none`});return}let r=await n(e);a(await s(`Loading`,async()=>r.organizations.logs.audit.get({organization_id:e[`organization-id`],...t})),{successLabel:`Loaded`})}},E={command:`audit`,describe:`Logs operations`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},D={command:`logs`,describe:`Operations for logs`,builder:e=>e.command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.positional(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const k={command:`create <organization-id>`,describe:`Batch create multiple memberships that grant access to a specific Organization.`,builder:O,handler:async e=>{if(e.dryRun){o({command:`cf organizations members-batch-create create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/members:batchCreate`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:r(e.body)});return}let t=await n(e);if(e.body){let n=r(e.body);a(await s(`Creating`,async()=>t.organizations.membersBatchCreate.create({...n,organization_id:e[`organization-id`]})),{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.`)}},A={command:`members-batch-create`,describe:`Operations for members-batch-create`,builder:e=>e.command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.positional(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`member-status`,{type:`string`,description:`The member.status field`,choices:[`active`,`canceled`]}).option(`member-user-email`,{type:`string`,description:`The member.user.email 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 M={command:`create <organization-id>`,describe:`Create a membership that grants access to a specific Organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:j,handler:async e=>{if(e.dryRun){o({command:`cf organizations members create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/members`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({member:{status:c(e[`member-status`],`member-status`,`text`),user:{email:c(e[`member-user-email`],`member-user-email`,`text`)}}}):r(e.body)});return}let t=await n(e);if(e.body){let n=r(e.body);a(await s(`Creating`,async()=>t.organizations.members.create({...n,organization_id:e[`organization-id`]})),{successLabel:`Created`});return}e[`member-user-email`]===void 0&&(e[`member-user-email`]=await u(`member-user-email`,`The member.user.email field`));let l=i({member:{status:c(e[`member-status`],`member-status`,`text`),user:{email:c(e[`member-user-email`],`member-user-email`,`text`)}}});a(await s(`Creating`,async()=>t.organizations.members.create({...l,organization_id:e[`organization-id`]})),{successLabel:`Created`})}};function N(e){return e.positional(`member-id`,{type:`string`,description:`Organization Member ID`,demandOption:!0}).option(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const P={command:`delete <member-id>`,describe:`Delete a membership to a particular Organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:N,handler:async e=>{if(e.dryRun){o({command:`cf organizations members delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/members/${e[`member-id`]==null?`<member-id>`:encodeURIComponent(String(e[`member-id`]))}`,pathParams:{"organization-id":String(e[`organization-id`]??``),"member-id":String(e[`member-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:r(e.body)});return}let t=await n(e);if(!await d({force:!!e.force})){process.stderr.write(`Aborted.
|
|
25
|
-
`);return}if(e.body){let n=r(e.body);a(await s(`Deleting`,async()=>t.organizations.members.delete({...n,organization_id:e[`organization-id`],member_id:e[`member-id`]})),{successLabel:`Deleted`});return}a(await s(`Deleting`,async()=>t.organizations.members.delete({organization_id:e[`organization-id`],member_id:e[`member-id`]})),{successLabel:`Deleted`})}};function F(e){return e.positional(`member-id`,{type:`string`,description:`Organization Member ID`,demandOption:!0}).option(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`get <member-id>`,describe:`Retrieve a single membership from an Organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:F,handler:async e=>{if(e.dryRun){o({command:`cf organizations members get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/members/${e[`member-id`]==null?`<member-id>`:encodeURIComponent(String(e[`member-id`]))}`,pathParams:{"organization-id":String(e[`organization-id`]??``),"member-id":String(e[`member-id`]??``)},bodyKind:`none`});return}let t=await n(e);a(await s(`Loading`,async()=>t.organizations.members.get({organization_id:e[`organization-id`],member_id:e[`member-id`]})),{successLabel:`Loaded`})}};function L(e){return e.option(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`status`,{type:`string`,description:`Filter the list of memberships by membership status.`}).option(`user-email`,{type:`string`,description:`Filter the list of memberships for a specific email.`}).option(`user-email-contains`,{type:`string`,description:`Filter the list of memberships for a specific email that contains a substring.`}).option(`user-email-starts-with`,{type:`string`,description:`Filter the list of memberships for a specific email that starts with a substring.`}).option(`user-email-ends-with`,{type:`string`,description:`Filter the list of memberships for a specific email that ends with a substring.`}).option(`page-token`,{type:`string`,description:`An opaque token returned from the last list response that when
|
|
26
|
-
provided will retrieve the next page.
|
|
27
|
-
|
|
28
|
-
Parameters used to filter the retrieved list must remain in subsequent
|
|
29
|
-
requests with a page token.`}).option(`page-size`,{type:`number`,description:`The amount of items to return. Defaults to 10.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`list`,describe:`List memberships for an Organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:f(L),handler:async e=>{let t={status:e.status,"user.email":e[`user-email`],"user.email.contains":e[`user-email-contains`],"user.email.startsWith":e[`user-email-starts-with`],"user.email.endsWith":e[`user-email-ends-with`],page_token:e[`page-token`],page_size:e[`page-size`]};if(e.dryRun){o({command:`cf organizations members list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/members`,pathParams:{"organization-id":String(e[`organization-id`]??``)},query:t,bodyKind:`none`});return}let r=await n(e);a(await s(`Loading`,async()=>r.organizations.members.list({organization_id:e[`organization-id`],...t})),{successLabel:`Loaded`})}},z={command:`members`,describe:`Operations for members`,builder:e=>e.command(M).command(P).command(I).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.positional(`organization-id`,{type:`string`,description:`The ID of the organization to retrieve a list of accounts for.`,demandOption:!0}).option(`account-pubname`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname is equal to
|
|
30
|
-
a particular string.`}).option(`account-pubname-starts-with`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname starts with
|
|
31
|
-
a particular string.`}).option(`account-pubname-ends-with`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname ends with
|
|
32
|
-
a particular string.`}).option(`account-pubname-contains`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname contains
|
|
33
|
-
a particular string.`}).option(`name`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the name is equal to a
|
|
34
|
-
particular string.`}).option(`name-starts-with`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the name starts with a
|
|
35
|
-
particular string.`}).option(`name-ends-with`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the name ends with a particular
|
|
36
|
-
string.`}).option(`name-contains`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the name contains a particular
|
|
37
|
-
string.`}).option(`order-by`,{type:`string`,description:"Field to order results by. Currently supported values: `account_name`.\nWhen not specified, results are ordered by internal account ID.",choices:[`account_name`]}).option(`direction`,{type:`string`,description:"Sort direction for the order_by field. Valid values: `asc`, `desc`.\nDefaults to `asc` when order_by is specified.",choices:[`asc`,`desc`]}).option(`page-token`,{type:`string`,description:`An opaque token returned from the last list response that when
|
|
38
|
-
provided will retrieve the next page.
|
|
39
|
-
|
|
40
|
-
Parameters used to filter the retrieved list must remain in subsequent
|
|
41
|
-
requests with a page token.`}).option(`page-size`,{type:`number`,description:`The amount of items to return. Defaults to 10.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`get <organization-id>`,describe:`Retrieve a list of accounts that belong to a specific organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:f(B),handler:async e=>{let t={account_pubname:e[`account-pubname`],"account_pubname.startsWith":e[`account-pubname-starts-with`],"account_pubname.endsWith":e[`account-pubname-ends-with`],"account_pubname.contains":e[`account-pubname-contains`],name:e.name,"name.startsWith":e[`name-starts-with`],"name.endsWith":e[`name-ends-with`],"name.contains":e[`name-contains`],order_by:e[`order-by`],direction:e.direction,page_token:e[`page-token`],page_size:e[`page-size`]};if(e.dryRun){o({command:`cf organizations organization-accounts get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/accounts`,pathParams:{"organization-id":String(e[`organization-id`]??``)},query:t,bodyKind:`none`});return}let r=await n(e);a(await s(`Loading`,async()=>r.organizations.organizationAccounts.get({organization_id:e[`organization-id`],...t})),{successLabel:`Loaded`})}},H={command:`organization-accounts`,describe:`Operations for organization-accounts`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function U(e){return e.positional(`organization-id`,{type:`string`,description:`The ID of the organization to retrieve a profile for.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`get <organization-id>`,describe:`Get an organizations profile if it exists. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:U,handler:async e=>{if(e.dryRun){o({command:`cf organizations organization-profile get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/profile`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`none`});return}let t=await n(e);a(await s(`Loading`,async()=>t.organizations.organizationProfile.get({organization_id:e[`organization-id`]})),{successLabel:`Loaded`})}};function G(e){return e.positional(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`business-address`,{type:`string`,description:`The business_address field`}).option(`business-email`,{type:`string`,description:`The business_email field`}).option(`business-name`,{type:`string`,description:`The business_name field`}).option(`business-phone`,{type:`string`,description:`The business_phone field`}).option(`external-metadata`,{type:`string`,description:`The external_metadata 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 K={command:`update <organization-id>`,describe:`Modify organization profile. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:G,handler:async e=>{if(e.dryRun){o({command:`cf organizations organization-profile update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/profile`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({business_address:c(e[`business-address`],`business-address`,`text`),business_email:c(e[`business-email`],`business-email`,`text`),business_name:c(e[`business-name`],`business-name`,`text`),business_phone:c(e[`business-phone`],`business-phone`,`text`),external_metadata:c(e[`external-metadata`],`external-metadata`,`text`)}):r(e.body)});return}let t=await n(e);if(e.body){let n=r(e.body);a(await s(`Updating`,async()=>t.organizations.organizationProfile.update({body:n,organization_id:e[`organization-id`]})),{successLabel:`Updated`});return}e[`business-address`]===void 0&&(e[`business-address`]=await u(`business-address`,`The business_address field`)),e[`business-email`]===void 0&&(e[`business-email`]=await u(`business-email`,`The business_email field`)),e[`business-name`]===void 0&&(e[`business-name`]=await u(`business-name`,`The business_name field`)),e[`business-phone`]===void 0&&(e[`business-phone`]=await u(`business-phone`,`The business_phone field`)),e[`external-metadata`]===void 0&&(e[`external-metadata`]=await u(`external-metadata`,`The external_metadata field`));let l=i({business_address:c(e[`business-address`],`business-address`,`text`),business_email:c(e[`business-email`],`business-email`,`text`),business_name:c(e[`business-name`],`business-name`,`text`),business_phone:c(e[`business-phone`],`business-phone`,`text`),external_metadata:c(e[`external-metadata`],`external-metadata`,`text`)});a(await s(`Updating`,async()=>t.organizations.organizationProfile.update({body:l,organization_id:e[`organization-id`]})),{successLabel:`Updated`})}},q={command:`organization-profile`,describe:`Operations for organization-profile`,builder:e=>e.command(W).command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function J(e){return e.option(`organization-id`,{type:`string`,description:`Organization identifier.`,demandOption:!0}).option(`status`,{type:`string`,description:`Filter shares by status.`,choices:[`active`,`deleting`,`deleted`]}).option(`kind`,{type:`string`,description:`Filter shares by kind.`,choices:[`sent`,`received`]}).option(`target-type`,{type:`string`,description:`Filter shares by target_type.`,choices:[`account`,`organization`]}).option(`resource-types`,{type:`string`,description:`Filter share resources by resource_types.`}).option(`order`,{type:`string`,description:`Order shares by values in the given field.`,choices:[`name`,`created`]}).option(`direction`,{type:`string`,description:`Direction to sort objects.`,choices:[`asc`,`desc`]}).option(`page`,{type:`number`,description:"Page number. Defaults to `1` when `per_page` is supplied without\n`page`. May be omitted entirely along with `per_page` to receive a\nnon-paginated response."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when `page`\nis supplied without `per_page`. May be omitted entirely along with\n`page` to receive a non-paginated response."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`list`,describe:`Lists all organization shares.`,builder:f(J),handler:async e=>{let t={status:e.status,kind:e.kind,target_type:e[`target-type`],resource_types:e[`resource-types`],order:e.order,direction:e.direction,page:e.page,per_page:e[`per-page`]};if(e.dryRun){o({command:`cf organizations shares list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/shares`,pathParams:{"organization-id":String(e[`organization-id`]??``)},query:t,bodyKind:`none`});return}let r=await n(e);a(await s(`Loading`,async()=>r.organizations.shares.list({organization_id:e[`organization-id`],...t})),{successLabel:`Loaded`})}},X={command:`shares`,describe:`Operations for shares`,builder:e=>e.command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Z(e){return e.positional(`organization-id`,{type:`string`,description:`The ID of the organization to modify.`,demandOption:!0}).option(`name`,{type:`string`,description:`The name field`}).option(`parent-id`,{type:`string`,description:`The parent.id field`}).option(`profile-business-address`,{type:`string`,description:`The profile.business_address field`}).option(`profile-business-email`,{type:`string`,description:`The profile.business_email field`}).option(`profile-business-name`,{type:`string`,description:`The profile.business_name field`}).option(`profile-business-phone`,{type:`string`,description:`The profile.business_phone field`}).option(`profile-external-metadata`,{type:`string`,description:`The profile.external_metadata field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new details of the organization. Only accepts updates to "name" currently.`}).check(e=>{if([`parent-id`].some(t=>e[t]!==void 0)){let t=[`parent-id`].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 --parent-* flag is set`)}return!0}).check(e=>{if([`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].some(t=>e[t]!==void 0)){let t=[`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].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 --profile-* flag is set`)}return!0})}const Q={command:`update <organization-id>`,describe:`Modify organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:Z,handler:async e=>{if(e.dryRun){o({command:`cf organizations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({name:c(e.name,`name`,`text`),parent:{id:c(e[`parent-id`],`parent-id`,`text`)},profile:{business_address:c(e[`profile-business-address`],`profile-business-address`,`text`),business_email:c(e[`profile-business-email`],`profile-business-email`,`text`),business_name:c(e[`profile-business-name`],`profile-business-name`,`text`),business_phone:c(e[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:c(e[`profile-external-metadata`],`profile-external-metadata`,`text`)}}):r(e.body)});return}let t=await n(e);if(e.body){let n=r(e.body);a(await s(`Updating`,async()=>t.organizations.update({body:n,organization_id:e[`organization-id`]})),{successLabel:`Updated`});return}e.name===void 0&&(e.name=await u(`name`,`The name field`));let l=i({name:c(e.name,`name`,`text`),parent:{id:c(e[`parent-id`],`parent-id`,`text`)},profile:{business_address:c(e[`profile-business-address`],`profile-business-address`,`text`),business_email:c(e[`profile-business-email`],`profile-business-email`,`text`),business_name:c(e[`profile-business-name`],`profile-business-name`,`text`),business_phone:c(e[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:c(e[`profile-external-metadata`],`profile-external-metadata`,`text`)}});a(await s(`Updating`,async()=>t.organizations.update({body:l,organization_id:e[`organization-id`]})),{successLabel:`Updated`})}},$={command:`organizations`,describe:`Multi-user organizations that group accounts, members, and shared settings under a single entity`,builder:e=>e.command(_).command(y).command(x).command(C).command(Q).command(h).command(D).command(z).command(A).command(H).command(q).command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{$ as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{n as e}from"./auth-DX9KnJ0P.mjs";import{n as t,t as n}from"./body-parser-DWSy7uZ8.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-CL8I-7YK.mjs";import{n as o}from"./input-validation-_fMCApaH.mjs";import{n as s,r as c,t as l}from"./prompt-q3B7sM2A.mjs";import{t as u}from"./cli-types-DGgEbf8K.mjs";function d(e){return e.option(`csr`,{type:`string`,description:`The Certificate Signing Request (CSR). Must be newline-encoded.`}).option(`hostnames`,{type:`string`,array:!0,description:"Array of hostnames or wildcard names bound to the certificate.\nHostnames must be fully qualified domain names (FQDNs) belonging to zones on your account (e.g., `example.com` or `sub.example.com`). Wildcards are supported only as a `*.` prefix for a single level (e.g., `*.example.com`). Double wildcards (`*.*.example.com`) and interior wildcards (`foo.*.example.com`) are not allowed. The wildcard suffix must be a multi-label domain (`*.example.com` is valid, but `*.com` is not). Unicode/IDN hostnames are accepted and automatically converted to punycode."}).option(`request-type`,{type:`string`,description:`Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers).`,choices:[`origin-rsa`,`origin-ecc`,`keyless-certificate`]}).option(`requested-validity`,{type:`number`,description:`The number of days for which the certificate should be valid.`,default:5475}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`create`,describe:`Create an Origin CA certificate. You can use an Origin CA Key as your User Service Key or an API token when calling this endpoint ([see above](#requests)).`,builder:d,handler:async l=>{if(l.dryRun){i({command:`cf origin-ca-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/certificates`,pathParams:{},bodyKind:`json`,body:l.body===void 0?n({csr:o(l.csr,`csr`,`text`),hostnames:l.hostnames,request_type:o(l[`request-type`],`request-type`,`text`),requested_validity:l[`requested-validity`]}):t(l.body)});return}let u=await e(l);if(l.body){let e=t(l.body);r(await a(`Creating`,async()=>u.originCaCertificates.create({...e})),{successLabel:`Created`});return}if(l.csr===void 0&&(l.csr=await c(`csr`,`The Certificate Signing Request (CSR). Must be newline-encoded.`)),l.hostnames===void 0)throw Error(`--hostnames is required (or pass --body with this field set).`);l[`request-type`]===void 0&&(l[`request-type`]=await s(`request-type`,`Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers).`,[`origin-rsa`,`origin-ecc`,`keyless-certificate`]));let d=n({csr:o(l.csr,`csr`,`text`),hostnames:l.hostnames,request_type:o(l[`request-type`],`request-type`,`text`),requested_validity:l[`requested-validity`]});r(await a(`Creating`,async()=>u.originCaCertificates.create({...d})),{successLabel:`Created`})}};function p(e){return e.positional(`certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const m={command:`delete <certificate-id>`,describe:`Revoke an existing Origin CA certificate by its serial number. You can use an Origin CA Key as your User Service Key or an API token when calling this endpoint ([see above](#requests)).`,builder:p,handler:async t=>{if(t.dryRun){i({command:`cf origin-ca-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/certificates/${t[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(t[`certificate-id`]))}`,pathParams:{"certificate-id":String(t[`certificate-id`]??``)},bodyKind:`none`});return}let n=await e(t);if(!await l({force:!!t.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}r(await a(`Deleting`,async()=>n.originCaCertificates.delete({certificate_id:t[`certificate-id`]})),{successLabel:`Deleted`})}};function h(e){return e.positional(`certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get <certificate-id>`,describe:`Get an existing Origin CA certificate by its serial number. You can use an Origin CA Key as your User Service Key or an API token when calling this endpoint ([see above](#requests)).`,builder:h,handler:async t=>{if(t.dryRun){i({command:`cf origin-ca-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/certificates/${t[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(t[`certificate-id`]))}`,pathParams:{"certificate-id":String(t[`certificate-id`]??``)},bodyKind:`none`});return}let n=await e(t);r(await a(`Loading`,async()=>n.originCaCertificates.get({certificate_id:t[`certificate-id`]})),{successLabel:`Loaded`})}};function _(e){return e.option(`zone-id`,{type:`string`,description:`Identifier.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of records per page.`}).option(`limit`,{type:`number`,description:`Limit to the number of records returned.`}).option(`offset`,{type:`number`,description:`Offset the results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`list`,describe:`List all existing Origin CA certificates for a given zone. You can use an Origin CA Key as your User Service Key or an API token when calling this endpoint ([see above](#requests)).`,builder:u(_),handler:async t=>{let n={zone_id:t[`zone-id`],page:t.page,per_page:t[`per-page`],limit:t.limit,offset:t.offset};if(t.dryRun){i({command:`cf origin-ca-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/certificates`,pathParams:{},query:n,bodyKind:`none`});return}let o=await e(t);r(await a(`Loading`,async()=>o.originCaCertificates.list(n)),{successLabel:`Loaded`})}},y={command:`origin-ca-certificates`,describe:`Free Cloudflare-signed certificates installed on your origin server for Full (strict) SSL mode`,builder:e=>e.command(f).command(m).command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{y as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{N as e}from"./oauth-B5k80sip.mjs";import{n as t}from"./auth-DX9KnJ0P.mjs";import{n,t as r}from"./body-parser-DWSy7uZ8.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-CL8I-7YK.mjs";import{n as s}from"./input-validation-_fMCApaH.mjs";import{n as c}from"./prompt-q3B7sM2A.mjs";function l(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`get`,describe:`Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when connecting to your origin. Preferred instructs Cloudflare to opportunistically send a Post-Quantum keyshare in the first message to the origin (for fastest connections when the origin supports and prefers PQ), supported means that PQ algorithms are advertised but only used when requested by the origin, and off means that PQ algorithms are not advertised.`,builder:l,handler:async n=>{if(n.dryRun){a({command:`cf origin-post-quantum-encryption get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/cache/origin_post_quantum_encryption`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``)},bodyKind:`none`});return}let r=await t(n),s=await e({zone:n.zone},r,{quiet:n.quiet});n.zoneId=s,i(await o(`Loading`,async()=>r.originPostQuantumEncryption.get({zone_id:s})),{successLabel:`Loaded`})}};function d(e){return e.option(`value`,{type:`string`,description:`Value of the Origin Post Quantum Encryption Setting.`,choices:[`preferred`,`supported`,`off`]}).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:`update`,describe:`Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when connecting to your origin. Preferred instructs Cloudflare to opportunistically send a Post-Quantum keyshare in the first message to the origin (for fastest connections when the origin supports and prefers PQ), supported means that PQ algorithms are advertised but only used when requested by the origin, and off means that PQ algorithms are not advertised.`,builder:d,handler:async l=>{if(l.dryRun){a({command:`cf origin-post-quantum-encryption update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/cache/origin_post_quantum_encryption`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?r({value:s(l.value,`value`,`text`)}):n(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=n(l.body);i(await o(`Updating`,async()=>u.originPostQuantumEncryption.update({...e,zone_id:d})),{successLabel:`Updated`});return}l.value===void 0&&(l.value=await c(`value`,`Value of the Origin Post Quantum Encryption Setting.`,[`preferred`,`supported`,`off`]));let f=r({value:s(l.value,`value`,`text`)});i(await o(`Updating`,async()=>u.originPostQuantumEncryption.update({...f,zone_id:d})),{successLabel:`Updated`})}},p={command:`origin-post-quantum-encryption`,describe:`Enable post-quantum key exchange for connections between Cloudflare and your origin server`,builder:e=>e.command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
|
package/dist/pages-5DKLs7CQ.mjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{O as e,P as t}from"./oauth-B5k80sip.mjs";import{i as n,n as r}from"./auth-DX9KnJ0P.mjs";import{n as i,t as a}from"./body-parser-DWSy7uZ8.mjs";import{t as o}from"./output-B6fBFRqe.mjs";import{n as s,t as c}from"./progress-CL8I-7YK.mjs";import{n as l,t as u}from"./input-validation-_fMCApaH.mjs";import{t as d}from"./local-CYc9q7l2.mjs";import{r as f,t as p}from"./prompt-q3B7sM2A.mjs";import{t as m}from"./cli-types-DGgEbf8K.mjs";function ee(e){return e.option(`build-config-build-caching`,{type:`boolean`,description:`Enable build caching for the project.`}).option(`build-config-build-command`,{type:`string`,description:`Command used to build project.`}).option(`build-config-destination-dir`,{type:`string`,description:`Output directory of the build.`}).option(`build-config-root-dir`,{type:`string`,description:`Directory to run the command.`}).option(`build-config-web-analytics-tag`,{type:`string`,description:`The classifying tag for analytics.`}).option(`build-config-web-analytics-token`,{type:`string`,description:`The auth token for analytics.`}).option(`deployment-configs-preview-always-use-latest-compatibility-date`,{type:`boolean`,description:`Whether to always use the latest compatibility date for Pages Functions.`,default:!1}).option(`deployment-configs-preview-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`,default:3}).option(`deployment-configs-preview-compatibility-date`,{type:`string`,description:`Compatibility date used for Pages Functions.`}).option(`deployment-configs-preview-compatibility-flags`,{type:`string`,array:!0,description:`Compatibility flags used for Pages Functions.`}).option(`deployment-configs-preview-fail-open`,{type:`boolean`,description:`Whether to fail open when the deployment config cannot be applied.`,default:!0}).option(`deployment-configs-preview-limits-cpu-ms`,{type:`number`,description:`CPU time limit in milliseconds.`}).option(`deployment-configs-preview-placement-mode`,{type:`string`,description:`Placement mode.`}).option(`deployment-configs-preview-usage-model`,{type:`string`,description:`The usage model for Pages Functions.`,choices:[`standard`,`bundled`,`unbound`],default:`standard`}).option(`deployment-configs-preview-wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration used for the deployment.`}).option(`deployment-configs-production-always-use-latest-compatibility-date`,{type:`boolean`,description:`Whether to always use the latest compatibility date for Pages Functions.`,default:!1}).option(`deployment-configs-production-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`,default:3}).option(`deployment-configs-production-compatibility-date`,{type:`string`,description:`Compatibility date used for Pages Functions.`}).option(`deployment-configs-production-compatibility-flags`,{type:`string`,array:!0,description:`Compatibility flags used for Pages Functions.`}).option(`deployment-configs-production-fail-open`,{type:`boolean`,description:`Whether to fail open when the deployment config cannot be applied.`,default:!0}).option(`deployment-configs-production-limits-cpu-ms`,{type:`number`,description:`CPU time limit in milliseconds.`}).option(`deployment-configs-production-placement-mode`,{type:`string`,description:`Placement mode.`}).option(`deployment-configs-production-usage-model`,{type:`string`,description:`The usage model for Pages Functions.`,choices:[`standard`,`bundled`,`unbound`],default:`standard`}).option(`deployment-configs-production-wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration used for the deployment.`}).option(`name`,{type:`string`,description:`Name of the project.`}).option(`production-branch`,{type:`string`,description:`Production branch of the project. Used to identify production deployments.`}).option(`source-config-deployments-enabled`,{type:`boolean`,description:`Whether to enable automatic deployments when pushing to the source repository.
|
|
3
|
-
When disabled, no deployments (production or preview) will be triggered automatically.
|
|
4
|
-
`}).option(`source-config-owner`,{type:`string`,description:`The owner of the repository.`}).option(`source-config-owner-id`,{type:`string`,description:`The owner ID of the repository.`}).option(`source-config-path-excludes`,{type:`string`,array:!0,description:"A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported."}).option(`source-config-path-includes`,{type:`string`,array:!0,description:"A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported."}).option(`source-config-pr-comments-enabled`,{type:`boolean`,description:`Whether to enable PR comments.`}).option(`source-config-preview-branch-excludes`,{type:`string`,array:!0,description:"A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`."}).option(`source-config-preview-branch-includes`,{type:`string`,array:!0,description:"A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`."}).option(`source-config-preview-deployment-setting`,{type:`string`,description:`Controls whether commits to preview branches trigger a preview deployment.`,choices:[`all`,`none`,`custom`]}).option(`source-config-production-branch`,{type:`string`,description:`The production branch of the repository.`}).option(`source-config-production-deployments-enabled`,{type:`boolean`,description:`Whether to trigger a production deployment on commits to the production branch.`}).option(`source-config-repo-id`,{type:`string`,description:`The ID of the repository.`}).option(`source-config-repo-name`,{type:`string`,description:`The name of the repository.`}).option(`source-type`,{type:`string`,description:`The source control management provider.`,choices:[`github`,`gitlab`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`deployment-configs-preview-compatibility-date`,`deployment-configs-preview-compatibility-flags`,`deployment-configs-preview-limits-cpu-ms`,`deployment-configs-preview-placement-mode`,`deployment-configs-preview-wrangler-config-hash`,`deployment-configs-production-compatibility-date`,`deployment-configs-production-compatibility-flags`,`deployment-configs-production-limits-cpu-ms`,`deployment-configs-production-placement-mode`,`deployment-configs-production-wrangler-config-hash`].some(t=>e[t]!==void 0)){let t=[`deployment-configs-preview-limits-cpu-ms`,`deployment-configs-preview-placement-mode`,`deployment-configs-production-limits-cpu-ms`,`deployment-configs-production-placement-mode`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --deployment_configs-* flag is set`)}return!0}).check(e=>{if([`source-config-deployments-enabled`,`source-config-owner`,`source-config-owner-id`,`source-config-path-excludes`,`source-config-path-includes`,`source-config-pr-comments-enabled`,`source-config-preview-branch-excludes`,`source-config-preview-branch-includes`,`source-config-preview-deployment-setting`,`source-config-production-branch`,`source-config-production-deployments-enabled`,`source-config-repo-id`,`source-config-repo-name`,`source-type`].some(t=>e[t]!==void 0)){let t=[`source-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --source-* flag is set`)}return!0})}const h={command:`create`,describe:`Create a new project.`,builder:ee,handler:async n=>{if(n.dryRun){s({command:`cf pages projects create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects`,pathParams:{},bodyKind:`json`,body:n.body===void 0?a({build_config:{build_caching:n[`build-config-build-caching`],build_command:l(n[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:l(n[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:l(n[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:l(n[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:l(n[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)},deployment_configs:{preview:{always_use_latest_compatibility_date:n[`deployment-configs-preview-always-use-latest-compatibility-date`],build_image_major_version:n[`deployment-configs-preview-build-image-major-version`],compatibility_date:l(n[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`),compatibility_flags:n[`deployment-configs-preview-compatibility-flags`],fail_open:n[`deployment-configs-preview-fail-open`],limits:{cpu_ms:n[`deployment-configs-preview-limits-cpu-ms`]},placement:{mode:l(n[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:l(n[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:l(n[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)},production:{always_use_latest_compatibility_date:n[`deployment-configs-production-always-use-latest-compatibility-date`],build_image_major_version:n[`deployment-configs-production-build-image-major-version`],compatibility_date:l(n[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`),compatibility_flags:n[`deployment-configs-production-compatibility-flags`],fail_open:n[`deployment-configs-production-fail-open`],limits:{cpu_ms:n[`deployment-configs-production-limits-cpu-ms`]},placement:{mode:l(n[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:l(n[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:l(n[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:l(n.name,`name`,`text`),production_branch:l(n[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:n[`source-config-deployments-enabled`],owner:l(n[`source-config-owner`],`source-config-owner`,`text`),owner_id:l(n[`source-config-owner-id`],`source-config-owner-id`,`text`),path_excludes:n[`source-config-path-excludes`],path_includes:n[`source-config-path-includes`],pr_comments_enabled:n[`source-config-pr-comments-enabled`],preview_branch_excludes:n[`source-config-preview-branch-excludes`],preview_branch_includes:n[`source-config-preview-branch-includes`],preview_deployment_setting:l(n[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:l(n[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:n[`source-config-production-deployments-enabled`],repo_id:l(n[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:l(n[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:l(n[`source-type`],`source-type`,`text`)}}):i(n.body)});return}let u=await r(n),p=n.local?d:await e();if(n.accountId=p,n.body){let e=i(n.body);o(await c(`Creating`,async()=>u.pages.projects.create({...e,account_id:p})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await f(`name`,`Name of the project.`)),n[`production-branch`]===void 0&&(n[`production-branch`]=await f(`production-branch`,`Production branch of the project. Used to identify production deployments.`));let m=a({build_config:{build_caching:n[`build-config-build-caching`],build_command:l(n[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:l(n[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:l(n[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:l(n[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:l(n[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)},deployment_configs:{preview:{always_use_latest_compatibility_date:n[`deployment-configs-preview-always-use-latest-compatibility-date`],build_image_major_version:n[`deployment-configs-preview-build-image-major-version`],compatibility_date:l(n[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`),compatibility_flags:n[`deployment-configs-preview-compatibility-flags`],fail_open:n[`deployment-configs-preview-fail-open`],limits:{cpu_ms:n[`deployment-configs-preview-limits-cpu-ms`]},placement:{mode:l(n[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:l(n[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:l(n[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)},production:{always_use_latest_compatibility_date:n[`deployment-configs-production-always-use-latest-compatibility-date`],build_image_major_version:n[`deployment-configs-production-build-image-major-version`],compatibility_date:l(n[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`),compatibility_flags:n[`deployment-configs-production-compatibility-flags`],fail_open:n[`deployment-configs-production-fail-open`],limits:{cpu_ms:n[`deployment-configs-production-limits-cpu-ms`]},placement:{mode:l(n[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:l(n[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:l(n[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:l(n.name,`name`,`text`),production_branch:l(n[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:n[`source-config-deployments-enabled`],owner:l(n[`source-config-owner`],`source-config-owner`,`text`),owner_id:l(n[`source-config-owner-id`],`source-config-owner-id`,`text`),path_excludes:n[`source-config-path-excludes`],path_includes:n[`source-config-path-includes`],pr_comments_enabled:n[`source-config-pr-comments-enabled`],preview_branch_excludes:n[`source-config-preview-branch-excludes`],preview_branch_includes:n[`source-config-preview-branch-includes`],preview_deployment_setting:l(n[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:l(n[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:n[`source-config-production-deployments-enabled`],repo_id:l(n[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:l(n[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:l(n[`source-type`],`source-type`,`text`)}});o(await c(`Creating`,async()=>u.pages.projects.create({...m,account_id:p})),{successLabel:`Created`})}};function g(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <project-name>`,describe:`Delete a project by name.`,builder:g,handler:async n=>{if(n.dryRun){s({command:`cf pages projects delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}`,pathParams:{"project-name":String(n[`project-name`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?d:await e();if(n.accountId=a,!await p({force:!!n.force})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}o(await c(`Deleting`,async()=>i.pages.projects.delete({account_id:a,project_name:n[`project-name`]})),{successLabel:`Deleted`})}};function v(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`branch`,{type:`string`,description:"The branch to build the new deployment from. The `HEAD` of the branch will be used. If omitted, the production branch will be used by default."}).option(`commit-dirty`,{type:`string`,description:`Boolean string indicating if the working directory has uncommitted changes.`}).option(`commit-hash`,{type:`string`,description:`Git commit SHA associated with this deployment.`}).option(`commit-message`,{type:`string`,description:`Git commit message associated with this deployment.`}).option(`manifest`,{type:`string`,description:`JSON string containing a manifest of files to deploy. Maps file paths to their content hashes. Required for direct upload deployments. Maximum 20,000 entries. `}).option(`pages-build-output-dir`,{type:`string`,description:`The build output directory path.`}).option(`wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration file used for this deployment.`})}const y={command:`create <project-name>`,describe:`Start a new deployment from production. The repository and account must have already been authorized on the Cloudflare Pages dashboard.`,builder:v,handler:async i=>{if(i.dryRun){s({command:`cf pages projects deployments create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${i[`project-name`]==null?`<project-name>`:encodeURIComponent(String(i[`project-name`]))}/deployments`,pathParams:{"project-name":String(i[`project-name`]??``)},bodyKind:`multipart`,body:{body:i.body,file:i.file,branch:i.branch,"commit-dirty":i[`commit-dirty`],"commit-hash":i[`commit-hash`],"commit-message":i[`commit-message`],manifest:i.manifest,"pages-build-output-dir":i[`pages-build-output-dir`],"wrangler-config-hash":i[`wrangler-config-hash`]}});return}let a=await r(i),f=i.local?d:await e();if(i.accountId=f,i.file!==void 0||i.body!==void 0||i.branch!==void 0||i[`commit-dirty`]!==void 0||i[`commit-hash`]!==void 0||i[`commit-message`]!==void 0||i.manifest!==void 0||i[`pages-build-output-dir`]!==void 0||i[`wrangler-config-hash`]!==void 0){let e=new FormData;if(i.file){let t=u(i.file);e.append(`_headers`,new Blob([t]),i.file.split(/[\\/]/).filter(Boolean).pop())}else i.body!==void 0&&e.append(`_headers`,i.body);i.branch!==void 0&&e.append(`branch`,String(l(i.branch,`branch`,`text`)??``)),i[`commit-dirty`]!==void 0&&e.append(`commit_dirty`,String(l(i[`commit-dirty`],`commit-dirty`,`text`)??``)),i[`commit-hash`]!==void 0&&e.append(`commit_hash`,String(l(i[`commit-hash`],`commit-hash`,`text`)??``)),i[`commit-message`]!==void 0&&e.append(`commit_message`,String(l(i[`commit-message`],`commit-message`,`text`)??``)),i.manifest!==void 0&&e.append(`manifest`,String(l(i.manifest,`manifest`,`text`)??``)),i[`pages-build-output-dir`]!==void 0&&e.append(`pages_build_output_dir`,String(l(i[`pages-build-output-dir`],`pages-build-output-dir`,`text`)??``)),i[`wrangler-config-hash`]!==void 0&&e.append(`wrangler_config_hash`,String(l(i[`wrangler-config-hash`],`wrangler-config-hash`,`text`)??``)),o(await c(`Creating`,async()=>n(a,`POST`,`/accounts/${f}/pages/projects/${encodeURIComponent(String(i[`project-name`]))}/deployments`,{body:e})),{successLabel:`Created`});return}if(i.body){let e=l(i.body,`body`,`binary`);o(await c(`Creating`,async()=>n(a,`POST`,`/accounts/${f}/pages/projects/${encodeURIComponent(String(i[`project-name`]))}/deployments`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>a.pages.projects.deployments.create({account_id:f,project_name:i[`project-name`]})),{successLabel:`Created`})}};function b(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`force`,{type:`boolean`,description:`Allow deletion of aliased non-production deployments when a normal delete would be rejected.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`delete <deployment-id>`,describe:`Delete a deployment.`,builder:b,handler:async n=>{let i={force:n.force};if(n.dryRun){s({command:`cf pages projects deployments delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/deployments/${n[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(n[`deployment-id`]))}`,pathParams:{"deployment-id":String(n[`deployment-id`]??``),"project-name":String(n[`project-name`]??``)},query:i,bodyKind:`none`});return}let a=await r(n),l=n.local?d:await e();if(n.accountId=l,!await p({force:!!n.force})){process.stderr.write(`Aborted.
|
|
6
|
-
`);return}o(await c(`Deleting`,async()=>a.pages.projects.deployments.delete({account_id:l,project_name:n[`project-name`],deployment_id:n[`deployment-id`],...i})),{successLabel:`Deleted`})}};function S(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <deployment-id>`,describe:`Fetch information about a deployment.`,builder:S,handler:async n=>{if(n.dryRun){s({command:`cf pages projects deployments get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/deployments/${n[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(n[`deployment-id`]))}`,pathParams:{"deployment-id":String(n[`deployment-id`]??``),"project-name":String(n[`project-name`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?d:await e();n.accountId=a,o(await c(`Loading`,async()=>i.pages.projects.deployments.get({account_id:a,project_name:n[`project-name`],deployment_id:n[`deployment-id`]})),{successLabel:`Loaded`})}};function w(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get <deployment-id>`,describe:`Fetch deployment logs for a project.`,builder:w,handler:async n=>{if(n.dryRun){s({command:`cf pages projects deployments history logs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/deployments/${n[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(n[`deployment-id`]))}/history/logs`,pathParams:{"deployment-id":String(n[`deployment-id`]??``),"project-name":String(n[`project-name`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?d:await e();n.accountId=a,o(await c(`Loading`,async()=>i.pages.projects.deployments.history.logs.get({account_id:a,project_name:n[`project-name`],deployment_id:n[`deployment-id`]})),{successLabel:`Loaded`})}},E={command:`logs`,describe:`Operations for projects.deployments.history.logs`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},D={command:`history`,describe:`Operations for projects.deployments.history`,builder:e=>e.command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`env`,{type:`string`,description:`What type of deployments to fetch.`,choices:[`production`,`preview`]}).option(`page`,{type:`number`,description:`Which page of deployments to fetch.`}).option(`per-page`,{type:`number`,description:`How many deployments to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`Fetch a list of project deployments.`,builder:m(O),handler:async n=>{let i={env:n.env,page:n.page,per_page:n[`per-page`]};if(n.dryRun){s({command:`cf pages projects deployments list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/deployments`,pathParams:{"project-name":String(n[`project-name`]??``)},query:i,bodyKind:`none`});return}let a=await r(n),l=n.local?d:await e();n.accountId=l,o(await c(`Loading`,async()=>a.pages.projects.deployments.list({account_id:l,project_name:n[`project-name`],...i})),{successLabel:`Loaded`})}};function A(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`retry <deployment-id>`,describe:`Retry a previous deployment.`,builder:A,handler:async n=>{if(n.dryRun){s({command:`cf pages projects deployments retry`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/deployments/${n[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(n[`deployment-id`]))}/retry`,pathParams:{"deployment-id":String(n[`deployment-id`]??``),"project-name":String(n[`project-name`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?d:await e();n.accountId=a,o(await c(`Creating`,async()=>i.pages.projects.deployments.retry({account_id:a,project_name:n[`project-name`],deployment_id:n[`deployment-id`]})),{successLabel:`Created`})}};function M(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`rollback <deployment-id>`,describe:`Rollback the production deployment to a previous deployment. You can only rollback to succesful builds on production.`,builder:M,handler:async n=>{if(n.dryRun){s({command:`cf pages projects deployments rollback`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/deployments/${n[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(n[`deployment-id`]))}/rollback`,pathParams:{"deployment-id":String(n[`deployment-id`]??``),"project-name":String(n[`project-name`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?d:await e();n.accountId=a,o(await c(`Creating`,async()=>i.pages.projects.deployments.rollback({account_id:a,project_name:n[`project-name`],deployment_id:n[`deployment-id`]})),{successLabel:`Created`})}};function P(e){return e.positional(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const F={command:`create <deployment-id>`,describe:`Start a tail that receives logs and exception data.`,builder:P,handler:async n=>{if(n.dryRun){s({command:`cf pages projects deployments tails create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/deployments/${n[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(n[`deployment-id`]))}/tails`,pathParams:{"deployment-id":String(n[`deployment-id`]??``),"project-name":String(n[`project-name`]??``)},bodyKind:`json`,body:n.body===void 0?void 0:i(n.body)});return}let a=await r(n),l=n.local?d:await e();if(n.accountId=l,n.body){let e=i(n.body);o(await c(`Creating`,async()=>a.pages.projects.deployments.tails.create({...e,account_id:l,project_name:n[`project-name`],deployment_id:n[`deployment-id`]})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>a.pages.projects.deployments.tails.create({account_id:l,project_name:n[`project-name`],deployment_id:n[`deployment-id`]})),{successLabel:`Created`})}};function I(e){return e.positional(`tail-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`deployment-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const L={command:`delete <tail-id>`,describe:`Deletes a tail from a Pages deployment.`,builder:I,handler:async n=>{if(n.dryRun){s({command:`cf pages projects deployments tails delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/deployments/${n[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(n[`deployment-id`]))}/tails/${n[`tail-id`]==null?`<tail-id>`:encodeURIComponent(String(n[`tail-id`]))}`,pathParams:{"tail-id":String(n[`tail-id`]??``),"deployment-id":String(n[`deployment-id`]??``),"project-name":String(n[`project-name`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?d:await e();if(n.accountId=a,!await p({force:!!n.force})){process.stderr.write(`Aborted.
|
|
7
|
-
`);return}o(await c(`Deleting`,async()=>i.pages.projects.deployments.tails.delete({account_id:a,project_name:n[`project-name`],deployment_id:n[`deployment-id`],tail_id:n[`tail-id`]})),{successLabel:`Deleted`})}},R={command:`tails`,describe:`Operations for projects.deployments.tails`,builder:e=>e.command(F).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},te={command:`deployments`,describe:`Operations for projects.deployments`,builder:e=>e.command(y).command(x).command(C).command(k).command(j).command(N).command(D).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`name`,{type:`string`,description:`The domain name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`create <project-name>`,describe:`Add a new domain for the Pages project.`,builder:z,handler:async n=>{if(n.dryRun){s({command:`cf pages projects domains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/domains`,pathParams:{"project-name":String(n[`project-name`]??``)},bodyKind:`json`,body:n.body===void 0?a({name:l(n.name,`name`,`text`)}):i(n.body)});return}let u=await r(n),p=n.local?d:await e();if(n.accountId=p,n.body){let e=i(n.body);o(await c(`Creating`,async()=>u.pages.projects.domains.create({...e,account_id:p,project_name:n[`project-name`]})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await f(`name`,`The domain name.`));let m=a({name:l(n.name,`name`,`text`)});o(await c(`Creating`,async()=>u.pages.projects.domains.create({...m,account_id:p,project_name:n[`project-name`]})),{successLabel:`Created`})}};function V(e){return e.positional(`domain-name`,{type:`string`,description:`The domain name.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const H={command:`delete <domain-name>`,describe:`Delete a Pages project's domain.`,builder:V,handler:async n=>{if(n.dryRun){s({command:`cf pages projects domains delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/domains/${n[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(n[`domain-name`]))}`,pathParams:{"domain-name":String(n[`domain-name`]??``),"project-name":String(n[`project-name`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?d:await e();if(n.accountId=a,!await p({force:!!n.force})){process.stderr.write(`Aborted.
|
|
8
|
-
`);return}o(await c(`Deleting`,async()=>i.pages.projects.domains.delete({account_id:a,project_name:n[`project-name`],domain_name:n[`domain-name`]})),{successLabel:`Deleted`})}};function U(e){return e.positional(`domain-name`,{type:`string`,description:`The domain name.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`edit <domain-name>`,describe:`Retry the validation status of a single domain.`,builder:U,handler:async n=>{if(n.dryRun){s({command:`cf pages projects domains edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/domains/${n[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(n[`domain-name`]))}`,pathParams:{"domain-name":String(n[`domain-name`]??``),"project-name":String(n[`project-name`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?d:await e();n.accountId=a,o(await c(`Updating`,async()=>i.pages.projects.domains.edit({account_id:a,project_name:n[`project-name`],domain_name:n[`domain-name`]})),{successLabel:`Updated`})}};function G(e){return e.positional(`domain-name`,{type:`string`,description:`The domain name.`,demandOption:!0}).option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`get <domain-name>`,describe:`Fetch a single domain.`,builder:G,handler:async n=>{if(n.dryRun){s({command:`cf pages projects domains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/domains/${n[`domain-name`]==null?`<domain-name>`:encodeURIComponent(String(n[`domain-name`]))}`,pathParams:{"domain-name":String(n[`domain-name`]??``),"project-name":String(n[`project-name`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?d:await e();n.accountId=a,o(await c(`Loading`,async()=>i.pages.projects.domains.get({account_id:a,project_name:n[`project-name`],domain_name:n[`domain-name`]})),{successLabel:`Loaded`})}};function q(e){return e.option(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`list`,describe:`Fetch a list of all domains associated with a Pages project.`,builder:q,handler:async n=>{if(n.dryRun){s({command:`cf pages projects domains list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/domains`,pathParams:{"project-name":String(n[`project-name`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?d:await e();n.accountId=a,o(await c(`Loading`,async()=>i.pages.projects.domains.list({account_id:a,project_name:n[`project-name`]})),{successLabel:`Loaded`})}},Y={command:`domains`,describe:`Operations for projects.domains`,builder:e=>e.command(B).command(H).command(W).command(K).command(J).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function X(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`build-config-build-caching`,{type:`boolean`,description:`Enable build caching for the project.`}).option(`build-config-build-command`,{type:`string`,description:`Command used to build project.`}).option(`build-config-destination-dir`,{type:`string`,description:`Output directory of the build.`}).option(`build-config-root-dir`,{type:`string`,description:`Directory to run the command.`}).option(`build-config-web-analytics-tag`,{type:`string`,description:`The classifying tag for analytics.`}).option(`build-config-web-analytics-token`,{type:`string`,description:`The auth token for analytics.`}).option(`deployment-configs-preview-always-use-latest-compatibility-date`,{type:`boolean`,description:`Whether to always use the latest compatibility date for Pages Functions.`}).option(`deployment-configs-preview-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`}).option(`deployment-configs-preview-compatibility-date`,{type:`string`,description:`Compatibility date used for Pages Functions.`}).option(`deployment-configs-preview-compatibility-flags`,{type:`string`,array:!0,description:`Compatibility flags used for Pages Functions.`}).option(`deployment-configs-preview-fail-open`,{type:`boolean`,description:`Whether to fail open when the deployment config cannot be applied.`}).option(`deployment-configs-preview-limits-cpu-ms`,{type:`number`,description:`CPU time limit in milliseconds.`}).option(`deployment-configs-preview-placement-mode`,{type:`string`,description:`Placement mode.`}).option(`deployment-configs-preview-usage-model`,{type:`string`,description:`The usage model for Pages Functions.`,choices:[`standard`,`bundled`,`unbound`]}).option(`deployment-configs-preview-wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration used for the deployment.`}).option(`deployment-configs-production-always-use-latest-compatibility-date`,{type:`boolean`,description:`Whether to always use the latest compatibility date for Pages Functions.`}).option(`deployment-configs-production-build-image-major-version`,{type:`number`,description:`The major version of the build image to use for Pages Functions.`}).option(`deployment-configs-production-compatibility-date`,{type:`string`,description:`Compatibility date used for Pages Functions.`}).option(`deployment-configs-production-compatibility-flags`,{type:`string`,array:!0,description:`Compatibility flags used for Pages Functions.`}).option(`deployment-configs-production-fail-open`,{type:`boolean`,description:`Whether to fail open when the deployment config cannot be applied.`}).option(`deployment-configs-production-limits-cpu-ms`,{type:`number`,description:`CPU time limit in milliseconds.`}).option(`deployment-configs-production-placement-mode`,{type:`string`,description:`Placement mode.`}).option(`deployment-configs-production-usage-model`,{type:`string`,description:`The usage model for Pages Functions.`,choices:[`standard`,`bundled`,`unbound`]}).option(`deployment-configs-production-wrangler-config-hash`,{type:`string`,description:`Hash of the Wrangler configuration used for the deployment.`}).option(`name`,{type:`string`,description:`Name of the project.`}).option(`production-branch`,{type:`string`,description:`Production branch of the project. Used to identify production deployments.`}).option(`source-config-deployments-enabled`,{type:`boolean`,description:`Whether to enable automatic deployments when pushing to the source repository.
|
|
9
|
-
When disabled, no deployments (production or preview) will be triggered automatically.
|
|
10
|
-
`}).option(`source-config-owner`,{type:`string`,description:`The owner of the repository.`}).option(`source-config-owner-id`,{type:`string`,description:`The owner ID of the repository.`}).option(`source-config-path-excludes`,{type:`string`,array:!0,description:"A list of paths that should be excluded from triggering a preview deployment. Wildcard syntax (`*`) is supported."}).option(`source-config-path-includes`,{type:`string`,array:!0,description:"A list of paths that should be watched to trigger a preview deployment. Wildcard syntax (`*`) is supported."}).option(`source-config-pr-comments-enabled`,{type:`boolean`,description:`Whether to enable PR comments.`}).option(`source-config-preview-branch-excludes`,{type:`string`,array:!0,description:"A list of branches that should not trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`."}).option(`source-config-preview-branch-includes`,{type:`string`,array:!0,description:"A list of branches that should trigger a preview deployment. Wildcard syntax (`*`) is supported. Must be used with `preview_deployment_setting` set to `custom`."}).option(`source-config-preview-deployment-setting`,{type:`string`,description:`Controls whether commits to preview branches trigger a preview deployment.`,choices:[`all`,`none`,`custom`]}).option(`source-config-production-branch`,{type:`string`,description:`The production branch of the repository.`}).option(`source-config-production-deployments-enabled`,{type:`boolean`,description:`Whether to trigger a production deployment on commits to the production branch.`}).option(`source-config-repo-id`,{type:`string`,description:`The ID of the repository.`}).option(`source-config-repo-name`,{type:`string`,description:`The name of the repository.`}).option(`source-type`,{type:`string`,description:`The source control management provider.`,choices:[`github`,`gitlab`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`deployment-configs-preview-compatibility-date`,`deployment-configs-preview-compatibility-flags`,`deployment-configs-preview-limits-cpu-ms`,`deployment-configs-preview-placement-mode`,`deployment-configs-preview-wrangler-config-hash`,`deployment-configs-production-compatibility-date`,`deployment-configs-production-compatibility-flags`,`deployment-configs-production-limits-cpu-ms`,`deployment-configs-production-placement-mode`,`deployment-configs-production-wrangler-config-hash`].some(t=>e[t]!==void 0)){let t=[`deployment-configs-preview-limits-cpu-ms`,`deployment-configs-preview-placement-mode`,`deployment-configs-production-limits-cpu-ms`,`deployment-configs-production-placement-mode`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --deployment_configs-* flag is set`)}return!0}).check(e=>{if([`source-config-deployments-enabled`,`source-config-owner`,`source-config-owner-id`,`source-config-path-excludes`,`source-config-path-includes`,`source-config-pr-comments-enabled`,`source-config-preview-branch-excludes`,`source-config-preview-branch-includes`,`source-config-preview-deployment-setting`,`source-config-production-branch`,`source-config-production-deployments-enabled`,`source-config-repo-id`,`source-config-repo-name`,`source-type`].some(t=>e[t]!==void 0)){let t=[`source-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --source-* flag is set`)}return!0})}const Z={command:`edit <project-name>`,describe:`Set new attributes for an existing project. Modify environment variables. To delete an environment variable, set the key to null.`,builder:X,handler:async n=>{if(n.dryRun){s({command:`cf pages projects edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}`,pathParams:{"project-name":String(n[`project-name`]??``)},bodyKind:`json`,body:n.body===void 0?a({build_config:{build_caching:n[`build-config-build-caching`],build_command:l(n[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:l(n[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:l(n[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:l(n[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:l(n[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)},deployment_configs:{preview:{always_use_latest_compatibility_date:n[`deployment-configs-preview-always-use-latest-compatibility-date`],build_image_major_version:n[`deployment-configs-preview-build-image-major-version`],compatibility_date:l(n[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`),compatibility_flags:n[`deployment-configs-preview-compatibility-flags`],fail_open:n[`deployment-configs-preview-fail-open`],limits:{cpu_ms:n[`deployment-configs-preview-limits-cpu-ms`]},placement:{mode:l(n[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:l(n[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:l(n[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)},production:{always_use_latest_compatibility_date:n[`deployment-configs-production-always-use-latest-compatibility-date`],build_image_major_version:n[`deployment-configs-production-build-image-major-version`],compatibility_date:l(n[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`),compatibility_flags:n[`deployment-configs-production-compatibility-flags`],fail_open:n[`deployment-configs-production-fail-open`],limits:{cpu_ms:n[`deployment-configs-production-limits-cpu-ms`]},placement:{mode:l(n[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:l(n[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:l(n[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:l(n.name,`name`,`text`),production_branch:l(n[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:n[`source-config-deployments-enabled`],owner:l(n[`source-config-owner`],`source-config-owner`,`text`),owner_id:l(n[`source-config-owner-id`],`source-config-owner-id`,`text`),path_excludes:n[`source-config-path-excludes`],path_includes:n[`source-config-path-includes`],pr_comments_enabled:n[`source-config-pr-comments-enabled`],preview_branch_excludes:n[`source-config-preview-branch-excludes`],preview_branch_includes:n[`source-config-preview-branch-includes`],preview_deployment_setting:l(n[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:l(n[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:n[`source-config-production-deployments-enabled`],repo_id:l(n[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:l(n[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:l(n[`source-type`],`source-type`,`text`)}}):i(n.body)});return}let u=await r(n),f=n.local?d:await e();if(n.accountId=f,n.body){let e=i(n.body);o(await c(`Updating`,async()=>u.pages.projects.edit({...e,account_id:f,project_name:n[`project-name`]})),{successLabel:`Updated`});return}let p=a({build_config:{build_caching:n[`build-config-build-caching`],build_command:l(n[`build-config-build-command`],`build-config-build-command`,`text`),destination_dir:l(n[`build-config-destination-dir`],`build-config-destination-dir`,`text`),root_dir:l(n[`build-config-root-dir`],`build-config-root-dir`,`text`),web_analytics_tag:l(n[`build-config-web-analytics-tag`],`build-config-web-analytics-tag`,`text`),web_analytics_token:l(n[`build-config-web-analytics-token`],`build-config-web-analytics-token`,`text`)},deployment_configs:{preview:{always_use_latest_compatibility_date:n[`deployment-configs-preview-always-use-latest-compatibility-date`],build_image_major_version:n[`deployment-configs-preview-build-image-major-version`],compatibility_date:l(n[`deployment-configs-preview-compatibility-date`],`deployment-configs-preview-compatibility-date`,`text`),compatibility_flags:n[`deployment-configs-preview-compatibility-flags`],fail_open:n[`deployment-configs-preview-fail-open`],limits:{cpu_ms:n[`deployment-configs-preview-limits-cpu-ms`]},placement:{mode:l(n[`deployment-configs-preview-placement-mode`],`deployment-configs-preview-placement-mode`,`text`)},usage_model:l(n[`deployment-configs-preview-usage-model`],`deployment-configs-preview-usage-model`,`text`),wrangler_config_hash:l(n[`deployment-configs-preview-wrangler-config-hash`],`deployment-configs-preview-wrangler-config-hash`,`text`)},production:{always_use_latest_compatibility_date:n[`deployment-configs-production-always-use-latest-compatibility-date`],build_image_major_version:n[`deployment-configs-production-build-image-major-version`],compatibility_date:l(n[`deployment-configs-production-compatibility-date`],`deployment-configs-production-compatibility-date`,`text`),compatibility_flags:n[`deployment-configs-production-compatibility-flags`],fail_open:n[`deployment-configs-production-fail-open`],limits:{cpu_ms:n[`deployment-configs-production-limits-cpu-ms`]},placement:{mode:l(n[`deployment-configs-production-placement-mode`],`deployment-configs-production-placement-mode`,`text`)},usage_model:l(n[`deployment-configs-production-usage-model`],`deployment-configs-production-usage-model`,`text`),wrangler_config_hash:l(n[`deployment-configs-production-wrangler-config-hash`],`deployment-configs-production-wrangler-config-hash`,`text`)}},name:l(n.name,`name`,`text`),production_branch:l(n[`production-branch`],`production-branch`,`text`),source:{config:{deployments_enabled:n[`source-config-deployments-enabled`],owner:l(n[`source-config-owner`],`source-config-owner`,`text`),owner_id:l(n[`source-config-owner-id`],`source-config-owner-id`,`text`),path_excludes:n[`source-config-path-excludes`],path_includes:n[`source-config-path-includes`],pr_comments_enabled:n[`source-config-pr-comments-enabled`],preview_branch_excludes:n[`source-config-preview-branch-excludes`],preview_branch_includes:n[`source-config-preview-branch-includes`],preview_deployment_setting:l(n[`source-config-preview-deployment-setting`],`source-config-preview-deployment-setting`,`text`),production_branch:l(n[`source-config-production-branch`],`source-config-production-branch`,`text`),production_deployments_enabled:n[`source-config-production-deployments-enabled`],repo_id:l(n[`source-config-repo-id`],`source-config-repo-id`,`text`),repo_name:l(n[`source-config-repo-name`],`source-config-repo-name`,`text`)},type:l(n[`source-type`],`source-type`,`text`)}});o(await c(`Updating`,async()=>u.pages.projects.edit({...p,account_id:f,project_name:n[`project-name`]})),{successLabel:`Updated`})}};function Q(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`get-upload-token <project-name>`,describe:`Get a short-lived JWT for Pages Direct Upload asset operations.`,builder:Q,handler:async n=>{if(n.dryRun){s({command:`cf pages projects get-upload-token`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/upload-token`,pathParams:{"project-name":String(n[`project-name`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?d:await e();n.accountId=a,o(await c(`Loading`,async()=>i.pages.projects.getUploadToken({account_id:a,project_name:n[`project-name`]})),{successLabel:`Loaded`})}};function re(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`get <project-name>`,describe:`Fetch a project by name.`,builder:re,handler:async n=>{if(n.dryRun){s({command:`cf pages projects get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}`,pathParams:{"project-name":String(n[`project-name`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?d:await e();n.accountId=a,o(await c(`Loading`,async()=>i.pages.projects.get({account_id:a,project_name:n[`project-name`]})),{successLabel:`Loaded`})}};function ae(e){return e.option(`page`,{type:`number`,description:`Which page of projects to fetch.`}).option(`per-page`,{type:`number`,description:`How many projects to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`list`,describe:`Fetch a list of all user projects.`,builder:ae,handler:async n=>{let i={page:n.page,per_page:n[`per-page`]};if(n.dryRun){s({command:`cf pages projects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(n),l=n.local?d:await e();n.accountId=l,o(await c(`Loading`,async()=>a.pages.projects.list({account_id:l,...i})),{successLabel:`Loaded`})}};function $(e){return e.positional(`project-name`,{type:`string`,description:`Name of the project.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const se={command:`purge-build-cache <project-name>`,describe:`Purge all cached build artifacts for a Pages project`,builder:$,handler:async n=>{if(n.dryRun){s({command:`cf pages projects purge-build-cache`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pages/projects/${n[`project-name`]==null?`<project-name>`:encodeURIComponent(String(n[`project-name`]))}/purge_build_cache`,pathParams:{"project-name":String(n[`project-name`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?d:await e();if(n.accountId=a,!await p({force:!!n.force,message:`This operation purges the build cache for a Pages project.`})){process.stderr.write(`Aborted.
|
|
11
|
-
`);return}o(await c(`Deleting`,async()=>i.pages.projects.purgeBuildCache({account_id:a,project_name:n[`project-name`]})),{successLabel:`Deleted`})}},ce={command:`projects`,describe:`Operations for projects`,builder:e=>e.command(h).command(_).command(Z).command(ie).command(ne).command(oe).command(se).command(te).command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},le={command:`pages`,describe:`Full-stack application hosting with Git-integrated builds, preview deployments, and custom domains`,builder:e=>e.command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{le as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{O as e,P as t}from"./oauth-B5k80sip.mjs";import{n}from"./auth-DX9KnJ0P.mjs";import{n as r,t as i}from"./body-parser-DWSy7uZ8.mjs";import{t as a}from"./output-B6fBFRqe.mjs";import{n as o,t as s}from"./progress-CL8I-7YK.mjs";import{n as c}from"./input-validation-_fMCApaH.mjs";import{t as l}from"./local-CYc9q7l2.mjs";import{n as u,r as d,t as f}from"./prompt-q3B7sM2A.mjs";function p(e){return e.option(`name`,{type:`string`,description:`Specifies the name of the Pipeline.`}).option(`sql`,{type:`string`,description:`Specifies SQL for the Pipeline processing flow.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`create-v1`,describe:`Create a new Pipeline.`,builder:p,handler:async u=>{if(u.dryRun){o({command:`cf pipelines create-v1`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/v1/pipelines`,pathParams:{},bodyKind:`json`,body:u.body===void 0?i({name:c(u.name,`name`,`text`),sql:c(u.sql,`sql`,`text`)}):r(u.body)});return}let f=await n(u),p=u.local?l:await e();if(u.accountId=p,u.body){let e=r(u.body);a(await s(`Creating`,async()=>f.pipelines.createV1({...e,account_id:p})),{successLabel:`Created`});return}u.name===void 0&&(u.name=await d(`name`,`Specifies the name of the Pipeline.`)),u.sql===void 0&&(u.sql=await d(`sql`,`Specifies SQL for the Pipeline processing flow.`));let m=i({name:c(u.name,`name`,`text`),sql:c(u.sql,`sql`,`text`)});a(await s(`Creating`,async()=>f.pipelines.createV1({...m,account_id:p})),{successLabel:`Created`})}};function h(e){return e.option(`destination-batch-max-bytes`,{type:`number`,description:`Specifies rough maximum size of files.`,default:1e8}).option(`destination-batch-max-duration-s`,{type:`number`,description:`Specifies duration to wait to aggregate batches files.`,default:300}).option(`destination-batch-max-rows`,{type:`number`,description:`Specifies rough maximum number of rows per file.`,default:1e7}).option(`destination-compression-type`,{type:`string`,description:`Specifies the desired compression algorithm and format.`,choices:[`none`,`gzip`,`deflate`],default:`gzip`}).option(`destination-credentials-access-key-id`,{type:`string`,description:`Specifies the R2 Bucket Access Key Id.`}).option(`destination-credentials-endpoint`,{type:`string`,description:`Specifies the R2 Endpoint.`}).option(`destination-credentials-secret-access-key`,{type:`string`,description:`Specifies the R2 Bucket Secret Access Key.`}).option(`destination-format`,{type:`string`,description:`Specifies the format of data to deliver.`,choices:[`json`]}).option(`destination-path-bucket`,{type:`string`,description:`Specifies the R2 Bucket to store files.`}).option(`destination-path-filepath`,{type:`string`,description:`Specifies the name pattern for directory.`}).option(`destination-path-prefix`,{type:`string`,description:`Specifies the base directory within the bucket.`}).option(`destination-type`,{type:`string`,description:`Specifies the type of destination.`,choices:[`r2`]}).option(`name`,{type:`string`,description:`Defines the name of the pipeline.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`create`,describe:`[DEPRECATED] Create a new pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:h,handler:async f=>{if(f.dryRun){o({command:`cf pipelines create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines`,pathParams:{},bodyKind:`json`,body:f.body===void 0?i({destination:{batch:{max_bytes:f[`destination-batch-max-bytes`],max_duration_s:f[`destination-batch-max-duration-s`],max_rows:f[`destination-batch-max-rows`]},compression:{type:c(f[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:c(f[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:c(f[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:c(f[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:c(f[`destination-format`],`destination-format`,`text`),path:{bucket:c(f[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:c(f[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:c(f[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:c(f[`destination-type`],`destination-type`,`text`)},name:c(f.name,`name`,`text`)}):r(f.body)});return}let p=await n(f),m=f.local?l:await e();if(f.accountId=m,f.body){let e=r(f.body);a(await s(`Creating`,async()=>p.pipelines.create({...e,account_id:m})),{successLabel:`Created`});return}f[`destination-credentials-access-key-id`]===void 0&&(f[`destination-credentials-access-key-id`]=await d(`destination-credentials-access-key-id`,`Specifies the R2 Bucket Access Key Id.`)),f[`destination-credentials-endpoint`]===void 0&&(f[`destination-credentials-endpoint`]=await d(`destination-credentials-endpoint`,`Specifies the R2 Endpoint.`)),f[`destination-credentials-secret-access-key`]===void 0&&(f[`destination-credentials-secret-access-key`]=await d(`destination-credentials-secret-access-key`,`Specifies the R2 Bucket Secret Access Key.`)),f[`destination-format`]===void 0&&(f[`destination-format`]=await u(`destination-format`,`Specifies the format of data to deliver.`,[`json`])),f[`destination-path-bucket`]===void 0&&(f[`destination-path-bucket`]=await d(`destination-path-bucket`,`Specifies the R2 Bucket to store files.`)),f[`destination-type`]===void 0&&(f[`destination-type`]=await u(`destination-type`,`Specifies the type of destination.`,[`r2`])),f.name===void 0&&(f.name=await d(`name`,`Defines the name of the pipeline.`));let h=i({destination:{batch:{max_bytes:f[`destination-batch-max-bytes`],max_duration_s:f[`destination-batch-max-duration-s`],max_rows:f[`destination-batch-max-rows`]},compression:{type:c(f[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:c(f[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:c(f[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:c(f[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:c(f[`destination-format`],`destination-format`,`text`),path:{bucket:c(f[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:c(f[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:c(f[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:c(f[`destination-type`],`destination-type`,`text`)},name:c(f.name,`name`,`text`)});a(await s(`Creating`,async()=>p.pipelines.create({...h,account_id:m})),{successLabel:`Created`})}};function _(e){return e.positional(`pipeline-id`,{type:`string`,description:`Specifies the public ID of the pipeline.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const v={command:`delete-v1 <pipeline-id>`,describe:`Delete Pipeline in Account.`,builder:_,handler:async r=>{if(r.dryRun){o({command:`cf pipelines delete-v1`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/v1/pipelines/${r[`pipeline-id`]==null?`<pipeline-id>`:encodeURIComponent(String(r[`pipeline-id`]))}`,pathParams:{"pipeline-id":String(r[`pipeline-id`]??``)},bodyKind:`none`});return}let i=await n(r),c=r.local?l:await e();if(r.accountId=c,!await f({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}a(await s(`Deleting`,async()=>i.pipelines.deleteV1({account_id:c,pipeline_id:r[`pipeline-id`]})),{successLabel:`Deleted`})}};function y(e){return e.positional(`pipeline-name`,{type:`string`,description:`Defines the name of the pipeline.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const b={command:`delete <pipeline-name>`,describe:`[DEPRECATED] Delete a pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:y,handler:async r=>{if(r.dryRun){o({command:`cf pipelines delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/${r[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(r[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(r[`pipeline-name`]??``)},bodyKind:`none`});return}let i=await n(r),c=r.local?l:await e();if(r.accountId=c,!await f({force:!!r.force})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}a(await s(`Deleting`,async()=>i.pipelines.delete({account_id:c,pipeline_name:r[`pipeline-name`]})),{successLabel:`Deleted`})}};function x(e){return e.positional(`pipeline-id`,{type:`string`,description:`Specifies the public ID of the pipeline.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get-v1 <pipeline-id>`,describe:`Get Pipelines Details.`,builder:x,handler:async r=>{if(r.dryRun){o({command:`cf pipelines get-v1`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/v1/pipelines/${r[`pipeline-id`]==null?`<pipeline-id>`:encodeURIComponent(String(r[`pipeline-id`]))}`,pathParams:{"pipeline-id":String(r[`pipeline-id`]??``)},bodyKind:`none`});return}let i=await n(r),c=r.local?l:await e();r.accountId=c,a(await s(`Loading`,async()=>i.pipelines.getV1({account_id:c,pipeline_id:r[`pipeline-id`]})),{successLabel:`Loaded`})}};function C(e){return e.positional(`pipeline-name`,{type:`string`,description:`Defines the name of the pipeline.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`get <pipeline-name>`,describe:`[DEPRECATED] Get configuration of a pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:C,handler:async r=>{if(r.dryRun){o({command:`cf pipelines get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/${r[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(r[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(r[`pipeline-name`]??``)},bodyKind:`none`});return}let i=await n(r),c=r.local?l:await e();r.accountId=c,a(await s(`Loading`,async()=>i.pipelines.get({account_id:c,pipeline_name:r[`pipeline-name`]})),{successLabel:`Loaded`})}};function T(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`name`,{type:`string`,description:`Filters pipelines by name (case-insensitive substring).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`list-v1`,describe:`List/Filter Pipelines in Account.`,builder:T,handler:async r=>{let i={page:r.page,per_page:r[`per-page`],name:r.name};if(r.dryRun){o({command:`cf pipelines list-v1`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/v1/pipelines`,pathParams:{},query:i,bodyKind:`none`});return}let c=await n(r),u=r.local?l:await e();r.accountId=u,a(await s(`Loading`,async()=>c.pipelines.listV1({account_id:u,...i})),{successLabel:`Loaded`})}};function D(e){return e.option(`search`,{type:`string`,description:`Specifies the prefix of pipeline name to search.`}).option(`page`,{type:`string`,description:`Specifies which page to retrieve.`}).option(`per-page`,{type:`string`,description:`Specifies the number of pipelines per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`list`,describe:`[DEPRECATED] List, filter, and paginate pipelines in an account. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:D,handler:async r=>{let i={search:r.search,page:r.page,per_page:r[`per-page`]};if(r.dryRun){o({command:`cf pipelines list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines`,pathParams:{},query:i,bodyKind:`none`});return}let c=await n(r),u=r.local?l:await e();r.accountId=u,a(await s(`Loading`,async()=>c.pipelines.list({account_id:u,...i})),{successLabel:`Loaded`})}};function k(e){return e.option(`config-account-id`,{type:`string`,description:`Cloudflare Account ID for the bucket`}).option(`config-bucket`,{type:`string`,description:`R2 Bucket to write to`}).option(`config-credentials-access-key-id`,{type:`string`,description:`Cloudflare Account ID for the bucket`}).option(`config-credentials-secret-access-key`,{type:`string`,description:`Cloudflare Account ID for the bucket`}).option(`config-file-naming-prefix`,{type:`string`,description:`The prefix to use in file name. i.e prefix-<uuid>.parquet`}).option(`config-file-naming-strategy`,{type:`string`,description:`Filename generation strategy.`,choices:[`serial`,`uuid`,`uuid_v7`,`ulid`]}).option(`config-file-naming-suffix`,{type:`string`,description:`This will overwrite the default file suffix. i.e .parquet, use with caution`}).option(`config-jurisdiction`,{type:`string`,description:`Jurisdiction this bucket is hosted in`}).option(`config-partitioning-time-pattern`,{type:`string`,description:`The pattern of the date string`}).option(`config-path`,{type:`string`,description:`Subpath within the bucket to write to`}).option(`config-rolling-policy-file-size-bytes`,{type:`number`,description:`Files will be rolled after reaching this number of bytes`}).option(`config-rolling-policy-inactivity-seconds`,{type:`number`,description:`Number of seconds of inactivity to wait before rolling over to a new file`}).option(`config-rolling-policy-interval-seconds`,{type:`number`,description:`Number of seconds to wait before rolling over to a new file`}).option(`config-namespace`,{type:`string`,description:`Table namespace`}).option(`config-table-name`,{type:`string`,description:`Table name`}).option(`config-token`,{type:`string`,description:`Authentication token`}).option(`format-decimal-encoding`,{type:`string`,description:`The format.decimal_encoding field`,choices:[`number`,`string`,`bytes`]}).option(`format-timestamp-format`,{type:`string`,description:`The format.timestamp_format field`,choices:[`rfc3339`,`unix_millis`]}).option(`format-unstructured`,{type:`boolean`,description:`The format.unstructured field`}).option(`format-type`,{type:`string`,description:`The format.type field`,choices:[`json`,`parquet`]}).option(`format-compression`,{type:`string`,description:`The format.compression field`,choices:[`uncompressed`,`snappy`,`gzip`,`zstd`,`lz4`]}).option(`format-row-group-bytes`,{type:`number`,description:`The format.row_group_bytes field`}).option(`name`,{type:`string`,description:`Defines the name of the Sink.`}).option(`schema-format-decimal-encoding`,{type:`string`,description:`The schema.format.decimal_encoding field`,choices:[`number`,`string`,`bytes`]}).option(`schema-format-timestamp-format`,{type:`string`,description:`The schema.format.timestamp_format field`,choices:[`rfc3339`,`unix_millis`]}).option(`schema-format-unstructured`,{type:`boolean`,description:`The schema.format.unstructured field`}).option(`schema-format-type`,{type:`string`,description:`The schema.format.type field`,choices:[`json`,`parquet`]}).option(`schema-format-compression`,{type:`string`,description:`The schema.format.compression field`,choices:[`uncompressed`,`snappy`,`gzip`,`zstd`,`lz4`]}).option(`schema-format-row-group-bytes`,{type:`number`,description:`The schema.format.row_group_bytes field`}).option(`schema-inferred`,{type:`boolean`,description:`The schema.inferred field`}).option(`type`,{type:`string`,description:`Specifies the type of sink.`,choices:[`r2`,`r2_data_catalog`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`config-credentials-access-key-id`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-credentials-secret-access-key`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-file-naming-prefix`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-file-naming-strategy`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-file-naming-suffix`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-jurisdiction`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-partitioning-time-pattern`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-path`,[`config-namespace`,`config-table-name`,`config-token`]).conflicts(`config-namespace`,[`config-credentials-access-key-id`,`config-credentials-secret-access-key`,`config-file-naming-prefix`,`config-file-naming-strategy`,`config-file-naming-suffix`,`config-jurisdiction`,`config-partitioning-time-pattern`,`config-path`]).conflicts(`config-table-name`,[`config-credentials-access-key-id`,`config-credentials-secret-access-key`,`config-file-naming-prefix`,`config-file-naming-strategy`,`config-file-naming-suffix`,`config-jurisdiction`,`config-partitioning-time-pattern`,`config-path`]).implies(`config-table-name`,[`config-token`]).conflicts(`config-token`,[`config-credentials-access-key-id`,`config-credentials-secret-access-key`,`config-file-naming-prefix`,`config-file-naming-strategy`,`config-file-naming-suffix`,`config-jurisdiction`,`config-partitioning-time-pattern`,`config-path`]).implies(`config-token`,[`config-table-name`]).conflicts(`format-decimal-encoding`,[`format-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`]).conflicts(`schema-format-decimal-encoding`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-timestamp-format`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-unstructured`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-compression`,[`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`]).conflicts(`schema-format-row-group-bytes`,[`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-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-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([`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`,`schema-format-type`,`schema-format-compression`,`schema-format-row-group-bytes`,`schema-inferred`].some(t=>e[t]!==void 0)){let t=[`schema-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 --schema-* flag is set`)}return!0})}const A={command:`create`,describe:`Create a new Sink.`,builder:k,handler:async f=>{if(f.dryRun){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:f.body===void 0?i({config:{account_id:c(f[`config-account-id`],`config-account-id`,`text`),bucket:c(f[`config-bucket`],`config-bucket`,`text`),credentials:{access_key_id:c(f[`config-credentials-access-key-id`],`config-credentials-access-key-id`,`text`),secret_access_key:c(f[`config-credentials-secret-access-key`],`config-credentials-secret-access-key`,`text`)},file_naming:{prefix:c(f[`config-file-naming-prefix`],`config-file-naming-prefix`,`text`),strategy:c(f[`config-file-naming-strategy`],`config-file-naming-strategy`,`text`),suffix:c(f[`config-file-naming-suffix`],`config-file-naming-suffix`,`text`)},jurisdiction:c(f[`config-jurisdiction`],`config-jurisdiction`,`text`),partitioning:{time_pattern:c(f[`config-partitioning-time-pattern`],`config-partitioning-time-pattern`,`text`)},path:c(f[`config-path`],`config-path`,`text`),rolling_policy:{file_size_bytes:f[`config-rolling-policy-file-size-bytes`],inactivity_seconds:f[`config-rolling-policy-inactivity-seconds`],interval_seconds:f[`config-rolling-policy-interval-seconds`]},namespace:c(f[`config-namespace`],`config-namespace`,`text`),table_name:c(f[`config-table-name`],`config-table-name`,`text`),token:c(f[`config-token`],`config-token`,`text`)},format:{decimal_encoding:c(f[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:c(f[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:f[`format-unstructured`],type:c(f[`format-type`],`format-type`,`text`),compression:c(f[`format-compression`],`format-compression`,`text`),row_group_bytes:f[`format-row-group-bytes`]},name:c(f.name,`name`,`text`),schema:{format:{decimal_encoding:c(f[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`),timestamp_format:c(f[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`),unstructured:f[`schema-format-unstructured`],type:c(f[`schema-format-type`],`schema-format-type`,`text`),compression:c(f[`schema-format-compression`],`schema-format-compression`,`text`),row_group_bytes:f[`schema-format-row-group-bytes`]},inferred:f[`schema-inferred`]},type:c(f.type,`type`,`text`)}):r(f.body)});return}let p=await n(f),m=f.local?l:await e();if(f.accountId=m,f.body){let e=r(f.body);a(await s(`Creating`,async()=>p.pipelines.sinks.create({...e,account_id:m})),{successLabel:`Created`});return}f.name===void 0&&(f.name=await d(`name`,`Defines the name of the Sink.`)),f.type===void 0&&(f.type=await u(`type`,`Specifies the type of sink.`,[`r2`,`r2_data_catalog`]));let h=i({config:{account_id:c(f[`config-account-id`],`config-account-id`,`text`),bucket:c(f[`config-bucket`],`config-bucket`,`text`),credentials:{access_key_id:c(f[`config-credentials-access-key-id`],`config-credentials-access-key-id`,`text`),secret_access_key:c(f[`config-credentials-secret-access-key`],`config-credentials-secret-access-key`,`text`)},file_naming:{prefix:c(f[`config-file-naming-prefix`],`config-file-naming-prefix`,`text`),strategy:c(f[`config-file-naming-strategy`],`config-file-naming-strategy`,`text`),suffix:c(f[`config-file-naming-suffix`],`config-file-naming-suffix`,`text`)},jurisdiction:c(f[`config-jurisdiction`],`config-jurisdiction`,`text`),partitioning:{time_pattern:c(f[`config-partitioning-time-pattern`],`config-partitioning-time-pattern`,`text`)},path:c(f[`config-path`],`config-path`,`text`),rolling_policy:{file_size_bytes:f[`config-rolling-policy-file-size-bytes`],inactivity_seconds:f[`config-rolling-policy-inactivity-seconds`],interval_seconds:f[`config-rolling-policy-interval-seconds`]},namespace:c(f[`config-namespace`],`config-namespace`,`text`),table_name:c(f[`config-table-name`],`config-table-name`,`text`),token:c(f[`config-token`],`config-token`,`text`)},format:{decimal_encoding:c(f[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:c(f[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:f[`format-unstructured`],type:c(f[`format-type`],`format-type`,`text`),compression:c(f[`format-compression`],`format-compression`,`text`),row_group_bytes:f[`format-row-group-bytes`]},name:c(f.name,`name`,`text`),schema:{format:{decimal_encoding:c(f[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`),timestamp_format:c(f[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`),unstructured:f[`schema-format-unstructured`],type:c(f[`schema-format-type`],`schema-format-type`,`text`),compression:c(f[`schema-format-compression`],`schema-format-compression`,`text`),row_group_bytes:f[`schema-format-row-group-bytes`]},inferred:f[`schema-inferred`]},type:c(f.type,`type`,`text`)});a(await s(`Creating`,async()=>p.pipelines.sinks.create({...h,account_id:m})),{successLabel:`Created`})}};function j(e){return e.positional(`sink-id`,{type:`string`,description:`Specifies the publid ID of the sink.`,demandOption:!0}).option(`force`,{type:`string`,description:`Deprecated: Delete sink forcefully, including deleting any dependent pipelines.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`delete <sink-id>`,describe:`Delete Pipeline in Account.`,builder:j,handler:async r=>{let i={force:r.force};if(r.dryRun){o({command:`cf pipelines sinks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/v1/sinks/${r[`sink-id`]==null?`<sink-id>`:encodeURIComponent(String(r[`sink-id`]))}`,pathParams:{"sink-id":String(r[`sink-id`]??``)},query:i,bodyKind:`none`});return}let c=await n(r),u=r.local?l:await e();if(r.accountId=u,!await f({force:!!r.force})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}a(await s(`Deleting`,async()=>c.pipelines.sinks.delete({account_id:u,sink_id:r[`sink-id`],...i})),{successLabel:`Deleted`})}};function N(e){return e.positional(`sink-id`,{type:`string`,description:`Specifies the publid ID of the sink.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get <sink-id>`,describe:`Get Sink Details.`,builder:N,handler:async r=>{if(r.dryRun){o({command:`cf pipelines sinks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/v1/sinks/${r[`sink-id`]==null?`<sink-id>`:encodeURIComponent(String(r[`sink-id`]))}`,pathParams:{"sink-id":String(r[`sink-id`]??``)},bodyKind:`none`});return}let i=await n(r),c=r.local?l:await e();r.accountId=c,a(await s(`Loading`,async()=>i.pipelines.sinks.get({account_id:c,sink_id:r[`sink-id`]})),{successLabel:`Loaded`})}};function F(e){return e.option(`pipeline-id`,{type:`string`,description:`Pipeline ID`}).option(`name`,{type:`string`,description:`Filters sinks by name (case-insensitive substring).`}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`list`,describe:`List/Filter Sinks in Account.`,builder:F,handler:async r=>{let i={pipeline_id:r[`pipeline-id`],name:r.name,page:r.page,per_page:r[`per-page`]};if(r.dryRun){o({command:`cf pipelines sinks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/v1/sinks`,pathParams:{},query:i,bodyKind:`none`});return}let c=await n(r),u=r.local?l:await e();r.accountId=u,a(await s(`Loading`,async()=>c.pipelines.sinks.list({account_id:u,...i})),{successLabel:`Loaded`})}},L={command:`sinks`,describe:`Operations for sinks`,builder:e=>e.command(A).command(M).command(P).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function R(e){return e.option(`format-decimal-encoding`,{type:`string`,description:`The format.decimal_encoding field`,choices:[`number`,`string`,`bytes`]}).option(`format-timestamp-format`,{type:`string`,description:`The format.timestamp_format field`,choices:[`rfc3339`,`unix_millis`]}).option(`format-unstructured`,{type:`boolean`,description:`The format.unstructured field`}).option(`format-type`,{type:`string`,description:`The format.type field`,choices:[`json`,`parquet`]}).option(`format-compression`,{type:`string`,description:`The format.compression field`,choices:[`uncompressed`,`snappy`,`gzip`,`zstd`,`lz4`]}).option(`format-row-group-bytes`,{type:`number`,description:`The format.row_group_bytes field`}).option(`http-authentication`,{type:`boolean`,description:`Indicates that authentication is required for the HTTP endpoint.`}).option(`http-cors-origins`,{type:`string`,array:!0,description:`The http.cors.origins field`}).option(`http-enabled`,{type:`boolean`,description:`Indicates that the HTTP endpoint is enabled.`}).option(`name`,{type:`string`,description:`Specifies the name of the Stream.`}).option(`schema-format-decimal-encoding`,{type:`string`,description:`The schema.format.decimal_encoding field`,choices:[`number`,`string`,`bytes`]}).option(`schema-format-timestamp-format`,{type:`string`,description:`The schema.format.timestamp_format field`,choices:[`rfc3339`,`unix_millis`]}).option(`schema-format-unstructured`,{type:`boolean`,description:`The schema.format.unstructured field`}).option(`schema-format-type`,{type:`string`,description:`The schema.format.type field`,choices:[`json`,`parquet`]}).option(`schema-format-compression`,{type:`string`,description:`The schema.format.compression field`,choices:[`uncompressed`,`snappy`,`gzip`,`zstd`,`lz4`]}).option(`schema-format-row-group-bytes`,{type:`number`,description:`The schema.format.row_group_bytes field`}).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`]).conflicts(`schema-format-decimal-encoding`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-timestamp-format`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-unstructured`,[`schema-format-compression`,`schema-format-row-group-bytes`]).conflicts(`schema-format-compression`,[`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`]).conflicts(`schema-format-row-group-bytes`,[`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-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([`schema-format-decimal-encoding`,`schema-format-timestamp-format`,`schema-format-unstructured`,`schema-format-type`,`schema-format-compression`,`schema-format-row-group-bytes`,`schema-inferred`].some(t=>e[t]!==void 0)){let t=[`schema-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 --schema-* 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 z={command:`create`,describe:`Create a new Stream.`,builder:R,handler:async u=>{if(u.dryRun){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:u.body===void 0?i({format:{decimal_encoding:c(u[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:c(u[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:u[`format-unstructured`],type:c(u[`format-type`],`format-type`,`text`),compression:c(u[`format-compression`],`format-compression`,`text`),row_group_bytes:u[`format-row-group-bytes`]},http:{authentication:u[`http-authentication`],cors:{origins:u[`http-cors-origins`]},enabled:u[`http-enabled`]},name:c(u.name,`name`,`text`),schema:{format:{decimal_encoding:c(u[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`),timestamp_format:c(u[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`),unstructured:u[`schema-format-unstructured`],type:c(u[`schema-format-type`],`schema-format-type`,`text`),compression:c(u[`schema-format-compression`],`schema-format-compression`,`text`),row_group_bytes:u[`schema-format-row-group-bytes`]},inferred:u[`schema-inferred`]},worker_binding:{enabled:u[`worker-binding-enabled`]}}):r(u.body)});return}let f=await n(u),p=u.local?l:await e();if(u.accountId=p,u.body){let e=r(u.body);a(await s(`Creating`,async()=>f.pipelines.streams.create({...e,account_id:p})),{successLabel:`Created`});return}u.name===void 0&&(u.name=await d(`name`,`Specifies the name of the Stream.`));let m=i({format:{decimal_encoding:c(u[`format-decimal-encoding`],`format-decimal-encoding`,`text`),timestamp_format:c(u[`format-timestamp-format`],`format-timestamp-format`,`text`),unstructured:u[`format-unstructured`],type:c(u[`format-type`],`format-type`,`text`),compression:c(u[`format-compression`],`format-compression`,`text`),row_group_bytes:u[`format-row-group-bytes`]},http:{authentication:u[`http-authentication`],cors:{origins:u[`http-cors-origins`]},enabled:u[`http-enabled`]},name:c(u.name,`name`,`text`),schema:{format:{decimal_encoding:c(u[`schema-format-decimal-encoding`],`schema-format-decimal-encoding`,`text`),timestamp_format:c(u[`schema-format-timestamp-format`],`schema-format-timestamp-format`,`text`),unstructured:u[`schema-format-unstructured`],type:c(u[`schema-format-type`],`schema-format-type`,`text`),compression:c(u[`schema-format-compression`],`schema-format-compression`,`text`),row_group_bytes:u[`schema-format-row-group-bytes`]},inferred:u[`schema-inferred`]},worker_binding:{enabled:u[`worker-binding-enabled`]}});a(await s(`Creating`,async()=>f.pipelines.streams.create({...m,account_id:p})),{successLabel:`Created`})}};function B(e){return e.positional(`stream-id`,{type:`string`,description:`Specifies the public ID of the stream.`,demandOption:!0}).option(`force`,{type:`string`,description:`Deprecated: Delete stream forcefully, including deleting any dependent pipelines.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`delete <stream-id>`,describe:`Delete Stream in Account.`,builder:B,handler:async r=>{let i={force:r.force};if(r.dryRun){o({command:`cf pipelines streams delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/v1/streams/${r[`stream-id`]==null?`<stream-id>`:encodeURIComponent(String(r[`stream-id`]))}`,pathParams:{"stream-id":String(r[`stream-id`]??``)},query:i,bodyKind:`none`});return}let c=await n(r),u=r.local?l:await e();if(r.accountId=u,!await f({force:!!r.force})){process.stderr.write(`Aborted.
|
|
6
|
-
`);return}a(await s(`Deleting`,async()=>c.pipelines.streams.delete({account_id:u,stream_id:r[`stream-id`],...i})),{successLabel:`Deleted`})}};function H(e){return e.positional(`stream-id`,{type:`string`,description:`Specifies the public ID of the stream.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`get <stream-id>`,describe:`Get Stream Details.`,builder:H,handler:async r=>{if(r.dryRun){o({command:`cf pipelines streams get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/v1/streams/${r[`stream-id`]==null?`<stream-id>`:encodeURIComponent(String(r[`stream-id`]))}`,pathParams:{"stream-id":String(r[`stream-id`]??``)},bodyKind:`none`});return}let i=await n(r),c=r.local?l:await e();r.accountId=c,a(await s(`Loading`,async()=>i.pipelines.streams.get({account_id:c,stream_id:r[`stream-id`]})),{successLabel:`Loaded`})}};function W(e){return e.option(`pipeline-id`,{type:`string`,description:`Specifies the public ID of the pipeline.`}).option(`name`,{type:`string`,description:`Filters streams by name (case-insensitive substring).`}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`list`,describe:`List/Filter Streams in Account.`,builder:W,handler:async r=>{let i={pipeline_id:r[`pipeline-id`],name:r.name,page:r.page,per_page:r[`per-page`]};if(r.dryRun){o({command:`cf pipelines streams list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/v1/streams`,pathParams:{},query:i,bodyKind:`none`});return}let c=await n(r),u=r.local?l:await e();r.accountId=u,a(await s(`Loading`,async()=>c.pipelines.streams.list({account_id:u,...i})),{successLabel:`Loaded`})}};function K(e){return e.positional(`stream-id`,{type:`string`,description:`Specifies the public ID of the stream.`,demandOption:!0}).option(`http-authentication`,{type:`boolean`,description:`Indicates that authentication is required for the HTTP endpoint.`}).option(`http-cors-origins`,{type:`string`,array:!0,description:`The http.cors.origins field`}).option(`http-enabled`,{type:`boolean`,description:`Indicates that the HTTP endpoint is enabled.`}).option(`worker-binding-enabled`,{type:`boolean`,description:`Indicates that the worker binding is enabled.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`http-authentication`,`http-cors-origins`,`http-enabled`].some(t=>e[t]!==void 0)){let t=[`http-authentication`,`http-enabled`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --http-* flag is set`)}return!0}).check(e=>{if([`worker-binding-enabled`].some(t=>e[t]!==void 0)){let t=[`worker-binding-enabled`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --worker_binding-* flag is set`)}return!0})}const q={command:`update <stream-id>`,describe:`Update a Stream.`,builder:K,handler:async c=>{if(c.dryRun){o({command:`cf pipelines streams update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/v1/streams/${c[`stream-id`]==null?`<stream-id>`:encodeURIComponent(String(c[`stream-id`]))}`,pathParams:{"stream-id":String(c[`stream-id`]??``)},bodyKind:`json`,body:c.body===void 0?i({http:{authentication:c[`http-authentication`],cors:{origins:c[`http-cors-origins`]},enabled:c[`http-enabled`]},worker_binding:{enabled:c[`worker-binding-enabled`]}}):r(c.body)});return}let u=await n(c),d=c.local?l:await e();if(c.accountId=d,c.body){let e=r(c.body);a(await s(`Updating`,async()=>u.pipelines.streams.update({...e,account_id:d,stream_id:c[`stream-id`]})),{successLabel:`Updated`});return}let f=i({http:{authentication:c[`http-authentication`],cors:{origins:c[`http-cors-origins`]},enabled:c[`http-enabled`]},worker_binding:{enabled:c[`worker-binding-enabled`]}});a(await s(`Updating`,async()=>u.pipelines.streams.update({...f,account_id:d,stream_id:c[`stream-id`]})),{successLabel:`Updated`})}},J={command:`streams`,describe:`Operations for streams`,builder:e=>e.command(z).command(V).command(U).command(G).command(q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Y(e){return e.positional(`pipeline-name`,{type:`string`,description:`Defines the name of the pipeline.`,demandOption:!0}).option(`destination-batch-max-bytes`,{type:`number`,description:`Specifies rough maximum size of files.`}).option(`destination-batch-max-duration-s`,{type:`number`,description:`Specifies duration to wait to aggregate batches files.`}).option(`destination-batch-max-rows`,{type:`number`,description:`Specifies rough maximum number of rows per file.`}).option(`destination-compression-type`,{type:`string`,description:`Specifies the desired compression algorithm and format.`,choices:[`none`,`gzip`,`deflate`]}).option(`destination-credentials-access-key-id`,{type:`string`,description:`Specifies the R2 Bucket Access Key Id.`}).option(`destination-credentials-endpoint`,{type:`string`,description:`Specifies the R2 Endpoint.`}).option(`destination-credentials-secret-access-key`,{type:`string`,description:`Specifies the R2 Bucket Secret Access Key.`}).option(`destination-format`,{type:`string`,description:`Specifies the format of data to deliver.`,choices:[`json`]}).option(`destination-path-bucket`,{type:`string`,description:`Specifies the R2 Bucket to store files.`}).option(`destination-path-filepath`,{type:`string`,description:`Specifies the name pattern for directory.`}).option(`destination-path-prefix`,{type:`string`,description:`Specifies the base directory within the bucket.`}).option(`destination-type`,{type:`string`,description:`Specifies the type of destination.`,choices:[`r2`]}).option(`name`,{type:`string`,description:`Defines the name of the pipeline.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const X={command:`update <pipeline-name>`,describe:`[DEPRECATED] Update an existing pipeline. Use the new /pipelines/v1/pipelines endpoint instead.`,builder:Y,handler:async f=>{if(f.dryRun){o({command:`cf pipelines update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/pipelines/${f[`pipeline-name`]==null?`<pipeline-name>`:encodeURIComponent(String(f[`pipeline-name`]))}`,pathParams:{"pipeline-name":String(f[`pipeline-name`]??``)},bodyKind:`json`,body:f.body===void 0?i({destination:{batch:{max_bytes:f[`destination-batch-max-bytes`],max_duration_s:f[`destination-batch-max-duration-s`],max_rows:f[`destination-batch-max-rows`]},compression:{type:c(f[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:c(f[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:c(f[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:c(f[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:c(f[`destination-format`],`destination-format`,`text`),path:{bucket:c(f[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:c(f[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:c(f[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:c(f[`destination-type`],`destination-type`,`text`)},name:c(f.name,`name`,`text`)}):r(f.body)});return}let p=await n(f),m=f.local?l:await e();if(f.accountId=m,f.body){let e=r(f.body);a(await s(`Updating`,async()=>p.pipelines.update({...e,account_id:m,pipeline_name:f[`pipeline-name`]})),{successLabel:`Updated`});return}f[`destination-credentials-access-key-id`]===void 0&&(f[`destination-credentials-access-key-id`]=await d(`destination-credentials-access-key-id`,`Specifies the R2 Bucket Access Key Id.`)),f[`destination-credentials-endpoint`]===void 0&&(f[`destination-credentials-endpoint`]=await d(`destination-credentials-endpoint`,`Specifies the R2 Endpoint.`)),f[`destination-credentials-secret-access-key`]===void 0&&(f[`destination-credentials-secret-access-key`]=await d(`destination-credentials-secret-access-key`,`Specifies the R2 Bucket Secret Access Key.`)),f[`destination-format`]===void 0&&(f[`destination-format`]=await u(`destination-format`,`Specifies the format of data to deliver.`,[`json`])),f[`destination-path-bucket`]===void 0&&(f[`destination-path-bucket`]=await d(`destination-path-bucket`,`Specifies the R2 Bucket to store files.`)),f[`destination-type`]===void 0&&(f[`destination-type`]=await u(`destination-type`,`Specifies the type of destination.`,[`r2`])),f.name===void 0&&(f.name=await d(`name`,`Defines the name of the pipeline.`));let h=i({destination:{batch:{max_bytes:f[`destination-batch-max-bytes`],max_duration_s:f[`destination-batch-max-duration-s`],max_rows:f[`destination-batch-max-rows`]},compression:{type:c(f[`destination-compression-type`],`destination-compression-type`,`text`)},credentials:{access_key_id:c(f[`destination-credentials-access-key-id`],`destination-credentials-access-key-id`,`text`),endpoint:c(f[`destination-credentials-endpoint`],`destination-credentials-endpoint`,`text`),secret_access_key:c(f[`destination-credentials-secret-access-key`],`destination-credentials-secret-access-key`,`text`)},format:c(f[`destination-format`],`destination-format`,`text`),path:{bucket:c(f[`destination-path-bucket`],`destination-path-bucket`,`text`),filepath:c(f[`destination-path-filepath`],`destination-path-filepath`,`text`),prefix:c(f[`destination-path-prefix`],`destination-path-prefix`,`text`)},type:c(f[`destination-type`],`destination-type`,`text`)},name:c(f.name,`name`,`text`)});a(await s(`Updating`,async()=>p.pipelines.update({...h,account_id:m,pipeline_name:f[`pipeline-name`]})),{successLabel:`Updated`})}};function Z(e){return e.option(`sql`,{type:`string`,description:`Specifies SQL to validate.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Q={command:`validate-sql`,describe:`Validate Arroyo SQL.`,builder:Z,handler:async u=>{if(u.dryRun){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:u.body===void 0?i({sql:c(u.sql,`sql`,`text`)}):r(u.body)});return}let f=await n(u),p=u.local?l:await e();if(u.accountId=p,u.body){let e=r(u.body);a(await s(`Creating`,async()=>f.pipelines.validateSql({...e,account_id:p})),{successLabel:`Created`});return}u.sql===void 0&&(u.sql=await d(`sql`,`Specifies SQL to validate.`));let m=i({sql:c(u.sql,`sql`,`text`)});a(await s(`Creating`,async()=>f.pipelines.validateSql({...m,account_id:p})),{successLabel:`Created`})}},$={command:`pipelines`,describe:`Ingest, transform, and route event streams into R2, analytics, or other destinations in real time`,builder:e=>e.command(g).command(m).command(b).command(v).command(w).command(S).command(O).command(E).command(X).command(Q).command(L).command(J).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{$ as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{t as e,y as t}from"./session-B8r8LNQN.mjs";import{r as n}from"./theme-DbNbIY4d.mjs";import{a as r}from"./dist-B7hsuvbF.mjs";import{t as i}from"./output-B6fBFRqe.mjs";function a(e){i(e)}const o=[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`];function s(){return!(!n()||!process.stdout.isTTY||process.env.CF_QUIET===`1`)}async function c(n,i){if(!s())return i();e(t);let a=r({frames:[...o],indicator:`timer`,delay:80});a.start(n);try{let e=await i();return a.stop(n),e}catch(e){throw a.error(n),e}}export{a as n,c as t};
|
package/dist/queues-BoenUGIw.mjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{O as e,P as t}from"./oauth-B5k80sip.mjs";import{n}from"./auth-DX9KnJ0P.mjs";import{n as r,t as i}from"./body-parser-DWSy7uZ8.mjs";import{t as a}from"./output-B6fBFRqe.mjs";import{n as o,t as s}from"./progress-CL8I-7YK.mjs";import{n as c}from"./input-validation-_fMCApaH.mjs";import{t as l}from"./local-CYc9q7l2.mjs";import{n as u,r as d,t as f}from"./prompt-q3B7sM2A.mjs";import{t as p}from"./cli-types-DGgEbf8K.mjs";function m(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dead-letter-queue`,{type:`string`,description:`The dead_letter_queue field`}).option(`script-name`,{type:`string`,description:`Name of a Worker`}).option(`settings-batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`settings-max-concurrency`,{type:`number`,description:"Maximum number of concurrent consumers that may consume from this Queue. Set to `null` to automatically opt in to the platform's maximum (recommended)."}).option(`settings-max-retries`,{type:`number`,description:`The maximum number of retries`}).option(`settings-max-wait-time-ms`,{type:`number`,description:`The number of milliseconds to wait for a batch to fill up before attempting to deliver it`}).option(`settings-retry-delay`,{type:`number`,description:`The number of seconds to delay before making the message available for another attempt.`}).option(`settings-visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).option(`type`,{type:`string`,description:`The type field`,choices:[`worker`,`http_pull`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating or updating a consumer`}).conflicts(`script-name`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-concurrency`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-wait-time-ms`,[`settings-visibility-timeout-ms`]).conflicts(`settings-visibility-timeout-ms`,[`script-name`,`settings-max-concurrency`,`settings-max-wait-time-ms`])}const h={command:`create <queue-id>`,describe:`Creates a new consumer for a Queue`,builder:m,handler:async f=>{if(f.dryRun){o({command:`cf queues consumers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/queues/${f[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(f[`queue-id`]))}/consumers`,pathParams:{"queue-id":String(f[`queue-id`]??``)},bodyKind:`json`,body:f.body===void 0?i({dead_letter_queue:c(f[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:c(f[`script-name`],`script-name`,`text`),settings:{batch_size:f[`settings-batch-size`],max_concurrency:f[`settings-max-concurrency`],max_retries:f[`settings-max-retries`],max_wait_time_ms:f[`settings-max-wait-time-ms`],retry_delay:f[`settings-retry-delay`],visibility_timeout_ms:f[`settings-visibility-timeout-ms`]},type:c(f.type,`type`,`text`)}):r(f.body)});return}let p=await n(f),m=f.local?l:await e();if(f.accountId=m,f.body){let e=r(f.body);a(await s(`Creating`,async()=>p.queues.consumers.create({body:e,account_id:m,queue_id:f[`queue-id`]})),{successLabel:`Created`});return}f.type===void 0&&(f.type=await u(`type`,`The type field`,[`worker`,`http_pull`])),f.type===`worker`&&f[`script-name`]===void 0&&(f[`script-name`]=await d(`script-name`,`Name of a Worker`,{question:`Enter value for --script-name`}));let h=i({dead_letter_queue:c(f[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:c(f[`script-name`],`script-name`,`text`),settings:{batch_size:f[`settings-batch-size`],max_concurrency:f[`settings-max-concurrency`],max_retries:f[`settings-max-retries`],max_wait_time_ms:f[`settings-max-wait-time-ms`],retry_delay:f[`settings-retry-delay`],visibility_timeout_ms:f[`settings-visibility-timeout-ms`]},type:c(f.type,`type`,`text`)});a(await s(`Creating`,async()=>p.queues.consumers.create({body:h,account_id:m,queue_id:f[`queue-id`]})),{successLabel:`Created`})}};function ee(e){return e.positional(`consumer-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <consumer-id>`,describe:`Deletes the consumer for a queue.`,builder:ee,handler:async r=>{if(r.dryRun){o({command:`cf queues consumers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/queues/${r[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(r[`queue-id`]))}/consumers/${r[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(r[`consumer-id`]))}`,pathParams:{"consumer-id":String(r[`consumer-id`]??``),"queue-id":String(r[`queue-id`]??``)},bodyKind:`none`});return}let i=await n(r),c=r.local?l:await e();if(r.accountId=c,!await f({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}a(await s(`Deleting`,async()=>i.queues.consumers.delete({account_id:c,queue_id:r[`queue-id`],consumer_id:r[`consumer-id`]})),{successLabel:`Deleted`})}};function _(e){return e.positional(`consumer-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <consumer-id>`,describe:`Fetches the consumer for a queue by consumer id`,builder:_,handler:async r=>{if(r.dryRun){o({command:`cf queues consumers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/queues/${r[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(r[`queue-id`]))}/consumers/${r[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(r[`consumer-id`]))}`,pathParams:{"consumer-id":String(r[`consumer-id`]??``),"queue-id":String(r[`queue-id`]??``)},bodyKind:`none`});return}let i=await n(r),c=r.local?l:await e();r.accountId=c,a(await s(`Loading`,async()=>i.queues.consumers.get({account_id:c,queue_id:r[`queue-id`],consumer_id:r[`consumer-id`]})),{successLabel:`Loaded`})}};function y(e){return e.option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`list`,describe:`Returns the consumers for a Queue`,builder:y,handler:async r=>{if(r.dryRun){o({command:`cf queues consumers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/queues/${r[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(r[`queue-id`]))}/consumers`,pathParams:{"queue-id":String(r[`queue-id`]??``)},bodyKind:`none`});return}let i=await n(r),c=r.local?l:await e();r.accountId=c,a(await s(`Loading`,async()=>i.queues.consumers.list({account_id:c,queue_id:r[`queue-id`]})),{successLabel:`Loaded`})}};function x(e){return e.positional(`consumer-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dead-letter-queue`,{type:`string`,description:`The dead_letter_queue field`}).option(`script-name`,{type:`string`,description:`Name of a Worker`}).option(`settings-batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`settings-max-concurrency`,{type:`number`,description:"Maximum number of concurrent consumers that may consume from this Queue. Set to `null` to automatically opt in to the platform's maximum (recommended)."}).option(`settings-max-retries`,{type:`number`,description:`The maximum number of retries`}).option(`settings-max-wait-time-ms`,{type:`number`,description:`The number of milliseconds to wait for a batch to fill up before attempting to deliver it`}).option(`settings-retry-delay`,{type:`number`,description:`The number of seconds to delay before making the message available for another attempt.`}).option(`settings-visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).option(`type`,{type:`string`,description:`The type field`,choices:[`worker`,`http_pull`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating or updating a consumer`}).conflicts(`script-name`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-concurrency`,[`settings-visibility-timeout-ms`]).conflicts(`settings-max-wait-time-ms`,[`settings-visibility-timeout-ms`]).conflicts(`settings-visibility-timeout-ms`,[`script-name`,`settings-max-concurrency`,`settings-max-wait-time-ms`])}const S={command:`update <consumer-id>`,describe:`Updates the consumer for a queue, or creates one if it does not exist.`,builder:x,handler:async f=>{if(f.dryRun){o({command:`cf queues consumers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/queues/${f[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(f[`queue-id`]))}/consumers/${f[`consumer-id`]==null?`<consumer-id>`:encodeURIComponent(String(f[`consumer-id`]))}`,pathParams:{"consumer-id":String(f[`consumer-id`]??``),"queue-id":String(f[`queue-id`]??``)},bodyKind:`json`,body:f.body===void 0?i({dead_letter_queue:c(f[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:c(f[`script-name`],`script-name`,`text`),settings:{batch_size:f[`settings-batch-size`],max_concurrency:f[`settings-max-concurrency`],max_retries:f[`settings-max-retries`],max_wait_time_ms:f[`settings-max-wait-time-ms`],retry_delay:f[`settings-retry-delay`],visibility_timeout_ms:f[`settings-visibility-timeout-ms`]},type:c(f.type,`type`,`text`)}):r(f.body)});return}let p=await n(f),m=f.local?l:await e();if(f.accountId=m,f.body){let e=r(f.body);a(await s(`Updating`,async()=>p.queues.consumers.update({body:e,account_id:m,queue_id:f[`queue-id`],consumer_id:f[`consumer-id`]})),{successLabel:`Updated`});return}f.type===void 0&&(f.type=await u(`type`,`The type field`,[`worker`,`http_pull`])),f.type===`worker`&&f[`script-name`]===void 0&&(f[`script-name`]=await d(`script-name`,`Name of a Worker`,{question:`Enter value for --script-name`}));let h=i({dead_letter_queue:c(f[`dead-letter-queue`],`dead-letter-queue`,`text`),script_name:c(f[`script-name`],`script-name`,`text`),settings:{batch_size:f[`settings-batch-size`],max_concurrency:f[`settings-max-concurrency`],max_retries:f[`settings-max-retries`],max_wait_time_ms:f[`settings-max-wait-time-ms`],retry_delay:f[`settings-retry-delay`],visibility_timeout_ms:f[`settings-visibility-timeout-ms`]},type:c(f.type,`type`,`text`)});a(await s(`Updating`,async()=>p.queues.consumers.update({body:h,account_id:m,queue_id:f[`queue-id`],consumer_id:f[`consumer-id`]})),{successLabel:`Updated`})}},C={command:`consumers`,describe:`Operations for consumers`,builder:e=>e.command(h).command(g).command(v).command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`queue-name`,{type:`string`,description:`The queue_name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const T={command:`create`,describe:`Create a new queue`,builder:w,handler:async u=>{if(u.dryRun){o({command:`cf queues create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/queues`,pathParams:{},bodyKind:`json`,body:u.body===void 0?i({queue_name:c(u[`queue-name`],`queue-name`,`text`)}):r(u.body)});return}let f=await n(u),p=u.local?l:await e();if(u.accountId=p,u.body){let e=r(u.body);a(await s(`Creating`,async()=>f.queues.create({...e,account_id:p})),{successLabel:`Created`});return}u[`queue-name`]===void 0&&(u[`queue-name`]=await d(`queue-name`,`The queue_name field`));let m=i({queue_name:c(u[`queue-name`],`queue-name`,`text`)});a(await s(`Creating`,async()=>f.queues.create({...m,account_id:p})),{successLabel:`Created`})}};function E(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const D={command:`delete <queue-id>`,describe:`Deletes a queue`,builder:E,handler:async r=>{if(r.dryRun){o({command:`cf queues delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/queues/${r[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(r[`queue-id`]))}`,pathParams:{"queue-id":String(r[`queue-id`]??``)},bodyKind:`none`});return}let i=await n(r),c=r.local?l:await e();if(r.accountId=c,!await f({force:!!r.force})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}a(await s(`Deleting`,async()=>i.queues.delete({account_id:c,queue_id:r[`queue-id`]})),{successLabel:`Deleted`})}};function O(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-name`,{type:`string`,description:`The queue_name field`}).option(`settings-delivery-delay`,{type:`number`,description:`Number of seconds to delay delivery of all messages to consumers.`}).option(`settings-delivery-paused`,{type:`boolean`,description:`Indicates if message delivery to consumers is currently paused.`}).option(`settings-message-retention-period`,{type:`number`,description:`Number of seconds after which an unconsumed message will be delayed.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const k={command:`edit <queue-id>`,describe:`Updates a Queue.`,builder:O,handler:async u=>{if(u.dryRun){o({command:`cf queues edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/queues/${u[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(u[`queue-id`]))}`,pathParams:{"queue-id":String(u[`queue-id`]??``)},bodyKind:`json`,body:u.body===void 0?i({queue_name:c(u[`queue-name`],`queue-name`,`text`),settings:{delivery_delay:u[`settings-delivery-delay`],delivery_paused:u[`settings-delivery-paused`],message_retention_period:u[`settings-message-retention-period`]}}):r(u.body)});return}let d=await n(u),f=u.local?l:await e();if(u.accountId=f,u.body){let e=r(u.body);a(await s(`Updating`,async()=>d.queues.edit({body:e,account_id:f,queue_id:u[`queue-id`]})),{successLabel:`Updated`});return}let p=i({queue_name:c(u[`queue-name`],`queue-name`,`text`),settings:{delivery_delay:u[`settings-delivery-delay`],delivery_paused:u[`settings-delivery-paused`],message_retention_period:u[`settings-message-retention-period`]}});a(await s(`Updating`,async()=>d.queues.edit({body:p,account_id:f,queue_id:u[`queue-id`]})),{successLabel:`Updated`})}};function A(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`get <queue-id>`,describe:`Get details about a specific queue.`,builder:A,handler:async r=>{if(r.dryRun){o({command:`cf queues get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/queues/${r[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(r[`queue-id`]))}`,pathParams:{"queue-id":String(r[`queue-id`]??``)},bodyKind:`none`});return}let i=await n(r),c=r.local?l:await e();r.accountId=c,a(await s(`Loading`,async()=>i.queues.get({account_id:c,queue_id:r[`queue-id`]})),{successLabel:`Loaded`})}};function M(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`list`,describe:`Returns the queues owned by an account.`,builder:M,handler:async r=>{if(r.dryRun){o({command:`cf queues list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/queues`,pathParams:{},bodyKind:`none`});return}let i=await n(r),c=r.local?l:await e();r.accountId=c,a(await s(`Loading`,async()=>i.queues.list({account_id:c})),{successLabel:`Loaded`})}};function P(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const F={command:`ack-preview <queue-id>`,describe:`Delete previewed messages from a Queue. Note that messages acknowledged this way aren't considered delivered, they are instantly deleted from this queue and do not affect metrics.`,builder:P,handler:async i=>{if(i.dryRun){o({command:`cf queues messages ack-preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/queues/${i[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(i[`queue-id`]))}/messages/preview/ack`,pathParams:{"queue-id":String(i[`queue-id`]??``)},bodyKind:`json`,body:i.body===void 0?void 0:r(i.body)});return}let c=await n(i),u=i.local?l:await e();if(i.accountId=u,i.body){let e=r(i.body);a(await s(`Creating`,async()=>c.queues.messages.ackPreview({...e,account_id:u,queue_id:i[`queue-id`]})),{successLabel:`Created`});return}a(await s(`Creating`,async()=>c.queues.messages.ackPreview({account_id:u,queue_id:i[`queue-id`]})),{successLabel:`Created`})}};function I(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const L={command:`ack <queue-id>`,describe:`Acknowledge + Retry messages from a Queue`,builder:I,handler:async i=>{if(i.dryRun){o({command:`cf queues messages ack`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/queues/${i[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(i[`queue-id`]))}/messages/ack`,pathParams:{"queue-id":String(i[`queue-id`]??``)},bodyKind:`json`,body:i.body===void 0?void 0:r(i.body)});return}let c=await n(i),u=i.local?l:await e();if(i.accountId=u,i.body){let e=r(i.body);a(await s(`Creating`,async()=>c.queues.messages.ack({...e,account_id:u,queue_id:i[`queue-id`]})),{successLabel:`Created`});return}a(await s(`Creating`,async()=>c.queues.messages.ack({account_id:u,queue_id:i[`queue-id`]})),{successLabel:`Created`})}};function R(e){return e.option(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`delay-seconds`,{type:`number`,description:`The number of seconds to wait for attempting to deliver this batch to consumers`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const z={command:`bulk-push`,describe:`Push a batch of message to a Queue`,builder:R,handler:async c=>{if(c.dryRun){o({command:`cf queues messages bulk-push`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/queues/${c[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(c[`queue-id`]))}/messages/batch`,pathParams:{"queue-id":String(c[`queue-id`]??``)},bodyKind:`json`,body:c.body===void 0?i({delay_seconds:c[`delay-seconds`]}):r(c.body)});return}let u=await n(c),d=c.local?l:await e();if(c.accountId=d,c.body){let e=r(c.body);a(await s(`Creating`,async()=>u.queues.messages.bulkPush({...e,account_id:d,queue_id:c[`queue-id`]})),{successLabel:`Created`});return}let f=i({delay_seconds:c[`delay-seconds`]});a(await s(`Creating`,async()=>u.queues.messages.bulkPush({...f,account_id:d,queue_id:c[`queue-id`]})),{successLabel:`Created`})}};function te(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`preview <queue-id>`,describe:`Preview messages from a Queue without leasing them. Messages remain available for subsequent preview or pull operations.`,builder:te,handler:async c=>{if(c.dryRun){o({command:`cf queues messages preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/queues/${c[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(c[`queue-id`]))}/messages/preview`,pathParams:{"queue-id":String(c[`queue-id`]??``)},bodyKind:`json`,body:c.body===void 0?i({batch_size:c[`batch-size`]}):r(c.body)});return}let u=await n(c),d=c.local?l:await e();if(c.accountId=d,c.body){let e=r(c.body);a(await s(`Loading`,async()=>u.queues.messages.preview({...e,account_id:d,queue_id:c[`queue-id`]})),{successLabel:`Loaded`});return}let f=i({batch_size:c[`batch-size`]});a(await s(`Loading`,async()=>u.queues.messages.preview({...f,account_id:d,queue_id:c[`queue-id`]})),{successLabel:`Loaded`})}};function V(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`batch-size`,{type:`number`,description:`The maximum number of messages to include in a batch.`}).option(`visibility-timeout-ms`,{type:`number`,description:`The number of milliseconds that a message is exclusively leased. After the timeout, the message becomes available for another attempt.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const H={command:`pull <queue-id>`,describe:`Pull a batch of messages from a Queue`,builder:V,handler:async c=>{if(c.dryRun){o({command:`cf queues messages pull`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/queues/${c[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(c[`queue-id`]))}/messages/pull`,pathParams:{"queue-id":String(c[`queue-id`]??``)},bodyKind:`json`,body:c.body===void 0?i({batch_size:c[`batch-size`],visibility_timeout_ms:c[`visibility-timeout-ms`]}):r(c.body)});return}let u=await n(c),d=c.local?l:await e();if(c.accountId=d,c.body){let e=r(c.body);a(await s(`Creating`,async()=>u.queues.messages.pull({...e,account_id:d,queue_id:c[`queue-id`]})),{successLabel:`Created`});return}let f=i({batch_size:c[`batch-size`],visibility_timeout_ms:c[`visibility-timeout-ms`]});a(await s(`Creating`,async()=>u.queues.messages.pull({...f,account_id:d,queue_id:c[`queue-id`]})),{successLabel:`Created`})}};function U(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`delay-seconds`,{type:`number`,description:`The number of seconds to wait for attempting to deliver this message to consumers`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const W={command:`push <queue-id>`,describe:`Push a message to a Queue`,builder:U,handler:async c=>{if(c.dryRun){o({command:`cf queues messages push`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/queues/${c[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(c[`queue-id`]))}/messages`,pathParams:{"queue-id":String(c[`queue-id`]??``)},bodyKind:`json`,body:c.body===void 0?i({delay_seconds:c[`delay-seconds`]}):r(c.body)});return}let u=await n(c),d=c.local?l:await e();if(c.accountId=d,c.body){let e=r(c.body);a(await s(`Creating`,async()=>u.queues.messages.push({body:e,account_id:d,queue_id:c[`queue-id`]})),{successLabel:`Created`});return}let f=i({delay_seconds:c[`delay-seconds`]});a(await s(`Creating`,async()=>u.queues.messages.push({body:f,account_id:d,queue_id:c[`queue-id`]})),{successLabel:`Created`})}},G={command:`messages`,describe:`Operations for messages`,builder:e=>e.command(L).command(F).command(z).command(B).command(H).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`delete-messages-permanently`,{type:`boolean`,description:`Confimation that all messages will be deleted permanently.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const q={command:`start <queue-id>`,describe:`Deletes all messages from the Queue.`,builder:K,handler:async c=>{if(c.dryRun){o({command:`cf queues purge start`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/queues/${c[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(c[`queue-id`]))}/purge`,pathParams:{"queue-id":String(c[`queue-id`]??``)},bodyKind:`json`,body:c.body===void 0?i({delete_messages_permanently:c[`delete-messages-permanently`]}):r(c.body)});return}let u=await n(c),d=c.local?l:await e();if(c.accountId=d,!await f({force:!!c.force,message:`This operation drops every message in the queue.`})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}if(c.body){let e=r(c.body);a(await s(`Deleting`,async()=>u.queues.purge.start({...e,account_id:d,queue_id:c[`queue-id`]})),{successLabel:`Deleted`});return}let p=i({delete_messages_permanently:c[`delete-messages-permanently`]});a(await s(`Deleting`,async()=>u.queues.purge.start({...p,account_id:d,queue_id:c[`queue-id`]})),{successLabel:`Deleted`})}};function J(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`status <queue-id>`,describe:`Get details about a Queue's purge status.`,builder:J,handler:async r=>{if(r.dryRun){o({command:`cf queues purge status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/queues/${r[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(r[`queue-id`]))}/purge`,pathParams:{"queue-id":String(r[`queue-id`]??``)},bodyKind:`none`});return}let i=await n(r),c=r.local?l:await e();r.accountId=c,a(await s(`Loading`,async()=>i.queues.purge.status({account_id:c,queue_id:r[`queue-id`]})),{successLabel:`Loaded`})}},X={command:`purge`,describe:`Operations for purge`,builder:e=>e.command(q).command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Z(e){return e.option(`destination-queue-id`,{type:`string`,description:`ID of the target queue`}).option(`destination-type`,{type:`string`,description:`Type of destination`,choices:[`queues.queue`]}).option(`enabled`,{type:`boolean`,description:`Whether the subscription is active`}).option(`events`,{type:`string`,array:!0,description:`List of event types this subscription handles`}).option(`name`,{type:`string`,description:`Name of the subscription`}).option(`source-type`,{type:`string`,description:`Type of source`,choices:[`images`,`kv`,`r2`,`superSlurper`,`vectorize`,`workersAi.model`,`workersBuilds.worker`,`workflows.workflow`]}).option(`source-model-name`,{type:`string`,description:`Name of the Workers AI model`}).option(`source-worker-name`,{type:`string`,description:`Name of the worker`}).option(`source-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-workflow-name`]).conflicts(`source-worker-name`,[`source-model-name`,`source-workflow-name`]).conflicts(`source-workflow-name`,[`source-model-name`,`source-worker-name`]).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 Q={command:`create`,describe:`Create a new event subscription for a queue`,builder:Z,handler:async u=>{if(u.dryRun){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:u.body===void 0?i({destination:{queue_id:c(u[`destination-queue-id`],`destination-queue-id`,`text`),type:c(u[`destination-type`],`destination-type`,`text`)},enabled:u.enabled,events:u.events,name:c(u.name,`name`,`text`),source:{type:c(u[`source-type`],`source-type`,`text`),model_name:c(u[`source-model-name`],`source-model-name`,`text`),worker_name:c(u[`source-worker-name`],`source-worker-name`,`text`),workflow_name:c(u[`source-workflow-name`],`source-workflow-name`,`text`)}}):r(u.body)});return}let d=await n(u),f=u.local?l:await e();if(u.accountId=f,u.body){let e=r(u.body);a(await s(`Creating`,async()=>d.queues.subscriptions.create({...e,account_id:f})),{successLabel:`Created`});return}let p=i({destination:{queue_id:c(u[`destination-queue-id`],`destination-queue-id`,`text`),type:c(u[`destination-type`],`destination-type`,`text`)},enabled:u.enabled,events:u.events,name:c(u.name,`name`,`text`),source:{type:c(u[`source-type`],`source-type`,`text`),model_name:c(u[`source-model-name`],`source-model-name`,`text`),worker_name:c(u[`source-worker-name`],`source-worker-name`,`text`),workflow_name:c(u[`source-workflow-name`],`source-workflow-name`,`text`)}});a(await s(`Creating`,async()=>d.queues.subscriptions.create({...p,account_id:f})),{successLabel:`Created`})}};function ne(e){return e.positional(`subscription-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const re={command:`delete <subscription-id>`,describe:`Delete an existing event subscription`,builder:ne,handler:async r=>{if(r.dryRun){o({command:`cf queues subscriptions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/event_subscriptions/subscriptions/${r[`subscription-id`]==null?`<subscription-id>`:encodeURIComponent(String(r[`subscription-id`]))}`,pathParams:{"subscription-id":String(r[`subscription-id`]??``)},bodyKind:`none`});return}let i=await n(r),c=r.local?l:await e();if(r.accountId=c,!await f({force:!!r.force})){process.stderr.write(`Aborted.
|
|
6
|
-
`);return}a(await s(`Deleting`,async()=>i.queues.subscriptions.delete({account_id:c,subscription_id:r[`subscription-id`]})),{successLabel:`Deleted`})}};function ie(e){return e.positional(`subscription-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ae={command:`get <subscription-id>`,describe:`Get details about an existing event subscription`,builder:ie,handler:async r=>{if(r.dryRun){o({command:`cf queues subscriptions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/event_subscriptions/subscriptions/${r[`subscription-id`]==null?`<subscription-id>`:encodeURIComponent(String(r[`subscription-id`]))}`,pathParams:{"subscription-id":String(r[`subscription-id`]??``)},bodyKind:`none`});return}let i=await n(r),c=r.local?l:await e();r.accountId=c,a(await s(`Loading`,async()=>i.queues.subscriptions.get({account_id:c,subscription_id:r[`subscription-id`]})),{successLabel:`Loaded`})}};function oe(e){return e.option(`page`,{type:`number`,description:`Page number for pagination`}).option(`per-page`,{type:`number`,description:`Number of items per page`}).option(`order`,{type:`string`,description:`Field to sort by`,choices:[`created_at`,`name`,`enabled`,`source`]}).option(`direction`,{type:`string`,description:`Sort direction`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $={command:`list`,describe:`Get a paginated list of event subscriptions with optional sorting and filtering`,builder:p(oe),handler:async r=>{let i={page:r.page,per_page:r[`per-page`],order:r.order,direction:r.direction};if(r.dryRun){o({command:`cf queues subscriptions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/event_subscriptions/subscriptions`,pathParams:{},query:i,bodyKind:`none`});return}let c=await n(r),u=r.local?l:await e();r.accountId=u,a(await s(`Loading`,async()=>c.queues.subscriptions.list({account_id:u,...i})),{successLabel:`Loaded`})}};function se(e){return e.positional(`subscription-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`destination-queue-id`,{type:`string`,description:`ID of the target queue`}).option(`destination-type`,{type:`string`,description:`Type of destination`,choices:[`queues.queue`]}).option(`enabled`,{type:`boolean`,description:`Whether the subscription is active`}).option(`events`,{type:`string`,array:!0,description:`List of event types this subscription handles`}).option(`name`,{type:`string`,description:`Name of the subscription`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`destination-queue-id`,`destination-type`].some(t=>e[t]!==void 0)){let t=[`destination-queue-id`,`destination-type`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --destination-* flag is set`)}return!0})}const ce={command:`update <subscription-id>`,describe:`Update an existing event subscription`,builder:se,handler:async u=>{if(u.dryRun){o({command:`cf queues subscriptions update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/event_subscriptions/subscriptions/${u[`subscription-id`]==null?`<subscription-id>`:encodeURIComponent(String(u[`subscription-id`]))}`,pathParams:{"subscription-id":String(u[`subscription-id`]??``)},bodyKind:`json`,body:u.body===void 0?i({destination:{queue_id:c(u[`destination-queue-id`],`destination-queue-id`,`text`),type:c(u[`destination-type`],`destination-type`,`text`)},enabled:u.enabled,events:u.events,name:c(u.name,`name`,`text`)}):r(u.body)});return}let d=await n(u),f=u.local?l:await e();if(u.accountId=f,u.body){let e=r(u.body);a(await s(`Updating`,async()=>d.queues.subscriptions.update({...e,account_id:f,subscription_id:u[`subscription-id`]})),{successLabel:`Updated`});return}let p=i({destination:{queue_id:c(u[`destination-queue-id`],`destination-queue-id`,`text`),type:c(u[`destination-type`],`destination-type`,`text`)},enabled:u.enabled,events:u.events,name:c(u.name,`name`,`text`)});a(await s(`Updating`,async()=>d.queues.subscriptions.update({...p,account_id:f,subscription_id:u[`subscription-id`]})),{successLabel:`Updated`})}},le={command:`subscriptions`,describe:`Operations for subscriptions`,builder:e=>e.command(Q).command(re).command(ae).command($).command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ue(e){return e.positional(`queue-id`,{type:`string`,description:`A Resource identifier.`,demandOption:!0}).option(`queue-name`,{type:`string`,description:`The queue_name field`}).option(`settings-delivery-delay`,{type:`number`,description:`Number of seconds to delay delivery of all messages to consumers.`}).option(`settings-delivery-paused`,{type:`boolean`,description:`Indicates if message delivery to consumers is currently paused.`}).option(`settings-message-retention-period`,{type:`number`,description:`Number of seconds after which an unconsumed message will be delayed.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const de={command:`update <queue-id>`,describe:`Updates a Queue. Note that this endpoint does not support partial updates. If successful, the Queue's configuration is overwritten with the supplied configuration.`,builder:ue,handler:async u=>{if(u.dryRun){o({command:`cf queues update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/queues/${u[`queue-id`]==null?`<queue-id>`:encodeURIComponent(String(u[`queue-id`]))}`,pathParams:{"queue-id":String(u[`queue-id`]??``)},bodyKind:`json`,body:u.body===void 0?i({queue_name:c(u[`queue-name`],`queue-name`,`text`),settings:{delivery_delay:u[`settings-delivery-delay`],delivery_paused:u[`settings-delivery-paused`],message_retention_period:u[`settings-message-retention-period`]}}):r(u.body)});return}let d=await n(u),f=u.local?l:await e();if(u.accountId=f,u.body){let e=r(u.body);a(await s(`Updating`,async()=>d.queues.update({body:e,account_id:f,queue_id:u[`queue-id`]})),{successLabel:`Updated`});return}let p=i({queue_name:c(u[`queue-name`],`queue-name`,`text`),settings:{delivery_delay:u[`settings-delivery-delay`],delivery_paused:u[`settings-delivery-paused`],message_retention_period:u[`settings-message-retention-period`]}});a(await s(`Updating`,async()=>d.queues.update({body:p,account_id:f,queue_id:u[`queue-id`]})),{successLabel:`Updated`})}},fe={command:`queues`,describe:`Reliable message queuing between Workers — produce, consume, and batch-process messages at scale`,builder:e=>e.command(T).command(D).command(k).command(j).command(N).command(de).command(C).command(G).command(X).command(le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{fe as default};
|