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,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{n as e,t}from"./metadata-
|
|
2
|
+
import{n as e,t}from"./metadata-Cnyws6iO.mjs";import n from"node:assert";function r(e,t){return`#compdef ${e}
|
|
3
3
|
compdef _${e} ${e}
|
|
4
4
|
|
|
5
5
|
# zsh completion for ${e} -*- shell-script -*-
|
|
@@ -796,6 +796,6 @@ complete -k -c ${e} -n '__${n}_requires_order_preservation && __${n}_prepare_com
|
|
|
796
796
|
}
|
|
797
797
|
|
|
798
798
|
Register-ArgumentCompleter -CommandName '${e}' -ScriptBlock $__${n}CompleterBlock
|
|
799
|
-
`}const s={ShellCompDirectiveError:1,ShellCompDirectiveNoSpace:2,ShellCompDirectiveNoFileComp:4,ShellCompDirectiveFilterFileExt:8,ShellCompDirectiveFilterDirs:16,ShellCompDirectiveKeepOrder:32,shellCompDirectiveMaxValue:64,ShellCompDirectiveDefault:0};var c=class{name;variadic;command;handler;constructor(e,t,n,r=!1){this.command=e,this.name=t,this.handler=n,this.variadic=r}},l=class{value;description;command;handler;alias;isBoolean;constructor(e,t,n,r,i,a){this.command=e,this.value=t,this.description=n,this.handler=r,this.alias=i,this.isBoolean=a}},u=class{value;description;options=new Map;arguments=new Map;parent;constructor(e,t){this.value=e,this.description=t}option(e,t,n,r){let i,a,o;typeof n==`function`?(i=n,a=r,o=!1):typeof n==`string`?(i=void 0,a=n,o=!0):(i=void 0,a=void 0,o=!0);let s=new l(this,e,t,i,a,o);return this.options.set(e,s),this}argument(e,t,n=!1){let r=new c(this,e,t,n);return this.arguments.set(e,r),this}};const d=new class extends u{commands=new Map;completions=[];directive=s.ShellCompDirectiveDefault;constructor(){super(``,``)}command(e,t){let n=new u(e,t);return this.commands.set(e,n),n}stripOptions(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r.startsWith(`-`)){n++;let t=!1,i=this.findOption(this,r);if(i)t=i.isBoolean??!1;else for(let[,e]of this.commands){let n=this.findOption(e,r);if(n){t=n.isBoolean??!1;break}}!t&&n<e.length&&!e[n].startsWith(`-`)&&n++}else t.push(r),n++}return t}matchCommand(e){e=this.stripOptions(e);let t=[],n=[],r=null;for(let i=0;i<e.length;i++){let a=e[i];t.push(a);let o=this.commands.get(t.join(` `));if(o)r=o;else{n=e.slice(i,e.length);break}}return[r||this,n]}shouldCompleteFlags(e,t){if(t.startsWith(`-`))return!0;if(e?.startsWith(`-`)){let t=this.findOption(this,e);if(!t){for(let[,n]of this.commands)if(t=this.findOption(n,e),t)break}return!(t&&t.isBoolean)}return!1}shouldCompleteCommands(e){return!e.startsWith(`-`)}handleFlagCompletion(e,t,n,r){let i;if(n.includes(`=`)){let[e]=n.split(`=`);i=e}else if(r?.startsWith(`-`)){let t=this.findOption(e,r);t&&!t.isBoolean&&(i=r)}if(i){let t=this.findOption(e,i);if(t?.handler){let n=[];t.handler.call(t,(e,t)=>n.push({value:e,description:t}),e.options),this.completions=n}return}if(n.startsWith(`-`)){let t=n.startsWith(`-`)&&!n.startsWith(`--`),r=n.replace(/^-+/,``);for(let[i,a]of e.options)t&&a.alias&&`-${a.alias}`.startsWith(n)?this.completions.push({value:`-${a.alias}`,description:a.description}):!t&&i.startsWith(r)&&this.completions.push({value:`--${i}`,description:a.description})}}findOption(e,t){let n=e.options.get(t);if(n||(n=e.options.get(t.replace(/^-+/,``)),n))return n;for(let[n,r]of e.options)if(r.alias&&`-${r.alias}`===t)return r}handleCommandCompletion(e,t){let n=this.stripOptions(e);for(let[e,r]of this.commands){if(e===``)continue;let i=e.split(` `);i.slice(0,n.length).every((e,t)=>e===n[t])&&i[n.length]?.startsWith(t)&&this.completions.push({value:i[n.length],description:r.description})}}handlePositionalCompletion(e,t){let n=this.stripOptions(t),r=e.value.split(` `).length,i=Math.max(0,n.length-r),a=Array.from(e.arguments.entries());if(a.length>0){let t;if(i<a.length){let[e,n]=a[i];t=n}else{let e=a[a.length-1][1];e.variadic&&(t=e)}if(t&&t.handler&&typeof t.handler==`function`){let n=[];t.handler.call(t,(e,t)=>n.push({value:e,description:t}),e.options),this.completions.push(...n)}}}complete(e){this.directive=s.ShellCompDirectiveNoFileComp;let t=new Set;this.completions.filter(e=>t.has(e.value)?!1:(t.add(e.value),!0)).filter(t=>{if(e.includes(`=`)){let[,n]=e.split(`=`);return t.value.startsWith(n)}return t.value.startsWith(e)}).forEach(e=>console.log(`${e.value}\t${e.description??``}`)),console.log(`:${this.directive}`)}parse(e){this.completions=[];let t=e[e.length-1]===``;t&&e.pop();let n=e[e.length-1]||``,r=e.slice(0,-1);t&&(n!==``&&r.push(n),n=``);let[i]=this.matchCommand(r),a=r[r.length-1];this.shouldCompleteFlags(a,n)?this.handleFlagCompletion(i,r,n,a):(this.shouldCompleteCommands(n)&&this.handleCommandCompletion(r,n),i&&i.arguments.size>0&&this.handlePositionalCompletion(i,r)),this.complete(n)}setup(e,t,s){switch(n(s===`zsh`||s===`bash`||s===`fish`||s===`powershell`,`Unsupported shell`),s){case`zsh`:{let n=r(e,t);console.log(n);break}case`bash`:{let n=i(e,t);console.log(n);break}case`fish`:{let n=a(e,t);console.log(n);break}case`powershell`:{let n=o(e,t);console.log(n);break}}}},f={"":[`auth`,`complete`,`
|
|
799
|
+
`}const s={ShellCompDirectiveError:1,ShellCompDirectiveNoSpace:2,ShellCompDirectiveNoFileComp:4,ShellCompDirectiveFilterFileExt:8,ShellCompDirectiveFilterDirs:16,ShellCompDirectiveKeepOrder:32,shellCompDirectiveMaxValue:64,ShellCompDirectiveDefault:0};var c=class{name;variadic;command;handler;constructor(e,t,n,r=!1){this.command=e,this.name=t,this.handler=n,this.variadic=r}},l=class{value;description;command;handler;alias;isBoolean;constructor(e,t,n,r,i,a){this.command=e,this.value=t,this.description=n,this.handler=r,this.alias=i,this.isBoolean=a}},u=class{value;description;options=new Map;arguments=new Map;parent;constructor(e,t){this.value=e,this.description=t}option(e,t,n,r){let i,a,o;typeof n==`function`?(i=n,a=r,o=!1):typeof n==`string`?(i=void 0,a=n,o=!0):(i=void 0,a=void 0,o=!0);let s=new l(this,e,t,i,a,o);return this.options.set(e,s),this}argument(e,t,n=!1){let r=new c(this,e,t,n);return this.arguments.set(e,r),this}};const d=new class extends u{commands=new Map;completions=[];directive=s.ShellCompDirectiveDefault;constructor(){super(``,``)}command(e,t){let n=new u(e,t);return this.commands.set(e,n),n}stripOptions(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r.startsWith(`-`)){n++;let t=!1,i=this.findOption(this,r);if(i)t=i.isBoolean??!1;else for(let[,e]of this.commands){let n=this.findOption(e,r);if(n){t=n.isBoolean??!1;break}}!t&&n<e.length&&!e[n].startsWith(`-`)&&n++}else t.push(r),n++}return t}matchCommand(e){e=this.stripOptions(e);let t=[],n=[],r=null;for(let i=0;i<e.length;i++){let a=e[i];t.push(a);let o=this.commands.get(t.join(` `));if(o)r=o;else{n=e.slice(i,e.length);break}}return[r||this,n]}shouldCompleteFlags(e,t){if(t.startsWith(`-`))return!0;if(e?.startsWith(`-`)){let t=this.findOption(this,e);if(!t){for(let[,n]of this.commands)if(t=this.findOption(n,e),t)break}return!(t&&t.isBoolean)}return!1}shouldCompleteCommands(e){return!e.startsWith(`-`)}handleFlagCompletion(e,t,n,r){let i;if(n.includes(`=`)){let[e]=n.split(`=`);i=e}else if(r?.startsWith(`-`)){let t=this.findOption(e,r);t&&!t.isBoolean&&(i=r)}if(i){let t=this.findOption(e,i);if(t?.handler){let n=[];t.handler.call(t,(e,t)=>n.push({value:e,description:t}),e.options),this.completions=n}return}if(n.startsWith(`-`)){let t=n.startsWith(`-`)&&!n.startsWith(`--`),r=n.replace(/^-+/,``);for(let[i,a]of e.options)t&&a.alias&&`-${a.alias}`.startsWith(n)?this.completions.push({value:`-${a.alias}`,description:a.description}):!t&&i.startsWith(r)&&this.completions.push({value:`--${i}`,description:a.description})}}findOption(e,t){let n=e.options.get(t);if(n||(n=e.options.get(t.replace(/^-+/,``)),n))return n;for(let[n,r]of e.options)if(r.alias&&`-${r.alias}`===t)return r}handleCommandCompletion(e,t){let n=this.stripOptions(e);for(let[e,r]of this.commands){if(e===``)continue;let i=e.split(` `);i.slice(0,n.length).every((e,t)=>e===n[t])&&i[n.length]?.startsWith(t)&&this.completions.push({value:i[n.length],description:r.description})}}handlePositionalCompletion(e,t){let n=this.stripOptions(t),r=e.value.split(` `).length,i=Math.max(0,n.length-r),a=Array.from(e.arguments.entries());if(a.length>0){let t;if(i<a.length){let[e,n]=a[i];t=n}else{let e=a[a.length-1][1];e.variadic&&(t=e)}if(t&&t.handler&&typeof t.handler==`function`){let n=[];t.handler.call(t,(e,t)=>n.push({value:e,description:t}),e.options),this.completions.push(...n)}}}complete(e){this.directive=s.ShellCompDirectiveNoFileComp;let t=new Set;this.completions.filter(e=>t.has(e.value)?!1:(t.add(e.value),!0)).filter(t=>{if(e.includes(`=`)){let[,n]=e.split(`=`);return t.value.startsWith(n)}return t.value.startsWith(e)}).forEach(e=>console.log(`${e.value}\t${e.description??``}`)),console.log(`:${this.directive}`)}parse(e){this.completions=[];let t=e[e.length-1]===``;t&&e.pop();let n=e[e.length-1]||``,r=e.slice(0,-1);t&&(n!==``&&r.push(n),n=``);let[i]=this.matchCommand(r),a=r[r.length-1];this.shouldCompleteFlags(a,n)?this.handleFlagCompletion(i,r,n,a):(this.shouldCompleteCommands(n)&&this.handleCommandCompletion(r,n),i&&i.arguments.size>0&&this.handlePositionalCompletion(i,r)),this.complete(n)}setup(e,t,s){switch(n(s===`zsh`||s===`bash`||s===`fish`||s===`powershell`,`Unsupported shell`),s){case`zsh`:{let n=r(e,t);console.log(n);break}case`bash`:{let n=i(e,t);console.log(n);break}case`fish`:{let n=a(e,t);console.log(n);break}case`powershell`:{let n=o(e,t);console.log(n);break}}}},f={"":[`auth`,`complete`,`dev`,`schema`,`agent-context`],auth:[`login`,`logout`,`whoami`,`create`,`delete`,`activate`,`deactivate`,`list`]},p=[{name:`quiet`,alias:`q`,desc:`Suppress non-essential output`},{name:`zone`,alias:`z`,desc:`Zone ID or domain name`},{name:`profile`,desc:`Use a specific auth profile`},{name:`local`,desc:`Route to a local wrangler dev / cf dev Miniflare session`},{name:`local-endpoint`,desc:`Local Miniflare endpoint URL (required with --local)`},{name:`help`,alias:`h`,desc:`Show help`},{name:`version`,alias:`v`,desc:`Show version`}];function m(){return e(import.meta.url,`commands.json`,t)?.commands??[]}function h(){for(let e of p)d.option(e.name,e.desc),e.alias&&d.option(e.alias,`Alias for --${e.name}`);let e=new Set;function t(t){let n=t.join(` `);e.has(n)||(e.add(n),d.command(n,``))}for(let[e,n]of Object.entries(f)){let r=e?e.split(` `):[];for(let e of n)t([...r,e])}let n=m();for(let t of n){if(t.hideCommand)continue;for(let n=1;n<t.fullPath.length;n++){let r=t.fullPath.slice(0,n).join(` `);e.has(r)||(e.add(r),d.command(r,``))}let n=t.fullPath.join(` `);e.add(n);let r=d.command(n,t.description??``);for(let e of t.options??[])e.enum&&e.enum.length>0?r.option(e.name,e.description??``,t=>{for(let n of e.enum??[])t(n,n)}):r.option(e.name,e.description??``)}}const g={command:`complete [shell]`,describe:`Generate and handle shell completions`,builder:e=>e.positional(`shell`,{type:`string`,choices:[`bash`,`zsh`,`fish`,`powershell`],description:`Shell type to generate completions for`}).example(`cf complete bash >> ~/.bashrc`,`Install bash completions (then restart your shell)`).example(`cf complete zsh >> ~/.zshrc`,`Install zsh completions (then restart your shell)`).example(`cf complete fish > ~/.config/fish/completions/cf.fish`,`Install fish completions`),handler:e=>{let t=(e._??[]).map(String),n=t.slice(+(t[0]===`complete`));if(n.length>0){h(),d.parse(n);return}if(!e.shell){process.stderr.write(`Usage: cf complete <bash|zsh|fish|powershell>
|
|
800
800
|
cf complete bash >> ~/.bashrc
|
|
801
801
|
`),process.exitCode=1;return}h(),d.setup(`cf`,`cf`,e.shell)}};export{g as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{n}from"./auth-CZ0E51rF.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-O88q63Bk.mjs";import{t as o}from"./local-C6TLPAT6.mjs";import{n as s,t as c}from"./body-parser-BO6mfo_W.mjs";import{n as l}from"./input-validation-BwUR9z8e.mjs";import{n as u,r as d,t as f}from"./prompt-DTAWiEm2.mjs";import{t as p}from"./cli-types-CFw6Xygp.mjs";function m(e){return e.option(`host-ipv4`,{type:`string`,description:`The host.ipv4 field`}).option(`host-network-tunnel-id`,{type:`string`,description:`The host.network.tunnel_id field`}).option(`host-ipv6`,{type:`string`,description:`The host.ipv6 field`}).option(`host-hostname`,{type:`string`,description:`The host.hostname field`}).option(`host-resolver-network-resolver-ips`,{type:`string`,array:!0,description:`The host.resolver_network.resolver_ips field`}).option(`host-resolver-network-tunnel-id`,{type:`string`,description:`The host.resolver_network.tunnel_id field`}).option(`name`,{type:`string`,description:`The name field`}).option(`tls-settings-cert-verification-mode`,{type:`string`,description:'TLS certificate verification mode for the connection to the origin.\n\n- `"verify_full"` — verify certificate chain and hostname (default)\n- `"verify_ca"` — verify certificate chain only, skip hostname check\n- `"disabled"` — do not verify the server certificate at all',choices:[`verify_full`,`verify_ca`,`disabled`]}).option(`type`,{type:`string`,description:`The type field`,choices:[`tcp`,`http`]}).option(`http-port`,{type:`number`,description:`The http_port field`}).option(`https-port`,{type:`number`,description:`The https_port field`}).option(`app-protocol`,{type:`string`,description:`The app_protocol field`,choices:[`postgresql`,`mysql`]}).option(`tcp-port`,{type:`number`,description:`The tcp_port 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)`}).conflicts(`host-ipv4`,[`host-ipv6`,`host-hostname`,`host-resolver-network-resolver-ips`]).conflicts(`host-ipv6`,[`host-ipv4`,`host-hostname`,`host-resolver-network-resolver-ips`]).conflicts(`host-hostname`,[`host-ipv4`,`host-ipv6`]).conflicts(`host-resolver-network-resolver-ips`,[`host-ipv4`,`host-ipv6`]).conflicts(`http-port`,[`app-protocol`,`tcp-port`]).conflicts(`https-port`,[`app-protocol`,`tcp-port`]).conflicts(`app-protocol`,[`http-port`,`https-port`]).conflicts(`tcp-port`,[`http-port`,`https-port`]).check(e=>{if([`host-ipv4`,`host-network-tunnel-id`,`host-ipv6`,`host-hostname`,`host-resolver-network-resolver-ips`,`host-resolver-network-tunnel-id`].some(t=>e[t]!==void 0)){let t=[`host-network-tunnel-id`,`host-resolver-network-tunnel-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 --host-* flag is set`)}return!0})}const h={command:`create`,describe:`Creates a new Workers VPC connectivity service in the account.`,builder:m,handler:async f=>{if(f.dryRun){i({command:`cf connectivity directory services create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/connectivity/directory/services`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({host:{ipv4:l(f[`host-ipv4`],`host-ipv4`,`text`),network:{tunnel_id:l(f[`host-network-tunnel-id`],`host-network-tunnel-id`,`text`)},ipv6:l(f[`host-ipv6`],`host-ipv6`,`text`),hostname:l(f[`host-hostname`],`host-hostname`,`text`),resolver_network:{resolver_ips:f[`host-resolver-network-resolver-ips`],tunnel_id:l(f[`host-resolver-network-tunnel-id`],`host-resolver-network-tunnel-id`,`text`)}},name:l(f.name,`name`,`text`),tls_settings:{cert_verification_mode:l(f[`tls-settings-cert-verification-mode`],`tls-settings-cert-verification-mode`,`text`)},type:l(f.type,`type`,`text`),http_port:f[`http-port`],https_port:f[`https-port`],app_protocol:l(f[`app-protocol`],`app-protocol`,`text`),tcp_port:f[`tcp-port`]}):s(f.body)});return}let p=await n(f),m=f.local?o:await t();if(f.accountId=m,f.body){let e=s(f.body);r(await a(`Creating`,async()=>p.connectivity.directory.services.create({body:e,account_id:m})),{successLabel:`Created`});return}f.name===void 0&&(f.name=await d(`name`,`The name field`)),f.type===void 0&&(f.type=await u(`type`,`The type field`,[`tcp`,`http`]));let h=c({host:{ipv4:l(f[`host-ipv4`],`host-ipv4`,`text`),network:{tunnel_id:l(f[`host-network-tunnel-id`],`host-network-tunnel-id`,`text`)},ipv6:l(f[`host-ipv6`],`host-ipv6`,`text`),hostname:l(f[`host-hostname`],`host-hostname`,`text`),resolver_network:{resolver_ips:f[`host-resolver-network-resolver-ips`],tunnel_id:l(f[`host-resolver-network-tunnel-id`],`host-resolver-network-tunnel-id`,`text`)}},name:l(f.name,`name`,`text`),tls_settings:{cert_verification_mode:l(f[`tls-settings-cert-verification-mode`],`tls-settings-cert-verification-mode`,`text`)},type:l(f.type,`type`,`text`),http_port:f[`http-port`],https_port:f[`https-port`],app_protocol:l(f[`app-protocol`],`app-protocol`,`text`),tcp_port:f[`tcp-port`]});r(await a(`Creating`,async()=>p.connectivity.directory.services.create({body:h,account_id:m})),{successLabel:`Created`})}};function g(e){return e.positional(`service-id`,{type:`string`,description:`Service ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <service-id>`,describe:`Removes a single Workers VPC connectivity service by its ID.`,builder:g,handler:async s=>{if(s.dryRun){i({command:`cf connectivity directory services delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/connectivity/directory/services/${s[`service-id`]==null?`<service-id>`:encodeURIComponent(String(s[`service-id`]))}`,pathParams:{"service-id":String(s[`service-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();if(s.accountId=l,!await f({force:!!s.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}r(await a(`Deleting`,async()=>c.connectivity.directory.services.delete({account_id:l,service_id:s[`service-id`]})),{successLabel:`Deleted`})}};function v(e){return e.positional(`service-id`,{type:`string`,description:`Service ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <service-id>`,describe:`Fetches a single Workers VPC connectivity service by its ID.`,builder:v,handler:async s=>{if(s.dryRun){i({command:`cf connectivity directory services get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/connectivity/directory/services/${s[`service-id`]==null?`<service-id>`:encodeURIComponent(String(s[`service-id`]))}`,pathParams:{"service-id":String(s[`service-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.connectivity.directory.services.get({account_id:l,service_id:s[`service-id`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`type`,{type:`string`,description:`Type`,choices:[`tcp`,`http`]}).option(`page`,{type:`number`,description:`Current page in the response`}).option(`per-page`,{type:`number`,description:`Max amount of entries returned per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Lists the Workers VPC connectivity services in the account.`,builder:p(b),handler:async s=>{let c={type:s.type,page:s.page,per_page:s[`per-page`]};if(s.dryRun){i({command:`cf connectivity directory services list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/connectivity/directory/services`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();s.accountId=u,r(await a(`Loading`,async()=>l.connectivity.directory.services.list({account_id:u,...c})),{successLabel:`Loaded`})}};function S(e){return e.positional(`service-id`,{type:`string`,description:`Service ID`,demandOption:!0}).option(`host-ipv4`,{type:`string`,description:`The host.ipv4 field`}).option(`host-network-tunnel-id`,{type:`string`,description:`The host.network.tunnel_id field`}).option(`host-ipv6`,{type:`string`,description:`The host.ipv6 field`}).option(`host-hostname`,{type:`string`,description:`The host.hostname field`}).option(`host-resolver-network-resolver-ips`,{type:`string`,array:!0,description:`The host.resolver_network.resolver_ips field`}).option(`host-resolver-network-tunnel-id`,{type:`string`,description:`The host.resolver_network.tunnel_id field`}).option(`name`,{type:`string`,description:`The name field`}).option(`tls-settings-cert-verification-mode`,{type:`string`,description:'TLS certificate verification mode for the connection to the origin.\n\n- `"verify_full"` — verify certificate chain and hostname (default)\n- `"verify_ca"` — verify certificate chain only, skip hostname check\n- `"disabled"` — do not verify the server certificate at all',choices:[`verify_full`,`verify_ca`,`disabled`]}).option(`type`,{type:`string`,description:`The type field`,choices:[`tcp`,`http`]}).option(`http-port`,{type:`number`,description:`The http_port field`}).option(`https-port`,{type:`number`,description:`The https_port field`}).option(`app-protocol`,{type:`string`,description:`The app_protocol field`,choices:[`postgresql`,`mysql`]}).option(`tcp-port`,{type:`number`,description:`The tcp_port 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)`}).conflicts(`host-ipv4`,[`host-ipv6`,`host-hostname`,`host-resolver-network-resolver-ips`]).conflicts(`host-ipv6`,[`host-ipv4`,`host-hostname`,`host-resolver-network-resolver-ips`]).conflicts(`host-hostname`,[`host-ipv4`,`host-ipv6`]).conflicts(`host-resolver-network-resolver-ips`,[`host-ipv4`,`host-ipv6`]).conflicts(`http-port`,[`app-protocol`,`tcp-port`]).conflicts(`https-port`,[`app-protocol`,`tcp-port`]).conflicts(`app-protocol`,[`http-port`,`https-port`]).conflicts(`tcp-port`,[`http-port`,`https-port`]).check(e=>{if([`host-ipv4`,`host-network-tunnel-id`,`host-ipv6`,`host-hostname`,`host-resolver-network-resolver-ips`,`host-resolver-network-tunnel-id`].some(t=>e[t]!==void 0)){let t=[`host-network-tunnel-id`,`host-resolver-network-tunnel-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 --host-* flag is set`)}return!0})}const C={command:`update <service-id>`,describe:`Updates an existing Workers VPC connectivity service by its ID.`,builder:S,handler:async u=>{if(u.dryRun){i({command:`cf connectivity directory services update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/connectivity/directory/services/${u[`service-id`]==null?`<service-id>`:encodeURIComponent(String(u[`service-id`]))}`,pathParams:{"service-id":String(u[`service-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({host:{ipv4:l(u[`host-ipv4`],`host-ipv4`,`text`),network:{tunnel_id:l(u[`host-network-tunnel-id`],`host-network-tunnel-id`,`text`)},ipv6:l(u[`host-ipv6`],`host-ipv6`,`text`),hostname:l(u[`host-hostname`],`host-hostname`,`text`),resolver_network:{resolver_ips:u[`host-resolver-network-resolver-ips`],tunnel_id:l(u[`host-resolver-network-tunnel-id`],`host-resolver-network-tunnel-id`,`text`)}},name:l(u.name,`name`,`text`),tls_settings:{cert_verification_mode:l(u[`tls-settings-cert-verification-mode`],`tls-settings-cert-verification-mode`,`text`)},type:l(u.type,`type`,`text`),http_port:u[`http-port`],https_port:u[`https-port`],app_protocol:l(u[`app-protocol`],`app-protocol`,`text`),tcp_port:u[`tcp-port`]}):s(u.body)});return}let d=await n(u),f=u.local?o:await t();if(u.accountId=f,u.body){let e=s(u.body);r(await a(`Updating`,async()=>d.connectivity.directory.services.update({body:e,account_id:f,service_id:u[`service-id`]})),{successLabel:`Updated`});return}let p=c({host:{ipv4:l(u[`host-ipv4`],`host-ipv4`,`text`),network:{tunnel_id:l(u[`host-network-tunnel-id`],`host-network-tunnel-id`,`text`)},ipv6:l(u[`host-ipv6`],`host-ipv6`,`text`),hostname:l(u[`host-hostname`],`host-hostname`,`text`),resolver_network:{resolver_ips:u[`host-resolver-network-resolver-ips`],tunnel_id:l(u[`host-resolver-network-tunnel-id`],`host-resolver-network-tunnel-id`,`text`)}},name:l(u.name,`name`,`text`),tls_settings:{cert_verification_mode:l(u[`tls-settings-cert-verification-mode`],`tls-settings-cert-verification-mode`,`text`)},type:l(u.type,`type`,`text`),http_port:u[`http-port`],https_port:u[`https-port`],app_protocol:l(u[`app-protocol`],`app-protocol`,`text`),tcp_port:u[`tcp-port`]});r(await a(`Updating`,async()=>d.connectivity.directory.services.update({body:p,account_id:f,service_id:u[`service-id`]})),{successLabel:`Updated`})}},w={command:`services`,describe:`Connectivity service entries that define available network endpoints and their properties`,builder:e=>e.command(h).command(_).command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},T={command:`directory`,describe:`Operations for directory`,builder:e=>e.command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},E={command:`connectivity`,describe:`Service directory for network connectivity endpoints and their configurations`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{E as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{n}from"./auth-CZ0E51rF.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-O88q63Bk.mjs";import{t as o}from"./local-C6TLPAT6.mjs";import{n as s,t as c}from"./body-parser-BO6mfo_W.mjs";function l(e){return e.positional(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`reboot-purge`,{type:`boolean`,description:`Purge connector state.`,default:!1}).option(`restart-purge`,{type:`boolean`,description:`Purge connector state.`,default:!1}).option(`shutdown-purge`,{type:`boolean`,description:`Purge connector state.`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Interrupt action for a connector.`})}const u={command:`create <connector-id>`,describe:`Creates an interrupt for a Magic WAN Connector.`,builder:l,handler:async l=>{if(l.dryRun){i({command:`cf connector-interrupts create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors/${l[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(l[`connector-id`]))}/interrupts`,pathParams:{"connector-id":String(l[`connector-id`]??``)},bodyKind:`json`,body:l.body===void 0?c({reboot:{purge:l[`reboot-purge`]},restart:{purge:l[`restart-purge`]},shutdown:{purge:l[`shutdown-purge`]}}):s(l.body)});return}let u=await n(l),d=l.local?o:await t();if(l.accountId=d,l.body){let e=s(l.body);r(await a(`Creating`,async()=>u.connectorInterrupts.create({...e,account_id:d,connector_id:l[`connector-id`]})),{successLabel:`Created`});return}let f=c({reboot:{purge:l[`reboot-purge`]},restart:{purge:l[`restart-purge`]},shutdown:{purge:l[`shutdown-purge`]}});r(await a(`Creating`,async()=>u.connectorInterrupts.create({...f,account_id:d,connector_id:l[`connector-id`]})),{successLabel:`Created`})}};function d(e){return e.option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`list`,describe:`Lists interrupts for a Magic WAN Connector.`,builder:d,handler:async s=>{if(s.dryRun){i({command:`cf connector-interrupts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/interrupts`,pathParams:{"connector-id":String(s[`connector-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.connectorInterrupts.list({account_id:l,connector_id:s[`connector-id`]})),{successLabel:`Loaded`})}},p={command:`connector-interrupts`,describe:`connector-interrupts`,builder:e=>e.command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{n}from"./auth-CZ0E51rF.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-O88q63Bk.mjs";import{t as o}from"./local-C6TLPAT6.mjs";import{t as s}from"./cli-types-CFw6Xygp.mjs";function c(e){return e.positional(`event-n`,{type:`string`,description:`Event n`,demandOption:!0}).option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`event-t`,{type:`string`,description:`Event t`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const l={command:`get <event-n>`,describe:`Gets Magic WAN Connector Telemetry Event`,builder:s(c),handler:async s=>{if(s.dryRun){i({command:`cf connector-telemetry-events get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/telemetry/events/${s[`event-t`]==null?`<event-t>`:encodeURIComponent(String(s[`event-t`]))}.${s[`event-n`]==null?`<event-n>`:encodeURIComponent(String(s[`event-n`]))}`,pathParams:{"connector-id":String(s[`connector-id`]??``),"event-t":String(s[`event-t`]??``),"event-n":String(s[`event-n`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.connectorTelemetryEvents.get({account_id:l,connector_id:s[`connector-id`],event_t:s[`event-t`],event_n:s[`event-n`]})),{successLabel:`Loaded`})}};function u(e){return e.option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`from`,{type:`number`,description:`From`,demandOption:!0}).option(`to`,{type:`number`,description:`To`,demandOption:!0}).option(`limit`,{type:`number`,description:`Limit`}).option(`cursor`,{type:`string`,description:`Cursor`}).option(`k`,{type:`string`,description:`Filter by event kind`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`list`,describe:`Lists Magic WAN Connector Telemetry Events`,builder:u,handler:async s=>{let c={from:s.from,to:s.to,limit:s.limit,cursor:s.cursor,k:s.k};if(s.dryRun){i({command:`cf connector-telemetry-events list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/telemetry/events`,pathParams:{"connector-id":String(s[`connector-id`]??``)},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();s.accountId=u,r(await a(`Loading`,async()=>l.connectorTelemetryEvents.list({account_id:u,connector_id:s[`connector-id`],...c})),{successLabel:`Loaded`})}},f={command:`connector-telemetry-events`,describe:`connector-telemetry-events`,builder:e=>e.command(l).command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{f as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{n}from"./auth-CZ0E51rF.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-O88q63Bk.mjs";import{t as o}from"./local-C6TLPAT6.mjs";import{t as s}from"./cli-types-CFw6Xygp.mjs";function c(e){return e.positional(`snapshot-t`,{type:`string`,description:`Snapshot t`,demandOption:!0}).option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const l={command:`get <snapshot-t>`,describe:`Gets Magic WAN Connector Telemetry Snapshot`,builder:s(c),handler:async s=>{if(s.dryRun){i({command:`cf connector-telemetry-snapshots get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/telemetry/snapshots/${s[`snapshot-t`]==null?`<snapshot-t>`:encodeURIComponent(String(s[`snapshot-t`]))}`,pathParams:{"connector-id":String(s[`connector-id`]??``),"snapshot-t":String(s[`snapshot-t`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.connectorTelemetrySnapshots.get({account_id:l,connector_id:s[`connector-id`],snapshot_t:s[`snapshot-t`]})),{successLabel:`Loaded`})}};function u(e){return e.option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`from`,{type:`number`,description:`From`,demandOption:!0}).option(`to`,{type:`number`,description:`To`,demandOption:!0}).option(`limit`,{type:`number`,description:`Limit`}).option(`cursor`,{type:`string`,description:`Cursor`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`list`,describe:`Lists Magic WAN Connector Telemetry Snapshots`,builder:u,handler:async s=>{let c={from:s.from,to:s.to,limit:s.limit,cursor:s.cursor};if(s.dryRun){i({command:`cf connector-telemetry-snapshots list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/telemetry/snapshots`,pathParams:{"connector-id":String(s[`connector-id`]??``)},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();s.accountId=u,r(await a(`Loading`,async()=>l.connectorTelemetrySnapshots.list({account_id:u,connector_id:s[`connector-id`],...c})),{successLabel:`Loaded`})}},f={command:`connector-telemetry-snapshots`,describe:`connector-telemetry-snapshots`,builder:e=>e.command(l).command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{f as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{n}from"./auth-CZ0E51rF.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-O88q63Bk.mjs";import{t as o}from"./local-C6TLPAT6.mjs";import{n as s,t as c}from"./body-parser-BO6mfo_W.mjs";import{n as l}from"./input-validation-BwUR9z8e.mjs";import{t as u}from"./prompt-DTAWiEm2.mjs";import{t as d}from"./cli-types-CFw6Xygp.mjs";function f(e){return e.option(`device-id`,{type:`string`,description:`The device.id field`}).option(`device-provision-license`,{type:`boolean`,description:`When true, create and provision a new licence key for the connector.`}).option(`device-serial-number`,{type:`string`,description:`The device.serial_number field`}).option(`activated`,{type:`boolean`,description:`The activated field`}).option(`interrupt-window-days-of-week`,{type:`string`,array:!0,description:`Allowed days of the week for upgrades. Default is all days.`}).option(`interrupt-window-duration-hours`,{type:`number`,description:`The interrupt_window_duration_hours field`}).option(`interrupt-window-embargo-dates`,{type:`string`,array:!0,description:`List of dates (YYYY-MM-DD) when upgrades are blocked.`}).option(`interrupt-window-hour-of-day`,{type:`number`,description:`The interrupt_window_hour_of_day field`}).option(`notes`,{type:`string`,description:`The notes field`}).option(`primary`,{type:`boolean`,description:`The primary field`,default:!0}).option(`site-id`,{type:`string`,description:`The site_id field`}).option(`timezone`,{type:`string`,description:`The timezone 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 p={command:`create`,describe:`Creates a Magic WAN Connector.`,builder:f,handler:async u=>{if(u.dryRun){i({command:`cf connectors create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({device:{id:l(u[`device-id`],`device-id`,`text`),provision_license:u[`device-provision-license`],serial_number:l(u[`device-serial-number`],`device-serial-number`,`text`)},activated:u.activated,interrupt_window_days_of_week:u[`interrupt-window-days-of-week`],interrupt_window_duration_hours:u[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:u[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:u[`interrupt-window-hour-of-day`],notes:l(u.notes,`notes`,`text`),primary:u.primary,site_id:l(u[`site-id`],`site-id`,`text`),timezone:l(u.timezone,`timezone`,`text`)}):s(u.body)});return}let d=await n(u),f=u.local?o:await t();if(u.accountId=f,u.body){let e=s(u.body);r(await a(`Creating`,async()=>d.connectors.create({...e,account_id:f})),{successLabel:`Created`});return}let p=c({device:{id:l(u[`device-id`],`device-id`,`text`),provision_license:u[`device-provision-license`],serial_number:l(u[`device-serial-number`],`device-serial-number`,`text`)},activated:u.activated,interrupt_window_days_of_week:u[`interrupt-window-days-of-week`],interrupt_window_duration_hours:u[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:u[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:u[`interrupt-window-hour-of-day`],notes:l(u.notes,`notes`,`text`),primary:u.primary,site_id:l(u[`site-id`],`site-id`,`text`),timezone:l(u.timezone,`timezone`,`text`)});r(await a(`Creating`,async()=>d.connectors.create({...p,account_id:f})),{successLabel:`Created`})}};function m(e){return e.positional(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const h={command:`delete <connector-id>`,describe:`Deletes a Magic WAN Connector.`,builder:m,handler:async s=>{if(s.dryRun){i({command:`cf connectors delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}`,pathParams:{"connector-id":String(s[`connector-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();if(s.accountId=l,!await u({force:!!s.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}r(await a(`Deleting`,async()=>c.connectors.delete({account_id:l,connector_id:s[`connector-id`]})),{successLabel:`Deleted`})}};function g(e){return e.positional(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`activated`,{type:`boolean`,description:`The activated field`}).option(`interrupt-window-days-of-week`,{type:`string`,array:!0,description:`Allowed days of the week for upgrades. Default is all days.`}).option(`interrupt-window-duration-hours`,{type:`number`,description:`The interrupt_window_duration_hours field`}).option(`interrupt-window-embargo-dates`,{type:`string`,array:!0,description:`List of dates (YYYY-MM-DD) when upgrades are blocked.`}).option(`interrupt-window-hour-of-day`,{type:`number`,description:`The interrupt_window_hour_of_day field`}).option(`notes`,{type:`string`,description:`The notes field`}).option(`primary`,{type:`boolean`,description:`The primary field`}).option(`site-id`,{type:`string`,description:`The site_id field`}).option(`timezone`,{type:`string`,description:`The timezone field`}).option(`provision-license`,{type:`boolean`,description:`When true, regenerate license key for the connector.`}).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 _={command:`edit <connector-id>`,describe:`Edits properties of a Magic WAN Connector. May be used to re-provision a license key.`,builder:g,handler:async u=>{if(u.dryRun){i({command:`cf connectors edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors/${u[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(u[`connector-id`]))}`,pathParams:{"connector-id":String(u[`connector-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({activated:u.activated,interrupt_window_days_of_week:u[`interrupt-window-days-of-week`],interrupt_window_duration_hours:u[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:u[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:u[`interrupt-window-hour-of-day`],notes:l(u.notes,`notes`,`text`),primary:u.primary,site_id:l(u[`site-id`],`site-id`,`text`),timezone:l(u.timezone,`timezone`,`text`),provision_license:u[`provision-license`]}):s(u.body)});return}let d=await n(u),f=u.local?o:await t();if(u.accountId=f,u.body){let e=s(u.body);r(await a(`Updating`,async()=>d.connectors.edit({...e,account_id:f,connector_id:u[`connector-id`]})),{successLabel:`Updated`});return}let p=c({activated:u.activated,interrupt_window_days_of_week:u[`interrupt-window-days-of-week`],interrupt_window_duration_hours:u[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:u[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:u[`interrupt-window-hour-of-day`],notes:l(u.notes,`notes`,`text`),primary:u.primary,site_id:l(u[`site-id`],`site-id`,`text`),timezone:l(u.timezone,`timezone`,`text`),provision_license:u[`provision-license`]});r(await a(`Updating`,async()=>d.connectors.edit({...p,account_id:f,connector_id:u[`connector-id`]})),{successLabel:`Updated`})}};function v(e){return e.positional(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <connector-id>`,describe:`Gets a Magic WAN Connector.`,builder:v,handler:async s=>{if(s.dryRun){i({command:`cf connectors get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}`,pathParams:{"connector-id":String(s[`connector-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.connectors.get({account_id:l,connector_id:s[`connector-id`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`device-type`,{type:`string`,description:`Filter connectors by device type.`,choices:[`MANAGED`,`LICENSED`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Lists Magic WAN Connectors.`,builder:d(b),handler:async s=>{let c={device_type:s[`device-type`]};if(s.dryRun){i({command:`cf connectors list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t();s.accountId=u,r(await a(`Loading`,async()=>l.connectors.list({account_id:u,...c})),{successLabel:`Loaded`})}};function S(e){return e.positional(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`activated`,{type:`boolean`,description:`The activated field`}).option(`interrupt-window-days-of-week`,{type:`string`,array:!0,description:`Allowed days of the week for upgrades. Default is all days.`}).option(`interrupt-window-duration-hours`,{type:`number`,description:`The interrupt_window_duration_hours field`}).option(`interrupt-window-embargo-dates`,{type:`string`,array:!0,description:`List of dates (YYYY-MM-DD) when upgrades are blocked.`}).option(`interrupt-window-hour-of-day`,{type:`number`,description:`The interrupt_window_hour_of_day field`}).option(`notes`,{type:`string`,description:`The notes field`}).option(`primary`,{type:`boolean`,description:`The primary field`}).option(`site-id`,{type:`string`,description:`The site_id field`}).option(`timezone`,{type:`string`,description:`The timezone field`}).option(`provision-license`,{type:`boolean`,description:`When true, regenerate license key for the connector.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`update <connector-id>`,describe:`Updates properties of a Magic WAN Connector. May be used to re-provision a license key.`,builder:S,handler:async u=>{if(u.dryRun){i({command:`cf connectors update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/magic/connectors/${u[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(u[`connector-id`]))}`,pathParams:{"connector-id":String(u[`connector-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({activated:u.activated,interrupt_window_days_of_week:u[`interrupt-window-days-of-week`],interrupt_window_duration_hours:u[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:u[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:u[`interrupt-window-hour-of-day`],notes:l(u.notes,`notes`,`text`),primary:u.primary,site_id:l(u[`site-id`],`site-id`,`text`),timezone:l(u.timezone,`timezone`,`text`),provision_license:u[`provision-license`]}):s(u.body)});return}let d=await n(u),f=u.local?o:await t();if(u.accountId=f,u.body){let e=s(u.body);r(await a(`Updating`,async()=>d.connectors.update({...e,account_id:f,connector_id:u[`connector-id`]})),{successLabel:`Updated`});return}let p=c({activated:u.activated,interrupt_window_days_of_week:u[`interrupt-window-days-of-week`],interrupt_window_duration_hours:u[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:u[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:u[`interrupt-window-hour-of-day`],notes:l(u.notes,`notes`,`text`),primary:u.primary,site_id:l(u[`site-id`],`site-id`,`text`),timezone:l(u.timezone,`timezone`,`text`),provision_license:u[`provision-license`]});r(await a(`Updating`,async()=>d.connectors.update({...p,account_id:f,connector_id:u[`connector-id`]})),{successLabel:`Updated`})}},w={command:`connectors`,describe:`connectors`,builder:e=>e.command(p).command(h).command(_).command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{D as e}from"./oauth-DBJ5GSFk.mjs";import{n as t}from"./auth-CZ0E51rF.mjs";import{t as n}from"./output-B6fBFRqe.mjs";import{n as r,t as i}from"./progress-O88q63Bk.mjs";import{n as a,t as o}from"./body-parser-BO6mfo_W.mjs";import{n as s}from"./input-validation-BwUR9z8e.mjs";import{n as c,t as l}from"./prompt-DTAWiEm2.mjs";function u(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const d={command:`disable`,describe:`Disable Content Scanning.`,builder:u,handler:async a=>{if(a.dryRun){r({command:`cf content-scanning disable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/content-upload-scan/disable`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await l({force:!!a.force,message:`This operation turns off WAF content scanning for a zone.`})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}n(await i(`Deleting`,async()=>o.contentScanning.disable({zone_id:s})),{successLabel:`Deleted`})}};function f(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`enable`,describe:`Enable Content Scanning.`,builder:f,handler:async a=>{if(a.dryRun){r({command:`cf content-scanning enable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/content-upload-scan/enable`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Creating`,async()=>o.contentScanning.enable({zone_id:s})),{successLabel:`Created`})}};function m(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Array of custom scan expressions to add.`})}const h={command:`create`,describe:`Add custom scan expressions for Content Scanning.`,builder:m,handler:async o=>{if(o.dryRun){r({command:`cf content-scanning payloads create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/content-upload-scan/payloads`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`json`,body:o.body===void 0?void 0:a(o.body)});return}let s=await t(o),c=await e({zone:o.zone},s,{quiet:o.quiet});if(o.zoneId=c,o.body){let e=a(o.body);n(await i(`Creating`,async()=>s.contentScanning.payloads.create({body:e,zone_id:c})),{successLabel:`Created`});return}if(o.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function g(e){return e.positional(`expression-id`,{type:`string`,description:`defines the unique ID for this custom scan expression.`,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 <expression-id>`,describe:`Delete a Content Scan Custom Expression.`,builder:g,handler:async a=>{if(a.dryRun){r({command:`cf content-scanning payloads delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/content-upload-scan/payloads/${a[`expression-id`]==null?`<expression-id>`:encodeURIComponent(String(a[`expression-id`]))}`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``),"expression-id":String(a[`expression-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await l({force:!!a.force})){process.stderr.write(`Aborted.
|
|
4
|
+
`);return}n(await i(`Deleting`,async()=>o.contentScanning.payloads.delete({zone_id:s,expression_id:a[`expression-id`]})),{successLabel:`Deleted`})}};function v(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`list`,describe:`Get a list of existing custom scan expressions for Content Scanning.`,builder:v,handler:async a=>{if(a.dryRun){r({command:`cf content-scanning payloads list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/content-upload-scan/payloads`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.contentScanning.payloads.list({zone_id:s})),{successLabel:`Loaded`})}},b={command:`payloads`,describe:`Operations for payloads`,builder:e=>e.command(h).command(_).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get`,describe:`Retrieve the current status of Content Scanning.`,builder:x,handler:async a=>{if(a.dryRun){r({command:`cf content-scanning settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/content-upload-scan/settings`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.contentScanning.settings.get({zone_id:s})),{successLabel:`Loaded`})}},C={command:`settings`,describe:`Operations for settings`,builder:e=>e.command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`value`,{type:`string`,description:`The status value for Content Scanning.`,choices:[`enabled`,`disabled`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Content Scanning settings to update.`})}const T={command:`update`,describe:`Update the Content Scanning status.`,builder:w,handler:async l=>{if(l.dryRun){r({command:`cf content-scanning update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/content-upload-scan/settings`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({value:s(l.value,`value`,`text`)}):a(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=a(l.body);n(await i(`Updating`,async()=>u.contentScanning.update({...e,zone_id:d})),{successLabel:`Updated`});return}l.value===void 0&&(l.value=await c(`value`,`The status value for Content Scanning.`,[`enabled`,`disabled`]));let f=o({value:s(l.value,`value`,`text`)});n(await i(`Updating`,async()=>u.contentScanning.update({...f,zone_id:d})),{successLabel:`Updated`})}},E={command:`content-scanning`,describe:`content-scanning`,builder:e=>e.command(d).command(p).command(T).command(b).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{E as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{D as e}from"./oauth-DBJ5GSFk.mjs";import{n as t}from"./auth-CZ0E51rF.mjs";import{t as n}from"./output-B6fBFRqe.mjs";import{n as r,t as i}from"./progress-O88q63Bk.mjs";import{n as a,t as o}from"./body-parser-BO6mfo_W.mjs";function s(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`get`,describe:`Retrieve the Certificate Transparency alerting subscription settings for a zone. Returns whether CT monitoring is enabled and the list of email addresses that receive alerts, if any have been configured.`,builder:s,handler:async a=>{if(a.dryRun){r({command:`cf ct-alerting get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/ct/alerting`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.ctAlerting.get({zone_id:s})),{successLabel:`Loaded`})}};function l(e){return e.option(`emails`,{type:`string`,array:!0,description:`Email addresses that receive CT alert notifications for the zone. A maximum of 100 addresses may be configured. Each address must be a valid RFC 5322 email address and must not contain a comma.
|
|
3
|
+
`}).option(`enabled`,{type:`boolean`,description:`Whether CT alerting is enabled for the zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for updating CT alerting subscription settings.`})}const u={command:`update`,describe:"Create or update the Certificate Transparency alerting subscription for a zone. Enables or disables email notifications when certificates are issued for the zone's domains. The `enabled` field is required on every request and controls whether the subscription is active. The `emails` field is optional and, when provided, replaces the stored recipient list for the zone. When `emails` is omitted, the stored recipient list is preserved and only the enabled state is toggled. A maximum of 100 email addresses may be configured per zone. Requests that omit `enabled` are rejected with error code 1008. Subscribe and unsubscribe notification emails are only sent for recipients whose effective subscription state changes. Idempotent requests (no state change) send no notification email.",builder:l,handler:async s=>{if(s.dryRun){r({command:`cf ct-alerting update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/ct/alerting`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?o({emails:s.emails,enabled:s.enabled}):a(s.body)});return}let c=await t(s),l=await e({zone:s.zone},c,{quiet:s.quiet});if(s.zoneId=l,s.body){let e=a(s.body);n(await i(`Updating`,async()=>c.ctAlerting.update({...e,zone_id:l})),{successLabel:`Updated`});return}if(s.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=o({emails:s.emails,enabled:s.enabled});n(await i(`Updating`,async()=>c.ctAlerting.update({...u,zone_id:l})),{successLabel:`Updated`})}},d={command:`ct-alerting`,describe:`ct-alerting`,builder:e=>e.command(c).command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{d as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{
|
|
3
|
-
Note: The API accepts this field as either "policy" or "policy_restrictions" in requests. Responses return this field as "policy_restrictions".`}).option(`private-key`,{type:`string`,description:`The zone's private key. Not required if custom_csr_id is provided, in which case the private key is retrieved from the CSR record held by Cloudflare.`}).option(`type`,{type:`string`,description:`The type 'legacy_custom' enables support for legacy clients which do not include SNI in the TLS handshake.`,choices:[`legacy_custom`,`sni_custom`],default:`legacy_custom`}).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 p={command:`create`,describe:`Upload a new SSL certificate for a zone.`,builder:f,handler:async t=>{if(t.dryRun){
|
|
4
|
-
`);return}
|
|
5
|
-
Note: The API accepts this field as either "policy" or "policy_restrictions" in requests. Responses return this field as "policy_restrictions".`}).option(`private-key`,{type:`string`,description:`The zone's private key. Not required if custom_csr_id is provided, in which case the private key is retrieved from the CSR record held by Cloudflare.`}).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 _={command:`edit <custom-certificate-id>`,describe:`Upload a new private key and/or PEM/CRT for the SSL certificate. Note: PATCHing a configuration for sni_custom certificates will result in a new resource id being returned, and the previous one being deleted.`,builder:g,handler:async t=>{if(t.dryRun){
|
|
2
|
+
import{D as e}from"./oauth-DBJ5GSFk.mjs";import{i as t,n}from"./auth-CZ0E51rF.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-O88q63Bk.mjs";import{n as o,t as s}from"./body-parser-BO6mfo_W.mjs";import{n as c}from"./input-validation-BwUR9z8e.mjs";import{r as l,t as u}from"./prompt-DTAWiEm2.mjs";import{t as d}from"./cli-types-CFw6Xygp.mjs";function f(e){return e.option(`bundle-method`,{type:`string`,description:`A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.`,choices:[`ubiquitous`,`optimal`,`force`],default:`ubiquitous`}).option(`certificate`,{type:`string`,description:`The zone's SSL certificate or certificate and the intermediate(s).`}).option(`custom-csr-id`,{type:`string`,description:`The identifier for the Custom CSR that was used.`}).option(`deploy`,{type:`string`,description:`The environment to deploy the certificate to, defaults to production.`,choices:[`staging`,`production`],default:`production`}).option(`geo-restrictions-label`,{type:`string`,description:`The geo_restrictions.label field`,choices:[`us`,`eu`,`highest_security`]}).option(`policy`,{type:`string`,description:`Specify the policy that determines the region where your private key will be held locally. HTTPS connections to any excluded data center will still be fully encrypted, but will incur some latency while Keyless SSL is used to complete the handshake with the nearest allowed data center. Any combination of countries, specified by their two letter country code (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) can be chosen, such as 'country: IN', as well as 'region: EU' which refers to the EU region. If there are too few data centers satisfying the policy, it will be rejected.
|
|
3
|
+
Note: The API accepts this field as either "policy" or "policy_restrictions" in requests. Responses return this field as "policy_restrictions".`}).option(`private-key`,{type:`string`,description:`The zone's private key. Not required if custom_csr_id is provided, in which case the private key is retrieved from the CSR record held by Cloudflare.`}).option(`type`,{type:`string`,description:`The type 'legacy_custom' enables support for legacy clients which do not include SNI in the TLS handshake.`,choices:[`legacy_custom`,`sni_custom`],default:`legacy_custom`}).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 p={command:`create`,describe:`Upload a new SSL certificate for a zone.`,builder:f,handler:async t=>{if(t.dryRun){i({command:`cf custom-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_certificates`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({bundle_method:c(t[`bundle-method`],`bundle-method`,`text`),certificate:c(t.certificate,`certificate`,`text`),custom_csr_id:c(t[`custom-csr-id`],`custom-csr-id`,`text`),deploy:c(t.deploy,`deploy`,`text`),geo_restrictions:{label:c(t[`geo-restrictions-label`],`geo-restrictions-label`,`text`)},policy:c(t.policy,`policy`,`text`),private_key:c(t[`private-key`],`private-key`,`text`),type:c(t.type,`type`,`text`)}):o(t.body)});return}let u=await n(t),d=await e({zone:t.zone},u,{quiet:t.quiet});if(t.zoneId=d,t.body){let e=o(t.body);r(await a(`Creating`,async()=>u.customCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}t.certificate===void 0&&(t.certificate=await l(`certificate`,`The zone's SSL certificate or certificate and the intermediate(s).`));let f=s({bundle_method:c(t[`bundle-method`],`bundle-method`,`text`),certificate:c(t.certificate,`certificate`,`text`),custom_csr_id:c(t[`custom-csr-id`],`custom-csr-id`,`text`),deploy:c(t.deploy,`deploy`,`text`),geo_restrictions:{label:c(t[`geo-restrictions-label`],`geo-restrictions-label`,`text`)},policy:c(t.policy,`policy`,`text`),private_key:c(t[`private-key`],`private-key`,`text`),type:c(t.type,`type`,`text`)});r(await a(`Creating`,async()=>u.customCertificates.create({...f,zone_id:d})),{successLabel:`Created`})}};function m(e){return e.positional(`custom-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 h={command:`delete <custom-certificate-id>`,describe:`Remove a SSL certificate from a zone.`,builder:m,handler:async t=>{if(t.dryRun){i({command:`cf custom-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_certificates/${t[`custom-certificate-id`]==null?`<custom-certificate-id>`:encodeURIComponent(String(t[`custom-certificate-id`]))}`,pathParams:{"custom-certificate-id":String(t[`custom-certificate-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});if(t.zoneId=s,!await u({force:!!t.force})){process.stderr.write(`Aborted.
|
|
4
|
+
`);return}r(await a(`Deleting`,async()=>o.customCertificates.delete({zone_id:s,custom_certificate_id:t[`custom-certificate-id`]})),{successLabel:`Deleted`})}};function g(e){return e.positional(`custom-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`bundle-method`,{type:`string`,description:`A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.`,choices:[`ubiquitous`,`optimal`,`force`]}).option(`certificate`,{type:`string`,description:`The zone's SSL certificate or certificate and the intermediate(s).`}).option(`custom-csr-id`,{type:`string`,description:`The identifier for the Custom CSR that was used.`}).option(`deploy`,{type:`string`,description:`The environment to deploy the certificate to, defaults to production.`,choices:[`staging`,`production`]}).option(`geo-restrictions-label`,{type:`string`,description:`The geo_restrictions.label field`,choices:[`us`,`eu`,`highest_security`]}).option(`policy`,{type:`string`,description:`Specify the policy that determines the region where your private key will be held locally. HTTPS connections to any excluded data center will still be fully encrypted, but will incur some latency while Keyless SSL is used to complete the handshake with the nearest allowed data center. Any combination of countries, specified by their two letter country code (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) can be chosen, such as 'country: IN', as well as 'region: EU' which refers to the EU region. If there are too few data centers satisfying the policy, it will be rejected.
|
|
5
|
+
Note: The API accepts this field as either "policy" or "policy_restrictions" in requests. Responses return this field as "policy_restrictions".`}).option(`private-key`,{type:`string`,description:`The zone's private key. Not required if custom_csr_id is provided, in which case the private key is retrieved from the CSR record held by Cloudflare.`}).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 _={command:`edit <custom-certificate-id>`,describe:`Upload a new private key and/or PEM/CRT for the SSL certificate. Note: PATCHing a configuration for sni_custom certificates will result in a new resource id being returned, and the previous one being deleted.`,builder:g,handler:async t=>{if(t.dryRun){i({command:`cf custom-certificates edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_certificates/${t[`custom-certificate-id`]==null?`<custom-certificate-id>`:encodeURIComponent(String(t[`custom-certificate-id`]))}`,pathParams:{"custom-certificate-id":String(t[`custom-certificate-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({bundle_method:c(t[`bundle-method`],`bundle-method`,`text`),certificate:c(t.certificate,`certificate`,`text`),custom_csr_id:c(t[`custom-csr-id`],`custom-csr-id`,`text`),deploy:c(t.deploy,`deploy`,`text`),geo_restrictions:{label:c(t[`geo-restrictions-label`],`geo-restrictions-label`,`text`)},policy:c(t.policy,`policy`,`text`),private_key:c(t[`private-key`],`private-key`,`text`)}):o(t.body)});return}let l=await n(t),u=await e({zone:t.zone},l,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=o(t.body);r(await a(`Updating`,async()=>l.customCertificates.edit({...e,zone_id:u,custom_certificate_id:t[`custom-certificate-id`]})),{successLabel:`Updated`});return}let d=s({bundle_method:c(t[`bundle-method`],`bundle-method`,`text`),certificate:c(t.certificate,`certificate`,`text`),custom_csr_id:c(t[`custom-csr-id`],`custom-csr-id`,`text`),deploy:c(t.deploy,`deploy`,`text`),geo_restrictions:{label:c(t[`geo-restrictions-label`],`geo-restrictions-label`,`text`)},policy:c(t.policy,`policy`,`text`),private_key:c(t[`private-key`],`private-key`,`text`)});r(await a(`Updating`,async()=>l.customCertificates.edit({...d,zone_id:u,custom_certificate_id:t[`custom-certificate-id`]})),{successLabel:`Updated`})}};function v(e){return e.positional(`custom-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 y={command:`get <custom-certificate-id>`,describe:`Retrieves details for a specific custom SSL certificate, including certificate metadata, bundle method, geographic restrictions, and associated keyless server configuration.`,builder:v,handler:async t=>{if(t.dryRun){i({command:`cf custom-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_certificates/${t[`custom-certificate-id`]==null?`<custom-certificate-id>`:encodeURIComponent(String(t[`custom-certificate-id`]))}`,pathParams:{"custom-certificate-id":String(t[`custom-certificate-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.customCertificates.get({zone_id:s,custom_certificate_id:t[`custom-certificate-id`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of zones per page.`}).option(`match`,{type:`string`,description:`Whether to match all search requirements or at least one (any).`,choices:[`any`,`all`]}).option(`status`,{type:`string`,description:`Status of the zone's custom SSL.`,choices:[`active`,`expired`,`deleted`,`pending`,`initializing`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`List, search, and filter all of your custom SSL certificates. The higher priority will break ties across overlapping 'legacy_custom' certificates, but 'legacy_custom' certificates will always supercede 'sni_custom' certificates.`,builder:d(b),handler:async t=>{let o={page:t.page,per_page:t[`per-page`],match:t.match,status:t.status};if(t.dryRun){i({command:`cf custom-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_certificates`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await n(t),c=await e({zone:t.zone},s,{quiet:t.quiet});t.zoneId=c,r(await a(`Loading`,async()=>s.customCertificates.list({zone_id:c,...o})),{successLabel:`Loaded`})}};function S(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`update`,describe:`If a zone has multiple SSL certificates, you can set the order in which they should be used during a request. The higher priority will break ties across overlapping 'legacy_custom' certificates.`,builder:S,handler:async s=>{if(s.dryRun){i({command:`cf custom-certificates prioritize update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/custom_certificates/prioritize`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?void 0:o(s.body)});return}let c=await n(s),l=await e({zone:s.zone},c,{quiet:s.quiet});if(s.zoneId=l,s.body){let e=o(s.body);r(await a(`Updating`,async()=>c.customCertificates.prioritize.update({...e,zone_id:l})),{successLabel:`Updated`});return}r(await a(`Updating`,async()=>t(c,`PUT`,`/zones/${s.zoneId}/custom_certificates/prioritize`)),{successLabel:`Updated`})}},w={command:`prioritize`,describe:`Operations for prioritize`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},T={command:`custom-certificates`,describe:`Upload and manage your own SSL/TLS certificates for a zone, with priority ordering`,builder:e=>e.command(p).command(h).command(_).command(y).command(x).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{T as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{D as e,O as t,w as n}from"./oauth-DBJ5GSFk.mjs";import{n as r}from"./auth-CZ0E51rF.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-O88q63Bk.mjs";import{t as s}from"./local-C6TLPAT6.mjs";import{n as c,t as l}from"./body-parser-BO6mfo_W.mjs";import{n as u}from"./input-validation-BwUR9z8e.mjs";import{r as d,t as f}from"./prompt-DTAWiEm2.mjs";import{t as p}from"./cli-types-CFw6Xygp.mjs";function m(e){return e.option(`common-name`,{type:`string`,description:`The common name (domain) for the CSR. Must be at most 64 characters.`}).option(`country`,{type:`string`,description:`Two-letter ISO 3166-1 alpha-2 country code.`}).option(`description`,{type:`string`,description:`Optional description for the CSR.`}).option(`key-type`,{type:`string`,description:`Key algorithm to use for the CSR. Defaults to rsa2048 if not specified.`,choices:[`rsa2048`,`p256v1`],default:`rsa2048`}).option(`locality`,{type:`string`,description:`City or locality name.`}).option(`name`,{type:`string`,description:`Human-readable name for the CSR.`}).option(`organization`,{type:`string`,description:`Organization name.`}).option(`organizational-unit`,{type:`string`,description:`Organizational unit name.`}).option(`sans`,{type:`string`,array:!0,description:`Subject Alternative Names for the CSR. At least one SAN is required.`}).option(`state`,{type:`string`,description:`State or province name.`}).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 a custom CSR.`})}const h={command:`customCsrsForAnAccountCreateCustomCsr`,describe:`Generate a new custom Certificate Signing Request (CSR) for an account. Cloudflare generates and securely stores the private key associated with the CSR.`,builder:m,handler:async e=>{if(e.dryRun){a({command:`cf custom-csrs customCsrsForAnAccountCreateCustomCsr`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/custom_csrs`,pathParams:{},bodyKind:`json`,body:e.body===void 0?l({common_name:u(e[`common-name`],`common-name`,`text`),country:u(e.country,`country`,`text`),description:u(e.description,`description`,`text`),key_type:u(e[`key-type`],`key-type`,`text`),locality:u(e.locality,`locality`,`text`),name:u(e.name,`name`,`text`),organization:u(e.organization,`organization`,`text`),organizational_unit:u(e[`organizational-unit`],`organizational-unit`,`text`),sans:e.sans,state:u(e.state,`state`,`text`)}):c(e.body)});return}let f=await r(e),p=e.local?s:await n();if(e.accountId=p,e.body){let t=c(e.body);i(await o(`Creating`,async()=>f.customCsrs.customCsrsForAnAccountCreateCustomCsr({...t,account_id:p})),{successLabel:`Created`});return}if(e[`common-name`]===void 0&&(e[`common-name`]=await d(`common-name`,`The common name (domain) for the CSR. Must be at most 64 characters.`)),e.country===void 0&&(e.country=await d(`country`,`Two-letter ISO 3166-1 alpha-2 country code.`)),e.locality===void 0&&(e.locality=await d(`locality`,`City or locality name.`)),e.organization===void 0&&(e.organization=await d(`organization`,`Organization name.`)),e.sans===void 0)throw Error(`--sans is required (or pass --body with this field set).`);e.state===void 0&&(e.state=await d(`state`,`State or province name.`));let m=l({common_name:u(e[`common-name`],`common-name`,`text`),country:u(e.country,`country`,`text`),description:u(e.description,`description`,`text`),key_type:u(e[`key-type`],`key-type`,`text`),locality:u(e.locality,`locality`,`text`),name:u(e.name,`name`,`text`),organization:u(e.organization,`organization`,`text`),organizational_unit:u(e[`organizational-unit`],`organizational-unit`,`text`),sans:e.sans,state:u(e.state,`state`,`text`)});i(await o(`Creating`,async()=>f.customCsrs.customCsrsForAnAccountCreateCustomCsr({...m,account_id:p})),{successLabel:`Created`})}};function g(e){return e.positional(`custom-csr-id`,{type:`string`,description:`Custom CSR identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`customCsrsForAnAccountCustomCsrDetails <custom-csr-id>`,describe:`Retrieve details for a specific custom Certificate Signing Request (CSR).`,builder:g,handler:async e=>{if(e.dryRun){a({command:`cf custom-csrs customCsrsForAnAccountCustomCsrDetails`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/custom_csrs/${e[`custom-csr-id`]==null?`<custom-csr-id>`:encodeURIComponent(String(e[`custom-csr-id`]))}`,pathParams:{"custom-csr-id":String(e[`custom-csr-id`]??``)},bodyKind:`none`});return}let c=await r(e),l=e.local?s:await n();e.accountId=l,i(await o(`Loading`,async()=>c.customCsrs.customCsrsForAnAccountCustomCsrDetails({account_id:l,custom_csr_id:e[`custom-csr-id`]})),{successLabel:`Loaded`})}};function v(e){return e.positional(`custom-csr-id`,{type:`string`,description:`Custom CSR identifier tag.`,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:`customCsrsForAnAccountDeleteCustomCsr <custom-csr-id>`,describe:`Delete a custom Certificate Signing Request (CSR) and its associated private key.`,builder:v,handler:async e=>{if(e.dryRun){a({command:`cf custom-csrs customCsrsForAnAccountDeleteCustomCsr`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/custom_csrs/${e[`custom-csr-id`]==null?`<custom-csr-id>`:encodeURIComponent(String(e[`custom-csr-id`]))}`,pathParams:{"custom-csr-id":String(e[`custom-csr-id`]??``)},bodyKind:`none`});return}let c=await r(e),l=e.local?s:await n();if(e.accountId=l,!await f({force:!!e.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}i(await o(`Deleting`,async()=>c.customCsrs.customCsrsForAnAccountDeleteCustomCsr({account_id:l,custom_csr_id:e[`custom-csr-id`]})),{successLabel:`Deleted`})}};function b(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of custom CSRs per page.`}).option(`order`,{type:`string`,description:`The field to sort the returned custom CSRs by.`,choices:[`name`,`account_tag`,`created_at`]}).option(`direction`,{type:`string`,description:`The direction to sort by.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`customCsrsForAnAccountListCustomCsrs`,describe:`List all custom Certificate Signing Requests (CSRs) for an account.`,builder:p(b),handler:async e=>{let c={page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction};if(e.dryRun){a({command:`cf custom-csrs customCsrsForAnAccountListCustomCsrs`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/custom_csrs`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(e),u=e.local?s:await n();e.accountId=u,i(await o(`Loading`,async()=>l.customCsrs.customCsrsForAnAccountListCustomCsrs({account_id:u,...c})),{successLabel:`Loaded`})}};function S(e){return e.option(`common-name`,{type:`string`,description:`The common name (domain) for the CSR. Must be at most 64 characters.`}).option(`country`,{type:`string`,description:`Two-letter ISO 3166-1 alpha-2 country code.`}).option(`key-type`,{type:`string`,description:`Key algorithm to use for the CSR. Defaults to rsa2048 if not specified.`,choices:[`rsa2048`,`p256v1`],default:`rsa2048`}).option(`locality`,{type:`string`,description:`City or locality name.`}).option(`organization`,{type:`string`,description:`Organization name.`}).option(`organizational-unit`,{type:`string`,description:`Organizational unit name.`}).option(`sans`,{type:`string`,array:!0,description:`Subject Alternative Names for the CSR. At least one SAN is required. The list should include the common name.`}).option(`state`,{type:`string`,description:`State or province name.`}).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 a custom CSR.`})}const C={command:`customCsrsForAZoneCreateCustomCsr`,describe:`Generate a new custom Certificate Signing Request (CSR) for a zone. Cloudflare generates and securely stores the private key associated with the CSR. The CSR can then be provided to a Certificate Authority for signing. Once signed, the certificate is uploaded via the Custom SSL endpoint using the CSR ID.`,builder:S,handler:async t=>{if(t.dryRun){a({command:`cf custom-csrs customCsrsForAZoneCreateCustomCsr`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_csrs`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?l({common_name:u(t[`common-name`],`common-name`,`text`),country:u(t.country,`country`,`text`),key_type:u(t[`key-type`],`key-type`,`text`),locality:u(t.locality,`locality`,`text`),organization:u(t.organization,`organization`,`text`),organizational_unit:u(t[`organizational-unit`],`organizational-unit`,`text`),sans:t.sans,state:u(t.state,`state`,`text`)}):c(t.body)});return}let n=await r(t),s=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=s,t.body){let e=c(t.body);i(await o(`Creating`,async()=>n.customCsrs.customCsrsForAZoneCreateCustomCsr({...e,zone_id:s})),{successLabel:`Created`});return}if(t[`common-name`]===void 0&&(t[`common-name`]=await d(`common-name`,`The common name (domain) for the CSR. Must be at most 64 characters.`)),t.country===void 0&&(t.country=await d(`country`,`Two-letter ISO 3166-1 alpha-2 country code.`)),t.locality===void 0&&(t.locality=await d(`locality`,`City or locality name.`)),t.organization===void 0&&(t.organization=await d(`organization`,`Organization name.`)),t.sans===void 0)throw Error(`--sans is required (or pass --body with this field set).`);t.state===void 0&&(t.state=await d(`state`,`State or province name.`));let f=l({common_name:u(t[`common-name`],`common-name`,`text`),country:u(t.country,`country`,`text`),key_type:u(t[`key-type`],`key-type`,`text`),locality:u(t.locality,`locality`,`text`),organization:u(t.organization,`organization`,`text`),organizational_unit:u(t[`organizational-unit`],`organizational-unit`,`text`),sans:t.sans,state:u(t.state,`state`,`text`)});i(await o(`Creating`,async()=>n.customCsrs.customCsrsForAZoneCreateCustomCsr({...f,zone_id:s})),{successLabel:`Created`})}};function w(e){return e.positional(`custom-csr-id`,{type:`string`,description:`Custom CSR identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`customCsrsForAZoneCustomCsrDetails <custom-csr-id>`,describe:`Retrieve details for a specific custom Certificate Signing Request (CSR).`,builder:w,handler:async t=>{if(t.dryRun){a({command:`cf custom-csrs customCsrsForAZoneCustomCsrDetails`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_csrs/${t[`custom-csr-id`]==null?`<custom-csr-id>`:encodeURIComponent(String(t[`custom-csr-id`]))}`,pathParams:{"custom-csr-id":String(t[`custom-csr-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(t),s=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=s,i(await o(`Loading`,async()=>n.customCsrs.customCsrsForAZoneCustomCsrDetails({zone_id:s,custom_csr_id:t[`custom-csr-id`]})),{successLabel:`Loaded`})}};function E(e){return e.positional(`custom-csr-id`,{type:`string`,description:`Custom CSR identifier tag.`,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:`customCsrsForAZoneDeleteCustomCsr <custom-csr-id>`,describe:`Delete a custom Certificate Signing Request (CSR) and its associated private key. A CSR cannot be deleted if any custom certificates still reference it.`,builder:E,handler:async t=>{if(t.dryRun){a({command:`cf custom-csrs customCsrsForAZoneDeleteCustomCsr`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_csrs/${t[`custom-csr-id`]==null?`<custom-csr-id>`:encodeURIComponent(String(t[`custom-csr-id`]))}`,pathParams:{"custom-csr-id":String(t[`custom-csr-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let n=await r(t),s=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=s,!await f({force:!!t.force})){process.stderr.write(`Aborted.
|
|
4
|
+
`);return}i(await o(`Deleting`,async()=>n.customCsrs.customCsrsForAZoneDeleteCustomCsr({zone_id:s,custom_csr_id:t[`custom-csr-id`]})),{successLabel:`Deleted`})}};function O(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of custom CSRs per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`customCsrsForAZoneListCustomCsrs`,describe:`List all custom Certificate Signing Requests (CSRs) for a zone.`,builder:O,handler:async t=>{let n={page:t.page,per_page:t[`per-page`]};if(t.dryRun){a({command:`cf custom-csrs customCsrsForAZoneListCustomCsrs`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_csrs`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:n,bodyKind:`none`});return}let s=await r(t),c=await e({zone:t.zone},s,{quiet:t.quiet});t.zoneId=c,i(await o(`Loading`,async()=>s.customCsrs.customCsrsForAZoneListCustomCsrs({zone_id:c,...n})),{successLabel:`Loaded`})}},A={command:`custom-csrs`,describe:`custom-csrs`,builder:e=>e.command(C).command(T).command(D).command(k).command(h).command(_).command(y).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{A as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{
|
|
3
|
-
`);return}i(await o(`Deleting`,async()=>r.customHostnames.certificatePack.certificates.delete({zone_id:s,custom_hostname_id:n[`custom-hostname-id`],certificate_pack_id:n[`certificate-pack-id`],certificate_id:n[`certificate-id`]})),{successLabel:`Deleted`})}};function p(e){return e.positional(`certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`custom-hostname-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`certificate-pack-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`custom-certificate`,{type:`string`,description:`If a custom uploaded certificate is used.`}).option(`custom-key`,{type:`string`,description:`The key for a custom uploaded certificate.`}).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:`update <certificate-id>`,describe:`Replace a single custom certificate within a certificate pack that contains two bundled certificates. The replacement must adhere to the following constraints. You can only replace an RSA certificate with another RSA certificate or an ECDSA certificate with another ECDSA certificate.`,builder:p,handler:async l=>{if(l.dryRun){a({command:`cf custom-hostnames certificate-pack certificates update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/custom_hostnames/${l[`custom-hostname-id`]==null?`<custom-hostname-id>`:encodeURIComponent(String(l[`custom-hostname-id`]))}/certificate_pack/${l[`certificate-pack-id`]==null?`<certificate-pack-id>`:encodeURIComponent(String(l[`certificate-pack-id`]))}/certificates/${l[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(l[`certificate-id`]))}`,pathParams:{"custom-hostname-id":String(l[`custom-hostname-id`]??``),"certificate-pack-id":String(l[`certificate-pack-id`]??``),"certificate-id":String(l[`certificate-id`]??``),"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?r({custom_certificate:s(l[`custom-certificate`],`custom-certificate`,`text`),custom_key:s(l[`custom-key`],`custom-key`,`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.customHostnames.certificatePack.certificates.update({body:e,zone_id:d,custom_hostname_id:l[`custom-hostname-id`],certificate_pack_id:l[`certificate-pack-id`],certificate_id:l[`certificate-id`]})),{successLabel:`Updated`});return}l[`custom-certificate`]===void 0&&(l[`custom-certificate`]=await c(`custom-certificate`,`If a custom uploaded certificate is used.`)),l[`custom-key`]===void 0&&(l[`custom-key`]=await c(`custom-key`,`The key for a custom uploaded certificate.`,{kind:`secret`}));let f=r({custom_certificate:s(l[`custom-certificate`],`custom-certificate`,`text`),custom_key:s(l[`custom-key`],`custom-key`,`text`)});i(await o(`Updating`,async()=>u.customHostnames.certificatePack.certificates.update({body:f,zone_id:d,custom_hostname_id:l[`custom-hostname-id`],certificate_pack_id:l[`certificate-pack-id`],certificate_id:l[`certificate-id`]})),{successLabel:`Updated`})}},h={command:`certificates`,describe:`Operations for certificate-pack.certificates`,builder:e=>e.command(f).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},g={command:`certificate-pack`,describe:`Operations for certificate-pack`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.option(`custom-origin-server`,{type:`string`,description:`a valid hostname that’s been added to your DNS zone as an A, AAAA, or CNAME record.`}).option(`custom-origin-sni`,{type:`string`,description:`A hostname that will be sent to your custom origin server as SNI for TLS handshake. This can be a valid subdomain of the zone or custom origin server name or the string ':request_host_header:' which will cause the host header in the request to be used as SNI. Not configurable with default/fallback origin server.`}).option(`hostname`,{type:`string`,description:`The custom hostname that will point to your hostname via CNAME.`}).option(`ssl-bundle-method`,{type:`string`,description:`A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.`,choices:[`ubiquitous`,`optimal`,`force`],default:`ubiquitous`}).option(`ssl-certificate-authority`,{type:`string`,description:`The Certificate Authority that will issue the certificate.`,choices:[`digicert`,`google`,`lets_encrypt`,`ssl_com`]}).option(`ssl-cloudflare-branding`,{type:`boolean`,description:`Whether or not to add Cloudflare Branding for the order. This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to true.`}).option(`ssl-custom-certificate`,{type:`string`,description:`If a custom uploaded certificate is used.`}).option(`ssl-custom-csr-id`,{type:`string`,description:`The identifier for the Custom CSR that was used.`}).option(`ssl-custom-key`,{type:`string`,description:`The key for a custom uploaded certificate.`}).option(`ssl-method`,{type:`string`,description:`Domain control validation (DCV) method used for this hostname.`,choices:[`http`,`txt`,`email`]}).option(`ssl-settings-ciphers`,{type:`string`,array:!0,description:`An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format.`}).option(`ssl-settings-early-hints`,{type:`string`,description:`Whether or not Early Hints is enabled.`,choices:[`on`,`off`]}).option(`ssl-settings-http2`,{type:`string`,description:`Whether or not HTTP2 is enabled.`,choices:[`on`,`off`]}).option(`ssl-settings-min-tls-version`,{type:`string`,description:`The minimum TLS version supported.`,choices:[`1.0`,`1.1`,`1.2`,`1.3`]}).option(`ssl-settings-tls-1-3`,{type:`string`,description:`Whether or not TLS 1.3 is enabled.`,choices:[`on`,`off`]}).option(`ssl-type`,{type:`string`,description:`Level of validation to be used for this hostname. Domain validation (dv) must be used.`,choices:[`dv`]}).option(`ssl-wildcard`,{type:`boolean`,description:`Indicates whether the certificate covers a wildcard.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`create`,describe:`Add a new custom hostname and request that an SSL certificate be issued for it. One of three validation methods—http, txt, email—should be used, with 'http' recommended if the CNAME is already in place (or will be soon). Specifying 'email' will send an email to the WHOIS contacts on file for the base domain plus hostmaster, postmaster, webmaster, admin, administrator. If http is used and the domain is not already pointing to the Managed CNAME host, the PATCH method must be used once it is (to complete validation). Enable bundling of certificates using the custom_cert_bundle field. The bundling process requires the following condition One certificate in the bundle must use an RSA, and the other must use an ECDSA.`,builder:_,handler:async l=>{if(l.dryRun){a({command:`cf custom-hostnames create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/custom_hostnames`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?r({custom_origin_server:s(l[`custom-origin-server`],`custom-origin-server`,`text`),custom_origin_sni:s(l[`custom-origin-sni`],`custom-origin-sni`,`text`),hostname:s(l.hostname,`hostname`,`text`),ssl:{bundle_method:s(l[`ssl-bundle-method`],`ssl-bundle-method`,`text`),certificate_authority:s(l[`ssl-certificate-authority`],`ssl-certificate-authority`,`text`),cloudflare_branding:l[`ssl-cloudflare-branding`],custom_certificate:s(l[`ssl-custom-certificate`],`ssl-custom-certificate`,`text`),custom_csr_id:s(l[`ssl-custom-csr-id`],`ssl-custom-csr-id`,`text`),custom_key:s(l[`ssl-custom-key`],`ssl-custom-key`,`text`),method:s(l[`ssl-method`],`ssl-method`,`text`),settings:{ciphers:l[`ssl-settings-ciphers`],early_hints:s(l[`ssl-settings-early-hints`],`ssl-settings-early-hints`,`text`),http2:s(l[`ssl-settings-http2`],`ssl-settings-http2`,`text`),min_tls_version:s(l[`ssl-settings-min-tls-version`],`ssl-settings-min-tls-version`,`text`),tls_1_3:s(l[`ssl-settings-tls-1-3`],`ssl-settings-tls-1-3`,`text`)},type:s(l[`ssl-type`],`ssl-type`,`text`),wildcard:l[`ssl-wildcard`]}}):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(`Creating`,async()=>u.customHostnames.create({...e,zone_id:d})),{successLabel:`Created`});return}l.hostname===void 0&&(l.hostname=await c(`hostname`,`The custom hostname that will point to your hostname via CNAME.`));let f=r({custom_origin_server:s(l[`custom-origin-server`],`custom-origin-server`,`text`),custom_origin_sni:s(l[`custom-origin-sni`],`custom-origin-sni`,`text`),hostname:s(l.hostname,`hostname`,`text`),ssl:{bundle_method:s(l[`ssl-bundle-method`],`ssl-bundle-method`,`text`),certificate_authority:s(l[`ssl-certificate-authority`],`ssl-certificate-authority`,`text`),cloudflare_branding:l[`ssl-cloudflare-branding`],custom_certificate:s(l[`ssl-custom-certificate`],`ssl-custom-certificate`,`text`),custom_csr_id:s(l[`ssl-custom-csr-id`],`ssl-custom-csr-id`,`text`),custom_key:s(l[`ssl-custom-key`],`ssl-custom-key`,`text`),method:s(l[`ssl-method`],`ssl-method`,`text`),settings:{ciphers:l[`ssl-settings-ciphers`],early_hints:s(l[`ssl-settings-early-hints`],`ssl-settings-early-hints`,`text`),http2:s(l[`ssl-settings-http2`],`ssl-settings-http2`,`text`),min_tls_version:s(l[`ssl-settings-min-tls-version`],`ssl-settings-min-tls-version`,`text`),tls_1_3:s(l[`ssl-settings-tls-1-3`],`ssl-settings-tls-1-3`,`text`)},type:s(l[`ssl-type`],`ssl-type`,`text`),wildcard:l[`ssl-wildcard`]}});i(await o(`Creating`,async()=>u.customHostnames.create({...f,zone_id:d})),{successLabel:`Created`})}};function y(e){return e.positional(`custom-hostname-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 b={command:`delete <custom-hostname-id>`,describe:`Permanently deletes a custom hostname and revokes any SSL certificates that were issued for it. This action cannot be undone.`,builder:y,handler:async n=>{if(n.dryRun){a({command:`cf custom-hostnames delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/custom_hostnames/${n[`custom-hostname-id`]==null?`<custom-hostname-id>`:encodeURIComponent(String(n[`custom-hostname-id`]))}`,pathParams:{"custom-hostname-id":String(n[`custom-hostname-id`]??``),"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});if(n.zoneId=s,!await l({force:!!n.force})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}
|
|
5
|
-
`);return}
|
|
2
|
+
import{D as e}from"./oauth-DBJ5GSFk.mjs";import{n as t}from"./auth-CZ0E51rF.mjs";import{t as n}from"./output-B6fBFRqe.mjs";import{n as r,t as i}from"./progress-O88q63Bk.mjs";import{n as a,t as o}from"./body-parser-BO6mfo_W.mjs";import{n as s}from"./input-validation-BwUR9z8e.mjs";import{r as c,t as l}from"./prompt-DTAWiEm2.mjs";import{t as u}from"./cli-types-CFw6Xygp.mjs";function d(e){return e.positional(`certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`custom-hostname-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`certificate-pack-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 f={command:`delete <certificate-id>`,describe:`Delete a single custom certificate from a certificate pack that contains two bundled certificates. Deletion is subject to the following constraints. You cannot delete a certificate if it is the only remaining certificate in the pack. At least one certificate must remain in the pack.`,builder:d,handler:async a=>{if(a.dryRun){r({command:`cf custom-hostnames certificate-pack certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/custom_hostnames/${a[`custom-hostname-id`]==null?`<custom-hostname-id>`:encodeURIComponent(String(a[`custom-hostname-id`]))}/certificate_pack/${a[`certificate-pack-id`]==null?`<certificate-pack-id>`:encodeURIComponent(String(a[`certificate-pack-id`]))}/certificates/${a[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(a[`certificate-id`]))}`,pathParams:{"custom-hostname-id":String(a[`custom-hostname-id`]??``),"certificate-pack-id":String(a[`certificate-pack-id`]??``),"certificate-id":String(a[`certificate-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await l({force:!!a.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}n(await i(`Deleting`,async()=>o.customHostnames.certificatePack.certificates.delete({zone_id:s,custom_hostname_id:a[`custom-hostname-id`],certificate_pack_id:a[`certificate-pack-id`],certificate_id:a[`certificate-id`]})),{successLabel:`Deleted`})}};function p(e){return e.positional(`certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`custom-hostname-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`certificate-pack-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`custom-certificate`,{type:`string`,description:`If a custom uploaded certificate is used.`}).option(`custom-key`,{type:`string`,description:`The key for a custom uploaded certificate.`}).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:`update <certificate-id>`,describe:`Replace a single custom certificate within a certificate pack that contains two bundled certificates. The replacement must adhere to the following constraints. You can only replace an RSA certificate with another RSA certificate or an ECDSA certificate with another ECDSA certificate.`,builder:p,handler:async l=>{if(l.dryRun){r({command:`cf custom-hostnames certificate-pack certificates update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/custom_hostnames/${l[`custom-hostname-id`]==null?`<custom-hostname-id>`:encodeURIComponent(String(l[`custom-hostname-id`]))}/certificate_pack/${l[`certificate-pack-id`]==null?`<certificate-pack-id>`:encodeURIComponent(String(l[`certificate-pack-id`]))}/certificates/${l[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(l[`certificate-id`]))}`,pathParams:{"custom-hostname-id":String(l[`custom-hostname-id`]??``),"certificate-pack-id":String(l[`certificate-pack-id`]??``),"certificate-id":String(l[`certificate-id`]??``),"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({custom_certificate:s(l[`custom-certificate`],`custom-certificate`,`text`),custom_key:s(l[`custom-key`],`custom-key`,`text`)}):a(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=a(l.body);n(await i(`Updating`,async()=>u.customHostnames.certificatePack.certificates.update({body:e,zone_id:d,custom_hostname_id:l[`custom-hostname-id`],certificate_pack_id:l[`certificate-pack-id`],certificate_id:l[`certificate-id`]})),{successLabel:`Updated`});return}l[`custom-certificate`]===void 0&&(l[`custom-certificate`]=await c(`custom-certificate`,`If a custom uploaded certificate is used.`)),l[`custom-key`]===void 0&&(l[`custom-key`]=await c(`custom-key`,`The key for a custom uploaded certificate.`,{kind:`secret`}));let f=o({custom_certificate:s(l[`custom-certificate`],`custom-certificate`,`text`),custom_key:s(l[`custom-key`],`custom-key`,`text`)});n(await i(`Updating`,async()=>u.customHostnames.certificatePack.certificates.update({body:f,zone_id:d,custom_hostname_id:l[`custom-hostname-id`],certificate_pack_id:l[`certificate-pack-id`],certificate_id:l[`certificate-id`]})),{successLabel:`Updated`})}},h={command:`certificates`,describe:`Operations for certificate-pack.certificates`,builder:e=>e.command(f).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},g={command:`certificate-pack`,describe:`Operations for certificate-pack`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.option(`custom-origin-server`,{type:`string`,description:`a valid hostname that’s been added to your DNS zone as an A, AAAA, or CNAME record.`}).option(`custom-origin-sni`,{type:`string`,description:`A hostname that will be sent to your custom origin server as SNI for TLS handshake. This can be a valid subdomain of the zone or custom origin server name or the string ':request_host_header:' which will cause the host header in the request to be used as SNI. Not configurable with default/fallback origin server.`}).option(`hostname`,{type:`string`,description:`The custom hostname that will point to your hostname via CNAME.`}).option(`ssl-bundle-method`,{type:`string`,description:`A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.`,choices:[`ubiquitous`,`optimal`,`force`],default:`ubiquitous`}).option(`ssl-certificate-authority`,{type:`string`,description:`The Certificate Authority that will issue the certificate.`,choices:[`digicert`,`google`,`lets_encrypt`,`ssl_com`]}).option(`ssl-cloudflare-branding`,{type:`boolean`,description:`Whether or not to add Cloudflare Branding for the order. This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to true.`}).option(`ssl-custom-certificate`,{type:`string`,description:`If a custom uploaded certificate is used.`}).option(`ssl-custom-csr-id`,{type:`string`,description:`The identifier for the Custom CSR that was used.`}).option(`ssl-custom-key`,{type:`string`,description:`The key for a custom uploaded certificate.`}).option(`ssl-method`,{type:`string`,description:`Domain control validation (DCV) method used for this hostname.`,choices:[`http`,`txt`,`email`]}).option(`ssl-settings-ciphers`,{type:`string`,array:!0,description:`An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format.`}).option(`ssl-settings-early-hints`,{type:`string`,description:`Whether or not Early Hints is enabled.`,choices:[`on`,`off`]}).option(`ssl-settings-http2`,{type:`string`,description:`Whether or not HTTP2 is enabled.`,choices:[`on`,`off`]}).option(`ssl-settings-min-tls-version`,{type:`string`,description:`The minimum TLS version supported.`,choices:[`1.0`,`1.1`,`1.2`,`1.3`]}).option(`ssl-settings-tls-1-3`,{type:`string`,description:`Whether or not TLS 1.3 is enabled.`,choices:[`on`,`off`]}).option(`ssl-type`,{type:`string`,description:`Level of validation to be used for this hostname. Domain validation (dv) must be used.`,choices:[`dv`]}).option(`ssl-wildcard`,{type:`boolean`,description:`Indicates whether the certificate covers a wildcard.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`create`,describe:`Add a new custom hostname and request that an SSL certificate be issued for it. One of three validation methods—http, txt, email—should be used, with 'http' recommended if the CNAME is already in place (or will be soon). Specifying 'email' will send an email to the WHOIS contacts on file for the base domain plus hostmaster, postmaster, webmaster, admin, administrator. If http is used and the domain is not already pointing to the Managed CNAME host, the PATCH method must be used once it is (to complete validation). Enable bundling of certificates using the custom_cert_bundle field. The bundling process requires the following condition One certificate in the bundle must use an RSA, and the other must use an ECDSA.`,builder:_,handler:async l=>{if(l.dryRun){r({command:`cf custom-hostnames create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/custom_hostnames`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({custom_origin_server:s(l[`custom-origin-server`],`custom-origin-server`,`text`),custom_origin_sni:s(l[`custom-origin-sni`],`custom-origin-sni`,`text`),hostname:s(l.hostname,`hostname`,`text`),ssl:{bundle_method:s(l[`ssl-bundle-method`],`ssl-bundle-method`,`text`),certificate_authority:s(l[`ssl-certificate-authority`],`ssl-certificate-authority`,`text`),cloudflare_branding:l[`ssl-cloudflare-branding`],custom_certificate:s(l[`ssl-custom-certificate`],`ssl-custom-certificate`,`text`),custom_csr_id:s(l[`ssl-custom-csr-id`],`ssl-custom-csr-id`,`text`),custom_key:s(l[`ssl-custom-key`],`ssl-custom-key`,`text`),method:s(l[`ssl-method`],`ssl-method`,`text`),settings:{ciphers:l[`ssl-settings-ciphers`],early_hints:s(l[`ssl-settings-early-hints`],`ssl-settings-early-hints`,`text`),http2:s(l[`ssl-settings-http2`],`ssl-settings-http2`,`text`),min_tls_version:s(l[`ssl-settings-min-tls-version`],`ssl-settings-min-tls-version`,`text`),tls_1_3:s(l[`ssl-settings-tls-1-3`],`ssl-settings-tls-1-3`,`text`)},type:s(l[`ssl-type`],`ssl-type`,`text`),wildcard:l[`ssl-wildcard`]}}):a(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=a(l.body);n(await i(`Creating`,async()=>u.customHostnames.create({...e,zone_id:d})),{successLabel:`Created`});return}l.hostname===void 0&&(l.hostname=await c(`hostname`,`The custom hostname that will point to your hostname via CNAME.`));let f=o({custom_origin_server:s(l[`custom-origin-server`],`custom-origin-server`,`text`),custom_origin_sni:s(l[`custom-origin-sni`],`custom-origin-sni`,`text`),hostname:s(l.hostname,`hostname`,`text`),ssl:{bundle_method:s(l[`ssl-bundle-method`],`ssl-bundle-method`,`text`),certificate_authority:s(l[`ssl-certificate-authority`],`ssl-certificate-authority`,`text`),cloudflare_branding:l[`ssl-cloudflare-branding`],custom_certificate:s(l[`ssl-custom-certificate`],`ssl-custom-certificate`,`text`),custom_csr_id:s(l[`ssl-custom-csr-id`],`ssl-custom-csr-id`,`text`),custom_key:s(l[`ssl-custom-key`],`ssl-custom-key`,`text`),method:s(l[`ssl-method`],`ssl-method`,`text`),settings:{ciphers:l[`ssl-settings-ciphers`],early_hints:s(l[`ssl-settings-early-hints`],`ssl-settings-early-hints`,`text`),http2:s(l[`ssl-settings-http2`],`ssl-settings-http2`,`text`),min_tls_version:s(l[`ssl-settings-min-tls-version`],`ssl-settings-min-tls-version`,`text`),tls_1_3:s(l[`ssl-settings-tls-1-3`],`ssl-settings-tls-1-3`,`text`)},type:s(l[`ssl-type`],`ssl-type`,`text`),wildcard:l[`ssl-wildcard`]}});n(await i(`Creating`,async()=>u.customHostnames.create({...f,zone_id:d})),{successLabel:`Created`})}};function y(e){return e.positional(`custom-hostname-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`customHostnameForAZoneCustomHostnameDetails <custom-hostname-id>`,describe:`Retrieves detailed information about a specific custom hostname, including SSL certificate status, ownership verification, and origin configuration.`,builder:y,handler:async a=>{if(a.dryRun){r({command:`cf custom-hostnames customHostnameForAZoneCustomHostnameDetails`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/custom_hostnames/${a[`custom-hostname-id`]==null?`<custom-hostname-id>`:encodeURIComponent(String(a[`custom-hostname-id`]))}`,pathParams:{"custom-hostname-id":String(a[`custom-hostname-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.customHostnames.customHostnameForAZoneCustomHostnameDetails({zone_id:s,custom_hostname_id:a[`custom-hostname-id`]})),{successLabel:`Loaded`})}};function x(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`customHostnameForAZoneGetCustomHostnameQuota`,describe:`Returns custom hostname quota usage for a zone. The allocated quota is a soft limit; creating custom hostnames after usage exceeds this limit can still succeed until the hard cap is reached. Use the exceeded and hard_cap fields to track when usage is above the soft limit and when new custom hostname creation will be rejected.`,builder:x,handler:async a=>{if(a.dryRun){r({command:`cf custom-hostnames customHostnameForAZoneGetCustomHostnameQuota`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/custom_hostnames/quota`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.customHostnames.customHostnameForAZoneGetCustomHostnameQuota({zone_id:s})),{successLabel:`Loaded`})}};function C(e){return e.positional(`custom-hostname-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 w={command:`delete <custom-hostname-id>`,describe:`Permanently deletes a custom hostname and revokes any SSL certificates that were issued for it. This action cannot be undone.`,builder:C,handler:async a=>{if(a.dryRun){r({command:`cf custom-hostnames delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/custom_hostnames/${a[`custom-hostname-id`]==null?`<custom-hostname-id>`:encodeURIComponent(String(a[`custom-hostname-id`]))}`,pathParams:{"custom-hostname-id":String(a[`custom-hostname-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await l({force:!!a.force})){process.stderr.write(`Aborted.
|
|
4
|
+
`);return}n(await i(`Deleting`,async()=>o.customHostnames.delete({zone_id:s,custom_hostname_id:a[`custom-hostname-id`]})),{successLabel:`Deleted`})}};function T(e){return e.positional(`custom-hostname-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`custom-origin-server`,{type:`string`,description:`a valid hostname that’s been added to your DNS zone as an A, AAAA, or CNAME record.`}).option(`custom-origin-sni`,{type:`string`,description:`A hostname that will be sent to your custom origin server as SNI for TLS handshake. This can be a valid subdomain of the zone or custom origin server name or the string ':request_host_header:' which will cause the host header in the request to be used as SNI. Not configurable with default/fallback origin server.`}).option(`ssl-bundle-method`,{type:`string`,description:`A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.`,choices:[`ubiquitous`,`optimal`,`force`]}).option(`ssl-certificate-authority`,{type:`string`,description:`The Certificate Authority that will issue the certificate.`,choices:[`digicert`,`google`,`lets_encrypt`,`ssl_com`]}).option(`ssl-cloudflare-branding`,{type:`boolean`,description:`Whether or not to add Cloudflare Branding for the order. This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to true.`}).option(`ssl-custom-certificate`,{type:`string`,description:`If a custom uploaded certificate is used.`}).option(`ssl-custom-csr-id`,{type:`string`,description:`The identifier for the Custom CSR that was used.`}).option(`ssl-custom-key`,{type:`string`,description:`The key for a custom uploaded certificate.`}).option(`ssl-method`,{type:`string`,description:`Domain control validation (DCV) method used for this hostname.`,choices:[`http`,`txt`,`email`]}).option(`ssl-settings-ciphers`,{type:`string`,array:!0,description:`An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format.`}).option(`ssl-settings-early-hints`,{type:`string`,description:`Whether or not Early Hints is enabled.`,choices:[`on`,`off`]}).option(`ssl-settings-http2`,{type:`string`,description:`Whether or not HTTP2 is enabled.`,choices:[`on`,`off`]}).option(`ssl-settings-min-tls-version`,{type:`string`,description:`The minimum TLS version supported.`,choices:[`1.0`,`1.1`,`1.2`,`1.3`]}).option(`ssl-settings-tls-1-3`,{type:`string`,description:`Whether or not TLS 1.3 is enabled.`,choices:[`on`,`off`]}).option(`ssl-type`,{type:`string`,description:`Level of validation to be used for this hostname. Domain validation (dv) must be used.`,choices:[`dv`]}).option(`ssl-wildcard`,{type:`boolean`,description:`Indicates whether the certificate covers a wildcard.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const E={command:`edit <custom-hostname-id>`,describe:`Modify SSL configuration for a custom hostname. When sent with SSL config that matches existing config, used to indicate that hostname should pass domain control validation (DCV). Can also be used to change validation type, e.g., from 'http' to 'email'. Bundle an existing certificate with another certificate by using the "custom_cert_bundle" field. The bundling process supports combining certificates as long as the following condition is met. One certificate must use the RSA algorithm, and the other must use the ECDSA algorithm.`,builder:T,handler:async c=>{if(c.dryRun){r({command:`cf custom-hostnames edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/custom_hostnames/${c[`custom-hostname-id`]==null?`<custom-hostname-id>`:encodeURIComponent(String(c[`custom-hostname-id`]))}`,pathParams:{"custom-hostname-id":String(c[`custom-hostname-id`]??``),"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({custom_origin_server:s(c[`custom-origin-server`],`custom-origin-server`,`text`),custom_origin_sni:s(c[`custom-origin-sni`],`custom-origin-sni`,`text`),ssl:{bundle_method:s(c[`ssl-bundle-method`],`ssl-bundle-method`,`text`),certificate_authority:s(c[`ssl-certificate-authority`],`ssl-certificate-authority`,`text`),cloudflare_branding:c[`ssl-cloudflare-branding`],custom_certificate:s(c[`ssl-custom-certificate`],`ssl-custom-certificate`,`text`),custom_csr_id:s(c[`ssl-custom-csr-id`],`ssl-custom-csr-id`,`text`),custom_key:s(c[`ssl-custom-key`],`ssl-custom-key`,`text`),method:s(c[`ssl-method`],`ssl-method`,`text`),settings:{ciphers:c[`ssl-settings-ciphers`],early_hints:s(c[`ssl-settings-early-hints`],`ssl-settings-early-hints`,`text`),http2:s(c[`ssl-settings-http2`],`ssl-settings-http2`,`text`),min_tls_version:s(c[`ssl-settings-min-tls-version`],`ssl-settings-min-tls-version`,`text`),tls_1_3:s(c[`ssl-settings-tls-1-3`],`ssl-settings-tls-1-3`,`text`)},type:s(c[`ssl-type`],`ssl-type`,`text`),wildcard:c[`ssl-wildcard`]}}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Updating`,async()=>l.customHostnames.edit({...e,zone_id:u,custom_hostname_id:c[`custom-hostname-id`]})),{successLabel:`Updated`});return}let d=o({custom_origin_server:s(c[`custom-origin-server`],`custom-origin-server`,`text`),custom_origin_sni:s(c[`custom-origin-sni`],`custom-origin-sni`,`text`),ssl:{bundle_method:s(c[`ssl-bundle-method`],`ssl-bundle-method`,`text`),certificate_authority:s(c[`ssl-certificate-authority`],`ssl-certificate-authority`,`text`),cloudflare_branding:c[`ssl-cloudflare-branding`],custom_certificate:s(c[`ssl-custom-certificate`],`ssl-custom-certificate`,`text`),custom_csr_id:s(c[`ssl-custom-csr-id`],`ssl-custom-csr-id`,`text`),custom_key:s(c[`ssl-custom-key`],`ssl-custom-key`,`text`),method:s(c[`ssl-method`],`ssl-method`,`text`),settings:{ciphers:c[`ssl-settings-ciphers`],early_hints:s(c[`ssl-settings-early-hints`],`ssl-settings-early-hints`,`text`),http2:s(c[`ssl-settings-http2`],`ssl-settings-http2`,`text`),min_tls_version:s(c[`ssl-settings-min-tls-version`],`ssl-settings-min-tls-version`,`text`),tls_1_3:s(c[`ssl-settings-tls-1-3`],`ssl-settings-tls-1-3`,`text`)},type:s(c[`ssl-type`],`ssl-type`,`text`),wildcard:c[`ssl-wildcard`]}});n(await i(`Updating`,async()=>l.customHostnames.edit({...d,zone_id:u,custom_hostname_id:c[`custom-hostname-id`]})),{successLabel:`Updated`})}};function D(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const O={command:`delete`,describe:`Removes the fallback origin configuration for custom hostnames on a zone. Custom hostnames without specific origins will no longer have a fallback.`,builder:D,handler:async a=>{if(a.dryRun){r({command:`cf custom-hostnames fallback-origin delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/custom_hostnames/fallback_origin`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await l({force:!!a.force})){process.stderr.write(`Aborted.
|
|
5
|
+
`);return}n(await i(`Deleting`,async()=>o.customHostnames.fallbackOrigin.delete({zone_id:s})),{successLabel:`Deleted`})}};function k(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`get`,describe:`Retrieves the current fallback origin configuration for custom hostnames on a zone. The fallback origin handles traffic when specific custom hostname origins are unavailable.`,builder:k,handler:async a=>{if(a.dryRun){r({command:`cf custom-hostnames fallback-origin get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/custom_hostnames/fallback_origin`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.customHostnames.fallbackOrigin.get({zone_id:s})),{successLabel:`Loaded`})}};function j(e){return e.option(`origin`,{type:`string`,description:`Your origin hostname that requests to your custom hostnames will be sent to.`}).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:`update`,describe:`Updates the fallback origin configuration for custom hostnames on a zone. Sets the default origin server for custom hostname traffic.`,builder:j,handler:async l=>{if(l.dryRun){r({command:`cf custom-hostnames fallback-origin update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/custom_hostnames/fallback_origin`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({origin:s(l.origin,`origin`,`text`)}):a(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=a(l.body);n(await i(`Updating`,async()=>u.customHostnames.fallbackOrigin.update({...e,zone_id:d})),{successLabel:`Updated`});return}l.origin===void 0&&(l.origin=await c(`origin`,`Your origin hostname that requests to your custom hostnames will be sent to.`));let f=o({origin:s(l.origin,`origin`,`text`)});n(await i(`Updating`,async()=>u.customHostnames.fallbackOrigin.update({...f,zone_id:d})),{successLabel:`Updated`})}},N={command:`fallback-origin`,describe:`Operations for fallback-origin`,builder:e=>e.command(O).command(A).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.option(`hostname`,{type:`string`,description:`Fully qualified domain name to match against. This parameter cannot be used with the 'id', 'hostname.exact', 'hostname.contain', or 'hostname.startsWith' parameters.`}).option(`hostname-exact`,{type:`string`,description:`Fully qualified domain name to match against. This parameter cannot be used with the 'id', 'hostname', 'hostname.contain', or 'hostname.startsWith' parameters.`}).option(`hostname-starts-with`,{type:`string`,description:`Filters hostnames by a prefix match on the hostname value. This parameter cannot be used with the 'id', 'hostname', 'hostname.exact', or 'hostname.contain' parameters.`}).option(`hostname-contain`,{type:`string`,description:`Filters hostnames by a substring match on the hostname value. This parameter cannot be used with the 'id', 'hostname', 'hostname.exact', or 'hostname.startsWith' parameters.`}).option(`id`,{type:`string`,description:`Hostname ID to match against. This ID was generated and returned during the initial custom_hostname creation. This parameter cannot be used with the 'hostname', 'hostname.exact', 'hostname.contain', or 'hostname.startsWith' parameters.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of hostnames per page.`}).option(`order`,{type:`string`,description:`Field to order hostnames by.`,choices:[`ssl`,`ssl_status`]}).option(`direction`,{type:`string`,description:`Direction to order hostnames.`,choices:[`asc`,`desc`]}).option(`ssl-status`,{type:`string`,description:`Filter by SSL certificate status.`,choices:[`initializing`,`pending_validation`,`deleted`,`pending_issuance`,`pending_deployment`,`pending_deletion`,`pending_expiration`,`expired`,`active`,`initializing_timed_out`,`validation_timed_out`,`issuance_timed_out`,`deployment_timed_out`,`deletion_timed_out`,`pending_cleanup`,`staging_deployment`,`staging_active`,`deactivating`,`inactive`,`backup_issued`,`holding_deployment`]}).option(`hostname-status`,{type:`string`,description:`Filter by the hostname's activation status.`,choices:[`active`,`pending`,`active_redeploying`,`moved`,`pending_deletion`,`deleted`,`pending_blocked`,`pending_migration`,`pending_provisioned`,`test_pending`,`test_active`,`test_active_apex`,`test_blocked`,`test_failed`,`provisioned`,`blocked`]}).option(`certificate-authority`,{type:`string`,description:`Filter by the certificate authority that issued the SSL certificate.`,choices:[`google`,`lets_encrypt`,`ssl_com`]}).option(`wildcard`,{type:`boolean`,description:`Filter by whether the custom hostname is a wildcard hostname.`}).option(`custom-origin-server`,{type:`string`,description:`Filter by custom origin server name.`}).option(`ssl`,{type:`string`,description:`Whether to filter hostnames based on if they have SSL enabled.`,choices:[`0`,`1`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`list`,describe:`List, search, sort, and filter all of your custom hostnames.`,builder:u(P),handler:async a=>{let o={hostname:a.hostname,"hostname.exact":a[`hostname-exact`],"hostname.startsWith":a[`hostname-starts-with`],"hostname.contain":a[`hostname-contain`],id:a.id,page:a.page,per_page:a[`per-page`],order:a.order,direction:a.direction,ssl_status:a[`ssl-status`],hostname_status:a[`hostname-status`],certificate_authority:a[`certificate-authority`],wildcard:a.wildcard,custom_origin_server:a[`custom-origin-server`],ssl:a.ssl};if(a.dryRun){r({command:`cf custom-hostnames list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/custom_hostnames`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await t(a),c=await e({zone:a.zone},s,{quiet:a.quiet});a.zoneId=c,n(await i(`Loading`,async()=>s.customHostnames.list({zone_id:c,...o})),{successLabel:`Loaded`})}},I={command:`custom-hostnames`,describe:`Bring custom vanity domains to your SaaS zone with per-hostname SSL and origin mapping`,builder:e=>e.command(v).command(b).command(S).command(w).command(E).command(F).command(g).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{I as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{O as e,w as t}from"./oauth-DBJ5GSFk.mjs";import{n}from"./auth-CZ0E51rF.mjs";import{t as r}from"./output-B6fBFRqe.mjs";import{n as i,t as a}from"./progress-O88q63Bk.mjs";import{t as o}from"./local-C6TLPAT6.mjs";import{n as s,t as c}from"./body-parser-BO6mfo_W.mjs";import{n as l}from"./input-validation-BwUR9z8e.mjs";import{r as u,t as d}from"./prompt-DTAWiEm2.mjs";function f(e){return e.option(`ns-name`,{type:`string`,description:`The FQDN of the name server.`}).option(`ns-set`,{type:`number`,description:`The number of the set that this name server belongs to.`,default:1}).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 p={command:`create`,describe:`Adds a custom nameserver to the account for use as a vanity nameserver on zones.`,builder:f,handler:async d=>{if(d.dryRun){i({command:`cf custom-nameservers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/custom_ns`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({ns_name:l(d[`ns-name`],`ns-name`,`text`),ns_set:d[`ns-set`]}):s(d.body)});return}let f=await n(d),p=d.local?o:await t();if(d.accountId=p,d.body){let e=s(d.body);r(await a(`Creating`,async()=>f.customNameservers.create({body:e,account_id:p})),{successLabel:`Created`});return}d[`ns-name`]===void 0&&(d[`ns-name`]=await u(`ns-name`,`The FQDN of the name server.`));let m=c({ns_name:l(d[`ns-name`],`ns-name`,`text`),ns_set:d[`ns-set`]});r(await a(`Creating`,async()=>f.customNameservers.create({body:m,account_id:p})),{successLabel:`Created`})}};function m(e){return e.positional(`custom-ns-id`,{type:`string`,description:`The FQDN of the name server.`,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 <custom-ns-id>`,describe:`Removes a custom nameserver from the account.`,builder:m,handler:async s=>{if(s.dryRun){i({command:`cf custom-nameservers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/custom_ns/${s[`custom-ns-id`]==null?`<custom-ns-id>`:encodeURIComponent(String(s[`custom-ns-id`]))}`,pathParams:{"custom-ns-id":String(s[`custom-ns-id`]??``)},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();if(s.accountId=l,!await d({force:!!s.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}r(await a(`Deleting`,async()=>c.customNameservers.delete({account_id:l,custom_ns_id:s[`custom-ns-id`]})),{successLabel:`Deleted`})}};function g(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get`,describe:`List an account's custom nameservers.`,builder:g,handler:async s=>{if(s.dryRun){i({command:`cf custom-nameservers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await e()??`<account-id>`}/custom_ns`,pathParams:{},bodyKind:`none`});return}let c=await n(s),l=s.local?o:await t();s.accountId=l,r(await a(`Loading`,async()=>c.customNameservers.get({account_id:l})),{successLabel:`Loaded`})}},v={command:`custom-nameservers`,describe:`Vanity nameservers that use your own domain instead of Cloudflare-assigned NS records`,builder:e=>e.command(p).command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{v as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{D as e,O as t,w as n}from"./oauth-DBJ5GSFk.mjs";import{n as r}from"./auth-CZ0E51rF.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-O88q63Bk.mjs";import{t as s}from"./local-C6TLPAT6.mjs";import{n as c,t as l}from"./body-parser-BO6mfo_W.mjs";import{n as u}from"./input-validation-BwUR9z8e.mjs";import{n as d,r as f,t as p}from"./prompt-DTAWiEm2.mjs";import{t as m}from"./cli-types-CFw6Xygp.mjs";function h(e){return e.positional(`identifier`,{type:`string`,description:`Error Page Types`,demandOption:!0}).option(`state`,{type:`string`,description:`The custom page state.`,choices:[`default`,`customized`]}).option(`url`,{type:`string`,description:`The URL associated with the custom page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`update <identifier>`,describe:`Updates the configuration of an existing custom page.`,builder:m(h),handler:async e=>{if(e.dryRun){a({command:`cf custom-pages account-custom-pages update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/custom_pages/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}`,pathParams:{identifier:String(e.identifier??``)},bodyKind:`json`,body:e.body===void 0?l({state:u(e.state,`state`,`text`),url:u(e.url,`url`,`text`)}):c(e.body)});return}let p=await r(e),m=e.local?s:await n();if(e.accountId=m,e.body){let t=c(e.body);i(await o(`Updating`,async()=>p.customPages.accountCustomPages.update({...t,account_identifier:m,identifier:e.identifier})),{successLabel:`Updated`});return}e.state===void 0&&(e.state=await d(`state`,`The custom page state.`,[`default`,`customized`])),e.url===void 0&&(e.url=await f(`url`,`The URL associated with the custom page.`));let h=l({state:u(e.state,`state`,`text`),url:u(e.url,`url`,`text`)});i(await o(`Updating`,async()=>p.customPages.accountCustomPages.update({...h,account_identifier:m,identifier:e.identifier})),{successLabel:`Updated`})}},_={command:`account-custom-pages`,describe:`Operations for account-custom-pages`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.option(`description`,{type:`string`,description:`A short description of the custom asset.`}).option(`name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`}).option(`url`,{type:`string`,description:`The URL where the asset content is fetched from.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`asset`,describe:`Creates a new custom asset at the account level.`,builder:v,handler:async e=>{if(e.dryRun){a({command:`cf custom-pages assets create custom asset`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/custom_pages/assets`,pathParams:{},bodyKind:`json`,body:e.body===void 0?l({description:u(e.description,`description`,`text`),name:u(e.name,`name`,`text`),url:u(e.url,`url`,`text`)}):c(e.body)});return}let d=await r(e),p=e.local?s:await n();if(e.accountId=p,e.body){let t=c(e.body);i(await o(`Creating`,async()=>d.customPages.assets.create.custom.asset({...t,account_identifier:p})),{successLabel:`Created`});return}e.description===void 0&&(e.description=await f(`description`,`A short description of the custom asset.`)),e.name===void 0&&(e.name=await f(`name`,`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`)),e.url===void 0&&(e.url=await f(`url`,`The URL where the asset content is fetched from.`));let m=l({description:u(e.description,`description`,`text`),name:u(e.name,`name`,`text`),url:u(e.url,`url`,`text`)});i(await o(`Creating`,async()=>d.customPages.assets.create.custom.asset({...m,account_identifier:p})),{successLabel:`Created`})}},b={command:`custom`,describe:`Operations for assets.create.custom`,builder:e=>e.command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(e){return e.positional(`zone-identifier`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`description`,{type:`string`,description:`A short description of the custom asset.`}).option(`name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`}).option(`url`,{type:`string`,description:`The URL where the asset content is fetched from.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`v2 <zone-identifier>`,describe:`Creates a new custom asset at the zone level.`,builder:x,handler:async t=>{if(t.dryRun){a({command:`cf custom-pages assets create v2`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_pages/assets`,pathParams:{"zone-identifier":String(t.zone??t[`zone-identifier`]??``)},bodyKind:`json`,body:t.body===void 0?l({description:u(t.description,`description`,`text`),name:u(t.name,`name`,`text`),url:u(t.url,`url`,`text`)}):c(t.body)});return}let n=await r(t),s=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=s,t.body){let e=c(t.body);i(await o(`Creating`,async()=>n.customPages.assets.create.v2({...e,zone_identifier:s})),{successLabel:`Created`});return}t.description===void 0&&(t.description=await f(`description`,`A short description of the custom asset.`)),t.name===void 0&&(t.name=await f(`name`,`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`)),t.url===void 0&&(t.url=await f(`url`,`The URL where the asset content is fetched from.`));let d=l({description:u(t.description,`description`,`text`),name:u(t.name,`name`,`text`),url:u(t.url,`url`,`text`)});i(await o(`Creating`,async()=>n.customPages.assets.create.v2({...d,zone_identifier:s})),{successLabel:`Created`})}},C={command:`create`,describe:`Operations for assets.create`,builder:e=>e.command(S).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.positional(`asset-name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`,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 T={command:`asset <asset-name>`,describe:`Deletes an existing custom asset.`,builder:w,handler:async e=>{if(e.dryRun){a({command:`cf custom-pages assets delete custom asset`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/custom_pages/assets/${e[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(e[`asset-name`]))}`,pathParams:{"asset-name":String(e[`asset-name`]??``)},bodyKind:`none`});return}let c=await r(e),l=e.local?s:await n();if(e.accountId=l,!await p({force:!!e.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}i(await o(`Deleting`,async()=>c.customPages.assets.delete.custom.asset({account_identifier:l,asset_name:e[`asset-name`]})),{successLabel:`Deleted`})}},E={command:`custom`,describe:`Operations for assets.delete.custom`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function D(e){return e.positional(`asset-name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`,demandOption:!0}).option(`zone-identifier`,{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 O={command:`v2 <asset-name>`,describe:`Deletes an existing custom asset.`,builder:D,handler:async t=>{if(t.dryRun){a({command:`cf custom-pages assets delete v2`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_pages/assets/${t[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(t[`asset-name`]))}`,pathParams:{"asset-name":String(t[`asset-name`]??``),"zone-identifier":String(t.zone??t[`zone-identifier`]??``)},bodyKind:`none`});return}let n=await r(t),s=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=s,!await p({force:!!t.force})){process.stderr.write(`Aborted.
|
|
4
|
+
`);return}i(await o(`Deleting`,async()=>n.customPages.assets.delete.v2({zone_identifier:s,asset_name:t[`asset-name`]})),{successLabel:`Deleted`})}},k={command:`delete`,describe:`Operations for assets.delete`,builder:e=>e.command(O).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.positional(`asset-name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`asset <asset-name>`,describe:`Fetches the details of a custom asset.`,builder:A,handler:async e=>{if(e.dryRun){a({command:`cf custom-pages assets get custom asset`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/custom_pages/assets/${e[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(e[`asset-name`]))}`,pathParams:{"asset-name":String(e[`asset-name`]??``)},bodyKind:`none`});return}let c=await r(e),l=e.local?s:await n();e.accountId=l,i(await o(`Loading`,async()=>c.customPages.assets.get.custom.asset({account_identifier:l,asset_name:e[`asset-name`]})),{successLabel:`Loaded`})}},M={command:`custom`,describe:`Operations for assets.get.custom`,builder:e=>e.command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.positional(`asset-name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`,demandOption:!0}).option(`zone-identifier`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`v2 <asset-name>`,describe:`Fetches the details of a custom asset.`,builder:N,handler:async t=>{if(t.dryRun){a({command:`cf custom-pages assets get v2`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_pages/assets/${t[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(t[`asset-name`]))}`,pathParams:{"asset-name":String(t[`asset-name`]??``),"zone-identifier":String(t.zone??t[`zone-identifier`]??``)},bodyKind:`none`});return}let n=await r(t),s=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=s,i(await o(`Loading`,async()=>n.customPages.assets.get.v2({zone_identifier:s,asset_name:t[`asset-name`]})),{successLabel:`Loaded`})}},F={command:`get`,describe:`Operations for assets.get`,builder:e=>e.command(P).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(e){return e.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 ee={command:`assets`,describe:`Fetches all the custom assets at the account level.`,builder:I,handler:async e=>{let c={page:e.page,per_page:e[`per-page`]};if(e.dryRun){a({command:`cf custom-pages assets list custom assets`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/custom_pages/assets`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(e),u=e.local?s:await n();e.accountId=u,i(await o(`Loading`,async()=>l.customPages.assets.list.custom.assets({account_identifier:u,...c})),{successLabel:`Loaded`})}},L={command:`custom`,describe:`Operations for assets.list.custom`,builder:e=>e.command(ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function R(e){return e.positional(`zone-identifier`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`v2 <zone-identifier>`,describe:`Fetches all the custom assets at the zone level.`,builder:R,handler:async t=>{let n={page:t.page,per_page:t[`per-page`]};if(t.dryRun){a({command:`cf custom-pages assets list v2`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_pages/assets`,pathParams:{"zone-identifier":String(t.zone??t[`zone-identifier`]??``)},query:n,bodyKind:`none`});return}let s=await r(t),c=await e({zone:t.zone},s,{quiet:t.quiet});t.zoneId=c,i(await o(`Loading`,async()=>s.customPages.assets.list.v2({zone_identifier:c,...n})),{successLabel:`Loaded`})}},B={command:`list`,describe:`Operations for assets.list`,builder:e=>e.command(z).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.positional(`asset-name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`,demandOption:!0}).option(`description`,{type:`string`,description:`A short description of the custom asset.`}).option(`url`,{type:`string`,description:`The URL where the asset content is fetched from.`}).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:`asset <asset-name>`,describe:`Updates the configuration of an existing custom asset.`,builder:V,handler:async e=>{if(e.dryRun){a({command:`cf custom-pages assets update custom asset`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/custom_pages/assets/${e[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(e[`asset-name`]))}`,pathParams:{"asset-name":String(e[`asset-name`]??``)},bodyKind:`json`,body:e.body===void 0?l({description:u(e.description,`description`,`text`),url:u(e.url,`url`,`text`)}):c(e.body)});return}let d=await r(e),p=e.local?s:await n();if(e.accountId=p,e.body){let t=c(e.body);i(await o(`Updating`,async()=>d.customPages.assets.update.custom.asset({...t,account_identifier:p,asset_name:e[`asset-name`]})),{successLabel:`Updated`});return}e.description===void 0&&(e.description=await f(`description`,`A short description of the custom asset.`)),e.url===void 0&&(e.url=await f(`url`,`The URL where the asset content is fetched from.`));let m=l({description:u(e.description,`description`,`text`),url:u(e.url,`url`,`text`)});i(await o(`Updating`,async()=>d.customPages.assets.update.custom.asset({...m,account_identifier:p,asset_name:e[`asset-name`]})),{successLabel:`Updated`})}},U={command:`custom`,describe:`Operations for assets.update.custom`,builder:e=>e.command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(e){return e.positional(`asset-name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`,demandOption:!0}).option(`zone-identifier`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`description`,{type:`string`,description:`A short description of the custom asset.`}).option(`url`,{type:`string`,description:`The URL where the asset content is fetched from.`}).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:`v2 <asset-name>`,describe:`Updates the configuration of an existing custom asset.`,builder:W,handler:async t=>{if(t.dryRun){a({command:`cf custom-pages assets update v2`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_pages/assets/${t[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(t[`asset-name`]))}`,pathParams:{"asset-name":String(t[`asset-name`]??``),"zone-identifier":String(t.zone??t[`zone-identifier`]??``)},bodyKind:`json`,body:t.body===void 0?l({description:u(t.description,`description`,`text`),url:u(t.url,`url`,`text`)}):c(t.body)});return}let n=await r(t),s=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=s,t.body){let e=c(t.body);i(await o(`Updating`,async()=>n.customPages.assets.update.v2({...e,zone_identifier:s,asset_name:t[`asset-name`]})),{successLabel:`Updated`});return}t.description===void 0&&(t.description=await f(`description`,`A short description of the custom asset.`)),t.url===void 0&&(t.url=await f(`url`,`The URL where the asset content is fetched from.`));let d=l({description:u(t.description,`description`,`text`),url:u(t.url,`url`,`text`)});i(await o(`Updating`,async()=>n.customPages.assets.update.v2({...d,zone_identifier:s,asset_name:t[`asset-name`]})),{successLabel:`Updated`})}},K={command:`update`,describe:`Operations for assets.update`,builder:e=>e.command(G).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},q={command:`assets`,describe:`Operations for assets`,builder:e=>e.command(C).command(k).command(F).command(B).command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function J(e){return e.positional(`identifier`,{type:`string`,description:`Error Page Types`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`get <identifier>`,describe:`Fetches the details of a custom page.`,builder:m(J),handler:async e=>{if(e.dryRun){a({command:`cf custom-pages get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/custom_pages/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}`,pathParams:{identifier:String(e.identifier??``)},bodyKind:`none`});return}let c=await r(e),l=e.local?s:await n();e.accountId=l,i(await o(`Loading`,async()=>c.customPages.get({account_identifier:l,identifier:e.identifier})),{successLabel:`Loaded`})}};function X(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`list`,describe:`Fetches all the custom pages at the account level.`,builder:X,handler:async e=>{if(e.dryRun){a({command:`cf custom-pages list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/custom_pages`,pathParams:{},bodyKind:`none`});return}let c=await r(e),l=e.local?s:await n();e.accountId=l,i(await o(`Loading`,async()=>c.customPages.list({account_identifier:l})),{successLabel:`Loaded`})}};function Q(e){return e.positional(`identifier`,{type:`string`,description:`Error Page Types`,demandOption:!0}).option(`zone-identifier`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`state`,{type:`string`,description:`The custom page state.`,choices:[`default`,`customized`]}).option(`url`,{type:`string`,description:`The URL associated with the custom page.`}).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 $={command:`update <identifier>`,describe:`Updates the configuration of an existing custom page.`,builder:m(Q),handler:async t=>{if(t.dryRun){a({command:`cf custom-pages update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_pages/${t.identifier==null?`<identifier>`:encodeURIComponent(String(t.identifier))}`,pathParams:{identifier:String(t.identifier??``),"zone-identifier":String(t.zone??t[`zone-identifier`]??``)},bodyKind:`json`,body:t.body===void 0?l({state:u(t.state,`state`,`text`),url:u(t.url,`url`,`text`)}):c(t.body)});return}let n=await r(t),s=await e({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=s,t.body){let e=c(t.body);i(await o(`Updating`,async()=>n.customPages.update({...e,zone_identifier:s,identifier:t.identifier})),{successLabel:`Updated`});return}t.state===void 0&&(t.state=await d(`state`,`The custom page state.`,[`default`,`customized`])),t.url===void 0&&(t.url=await f(`url`,`The URL associated with the custom page.`));let p=l({state:u(t.state,`state`,`text`),url:u(t.url,`url`,`text`)});i(await o(`Updating`,async()=>n.customPages.update({...p,zone_identifier:s,identifier:t.identifier})),{successLabel:`Updated`})}};function te(e){return e.positional(`identifier`,{type:`string`,description:`Error Page Types`,demandOption:!0}).option(`zone-identifier`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`get <identifier>`,describe:`Fetches the details of a custom page.`,builder:m(te),handler:async t=>{if(t.dryRun){a({command:`cf custom-pages zone-custom-pages get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_pages/${t.identifier==null?`<identifier>`:encodeURIComponent(String(t.identifier))}`,pathParams:{identifier:String(t.identifier??``),"zone-identifier":String(t.zone??t[`zone-identifier`]??``)},bodyKind:`none`});return}let n=await r(t),s=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=s,i(await o(`Loading`,async()=>n.customPages.zoneCustomPages.get({zone_identifier:s,identifier:t.identifier})),{successLabel:`Loaded`})}};function re(e){return e.option(`zone-identifier`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`list`,describe:`Fetches all the custom pages at the zone level.`,builder:re,handler:async t=>{if(t.dryRun){a({command:`cf custom-pages zone-custom-pages list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_pages`,pathParams:{"zone-identifier":String(t.zone??t[`zone-identifier`]??``)},bodyKind:`none`});return}let n=await r(t),s=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=s,i(await o(`Loading`,async()=>n.customPages.zoneCustomPages.list({zone_identifier:s})),{successLabel:`Loaded`})}},ae={command:`zone-custom-pages`,describe:`Operations for zone-custom-pages`,builder:e=>e.command(ne).command(ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},oe={command:`custom-pages`,describe:`Custom error and challenge pages (1000s, WAF blocks, captchas) for zones and accounts`,builder:e=>e.command(Y).command(Z).command($).command(_).command(q).command(ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{oe as default};
|