cf 1.0.0-beta.25 → 1.0.0-beta.27
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/commands.json +2015 -3426
- package/dist/_meta/hand-written-commands.json +16 -1
- package/dist/_meta/schemas.json +9249 -2339
- package/dist/abuse-reports-RxXqfDEW.mjs +24 -0
- package/dist/{access-__sFDSFL.mjs → access-BxEprr2f.mjs} +1 -1
- package/dist/{accounts-CmggwRjh.mjs → accounts-DU2ZNYqP.mjs} +17 -11
- package/dist/{acm-AAhRZUAU.mjs → acm-CBCIKBJ4.mjs} +1 -1
- package/dist/{addressing-DVeJNPZc.mjs → addressing-BKxiLRHk.mjs} +1 -1
- package/dist/{agent-memory-DQhWO6sc.mjs → agent-memory-DkBpQYUL.mjs} +1 -1
- package/dist/{ai-CULO9sno.mjs → ai-DqEN_hhg.mjs} +2 -2
- package/dist/{ai-audit-udn4HF34.mjs → ai-audit-BmzOgt6x.mjs} +1 -1
- package/dist/{ai-gateway-Bm2MMdec.mjs → ai-gateway-B0uiYVHq.mjs} +3 -3
- package/dist/ai-search-DbZIxdio.mjs +74 -0
- package/dist/{ai-security-DXy9ht-9.mjs → ai-security-CvZfP2JC.mjs} +1 -1
- package/dist/{alerting-CssnaN2i.mjs → alerting-BjGwBxZT.mjs} +1 -1
- package/dist/{analytics-BVo7Ax0w.mjs → analytics-C7kT_H-W.mjs} +4 -4
- package/dist/{analytics-engine-BBd0Bydx.mjs → analytics-engine-BHpcNSdD.mjs} +1 -1
- package/dist/{api-security-C-D9OKtH.mjs → api-security-BbcvDtff.mjs} +2 -2
- package/dist/{argo-DSziwzvA.mjs → argo-D1VONzu-.mjs} +1 -1
- package/dist/{artifacts-nVMgn4dn.mjs → artifacts-2R2sxIKO.mjs} +3 -3
- package/dist/{audit-logs-DIZ5oA_y.mjs → audit-logs-LoBB1OO_.mjs} +1 -1
- package/dist/auth-CspwoBlp.mjs +2 -0
- package/dist/{auth-JsvLULHA.mjs → auth-D499YE2n.mjs} +3 -3
- package/dist/{auth-CB9wjyad.mjs → auth-FK2eLQ02.mjs} +1 -1
- package/dist/{auth-token-BAgw7kYP.mjs → auth-token-BwpERbnG.mjs} +1 -1
- package/dist/{autoconfig-CajkMb3B.mjs → autoconfig-B2w-woU0.mjs} +85 -83
- package/dist/{basin-catalog-BRvGeKm3.mjs → basin-catalog-AgOHGiPI.mjs} +2 -2
- package/dist/billing-DRNww0iC.mjs +24 -0
- package/dist/{blocks-D2tE8dp2.mjs → blocks-C8vyXIAT.mjs} +1 -1
- package/dist/body-unions-CjpNjwSW.mjs +2 -0
- package/dist/bot-management-fwxKIbaB.mjs +9 -0
- package/dist/{botnet-feed-VOL5P4s3.mjs → botnet-feed-DCYB5kYZ.mjs} +1 -1
- package/dist/{brand-protection-CSVHQ9Pt.mjs → brand-protection-BVICLzBc.mjs} +1 -1
- package/dist/browser-run-CEk-NIgP.mjs +40 -0
- package/dist/build-CRm2TQq8.mjs +2 -0
- package/dist/{build-BfkzV5_c.mjs → build-DO_GNhRl.mjs} +1 -1
- package/dist/{builds-y5BQCJ81.mjs → builds-CoazxuN-.mjs} +26 -26
- package/dist/{cache-Bvr988Hj.mjs → cache-jlLJLSu7.mjs} +1 -1
- package/dist/{cf-DgLg6Hop.mjs → cf-hP0SOgC6.mjs} +2 -2
- package/dist/{chunk-2HLTAS5V-B92NbX1j.mjs → chunk-AAQI36FL-e6E5HW1g.mjs} +1 -1
- package/dist/{chunk-DSGVRFIS-Dq2PrGsi.mjs → chunk-DSGVRFIS-DQwKND2c.mjs} +1 -1
- package/dist/chunk-SOBRPAPT-BKzUiNx_.mjs +363 -0
- package/dist/{cli-BTxJfFus.mjs → cli-Nqf58-1c.mjs} +3 -3
- package/dist/{client-side-security-CFmO0uz9.mjs → client-side-security-VmZzMy-m.mjs} +1 -1
- package/dist/{cloud-connector-CtwPdFBa.mjs → cloud-connector-bMlFnqP0.mjs} +1 -1
- package/dist/{cloudflared-DPkNN1Qv.mjs → cloudflared-Ba4KWdTO.mjs} +1 -1
- package/dist/{cloudforce-one-DHrMaxnU.mjs → cloudforce-one-CCaIBOAo.mjs} +121 -119
- package/dist/{command-CDYTsmxe.mjs → command-BASaTmJc.mjs} +1 -1
- package/dist/{command-BWyx7dNO.mjs → command-BiIVclNA.mjs} +1 -1
- package/dist/{command-CXwKBbj9.mjs → command-Bih1HLr3.mjs} +1 -1
- package/dist/{command-Ct3tf-P5.mjs → command-BxZBNPxG.mjs} +1 -1
- package/dist/{command-DPOjEs1B.mjs → command-ByYf12-8.mjs} +1 -1
- package/dist/{command-CmK8-DJ9.mjs → command-C0qCuw03.mjs} +1 -1
- package/dist/{command-DqWBPiew.mjs → command-C2FVMd1b.mjs} +1 -1
- package/dist/{command-ckixJeTm.mjs → command-C4OgtX_x.mjs} +1 -1
- package/dist/{command-CCDzJjIB.mjs → command-C5Kqc5Km.mjs} +1 -1
- package/dist/{command-lJJ7sEZe.mjs → command-CFxyp8Uo.mjs} +1 -1
- package/dist/{command-ClneauMx.mjs → command-CZAR85ba.mjs} +1 -1
- package/dist/{command-BXCk1OsI.mjs → command-CelQVrZL.mjs} +1 -1
- package/dist/{command-YFWLEK8W.mjs → command-CrAlzysj.mjs} +1 -1
- package/dist/{command-6_Ms3TZv.mjs → command-pMoNdd22.mjs} +1 -1
- package/dist/{completions-B1rYgw_a.mjs → completions-DRzBiqpv.mjs} +1 -1
- package/dist/{connector-interrupts-DecTdK6X.mjs → connector-interrupts-CrTeSyaM.mjs} +1 -1
- package/dist/{connector-telemetry-events-wePxPACj.mjs → connector-telemetry-events-BbAOUt9h.mjs} +1 -1
- package/dist/{connector-telemetry-snapshots-D8sXR1qx.mjs → connector-telemetry-snapshots-DcpBx7Qx.mjs} +1 -1
- package/dist/{connectors-C-6RQ_Q1.mjs → connectors-D1WFLJoE.mjs} +1 -1
- package/dist/{containers-D65Gpj9Q.mjs → containers-BOBEs1Gk.mjs} +4 -4
- package/dist/containers-DINLx5_i.mjs +380 -0
- package/dist/{content-scan-DbIDQ-Yu.mjs → content-scan-D1GfPSL0.mjs} +1 -1
- package/dist/{context-DCon1tRZ.mjs → context-Dp4CXG22.mjs} +1 -1
- package/dist/{cps-DGLmzCzp.mjs → cps-D4uhzg3k.mjs} +1 -1
- package/dist/{csam-scanner-R7Ih-Dnw.mjs → csam-scanner-DOOUBeBM.mjs} +1 -3
- package/dist/custom-csrs-DtdFo5YZ.mjs +18 -0
- package/dist/{custom-hostnames-BFWR-tR_.mjs → custom-hostnames-ccdlELaD.mjs} +1 -1
- package/dist/custom-nameservers-p3gDjfva.mjs +12 -0
- package/dist/custom-pages-DAkKVzgR.mjs +38 -0
- package/dist/d1-CDIyRdh4.mjs +52 -0
- package/dist/{delegate-CTj0dYET.mjs → delegate-B4bKqF7i.mjs} +1 -1
- package/dist/delegate.mjs +1 -1
- package/dist/{deploy-BVTA83rN.mjs → deploy-BaC5Ty7F.mjs} +1 -1
- package/dist/{deploy-context-CO8ZSRwx.mjs → deploy-context-DTTgNGro.mjs} +1 -1
- package/dist/{deploy-input-PhKRxa_2.mjs → deploy-input-mAy06fAI.mjs} +1 -1
- package/dist/{dev-CM5GLHNn.mjs → dev-De-HszNT.mjs} +1 -1
- package/dist/{diagnostics-DPjl0aCm.mjs → diagnostics-D1CUs2o9.mjs} +1 -1
- package/dist/{dist-ataVE8ob.mjs → dist-D5qkmHhC.mjs} +2 -2
- package/dist/{dls-BLTIVlbh.mjs → dls-DWBiYzY1.mjs} +1 -1
- package/dist/{dns-firewall-D1bb1byu.mjs → dns-firewall-DH9xIT5H.mjs} +8 -8
- package/dist/{dns-DkqVq-nB.mjs → dns-wMjf1t6-.mjs} +14 -8
- package/dist/{docs-tOv_OllI.mjs → docs-BA7qslb2.mjs} +1 -1
- package/dist/{dotenv-qsoPELMm.mjs → dotenv-DKRemNCH.mjs} +1 -1
- package/dist/{durable-objects-OJhns_to.mjs → durable-objects-DF0MYpnV.mjs} +1 -1
- package/dist/{email-auth-BbsIBNlu.mjs → email-auth-BShMFXn4.mjs} +1 -1
- package/dist/email-domains-CDSbVclP.mjs +14 -0
- package/dist/{email-routing-DnitWE1A.mjs → email-routing-CBCkbg_F.mjs} +4 -2
- package/dist/{email-security-DiWtb7cx.mjs → email-security-CnNa1YON.mjs} +4 -4
- package/dist/{email-sending-DuDjXykw.mjs → email-sending-CpDSw-Eb.mjs} +16 -16
- package/dist/error-sanitization-B025CygB.mjs +2 -0
- package/dist/{error-sanitization-ahuAGEjT.mjs → error-sanitization-DG8WSzHe.mjs} +1 -1
- package/dist/{errors-CCFmptqJ.mjs → errors-DatLr-iR.mjs} +1 -1
- package/dist/{field-extractors-DNNnkBZH.mjs → field-extractors-BwGdMnTr.mjs} +1 -1
- package/dist/{firewall-C7eZRNVF.mjs → firewall-CY_oem-d.mjs} +25 -9
- package/dist/{flagship-BczjsrJ5.mjs → flagship-Bat5EZCk.mjs} +1 -1
- package/dist/{fraud-wE0UM2SM.mjs → fraud-CSUKLh8X.mjs} +2 -2
- package/dist/global-options-DiKj2cQy.mjs +2 -0
- package/dist/{google-tag-gateway-6mvtxcJK.mjs → google-tag-gateway-C2skt6t-.mjs} +1 -1
- package/dist/{healthchecks-aIB3DebS.mjs → healthchecks-uC43QKQd.mjs} +1 -1
- package/dist/{hyperdrive-DHRP8SJS.mjs → hyperdrive-FcBbpew4.mjs} +3 -3
- package/dist/iam-8T74DNhH.mjs +62 -0
- package/dist/{images-CLgvxd0t.mjs → images-C3JUaf6b.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{init-B_DBTMXU.mjs → init-BEVVz4_P.mjs} +1 -1
- package/dist/{intel-jnoIVlYG.mjs → intel-DRy4rHrt.mjs} +6 -7
- package/dist/{interactive-1g0dnrA8.mjs → interactive-CKHdGvkh.mjs} +1 -1
- package/dist/{internal-Ba3b-Z8J.mjs → internal-CamuESs0.mjs} +1 -1
- package/dist/{ips-CQ4gFfex.mjs → ips-DinCNnWj.mjs} +1 -1
- package/dist/k2-wsanPL3y.mjs +10 -0
- package/dist/{kv-DQfnNE-w.mjs → kv-BLSPcEnH.mjs} +1 -1
- package/dist/{lazy-command-DjGzxiUT.mjs → lazy-command-WB1FOuew.mjs} +1 -1
- package/dist/{leaked-credential-checks-CaqjG3Oz.mjs → leaked-credential-checks-CSZd9hBQ.mjs} +1 -1
- package/dist/{live-BfobGv8W.mjs → live-B6AsI_E5.mjs} +1 -1
- package/dist/{load-balancers-BzSCp2Uh.mjs → load-balancers-gap5u4b1.mjs} +19 -7
- package/dist/local-CFsO9Tkg.mjs +2 -0
- package/dist/{local-BNmz58v4.mjs → local-CgBhtmON.mjs} +1 -1
- package/dist/{local-runtime-DvH92pV8.mjs → local-runtime-CmlJ20uJ.mjs} +1 -1
- package/dist/{login-B9wYab6S.mjs → login-BJHaTERg.mjs} +1 -1
- package/dist/login-BfuOf-Yi.mjs +2 -0
- package/dist/logpush-qhlxsioM.mjs +68 -0
- package/dist/{logs-Dan7xU-k.mjs → logs-bI54CJ0w.mjs} +23 -7
- package/dist/{magic-network-monitoring-TAjt04vN.mjs → magic-network-monitoring-CX3TaMTu.mjs} +1 -1
- package/dist/{magic-transit-BSuLHnQ5.mjs → magic-transit-BwDyySHJ.mjs} +20 -20
- package/dist/{managed-defense-CTnIZLg4.mjs → managed-defense-CsBBkfeQ.mjs} +2 -2
- package/dist/{managed-transforms-BETvesjp.mjs → managed-transforms-CUC-uAbW.mjs} +1 -1
- package/dist/{mcp-DhjMGaKc.mjs → mcp-CyI0sDmL.mjs} +3 -3
- package/dist/{mesh-jxLLG3t4.mjs → mesh-Czr0UCP4.mjs} +2 -2
- package/dist/{migrate-Bkhk38nJ.mjs → migrate-DKDWYrz2.mjs} +1 -1
- package/dist/{monetization-BqDgHlPv.mjs → monetization-NUgfDtSy.mjs} +7 -3
- package/dist/{network-D6BRpgOv.mjs → network-B42zrBic.mjs} +1 -1
- package/dist/{network-interconnects-tP41GbnL.mjs → network-interconnects-DuIBe8fK.mjs} +4 -4
- package/dist/{o11y-h4cIC_1T.mjs → o11y-oEUpMC3O.mjs} +6 -6
- package/dist/{oauth-CuM12iNb.mjs → oauth-BLQ1-y3R.mjs} +1 -1
- package/dist/{oauth-nDH3nTCa.mjs → oauth-BmSFLp_s.mjs} +1 -1
- package/dist/observability-BxhJQCgZ.mjs +4 -0
- package/dist/organization-CEnlXwrl.mjs +70 -0
- package/dist/{organizations-7Q3d9vcW.mjs → organizations-Dt86ToxE.mjs} +1 -1
- package/dist/{origin-post-quantum-encryption-XBMPCdSL.mjs → origin-post-quantum-encryption-lX-uaJSL.mjs} +1 -1
- package/dist/package-CiRJBRHO.mjs +2 -0
- package/dist/{page-rules-BlT5xlhH.mjs → page-rules-J6LhwR-s.mjs} +1 -1
- package/dist/{pages-CIbL62L2.mjs → pages-BksdnChs.mjs} +4 -4
- package/dist/{pay-per-crawl-BzsBqo_m.mjs → pay-per-crawl-BLcbHRoR.mjs} +1 -1
- package/dist/{pay-per-use-DtejLYJ8.mjs → pay-per-use-VatiU-Nt.mjs} +4 -2
- package/dist/{pipelines-LjLb8jq6.mjs → pipelines-B5AoB3f3.mjs} +5 -5
- package/dist/precursor-D3VH2MXT.mjs +4 -0
- package/dist/{previews-zRYO9uO9.mjs → previews-DzJ85fsr.mjs} +1 -1
- package/dist/{progress-_Jux05O5.mjs → progress-DLri-rA7.mjs} +1 -1
- package/dist/{prompt-SNVLBS1b.mjs → prompt-D0dXwuME.mjs} +1 -1
- package/dist/{queues-Ci4rGGC4.mjs → queues-BsAck4To.mjs} +5 -5
- package/dist/{r2-qm2hgS43.mjs → r2-BYjdHDEZ.mjs} +38 -38
- package/dist/{radar-C_ydbJe_.mjs → radar-CvLtu-Vr.mjs} +1 -1
- package/dist/{raw-fetch-D3ydyJYW.mjs → raw-fetch-DQeDx1wT.mjs} +1 -1
- package/dist/{ready-hk-_B8z3.mjs → ready-gsGEaWLL.mjs} +1 -1
- package/dist/{realtime-BAvjYmYw.mjs → realtime-DiCEgFTC.mjs} +81 -79
- package/dist/{registrar-DD7WZaP2.mjs → registrar-D4wdgWpo.mjs} +8 -8
- package/dist/{registrar-sandbox-DbxloH5s.mjs → registrar-sandbox-B6yopzdG.mjs} +2 -2
- package/dist/{reporting-CRVg3J1C.mjs → reporting-BiHgnT8L.mjs} +1 -1
- package/dist/{request-headers-Cn01EsbI.mjs → request-headers-CoxHUNcB.mjs} +1 -1
- package/dist/{request-tracers-BWs0rdFS.mjs → request-tracers-817HTytF.mjs} +1 -1
- package/dist/{resource-sharing-yipIkdbd.mjs → resource-sharing-CW9xxtq5.mjs} +12 -12
- package/dist/{rules-CCtaBLiN.mjs → rules-CRhe_ca9.mjs} +1 -1
- package/dist/rulesets-CKyc-Xlx.mjs +42 -0
- package/dist/{rum-gDOKylu_.mjs → rum-BfnWHW_d.mjs} +1 -1
- package/dist/{run-Br8sYjNF.mjs → run-Ciw_GIrC.mjs} +1 -1
- package/dist/run-DD45EQTm.mjs +2 -0
- package/dist/{schema-cache-Cb64Nqbt.mjs → schema-cache-BIo0Gi2H.mjs} +1 -1
- package/dist/schema-flags-DrqvwQNw.mjs +4 -0
- package/dist/{scim-CM8Xah56.mjs → scim-C4iRWNYB.mjs} +1 -1
- package/dist/{secrets-store-BEnXiYCC.mjs → secrets-store-DgtzZRze.mjs} +1 -1
- package/dist/security-insights-SlUGW3F_.mjs +62 -0
- package/dist/{security-txt-BF0PWAEW.mjs → security-txt-C3YS0REz.mjs} +1 -1
- package/dist/{session-B7vOqdZU.mjs → session-D2yuwO4i.mjs} +1 -1
- package/dist/{shared-CBMFY1VY.mjs → shared--uVkAAd7.mjs} +1 -1
- package/dist/{signed-url-VDDQlllt.mjs → signed-url-ClLk45_J.mjs} +1 -1
- package/dist/{smart-shield-DQku_wYi.mjs → smart-shield-Dn95hqUH.mjs} +1 -1
- package/dist/{snippets-B3FCEMuh.mjs → snippets-BNUKOajz.mjs} +1 -1
- package/dist/{spawn-9sE67p7c.mjs → spawn-DuT4snxu.mjs} +1 -1
- package/dist/{spectrum-nLirlVue.mjs → spectrum-Cj0BMtg2.mjs} +3 -3
- package/dist/{speed-C1hCyMPy.mjs → speed-BrVeZRyX.mjs} +1 -1
- package/dist/{sql-DVQOKThL.mjs → sql-BX1pBqj3.mjs} +2 -2
- package/dist/src-DPnUfK4c.mjs +131 -0
- package/dist/{ssl-CYDRgr24.mjs → ssl-Bx4LCutF.mjs} +3 -3
- package/dist/{startup-profile-BLvw_Wmc.mjs → startup-profile-DqaYNT0b.mjs} +1 -1
- package/dist/startup-profile-tZNb2HGz.mjs +2 -0
- package/dist/{state-B8n0QU04.mjs → state-BmzOLELo.mjs} +1 -1
- package/dist/state-Uwfrmw5I.mjs +2 -0
- package/dist/{stream-DHyejrI6.mjs → stream-BRzr6yh0.mjs} +1 -1
- package/dist/{tags-DOL6dKQE.mjs → tags-xVzjZxdt.mjs} +11 -5
- package/dist/{telemetry-DJ8-Q2pU.mjs → telemetry-CJ9URio3.mjs} +1 -1
- package/dist/telemetry-Pt5GpCKD.mjs +2 -0
- package/dist/tenant-custom-nameservers-M7Fxqh2W.mjs +8 -0
- package/dist/{tunnels-CMAmH4Vh.mjs → tunnels-DQVXKUKA.mjs} +3 -3
- package/dist/{turnstile-DTJjDMFp.mjs → turnstile-B_Ugzgom.mjs} +1 -1
- package/dist/ui-FYultowZ.mjs +2 -0
- package/dist/{update-check-DDGKWkmi.mjs → update-check-DHUo4FOJ.mjs} +1 -1
- package/dist/{update-check-BkCdHK-3.mjs → update-check-DRr0eRhB.mjs} +1 -1
- package/dist/update-check-worker.mjs +1 -1
- package/dist/{url-normalization-BbWOra1u.mjs → url-normalization-CZRQH_pJ.mjs} +1 -1
- package/dist/{url-scanner-Bj-eS_3C.mjs → url-scanner-BH4PLy16.mjs} +1 -1
- package/dist/{user-CMzTHHVX.mjs → user-Bn82Qw0Y.mjs} +10 -12
- package/dist/{vectorize-D4H7_KPs.mjs → vectorize-DoVVz_sh.mjs} +1 -1
- package/dist/version-Zr2oF8mY.mjs +2 -0
- package/dist/{waiting-rooms-CqMbVu9s.mjs → waiting-rooms-QUW131o3.mjs} +5 -3
- package/dist/{web-assets-BgfzyF8t.mjs → web-assets-CgQXsp8m.mjs} +2 -2
- package/dist/{web3-ByCe47FI.mjs → web3-TY9s6Swn.mjs} +3 -3
- package/dist/workers-B3uJqJKc.mjs +39 -0
- package/dist/{workers-builds-2N71_8MZ.mjs → workers-builds-BgGY0IGk.mjs} +2 -2
- package/dist/{workers-for-platforms-BMN4QXgT.mjs → workers-for-platforms-5RkV9MVp.mjs} +2 -2
- package/dist/workers-vpc-Bt4OQbwM.mjs +12 -0
- package/dist/{workflows-COiyqt-B.mjs → workflows-6m85DdqF.mjs} +7 -7
- package/dist/{wrangler-migration-CqSg8IDj.mjs → wrangler-migration-BbmGOu8l.mjs} +3 -3
- package/dist/{zaraz-DjwhCH8A.mjs → zaraz-8WSJ7l0L.mjs} +2 -2
- package/dist/{zero-trust-BmpuDOmH.mjs → zero-trust-DK0cqDZv.mjs} +483 -405
- package/dist/{zones-XYQiz5kF.mjs → zones-DTAcguf6.mjs} +3 -3
- package/package.json +14 -14
- package/dist/abuse-reports-BIS9MZn7.mjs +0 -24
- package/dist/ai-search-GRN_gXgU.mjs +0 -74
- package/dist/auth-Bls_1yRW.mjs +0 -2
- package/dist/billing-BhPoqyKC.mjs +0 -22
- package/dist/bot-management-BfjX5DuH.mjs +0 -9
- package/dist/browser-run-cxOd2cZE.mjs +0 -40
- package/dist/build-DCdLWwOg.mjs +0 -2
- package/dist/chunk-3PJ54H4K-CbRAWQWI.mjs +0 -363
- package/dist/containers-C_byVTZF.mjs +0 -380
- package/dist/custom-csrs-D0RnVoJ7.mjs +0 -10
- package/dist/custom-nameservers-Dn_9Ssti.mjs +0 -8
- package/dist/custom-pages-HqIQcb77.mjs +0 -20
- package/dist/d1-CopIY9RT.mjs +0 -89
- package/dist/email-domains-pWZi1M4q.mjs +0 -12
- package/dist/error-sanitization-rodO1WCL.mjs +0 -2
- package/dist/iam-6t7-ScrS.mjs +0 -48
- package/dist/k2-Bsm6rzNX.mjs +0 -10
- package/dist/local-ChR3YIMU.mjs +0 -2
- package/dist/login-ierSCYE6.mjs +0 -2
- package/dist/logpush-DgfiSd1b.mjs +0 -44
- package/dist/magic-cloud-networking-DP8fWC4a.mjs +0 -68
- package/dist/oauth-clients-B0voUiXM.mjs +0 -14
- package/dist/oauth-scopes-Bhns1ZHW.mjs +0 -4
- package/dist/organization-Cy55HoRR.mjs +0 -73
- package/dist/package-DK3JX4I3.mjs +0 -2
- package/dist/precursor-BKp5_Ag4.mjs +0 -4
- package/dist/rulesets-DBEvCNDS.mjs +0 -34
- package/dist/run-LOgTLpob.mjs +0 -2
- package/dist/schema-flags-BcbbCWR5.mjs +0 -4
- package/dist/security-insights-Be5GvdBA.mjs +0 -40
- package/dist/src-Bh2gHpI7.mjs +0 -131
- package/dist/startup-profile-ByxSdhEl.mjs +0 -2
- package/dist/state-BTOzaT5L.mjs +0 -2
- package/dist/telemetry-kjElc1zT.mjs +0 -2
- package/dist/tenant-2EdATz2Y.mjs +0 -10
- package/dist/tenant-custom-nameservers-DhEpJNST.mjs +0 -8
- package/dist/ui-7zujR-O7.mjs +0 -2
- package/dist/version-DIIJ2ixL.mjs +0 -2
- package/dist/workers-BiLsPkYD.mjs +0 -39
- package/dist/workers-vpc-3o7dMg7-.mjs +0 -12
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CgBhtmON.mjs";import{n}from"./auth-FK2eLQ02.mjs";import{a as r,i,t as a}from"./context-Dp4CXG22.mjs";import{t as o}from"./output-BJEgbI0G.mjs";import{t as s}from"./dry-run-gy0Hl9xo.mjs";import{t as c}from"./progress-DLri-rA7.mjs";import{t as l}from"./run-Ciw_GIrC.mjs";import"./telemetry-Pt5GpCKD.mjs";import{a as u,n as d,t as f}from"./body-parser-BKcZS9iJ.mjs";import{n as p}from"./input-validation-D7z60HJH.mjs";import{a as m,i as h,n as g}from"./prompt-D0dXwuME.mjs";var _={method:`GET`,path:t=>e`/${t.account_or_zone}/${t.account_or_zone_id}/waiting_rooms`,query:[`page`,`per_page`]};function ee(e){return e.usage(`$0 waiting-rooms account-waiting-rooms list
|
|
3
3
|
|
|
4
|
-
Lists waiting rooms for account or zone
|
|
4
|
+
Lists waiting rooms for account or zone.
|
|
5
|
+
|
|
6
|
+
Runs against your account. Pass --zone to run against a zone instead. CLOUDFLARE_ZONE_ID is ignored.`).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page. Must be a multiple of 5.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`list`,describe:`List waiting rooms for account or zone`,builder:ee,handler:async e=>l({command:`waiting-rooms account-waiting-rooms list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let l={page:e.page,per_page:e[`per-page`]};if(e.dryRun){let t=e.zone===void 0?await r():void 0,n=e.zone===void 0?`accounts`:`zones`,i=e.zone??t??`<account-id>`;s({command:`cf waiting-rooms account-waiting-rooms list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${n}/${i}/waiting_rooms`,pathParams:{"account-or-zone":String(n),"account-or-zone-id":String(i)},query:l,bodyKind:`none`});return}let u=await n(e),d=e.zone===void 0?`accounts`:`zones`,f=d===`zones`?await i({zone:e.zone},u,{quiet:e.quiet}):e.local?t:await a();d===`zones`?e.zoneId=f:e.accountId=f;let p=await c(`Loading`,async()=>u.send(_,{account_or_zone:d,account_or_zone_id:f,...l}));o(p,{successLabel:`Loaded`})})},y={command:`account-waiting-rooms`,describe:`Account-scoped waiting room listing`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var b={method:`POST`,path:t=>e`/zones/${t.zone_id}/waiting_rooms`,body:`json`};function te(e){return e.usage(`$0 waiting-rooms create
|
|
5
7
|
|
|
6
8
|
Creates a new waiting room.`).option(`additional-routes`,{type:`string`,description:`Only available for the Waiting Room Advanced subscription. Additional hostname and path combinations to which this waiting room will be applied. There is an implied wildcard at the end of the path. The hostname and path combination must be unique to this and all other waiting rooms. Provide as a JSON array of objects or @path/to/file.json.`}).option(`cookie-attributes-samesite`,{type:`string`,description:"Configures the SameSite attribute on the waiting room cookie. Value `auto` will be translated to `lax` or `none` depending if **Always Use HTTPS** is enabled. Note that when using value `none`, the secure attribute cannot be set to `never`.",choices:[`auto`,`lax`,`none`,`strict`]}).coerce(`cookie-attributes-samesite`,e=>p(e,`cookie-attributes-samesite`,`text`)).option(`cookie-attributes-secure`,{type:`string`,description:"Configures the Secure attribute on the waiting room cookie. Value `always` indicates that the Secure attribute will be set in the Set-Cookie header, `never` indicates that the Secure attribute will not be set, and `auto` will set the Secure attribute depending if **Always Use HTTPS** is enabled.",choices:[`auto`,`always`,`never`]}).coerce(`cookie-attributes-secure`,e=>p(e,`cookie-attributes-secure`,`text`)).option(`cookie-suffix`,{type:`string`,description:"Appends a '_' + a custom suffix to the end of Cloudflare Waiting Room's cookie name(__cf_waitingroom). If `cookie_suffix` is \"abcd\", the cookie name will be `__cf_waitingroom_abcd`. This field is required if using `additional_routes`.",default:``}).option(`custom-page-html`,{type:`string`,description:"Only available for the Waiting Room Advanced subscription. This is a template html file that will be rendered at the edge. If no custom_page_html is provided, the default waiting room will be used. The template is based on mustache ( https://mustache.github.io/ ). There are several variables that are evaluated by the Cloudflare edge:\n1. {{`waitTimeKnown`}} Acts like a boolean value that indicates the behavior to take when wait time is not available, for instance when queue_all is **true**.\n2. {{`waitTimeFormatted`}} Estimated wait time for the user. For example, five minutes. Alternatively, you can use:\n3. {{`waitTime`}} Number of minutes of estimated wait for a user.\n4. {{`waitTimeHours`}} Number of hours of estimated wait for a user (`Math.floor(waitTime/60)`).\n5. {{`waitTimeHourMinutes`}} Number of minutes above the `waitTimeHours` value (`waitTime%60`).\n6. {{`queueIsFull`}} Changes to **true** when no more people can be added to the queue.\n\nTo view the full list of variables, look at the `cfWaitingRoom` object described under the `json_response_enabled` property in other Waiting Room API calls.",default:``}).option(`default-template-language`,{type:`string`,description:"The language of the default page template. If no default_template_language is provided, then `en-US` (English) will be used.",choices:/* @__PURE__ */ `en-US.es-ES.de-DE.fr-FR.it-IT.ja-JP.ko-KR.pt-BR.zh-CN.zh-TW.nl-NL.pl-PL.id-ID.tr-TR.ar-EG.ru-RU.fa-IR.bg-BG.hr-HR.cs-CZ.da-DK.fi-FI.lt-LT.lv-LV.ms-MY.nb-NO.ro-RO.el-GR.he-IL.hi-IN.hu-HU.sr-BA.sk-SK.sl-SI.sv-SE.tl-PH.th-TH.uk-UA.vi-VN`.split(`.`),default:`en-US`}).coerce(`default-template-language`,e=>p(e,`default-template-language`,`text`)).option(`description`,{type:`string`,description:`A note that you can use to add more details about the waiting room.`,default:``}).option(`disable-session-renewal`,{type:`boolean`,description:"Only available for the Waiting Room Advanced subscription. Disables automatic renewal of session cookies. If `true`, an accepted user will have session_duration minutes to browse the site. After that, they will have to go through the waiting room again. If `false`, a user's session cookie will be automatically renewed on every request.",default:!1}).option(`enabled-origin-commands`,{type:`string`,array:!0,description:`A list of enabled origin commands.`}).option(`host`,{type:`string`,description:`The host name to which the waiting room will be applied (no wildcards). Please do not include the scheme (http:// or https://). The host and path combination must be unique.`}).option(`json-response-enabled`,{type:`boolean`,description:'Only available for the Waiting Room Advanced subscription. If `true`, requests to the waiting room with the header `Accept: application/json` will receive a JSON response object with information on the user\'s status in the waiting room as opposed to the configured static HTML page. This JSON response object has one property `cfWaitingRoom` which is an object containing the following fields:\n1. `inWaitingRoom`: Boolean indicating if the user is in the waiting room (always **true**).\n2. `waitTimeKnown`: Boolean indicating if the current estimated wait times are accurate. If **false**, they are not available.\n3. `waitTime`: Valid only when `waitTimeKnown` is **true**. Integer indicating the current estimated time in minutes the user will wait in the waiting room. When `queueingMethod` is **random**, this is set to `waitTime50Percentile`.\n4. `waitTime25Percentile`: Valid only when `queueingMethod` is **random** and `waitTimeKnown` is **true**. Integer indicating the current estimated maximum wait time for the 25% of users that gain entry the fastest (25th percentile).\n5. `waitTime50Percentile`: Valid only when `queueingMethod` is **random** and `waitTimeKnown` is **true**. Integer indicating the current estimated maximum wait time for the 50% of users that gain entry the fastest (50th percentile). In other words, half of the queued users are expected to let into the origin website before `waitTime50Percentile` and half are expected to be let in after it.\n6. `waitTime75Percentile`: Valid only when `queueingMethod` is **random** and `waitTimeKnown` is **true**. Integer indicating the current estimated maximum wait time for the 75% of users that gain entry the fastest (75th percentile).\n7. `waitTimeFormatted`: String displaying the `waitTime` formatted in English for users. If `waitTimeKnown` is **false**, `waitTimeFormatted` will display **unavailable**.\n8. `queueIsFull`: Boolean indicating if the waiting room\'s queue is currently full and not accepting new users at the moment.\n9. `queueAll`: Boolean indicating if all users will be queued in the waiting room and no one will be let into the origin website.\n10. `lastUpdated`: String displaying the timestamp as an ISO 8601 string of the user\'s last attempt to leave the waiting room and be let into the origin website. The user is able to make another attempt after `refreshIntervalSeconds` past this time. If the user makes a request too soon, it will be ignored and `lastUpdated` will not change.\n11. `refreshIntervalSeconds`: Integer indicating the number of seconds after `lastUpdated` until the user is able to make another attempt to leave the waiting room and be let into the origin website. When the `queueingMethod` is `reject`, there is no specified refresh time —\\_it will always be **zero**.\n12. `queueingMethod`: The queueing method currently used by the waiting room. It is either **fifo**, **random**, **passthrough**, or **reject**.\n13. `isFIFOQueue`: Boolean indicating if the waiting room uses a FIFO (First-In-First-Out) queue.\n14. `isRandomQueue`: Boolean indicating if the waiting room uses a Random queue where users gain access randomly.\n15. `isPassthroughQueue`: Boolean indicating if the waiting room uses a passthrough queue. Keep in mind that when passthrough is enabled, this JSON response will only exist when `queueAll` is **true** or `isEventPrequeueing` is **true** because in all other cases requests will go directly to the origin.\n16. `isRejectQueue`: Boolean indicating if the waiting room uses a reject queue.\n17. `isEventActive`: Boolean indicating if an event is currently occurring. Events are able to change a waiting room\'s behavior during a specified period of time. For additional information, look at the event properties `prequeue_start_time`, `event_start_time`, and `event_end_time` in the documentation for creating waiting room events. Events are considered active between these start and end times, as well as during the prequeueing period if it exists.\n18. `isEventPrequeueing`: Valid only when `isEventActive` is **true**. Boolean indicating if an event is currently prequeueing users before it starts.\n19. `timeUntilEventStart`: Valid only when `isEventPrequeueing` is **true**. Integer indicating the number of minutes until the event starts.\n20. `timeUntilEventStartFormatted`: String displaying the `timeUntilEventStart` formatted in English for users. If `isEventPrequeueing` is **false**, `timeUntilEventStartFormatted` will display **unavailable**.\n21. `timeUntilEventEnd`: Valid only when `isEventActive` is **true**. Integer indicating the number of minutes until the event ends.\n22. `timeUntilEventEndFormatted`: String displaying the `timeUntilEventEnd` formatted in English for users. If `isEventActive` is **false**, `timeUntilEventEndFormatted` will display **unavailable**.\n23. `shuffleAtEventStart`: Valid only when `isEventActive` is **true**. Boolean indicating if the users in the prequeue are shuffled randomly when the event starts.\n24. `turnstile`: Empty when turnstile isn\'t enabled. String displaying an html tag to display the Turnstile widget. Please add the `{{{turnstile}}}` tag to the `custom_html` template to ensure the Turnstile widget appears.\n25. `infiniteQueue`: Boolean indicating whether the response is for a user in the infinite queue.\n\nAn example cURL to a waiting room could be:\n\n curl -X GET "https://example.com/waitingroom" \\\n -H "Accept: application/json"\n\nIf `json_response_enabled` is **true** and the request hits the waiting room, an example JSON response when `queueingMethod` is **fifo** and no event is active could be:\n\n {\n "cfWaitingRoom": {\n "inWaitingRoom": true,\n "waitTimeKnown": true,\n "waitTime": 10,\n "waitTime25Percentile": 0,\n "waitTime50Percentile": 0,\n "waitTime75Percentile": 0,\n "waitTimeFormatted": "10 minutes",\n "queueIsFull": false,\n "queueAll": false,\n "lastUpdated": "2020-08-03T23:46:00.000Z",\n "refreshIntervalSeconds": 20,\n "queueingMethod": "fifo",\n "isFIFOQueue": true,\n "isRandomQueue": false,\n "isPassthroughQueue": false,\n "isRejectQueue": false,\n "isEventActive": false,\n "isEventPrequeueing": false,\n "timeUntilEventStart": 0,\n "timeUntilEventStartFormatted": "unavailable",\n "timeUntilEventEnd": 0,\n "timeUntilEventEndFormatted": "unavailable",\n "shuffleAtEventStart": false\n }\n }\n\nIf `json_response_enabled` is **true** and the request hits the waiting room, an example JSON response when `queueingMethod` is **random** and an event is active could be:\n\n {\n "cfWaitingRoom": {\n "inWaitingRoom": true,\n "waitTimeKnown": true,\n "waitTime": 10,\n "waitTime25Percentile": 5,\n "waitTime50Percentile": 10,\n "waitTime75Percentile": 15,\n "waitTimeFormatted": "5 minutes to 15 minutes",\n "queueIsFull": false,\n "queueAll": false,\n "lastUpdated": "2020-08-03T23:46:00.000Z",\n "refreshIntervalSeconds": 20,\n "queueingMethod": "random",\n "isFIFOQueue": false,\n "isRandomQueue": true,\n "isPassthroughQueue": false,\n "isRejectQueue": false,\n "isEventActive": true,\n "isEventPrequeueing": false,\n "timeUntilEventStart": 0,\n "timeUntilEventStartFormatted": "unavailable",\n "timeUntilEventEnd": 15,\n "timeUntilEventEndFormatted": "15 minutes",\n "shuffleAtEventStart": true\n }\n }',default:!1}).option(`name`,{type:`string`,description:`A unique name to identify the waiting room. Only alphanumeric characters, hyphens and underscores are allowed.`}).option(`new-users-per-minute`,{type:`number`,description:`Sets the number of new users that will be let into the route every minute. This value is used as baseline for the number of users that are let in per minute. So it is possible that there is a little more or little less traffic coming to the route based on the traffic patterns at that time around the world.`}).option(`path`,{type:`string`,description:`Sets the path within the host to enable the waiting room on. The waiting room will be enabled for all subpaths as well. If there are two waiting rooms on the same subpath, the waiting room for the most specific path will be chosen. Wildcards and query parameters are not supported.`,default:`/`}).option(`queue-all`,{type:`boolean`,description:"If queue_all is `true`, all the traffic that is coming to a route will be sent to the waiting room. No new traffic can get to the route once this field is set and estimated time will become unavailable.",default:!1}).option(`queueing-method`,{type:`string`,description:"Sets the queueing method used by the waiting room. Changing this parameter from the **default** queueing method is only available for the Waiting Room Advanced subscription. Regardless of the queueing method, if `queue_all` is enabled or an event is prequeueing, users in the waiting room will not be accepted to the origin. These users will always see a waiting room page that refreshes automatically. The valid queueing methods are:\n1. `fifo` **(default)**: First-In-First-Out queue where customers gain access in the order they arrived.\n2. `random`: Random queue where customers gain access randomly, regardless of arrival time.\n3. `passthrough`: Users will pass directly through the waiting room and into the origin website. As a result, any configured limits will not be respected while this is enabled. This method can be used as an alternative to disabling a waiting room (with `suspended`) so that analytics are still reported. This can be used if you wish to allow all traffic normally, but want to restrict traffic during a waiting room event, or vice versa.\n4. `reject`: Users will be immediately rejected from the waiting room. As a result, no users will reach the origin website while this is enabled. This can be used if you wish to reject all traffic while performing maintenance, block traffic during a specified period of time (an event), or block traffic while events are not occurring. Consider a waiting room used for vaccine distribution that only allows traffic during sign-up events, and otherwise blocks all traffic. For this case, the waiting room uses `reject`, and its events override this with `fifo`, `random`, or `passthrough`. When this queueing method is enabled and neither `queueAll` is enabled nor an event is prequeueing, the waiting room page **will not refresh automatically**.",choices:[`fifo`,`random`,`passthrough`,`reject`],default:`fifo`}).coerce(`queueing-method`,e=>p(e,`queueing-method`,`text`)).option(`queueing-status-code`,{type:`number`,description:`HTTP status code returned to a user while in the queue.`,default:200}).option(`session-duration`,{type:`number`,description:`Lifetime of a cookie (in minutes) set by Cloudflare for users who get access to the route. If a user is not seen by Cloudflare again in that time period, they will be treated as a new user that visits the route.`,default:5}).option(`suspended`,{type:`boolean`,description:"Suspends or allows traffic going to the waiting room. If set to `true`, the traffic will not go to the waiting room.",default:!1}).option(`total-active-users`,{type:`number`,description:`Sets the total number of active user sessions on the route at a point in time. A route is a combination of host and path on which a waiting room is available. This value is used as a baseline for the total number of active user sessions on the route. It is possible to have a situation where there are more or less active users sessions on the route based on the traffic patterns at that time around the world.`}).option(`turnstile-action`,{type:`string`,description:"Which action to take when a bot is detected using Turnstile. `log` will\nhave no impact on queueing behavior, simply keeping track of how many\nbots are detected in Waiting Room Analytics. `infinite_queue` will send\nbots to a false queueing state, where they will never reach your\norigin. `infinite_queue` requires Advanced Waiting Room.\n",choices:[`log`,`infinite_queue`],default:`log`}).coerce(`turnstile-action`,e=>p(e,`turnstile-action`,`text`)).option(`turnstile-mode`,{type:`string`,description:"Which Turnstile widget type to use for detecting bot traffic. See\n[the Turnstile documentation](https://developers.cloudflare.com/turnstile/concepts/widget/#widget-types)\nfor the definitions of these widget types. Set to `off` to disable the\nTurnstile integration entirely. Setting this to anything other than\n`off` or `invisible` requires Advanced Waiting Room.\n",choices:[`off`,`invisible`,`visible_non_interactive`,`visible_managed`],default:`invisible`}).coerce(`turnstile-mode`,e=>p(e,`turnstile-mode`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ne={command:`create`,describe:`Create waiting room`,builder:te,handler:async e=>l({command:`waiting-rooms create`,classification:{safeFlags:[`cookie-attributes-samesite`,`cookie-attributes-secure`,`default-template-language`,`disable-session-renewal`,`json-response-enabled`,`queue-all`,`queueing-method`,`suspended`,`turnstile-action`,`turnstile-mode`,`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf waiting-rooms create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/waiting_rooms`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?f({additional_routes:u(e[`additional-routes`],`additional-routes`),cookie_attributes:{samesite:e[`cookie-attributes-samesite`],secure:e[`cookie-attributes-secure`]},cookie_suffix:p(e[`cookie-suffix`],`cookie-suffix`,`text`),custom_page_html:p(e[`custom-page-html`],`custom-page-html`,`text`),default_template_language:e[`default-template-language`],description:p(e.description,`description`,`text`),disable_session_renewal:e[`disable-session-renewal`],enabled_origin_commands:e[`enabled-origin-commands`],host:p(e.host,`host`,`text`),json_response_enabled:e[`json-response-enabled`],name:p(e.name,`name`,`text`),new_users_per_minute:e[`new-users-per-minute`],path:p(e.path,`path`,`text`),queue_all:e[`queue-all`],queueing_method:e[`queueing-method`],queueing_status_code:e[`queueing-status-code`],session_duration:e[`session-duration`],suspended:e.suspended,total_active_users:e[`total-active-users`],turnstile_action:e[`turnstile-action`],turnstile_mode:e[`turnstile-mode`]}):d(e.body)});return}let t=await n(e),r=await i({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=d(e.body),i=await c(`Creating`,async()=>t.send(b,{body:n,zone_id:r}));o(i,{successLabel:`Created`});return}if(e.host===void 0&&(e.host=await m(`host`,`The host name to which the waiting room will be applied (no wildcards). Please do not include the scheme (http:// or https://). The host and path combination must be unique.`)),e.name===void 0&&(e.name=await m(`name`,`A unique name to identify the waiting room. Only alphanumeric characters, hyphens and underscores are allowed.`)),e[`new-users-per-minute`]===void 0)throw Error(`--new-users-per-minute is required (or pass --body with this field set).`);if(e[`total-active-users`]===void 0)throw Error(`--total-active-users is required (or pass --body with this field set).`);let a=f({additional_routes:u(e[`additional-routes`],`additional-routes`),cookie_attributes:{samesite:e[`cookie-attributes-samesite`],secure:e[`cookie-attributes-secure`]},cookie_suffix:p(e[`cookie-suffix`],`cookie-suffix`,`text`),custom_page_html:p(e[`custom-page-html`],`custom-page-html`,`text`),default_template_language:e[`default-template-language`],description:p(e.description,`description`,`text`),disable_session_renewal:e[`disable-session-renewal`],enabled_origin_commands:e[`enabled-origin-commands`],host:p(e.host,`host`,`text`),json_response_enabled:e[`json-response-enabled`],name:p(e.name,`name`,`text`),new_users_per_minute:e[`new-users-per-minute`],path:p(e.path,`path`,`text`),queue_all:e[`queue-all`],queueing_method:e[`queueing-method`],queueing_status_code:e[`queueing-status-code`],session_duration:e[`session-duration`],suspended:e.suspended,total_active_users:e[`total-active-users`],turnstile_action:e[`turnstile-action`],turnstile_mode:e[`turnstile-mode`]}),l=await c(`Creating`,async()=>t.send(b,{body:a,zone_id:r}));o(l,{successLabel:`Created`})})};var re={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/waiting_rooms/${t.waiting_room_id}`};function ie(e){return e.usage(`$0 waiting-rooms delete <waiting-room-id>
|
|
7
9
|
|
|
@@ -29,7 +31,7 @@ Only available for the Waiting Room Advanced subscription. Creates a rule for a
|
|
|
29
31
|
|
|
30
32
|
Deletes a rule for a waiting room.`).positional(`rule-id`,{type:`string`,description:`The ID of the rule.`,demandOption:!0}).option(`waiting-room-id`,{type:`string`,description:`Waiting room 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 ge={command:`delete <rule-id>`,describe:`Delete Waiting Room Rule`,builder:he,handler:async e=>l({command:`waiting-rooms rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){s({command:`cf waiting-rooms rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/waiting_rooms/${e[`waiting-room-id`]==null?`<waiting-room-id>`:encodeURIComponent(String(e[`waiting-room-id`]))}/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"waiting-room-id":String(e[`waiting-room-id`]??``),"rule-id":String(e[`rule-id`]??``)},bodyKind:`none`});return}let t=await n(e),r=await i({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,!await g({force:!!e.force,message:`This operation deletes the rule from the waiting room.`}))return;let a=await c(`Deleting`,async()=>t.send(me,{zone_id:r,waiting_room_id:e[`waiting-room-id`],rule_id:e[`rule-id`]}));o(a,{successLabel:`Deleted`})})};var Y={method:`PATCH`,path:t=>e`/zones/${t.zone_id}/waiting_rooms/${t.waiting_room_id}/rules/${t.rule_id}`,body:`json`,constants:{action:`bypass_waiting_room`}};function _e(e){return e.usage(`$0 waiting-rooms rules edit <rule-id>
|
|
31
33
|
|
|
32
|
-
Patches a rule for a waiting room.`).positional(`rule-id`,{type:`string`,description:`The ID of the rule.`,demandOption:!0}).option(`waiting-room-id`,{type:`string`,description:`Waiting room ID`,demandOption:!0}).option(`action`,{type:`string`,description:`The action to take when the expression matches.`,choices:[`bypass_waiting_room`]}).coerce(`action`,e=>p(e,`action`,`text`)).option(`description`,{type:`string`,description:`The description of the rule.`}).option(`enabled`,{type:`boolean`,description:`When set to true, the rule is enabled.`}).option(`expression`,{type:`string`,description:`Criteria defining when there is a match for the current rule.`}).option(`position-index`,{type:`number`,description:`Places the rule in the exact position specified by the integer number <POSITION_NUMBER>. Position numbers start with 1. Existing rules in the ruleset from the specified position number onward are shifted one position (no rule is overwritten).`}).option(`position-before`,{type:`string`,description:`Places the rule before rule <RULE_ID>. Use this argument with an empty rule ID value ("") to set the rule as the first rule in the ruleset.`}).option(`position-after`,{type:`string`,description:`Places the rule after rule <RULE_ID>. Use this argument with an empty rule ID value ("") to set the rule as the last rule in the ruleset.`}).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)`})
|
|
34
|
+
Patches a rule for a waiting room.`).positional(`rule-id`,{type:`string`,description:`The ID of the rule.`,demandOption:!0}).option(`waiting-room-id`,{type:`string`,description:`Waiting room ID`,demandOption:!0}).option(`action`,{type:`string`,description:`The action to take when the expression matches.`,choices:[`bypass_waiting_room`]}).coerce(`action`,e=>p(e,`action`,`text`)).option(`description`,{type:`string`,description:`The description of the rule.`}).option(`enabled`,{type:`boolean`,description:`When set to true, the rule is enabled.`}).option(`expression`,{type:`string`,description:`Criteria defining when there is a match for the current rule.`}).option(`position-index`,{type:`number`,description:`Places the rule in the exact position specified by the integer number <POSITION_NUMBER>. Position numbers start with 1. Existing rules in the ruleset from the specified position number onward are shifted one position (no rule is overwritten).`}).option(`position-before`,{type:`string`,description:`Places the rule before rule <RULE_ID>. Use this argument with an empty rule ID value ("") to set the rule as the first rule in the ruleset.`}).option(`position-after`,{type:`string`,description:`Places the rule after rule <RULE_ID>. Use this argument with an empty rule ID value ("") to set the rule as the last rule in the ruleset.`}).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 ve={command:`edit <rule-id>`,describe:`Patch Waiting Room Rule`,builder:_e,handler:async e=>l({command:`waiting-rooms rules edit`,classification:{safeFlags:[`action`,`enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf waiting-rooms rules edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/waiting_rooms/${e[`waiting-room-id`]==null?`<waiting-room-id>`:encodeURIComponent(String(e[`waiting-room-id`]))}/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"waiting-room-id":String(e[`waiting-room-id`]??``),"rule-id":String(e[`rule-id`]??``)},bodyKind:`json`,body:e.body===void 0?f({action:e.action,description:p(e.description,`description`,`text`),enabled:e.enabled,expression:p(e.expression,`expression`,`text`),position:{index:e[`position-index`],before:p(e[`position-before`],`position-before`,`text`),after:p(e[`position-after`],`position-after`,`text`)}}):d(e.body)});return}let t=await n(e),r=await i({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=d(e.body),i=await c(`Updating`,async()=>t.send(Y,{body:n,zone_id:r,waiting_room_id:e[`waiting-room-id`],rule_id:e[`rule-id`]}));o(i,{successLabel:`Updated`});return}e.action===void 0&&(e.action=await h(`action`,`The action to take when the expression matches.`,[`bypass_waiting_room`])),e.expression===void 0&&(e.expression=await m(`expression`,`Criteria defining when there is a match for the current rule.`));let a=f({action:e.action,description:p(e.description,`description`,`text`),enabled:e.enabled,expression:p(e.expression,`expression`,`text`),position:{index:e[`position-index`],before:p(e[`position-before`],`position-before`,`text`),after:p(e[`position-after`],`position-after`,`text`)}}),l=await c(`Updating`,async()=>t.send(Y,{body:a,zone_id:r,waiting_room_id:e[`waiting-room-id`],rule_id:e[`rule-id`]}));o(l,{successLabel:`Updated`})})};var ye={method:`GET`,path:t=>e`/zones/${t.zone_id}/waiting_rooms/${t.waiting_room_id}/rules`};function be(e){return e.usage(`$0 waiting-rooms rules get <waiting-room-id>
|
|
33
35
|
|
|
34
36
|
Lists rules for a waiting room.`).positional(`waiting-room-id`,{type:`string`,description:`Waiting room ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xe={command:`get <waiting-room-id>`,describe:`List Waiting Room Rules`,builder:be,handler:async e=>l({command:`waiting-rooms rules get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf waiting-rooms rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/waiting_rooms/${e[`waiting-room-id`]==null?`<waiting-room-id>`:encodeURIComponent(String(e[`waiting-room-id`]))}/rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"waiting-room-id":String(e[`waiting-room-id`]??``)},bodyKind:`none`});return}let t=await n(e),r=await i({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r;let a=await c(`Loading`,async()=>t.send(ye,{zone_id:r,waiting_room_id:e[`waiting-room-id`]}));o(a,{successLabel:`Loaded`})})};var Se={method:`PUT`,path:t=>e`/zones/${t.zone_id}/waiting_rooms/${t.waiting_room_id}/rules`,body:`json`};function Ce(e){return e.usage(`$0 waiting-rooms rules update <waiting-room-id>
|
|
35
37
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-FK2eLQ02.mjs";import{i as n}from"./context-Dp4CXG22.mjs";import{t as r}from"./output-BJEgbI0G.mjs";import{t as i}from"./dry-run-gy0Hl9xo.mjs";import{t as a}from"./progress-DLri-rA7.mjs";import{t as o}from"./run-Ciw_GIrC.mjs";import"./telemetry-Pt5GpCKD.mjs";import{n as s,r as c,t as l}from"./body-parser-BKcZS9iJ.mjs";import{n as u}from"./input-validation-D7z60HJH.mjs";import{a as d,i as f,n as p}from"./prompt-D0dXwuME.mjs";var m={method:`GET`,path:t=>e`/zones/${t.zone_id}/api_gateway/discovery`};function ee(e){return e.usage(`$0 web-assets discovery get
|
|
3
3
|
|
|
4
4
|
Returns the latest API operations discovered from zone traffic, rendered as OpenAPI schemas.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get`,describe:`Export discovered API operations as OpenAPI schemas`,builder:ee,handler:async e=>o({command:`web-assets discovery get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf web-assets discovery get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/api_gateway/discovery`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});e.zoneId=s;let c=await a(`Loading`,async()=>o.send(m,{zone_id:s}));r(c,{successLabel:`Loaded`})})};var te={method:`PATCH`,path:t=>e`/zones/${t.zone_id}/api_gateway/discovery/operations`,body:`json`};function ne(e){return e.usage(`$0 web-assets discovery operations bulk-edit
|
|
5
5
|
|
|
6
6
|
Updates the state of one or more discovered web and API operations.`).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 re={command:`bulk-edit`,describe:`Edit discovered web and API operations`,builder:ne,handler:async e=>o({command:`web-assets discovery operations bulk-edit`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf web-assets discovery operations bulk-edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/api_gateway/discovery/operations`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:s(e.body)});return}let o=await t(e),c=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=c,e.body){let t=s(e.body),n=await a(`Updating`,async()=>o.send(te,{body:t,zone_id:c}));r(n,{successLabel:`Updated`})}else if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};var g={method:`PATCH`,path:t=>e`/zones/${t.zone_id}/api_gateway/discovery/operations/${t.discovery_id}`,body:`json`};function ie(e){return e.usage(`$0 web-assets discovery operations edit <discovery-id>
|
|
7
7
|
|
|
8
|
-
Updates the state of a discovered web or API operation.`).positional(`discovery-id`,{type:`string`,description:`Discovery ID of a discovered operation`,demandOption:!0}).option(`state`,{type:`string`,description:"Mark state of operation in API Discovery\n * `review` - Mark operation as for review\n * `ignored` - Mark operation as ignored
|
|
8
|
+
Updates the state of a discovered web or API operation.`).positional(`discovery-id`,{type:`string`,description:`Discovery ID of a discovered operation`,demandOption:!0}).option(`state`,{type:`string`,description:"Mark state of operation in API Discovery\n * `review` - Mark operation as for review\n * `ignored` - Mark operation as ignored",choices:[`review`,`ignored`]}).coerce(`state`,e=>u(e,`state`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ae={command:`edit <discovery-id>`,describe:`Edit a discovered web or API operation`,builder:ie,handler:async e=>o({command:`web-assets discovery operations edit`,classification:{safeFlags:[`state`,`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf web-assets discovery operations edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/api_gateway/discovery/operations/${e[`discovery-id`]==null?`<discovery-id>`:encodeURIComponent(String(e[`discovery-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"discovery-id":String(e[`discovery-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({state:e.state}):s(e.body)});return}let o=await t(e),c=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=c,e.body){let t=s(e.body),n=await a(`Updating`,async()=>o.send(g,{body:t,zone_id:c,discovery_id:e[`discovery-id`]}));r(n,{successLabel:`Updated`});return}let u=l({state:e.state}),d=await a(`Updating`,async()=>o.send(g,{body:u,zone_id:c,discovery_id:e[`discovery-id`]}));r(d,{successLabel:`Updated`})})};var oe={method:`GET`,path:t=>e`/zones/${t.zone_id}/api_gateway/discovery/operations/${t.discovery_id}`};function se(e){return e.usage(`$0 web-assets discovery operations get <discovery-id>
|
|
9
9
|
|
|
10
10
|
Returns a discovered web or API operation by discovery ID.`).positional(`discovery-id`,{type:`string`,description:`Discovery ID of a discovered operation`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ce={command:`get <discovery-id>`,describe:`Get a discovered web or API operation`,builder:se,handler:async e=>o({command:`web-assets discovery operations get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf web-assets discovery operations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/api_gateway/discovery/operations/${e[`discovery-id`]==null?`<discovery-id>`:encodeURIComponent(String(e[`discovery-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"discovery-id":String(e[`discovery-id`]??``)},bodyKind:`none`});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});e.zoneId=s;let c=await a(`Loading`,async()=>o.send(oe,{zone_id:s,discovery_id:e[`discovery-id`]}));r(c,{successLabel:`Loaded`})})};var le={method:`GET`,path:t=>e`/zones/${t.zone_id}/api_gateway/discovery/operations`,query:[`page`,`per_page`,`host`,`method`,`endpoint`,`direction`,`order`,`diff`,`origin`,`state`]};function _(e){return e.usage(`$0 web-assets discovery operations list
|
|
11
11
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-FK2eLQ02.mjs";import{i as n}from"./context-Dp4CXG22.mjs";import{t as r}from"./output-BJEgbI0G.mjs";import{t as i}from"./dry-run-gy0Hl9xo.mjs";import{t as a}from"./progress-DLri-rA7.mjs";import{t as o}from"./run-Ciw_GIrC.mjs";import"./telemetry-Pt5GpCKD.mjs";import{a as s,n as c,t as l}from"./body-parser-BKcZS9iJ.mjs";import{n as u}from"./input-validation-D7z60HJH.mjs";import{a as d,i as f,n as p}from"./prompt-D0dXwuME.mjs";var m={method:`POST`,path:t=>e`/zones/${t.zone_id}/web3/hostnames`,body:`json`};function h(e){return e.usage(`$0 web3 hostnames create
|
|
3
3
|
|
|
4
|
-
Create Web3 Hostname`).option(`description`,{type:`string`,description:`Specify an optional description of the hostname.`}).option(`dnslink`,{type:`string`,description:`Specify the DNSLink value used if the target is ipfs.`}).option(`name`,{type:`string`,description:`Specify the hostname that points to the target gateway via CNAME.`}).option(`target`,{type:`string`,description:`Specify the target gateway of the hostname.`,choices:[`ethereum`,`ipfs`,`ipfs_universal_path`]}).coerce(`target`,e=>u(e,`target`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`create`,describe:`Create Web3 Hostname`,builder:h,handler:async e=>o({command:`web3 hostnames create`,classification:{safeFlags:[`target`,`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf web3 hostnames create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/web3/hostnames`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({description:u(e.description,`description`,`text`),dnslink:u(e.dnslink,`dnslink`,`text`),name:u(e.name,`name`,`text`),target:e.target}):c(e.body)});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=s,e.body){let t=c(e.body),n=await a(`Creating`,async()=>o.send(m,{body:t,zone_id:s}));r(n,{successLabel:`Created`});return}e.name===void 0&&(e.name=await d(`name`,`Specify the hostname that points to the target gateway via CNAME.`)),e.target===void 0&&(e.target=await f(`target`,`Specify the target gateway of the hostname.`,[`ethereum`,`ipfs`,`ipfs_universal_path`]));let p=l({description:u(e.description,`description`,`text`),dnslink:u(e.dnslink,`dnslink`,`text`),name:u(e.name,`name`,`text`),target:e.target}),h=await a(`Creating`,async()=>o.send(m,{body:p,zone_id:s}));r(h,{successLabel:`Created`})})};var _={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/web3/hostnames/${t.identifier}`};function v(e){return e.usage(`$0 web3 hostnames delete <identifier>
|
|
4
|
+
Create Web3 Hostname`).option(`description`,{type:`string`,description:`Specify an optional description of the hostname.`}).option(`dnslink`,{type:`string`,description:`Specify the DNSLink value used if the target is ipfs.`}).option(`name`,{type:`string`,description:`Specify the hostname that points to the target gateway via CNAME.`}).option(`target`,{type:`string`,description:`Specify the target gateway of the hostname.`,choices:[`ethereum`,`ipfs`,`ipfs_universal_path`]}).coerce(`target`,e=>u(e,`target`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`create`,describe:`Create Web3 Hostname`,builder:h,handler:async e=>o({command:`web3 hostnames create`,classification:{safeFlags:[`target`,`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf web3 hostnames create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/web3/hostnames`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({description:u(e.description,`description`,`text`),dnslink:u(e.dnslink,`dnslink`,`text`),name:u(e.name,`name`,`text`),target:e.target}):c(e.body)});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=s,e.body){let t=c(e.body),n=await a(`Creating`,async()=>o.send(m,{body:t,zone_id:s}));r(n,{successLabel:`Created`});return}e.name===void 0&&(e.name=await d(`name`,`Specify the hostname that points to the target gateway via CNAME.`)),e.target===void 0&&(e.target=await f(`target`,`Specify the target gateway of the hostname.`,[`ethereum`,`ipfs`,`ipfs_universal_path`]));let p=l({description:u(e.description,`description`,`text`),dnslink:u(e.dnslink,`dnslink`,`text`),name:u(e.name,`name`,`text`),target:e.target}),h=await a(`Creating`,async()=>o.send(m,{body:p,zone_id:s}));r(h,{successLabel:`Created`})})};var _={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/web3/hostnames/${t.identifier}`,body:`json`};function v(e){return e.usage(`$0 web3 hostnames delete <identifier>
|
|
5
5
|
|
|
6
6
|
Delete Web3 Hostname`).positional(`identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={command:`delete <identifier>`,describe:`Delete Web3 Hostname`,builder:v,handler:async e=>o({command:`web3 hostnames delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){i({command:`cf web3 hostnames delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/web3/hostnames/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),identifier:String(e.identifier??``)},bodyKind:`none`});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=s,!await p({force:!!e.force}))return;let c=await a(`Deleting`,async()=>o.send(_,{zone_id:s,identifier:e.identifier}));r(c,{successLabel:`Deleted`})})};var b={method:`PATCH`,path:t=>e`/zones/${t.zone_id}/web3/hostnames/${t.identifier}`,body:`json`};function x(e){return e.usage(`$0 web3 hostnames edit <identifier>
|
|
7
7
|
|
|
@@ -9,7 +9,7 @@ Edit Web3 Hostname`).positional(`identifier`,{type:`string`,description:`Specify
|
|
|
9
9
|
|
|
10
10
|
Web3 Hostname Details`).positional(`identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get <identifier>`,describe:`Web3 Hostname Details`,builder:w,handler:async e=>o({command:`web3 hostnames get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf web3 hostnames get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/web3/hostnames/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),identifier:String(e.identifier??``)},bodyKind:`none`});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});e.zoneId=s;let c=await a(`Loading`,async()=>o.send(C,{zone_id:s,identifier:e.identifier}));r(c,{successLabel:`Loaded`})})};var E={method:`POST`,path:t=>e`/zones/${t.zone_id}/web3/hostnames/${t.identifier}/ipfs_universal_path/content_list/entries`,body:`json`};function D(e){return e.usage(`$0 web3 hostnames ipfs-universal-paths content-lists entries create <identifier>
|
|
11
11
|
|
|
12
|
-
Create IPFS Universal Path Gateway Content List Entry`).positional(`identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,demandOption:!0}).option(`content`,{type:`string`,description:`Specify the CID or content path of content to block.`}).option(`description`,{type:`string`,description:`Specify an optional description of the content list entry.`}).option(`type`,{type:`string`,description:`Specify the type of content list entry to block.`,choices:[`cid`,`content_path`]}).coerce(`type`,e=>u(e,`type`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const O={command:`create <identifier>`,describe:`Create IPFS Universal Path Gateway Content List Entry`,builder:D,handler:async e=>o({command:`web3 hostnames ipfs-universal-paths content-lists entries create`,classification:{safeFlags:[`type`,`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf web3 hostnames ipfs-universal-paths content-lists entries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/web3/hostnames/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}/ipfs_universal_path/content_list/entries`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),identifier:String(e.identifier??``)},bodyKind:`json`,body:e.body===void 0?l({content:u(e.content,`content`,`text`),description:u(e.description,`description`,`text`),type:e.type}):c(e.body)});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=s,e.body){let t=c(e.body),n=await a(`Creating`,async()=>o.send(E,{body:t,zone_id:s,identifier:e.identifier}));r(n,{successLabel:`Created`});return}e.content===void 0&&(e.content=await d(`content`,`Specify the CID or content path of content to block.`)),e.type===void 0&&(e.type=await f(`type`,`Specify the type of content list entry to block.`,[`cid`,`content_path`]));let p=l({content:u(e.content,`content`,`text`),description:u(e.description,`description`,`text`),type:e.type}),m=await a(`Creating`,async()=>o.send(E,{body:p,zone_id:s,identifier:e.identifier}));r(m,{successLabel:`Created`})})};var k={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/web3/hostnames/${t.identifier}/ipfs_universal_path/content_list/entries/${t.content_list_entry_identifier}`};function A(e){return e.usage(`$0 web3 hostnames ipfs-universal-paths content-lists entries delete <content-list-entry-identifier>
|
|
12
|
+
Create IPFS Universal Path Gateway Content List Entry`).positional(`identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,demandOption:!0}).option(`content`,{type:`string`,description:`Specify the CID or content path of content to block.`}).option(`description`,{type:`string`,description:`Specify an optional description of the content list entry.`}).option(`type`,{type:`string`,description:`Specify the type of content list entry to block.`,choices:[`cid`,`content_path`]}).coerce(`type`,e=>u(e,`type`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const O={command:`create <identifier>`,describe:`Create IPFS Universal Path Gateway Content List Entry`,builder:D,handler:async e=>o({command:`web3 hostnames ipfs-universal-paths content-lists entries create`,classification:{safeFlags:[`type`,`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf web3 hostnames ipfs-universal-paths content-lists entries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/web3/hostnames/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}/ipfs_universal_path/content_list/entries`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),identifier:String(e.identifier??``)},bodyKind:`json`,body:e.body===void 0?l({content:u(e.content,`content`,`text`),description:u(e.description,`description`,`text`),type:e.type}):c(e.body)});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=s,e.body){let t=c(e.body),n=await a(`Creating`,async()=>o.send(E,{body:t,zone_id:s,identifier:e.identifier}));r(n,{successLabel:`Created`});return}e.content===void 0&&(e.content=await d(`content`,`Specify the CID or content path of content to block.`)),e.type===void 0&&(e.type=await f(`type`,`Specify the type of content list entry to block.`,[`cid`,`content_path`]));let p=l({content:u(e.content,`content`,`text`),description:u(e.description,`description`,`text`),type:e.type}),m=await a(`Creating`,async()=>o.send(E,{body:p,zone_id:s,identifier:e.identifier}));r(m,{successLabel:`Created`})})};var k={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/web3/hostnames/${t.identifier}/ipfs_universal_path/content_list/entries/${t.content_list_entry_identifier}`,body:`json`};function A(e){return e.usage(`$0 web3 hostnames ipfs-universal-paths content-lists entries delete <content-list-entry-identifier>
|
|
13
13
|
|
|
14
14
|
Delete IPFS Universal Path Gateway Content List Entry`).positional(`content-list-entry-identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,demandOption:!0}).option(`identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,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 j={command:`delete <content-list-entry-identifier>`,describe:`Delete IPFS Universal Path Gateway Content List Entry`,builder:A,handler:async e=>o({command:`web3 hostnames ipfs-universal-paths content-lists entries delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){i({command:`cf web3 hostnames ipfs-universal-paths content-lists entries delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/web3/hostnames/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}/ipfs_universal_path/content_list/entries/${e[`content-list-entry-identifier`]==null?`<content-list-entry-identifier>`:encodeURIComponent(String(e[`content-list-entry-identifier`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),identifier:String(e.identifier??``),"content-list-entry-identifier":String(e[`content-list-entry-identifier`]??``)},bodyKind:`none`});return}let o=await t(e),s=await n({zone:e.zone},o,{quiet:e.quiet});if(e.zoneId=s,!await p({force:!!e.force}))return;let c=await a(`Deleting`,async()=>o.send(k,{zone_id:s,identifier:e.identifier,content_list_entry_identifier:e[`content-list-entry-identifier`]}));r(c,{successLabel:`Deleted`})})};var M={method:`GET`,path:t=>e`/zones/${t.zone_id}/web3/hostnames/${t.identifier}/ipfs_universal_path/content_list/entries/${t.content_list_entry_identifier}`};function N(e){return e.usage(`$0 web3 hostnames ipfs-universal-paths content-lists entries get <content-list-entry-identifier>
|
|
15
15
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./lazy-command-WB1FOuew.mjs";import{r as t}from"./dotenv-DKRemNCH.mjs";import{J as n}from"./dist-D5qkmHhC.mjs";import"./api-X3wKppsT.mjs";import{t as r}from"./path-DRw6Y-nd.mjs";import{t as i}from"./hand-written-dry-run-B82fRl2N.mjs";import{t as a}from"./local-CgBhtmON.mjs";import{i as o,n as s}from"./auth-FK2eLQ02.mjs";import{t as c}from"./log-BWdaOGOW.mjs";import{a as l,r as u,t as d}from"./context-Dp4CXG22.mjs";import{t as f}from"./deploy-context-DTTgNGro.mjs";import{t as p}from"./output-BJEgbI0G.mjs";import{t as m}from"./dry-run-gy0Hl9xo.mjs";import{t as h}from"./progress-DLri-rA7.mjs";import{n as g,t as _}from"./run-Ciw_GIrC.mjs";import"./telemetry-Pt5GpCKD.mjs";import{a as v,n as y,r as b,s as x,t as S}from"./body-parser-BKcZS9iJ.mjs";import{n as C,t as w}from"./input-validation-D7z60HJH.mjs";import{a as T,i as E,n as D}from"./prompt-D0dXwuME.mjs";import{n as O,t as k}from"./raw-fetch-DQeDx1wT.mjs";import{t as A}from"./body-unions-CjpNjwSW.mjs";import{c as ee,r as te,u as ne}from"./containers-DINLx5_i.mjs";import{a as j,i as M,n as N,o as P,r as F,s as I}from"./build-DO_GNhRl.mjs";import{r as L}from"./deploy-input-mAy06fAI.mjs";import{n as R,t as z}from"./shared--uVkAAd7.mjs";import{readBuildOutput as B}from"@cloudflare/build-output-utils";var V={method:`DELETE`,path:e=>r`/accounts/${e.account_id}/workers/workers/${e.worker_id}`,query:[`force`],errors:{400:`BadRequestError`,401:`UnauthorizedError`,404:`NotFoundError`,500:`InternalServerError`}};function H(e){return e.usage(`$0 workers delete <worker-id>
|
|
3
|
+
|
|
4
|
+
Delete a Worker and all its associated resources (versions, deployments, etc.).`).positional(`worker-id`,{type:`string`,description:`Identifier for the Worker, which can be ID or name.`,demandOption:!0}).option(`delete-with-references`,{type:`boolean`,description:`If true, delete the Worker even when other Workers still reference it. Service bindings in those Workers may be left broken. Durable Object namespaces implemented by the deleted Worker are deleted even if other Workers reference them.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const U={command:`delete <worker-id>`,describe:`Delete Worker`,builder:H,handler:async e=>_({command:`workers delete`,classification:{safeFlags:[`delete-with-references`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let t={force:e[`delete-with-references`]};if(e.dryRun){let n=await l();m({command:`cf workers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/workers/workers/${e[`worker-id`]==null?`<worker-id>`:encodeURIComponent(String(e[`worker-id`]))}`,pathParams:{"worker-id":String(e[`worker-id`]??``)},query:t,bodyKind:`none`});return}let n=await s(e),r=e.local?a:await d();if(e.accountId=r,!await D({force:!!e.force,message:`This will permanently delete the Worker and its associated versions and deployments.`}))return;let i=await h(`Deleting`,async()=>n.send(V,{account_id:r,worker_id:e[`worker-id`],...t}));p(i,{successLabel:`Deleted`})})};var W={method:`POST`,path:e=>r`/accounts/${e.account_id}/workers/scripts/${e.script_name}/deployments`,query:[`force`],body:`json`,constants:{strategy:`percentage`}};function G(e){return e.usage(`$0 workers deployments create
|
|
5
|
+
|
|
6
|
+
Deployments configure how [Worker Versions](https://developers.cloudflare.com/api/operations/worker-versions-list-versions) are deployed to traffic. A deployment can consist of multiple versions of a Worker.`).option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script.`}).option(`bypass-deployment-checks`,{type:`boolean`,description:`If set to true, the deployment will be created even if normally blocked by something such rolling back to an older version when a secret has changed.`}).option(`code-update-strategy-mode`,{type:`string`,description:`Apply Durable Object code updates immediately.`,choices:[`immediate`,`deferred`]}).coerce(`code-update-strategy-mode`,e=>C(e,`code-update-strategy-mode`,`text`)).option(`code-update-strategy-max-delay`,{type:`number`,description:`Set the maximum number of seconds to wait before forcing the update. When omitted, the default maximum delay applies.`}).option(`strategy`,{type:`string`,description:`The strategy field`,choices:[`percentage`]}).coerce(`strategy`,e=>C(e,`strategy`,`text`)).option(`versions`,{type:`string`,description:'Worker versions included in this deployment. Each object must contain a `version_id` UUID and a `percentage`; percentages across all objects must total 100. In the `cf` CLI, pass the entire array as one JSON value to `--versions`, either inline, for example `--versions \'[{"version_id":"023e105f-2a42-4f8b-a1c1-73f6a2a30c0f","percentage":100}]\'`, or from a JSON file with `--versions @versions.json`. Provide as a JSON array of objects or @path/to/file.json.'}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{let t=[`code-update-strategy-mode`,`code-update-strategy-max-delay`].some(t=>e[t]!==void 0);if(!e.body&&t){let t=[`code-update-strategy-mode`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --code-update-strategy-* flag is set`)}return!0})}const K=[{path:[`code_update_strategy`],selector:`mode`,variants:[{values:[`immediate`],schema:{type:`object`,properties:{mode:{enum:[`immediate`]}},required:[`mode`],additionalProperties:!1}},{values:[`deferred`],schema:{type:`object`,properties:{max_delay:{anyOf:[{type:`number`},{type:`null`}]},mode:{enum:[`deferred`]}},required:[`mode`],additionalProperties:!1}}]}],q={command:`create`,describe:`Create Worker Deployment`,builder:G,handler:async e=>_({command:`workers deployments create`,classification:{safeFlags:[`bypass-deployment-checks`,`code-update-strategy-mode`,`strategy`,`dry-run`]}},e,async()=>{let t={force:e[`bypass-deployment-checks`]};if(e.dryRun){let n=await l();m({command:`cf workers deployments create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/workers/scripts/${e.worker??`<worker>`}/deployments`,pathParams:{"script-name":String(e[`script-name`]??``)},query:t,bodyKind:`json`,body:e.body===void 0?A(S({code_update_strategy:{mode:e[`code-update-strategy-mode`],max_delay:e[`code-update-strategy-max-delay`]},strategy:e.strategy,versions:v(e.versions,`versions`)}),K):y(e.body)});return}let n=await s(e),r=e.local?a:await d();e.accountId=r;let i=u({scriptName:e.worker});if(e.worker=i,e.body){let a=y(e.body);new URLSearchParams(Object.entries(t).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let o=await h(`Creating`,async()=>n.send(W,{body:a,account_id:r,script_name:i,...t}));p(o,{successLabel:`Created`});return}if(e.strategy===void 0&&(e.strategy=await E(`strategy`,`The strategy field`,[`percentage`])),e.versions===void 0)throw Error(`--versions is required (or pass --body with this field set).`);let o=S({code_update_strategy:{mode:e[`code-update-strategy-mode`],max_delay:e[`code-update-strategy-max-delay`]},strategy:e.strategy,versions:v(e.versions,`versions`)});A(o,K),new URLSearchParams(Object.entries(t).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let c=await h(`Creating`,async()=>n.send(W,{body:o,account_id:r,script_name:i,...t}));p(c,{successLabel:`Created`})})};var J={method:`DELETE`,path:e=>r`/accounts/${e.account_id}/workers/scripts/${e.script_name}/deployments/${e.deployment_id}`};function Y(e){return e.usage(`$0 workers deployments delete <deployment-id>
|
|
7
|
+
|
|
8
|
+
Delete a Worker Deployment. The latest deployment, which is actively serving traffic, cannot be deleted. All other deployments can be deleted.`).positional(`deployment-id`,{type:`string`,description:`Deployment ID`,demandOption:!0}).option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script.`}).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 X={command:`delete <deployment-id>`,describe:`Delete Worker Deployment`,builder:Y,handler:async e=>_({command:`workers deployments delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await l();m({command:`cf workers deployments delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/scripts/${e.worker??`<worker>`}/deployments/${e[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(e[`deployment-id`]))}`,pathParams:{"script-name":String(e[`script-name`]??``),"deployment-id":String(e[`deployment-id`]??``)},bodyKind:`none`});return}let t=await s(e),n=e.local?a:await d();e.accountId=n;let r=u({scriptName:e.worker});if(e.worker=r,!await D({force:!!e.force,message:`This will permanently delete the Worker deployment.`}))return;let i=await h(`Deleting`,async()=>t.send(J,{account_id:n,script_name:r,deployment_id:e[`deployment-id`]}));p(i,{successLabel:`Deleted`})})};var Z={method:`GET`,path:e=>r`/accounts/${e.account_id}/workers/scripts/${e.script_name}/deployments/${e.deployment_id}`};function re(e){return e.usage(`$0 workers deployments get <deployment-id>
|
|
9
|
+
|
|
10
|
+
Get information about a Worker Deployment.`).positional(`deployment-id`,{type:`string`,description:`Deployment ID`,demandOption:!0}).option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`get <deployment-id>`,describe:`Get Worker Deployment`,builder:re,handler:async e=>_({command:`workers deployments get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await l();m({command:`cf workers deployments get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/scripts/${e.worker??`<worker>`}/deployments/${e[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(e[`deployment-id`]))}`,pathParams:{"script-name":String(e[`script-name`]??``),"deployment-id":String(e[`deployment-id`]??``)},bodyKind:`none`});return}let t=await s(e),n=e.local?a:await d();e.accountId=n;let r=u({scriptName:e.worker});e.worker=r;let i=await h(`Loading`,async()=>t.send(Z,{account_id:n,script_name:r,deployment_id:e[`deployment-id`]}));p(i,{successLabel:`Loaded`})})};var ae={method:`GET`,path:e=>r`/accounts/${e.account_id}/workers/scripts/${e.script_name}/deployments`,query:[`since`,`until`,`page`,`per_page`]};function oe(e){return e.usage(`$0 workers deployments list
|
|
11
|
+
|
|
12
|
+
List Worker deployments. The first deployment in the list is the latest deployment actively serving traffic.`).option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script.`}).option(`since`,{type:`string`,description:`Start of the deployment creation time range, inclusive.`}).option(`until`,{type:`string`,description:`End of the deployment creation time range, inclusive.`}).option(`page`,{type:`number`,description:`Current page.`}).option(`per-page`,{type:`number`,description:`Items per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const se={command:`list`,describe:`List Worker Deployments`,builder:oe,handler:async e=>_({command:`workers deployments list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={since:e.since,until:e.until,page:e.page,per_page:e[`per-page`]};if(e.dryRun){let n=await l();m({command:`cf workers deployments list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/workers/scripts/${e.worker??`<worker>`}/deployments`,pathParams:{"script-name":String(e[`script-name`]??``)},query:t,bodyKind:`none`});return}let n=await s(e),r=e.local?a:await d();e.accountId=r;let i=u({scriptName:e.worker});e.worker=i;let o=await h(`Loading`,async()=>n.send(ae,{account_id:r,script_name:i,...t}));p(o,{successLabel:`Loaded`})})},ce={command:`deployments`,describe:`Operations for deployments`,builder:e=>e.command(q).command(X).command(ie).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var le={method:`GET`,path:e=>r`/accounts/${e.account_id}/workers/workers/${e.worker_id}`,errors:{400:`BadRequestError`,404:`NotFoundError`,500:`InternalServerError`}};function ue(e){return e.usage(`$0 workers get <worker-id>
|
|
13
|
+
|
|
14
|
+
Get details about a specific Worker.`).positional(`worker-id`,{type:`string`,description:`Identifier for the Worker, which can be ID or name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`get <worker-id>`,describe:`Get Worker`,builder:ue,handler:async e=>_({command:`workers get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await l();m({command:`cf workers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/workers/${e[`worker-id`]==null?`<worker-id>`:encodeURIComponent(String(e[`worker-id`]))}`,pathParams:{"worker-id":String(e[`worker-id`]??``)},bodyKind:`none`});return}let t=await s(e),n=e.local?a:await d();e.accountId=n;let r=await h(`Loading`,async()=>t.send(le,{account_id:n,worker_id:e[`worker-id`]}));p(r,{successLabel:`Loaded`})})};var fe={method:`GET`,path:e=>r`/accounts/${e.account_id}/workers/workers`,query:[`page`,`per_page`,`order_by`,`order`],errors:{401:`UnauthorizedError`,500:`InternalServerError`}};function pe(e){return e.usage(`$0 workers list
|
|
15
|
+
|
|
16
|
+
List all Workers for an account.`).option(`page`,{type:`number`,description:`Current page.`}).option(`per-page`,{type:`number`,description:`Items per-page.`}).option(`order-by`,{type:`string`,description:`Property to sort results by.`,choices:[`deployed_on`,`updated_on`,`created_on`,`name`]}).option(`order`,{type:`string`,description:`Sort direction.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`list`,describe:`List Workers`,builder:pe,handler:async e=>_({command:`workers list`,classification:{safeFlags:[`order-by`,`order`,`dry-run`]}},e,async()=>{let t={page:e.page,per_page:e[`per-page`],order_by:e[`order-by`],order:e.order};if(e.dryRun){let e=await l();m({command:`cf workers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/workers`,pathParams:{},query:t,bodyKind:`none`});return}let n=await s(e),r=e.local?a:await d();e.accountId=r;let i=await h(`Loading`,async()=>n.send(fe,{account_id:r,...t}));p(i,{successLabel:`Loaded`})})};var he={method:`GET`,path:e=>r`/accounts/${e.account_id}/workers/scripts-search`,query:[`name`,`id`,`order_by`,`page`,`per_page`]};function ge(e){return e.usage(`$0 workers scripts search
|
|
17
|
+
|
|
18
|
+
Search for Worker scripts in an account.`).option(`name`,{type:`string`,description:`Worker name to search for. Both exact and partial matches are returned.`}).option(`id`,{type:`string`,description:`Worker ID (also called tag) to search for. Only exact matches are returned.`}).option(`order-by`,{type:`string`,description:`Property to sort results by. Results are sorted in ascending order.`,choices:[`created_on`,`modified_on`,`name`]}).option(`page`,{type:`number`,description:`Current page.`}).option(`per-page`,{type:`number`,description:`Items per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _e={command:`search`,describe:`Search Worker Scripts`,builder:ge,handler:async e=>_({command:`workers scripts search`,classification:{safeFlags:[`order-by`,`dry-run`]}},e,async()=>{let t={name:e.name,id:e.id,order_by:e[`order-by`],page:e.page,per_page:e[`per-page`]};if(e.dryRun){let e=await l();m({command:`cf workers scripts search`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/scripts-search`,pathParams:{},query:t,bodyKind:`none`});return}let n=await s(e),r=e.local?a:await d();e.accountId=r;let i=await h(`Loading`,async()=>n.send(he,{account_id:r,...t}));p(i,{successLabel:`Loaded`})})},ve={command:`scripts`,describe:`Operations for scripts`,builder:e=>e.command(_e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ye(e){return e.usage(`$0 workers secrets bulk
|
|
19
|
+
|
|
20
|
+
Create, update, or delete multiple secrets on a Worker script in a single operation using JSON Merge Patch (RFC 7396). This operation creates a single version with all changes included. Prefer this API instead of changing many secrets individually. Usage: - To create or update a secret, set its value to a secret object. - To delete a secret, set its value to \`null\`. - Secrets not included in the request are left unchanged.`).option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script.`}).option(`secrets`,{type:`string`,description:`Map of secret names to secret values:
|
|
21
|
+
- Set to a secret object to create or update.
|
|
22
|
+
- Set to \`null\` to delete.
|
|
23
|
+
- Omit to leave unchanged. Provide as a JSON object or @path/to/file.json.`}).option(`version-tags`,{type:`string`,description:`Optional version tags to apply to the new script version. Provide as a JSON object or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`JSON Merge Patch (RFC 7396) request body for bulk secret changes. `}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const be={command:`bulk`,describe:`Patch multiple Worker script secrets`,builder:ye,handler:async e=>_({command:`workers secrets bulk`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.body===void 0&&e.file===void 0&&e.secrets===void 0&&e[`version-tags`]===void 0)throw Error(`--body is required unless at least one JSON map flag is provided (--secrets, --version-tags).`);if(e.dryRun){let t=await l();m({command:`cf workers secrets bulk`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/scripts/${e.worker??`<worker>`}/secrets-bulk`,pathParams:{"script-name":String(e[`script-name`]??``)},bodyKind:e.file===void 0?`json`:`octet-stream`,body:e.file===void 0?e.body===void 0?S({secrets:b(e.secrets,`secrets`),version_tags:b(e[`version-tags`],`version-tags`)},[[`secrets`],[`version_tags`]]):y(e.body):{file:e.file}});return}let t=await s(e),n=e.local?a:await d();e.accountId=n;let r=u({scriptName:e.worker});if(e.worker=r,e.file){let i=w(e.file),a=await h(`Updating`,async()=>o(t,`PATCH`,`/accounts/${n}/workers/scripts/${r}/secrets-bulk`,{body:i,headers:{"Content-Type":`application/merge-patch+json`}}));p(a,{successLabel:`Updated`});return}if(e.body){let i=y(e.body),a=await h(`Updating`,async()=>o(t,`PATCH`,`/accounts/${n}/workers/scripts/${r}/secrets-bulk`,{body:i}));p(a,{successLabel:`Updated`});return}let i={};e.secrets!==void 0&&x(i,[`secrets`],b(e.secrets,`secrets`)),e[`version-tags`]!==void 0&&x(i,[`version_tags`],b(e[`version-tags`],`version-tags`));let c=await h(`Updating`,async()=>o(t,`PATCH`,`/accounts/${n}/workers/scripts/${r}/secrets-bulk`,{body:i}));p(c,{successLabel:`Updated`})})};var xe={method:`DELETE`,path:e=>r`/accounts/${e.account_id}/workers/scripts/${e.script_name}/secrets/${e.secret_name}`,query:[`url_encoded`]};function Se(e){return e.usage(`$0 workers secrets delete <secret-name>
|
|
24
|
+
|
|
25
|
+
Remove a secret from a Worker script by creating a new version without that secret. When changing more than one secret at a time, prefer the "Patch multiple script secrets" API instead of changing many secrets individually.`).positional(`secret-name`,{type:`string`,description:`A JavaScript variable name for the secret binding.`,demandOption:!0}).option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script.`}).option(`url-encoded`,{type:`boolean`,description:`Flag that indicates whether the secret name is URL encoded.`}).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 Ce={command:`delete <secret-name>`,describe:`Delete Worker script secret`,builder:Se,handler:async e=>_({command:`workers secrets delete`,classification:{safeFlags:[`url-encoded`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let t={url_encoded:e[`url-encoded`]};if(e.dryRun){let n=await l();m({command:`cf workers secrets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/workers/scripts/${e.worker??`<worker>`}/secrets/${e[`secret-name`]==null?`<secret-name>`:encodeURIComponent(String(e[`secret-name`]))}`,pathParams:{"script-name":String(e[`script-name`]??``),"secret-name":String(e[`secret-name`]??``)},query:t,bodyKind:`none`});return}let n=await s(e),r=e.local?a:await d();e.accountId=r;let i=u({scriptName:e.worker});if(e.worker=i,!await D({force:!!e.force,message:`This will permanently delete the Worker script secret.`}))return;let o=await h(`Deleting`,async()=>n.send(xe,{account_id:r,script_name:i,secret_name:e[`secret-name`],...t}));p(o,{successLabel:`Deleted`})})};var we={method:`GET`,path:e=>r`/accounts/${e.account_id}/workers/scripts/${e.script_name}/secrets/${e.secret_name}`,query:[`url_encoded`]};function Te(e){return e.usage(`$0 workers secrets get <secret-name>
|
|
26
|
+
|
|
27
|
+
Get a given secret binding (value omitted) on a Worker script.`).positional(`secret-name`,{type:`string`,description:`A JavaScript variable name for the secret binding.`,demandOption:!0}).option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script.`}).option(`url-encoded`,{type:`boolean`,description:`Flag that indicates whether the secret name is URL encoded.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ee={command:`get <secret-name>`,describe:`Get a secret binding`,builder:Te,handler:async e=>_({command:`workers secrets get`,classification:{safeFlags:[`url-encoded`,`dry-run`]}},e,async()=>{let t={url_encoded:e[`url-encoded`]};if(e.dryRun){let n=await l();m({command:`cf workers secrets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/workers/scripts/${e.worker??`<worker>`}/secrets/${e[`secret-name`]==null?`<secret-name>`:encodeURIComponent(String(e[`secret-name`]))}`,pathParams:{"script-name":String(e[`script-name`]??``),"secret-name":String(e[`secret-name`]??``)},query:t,bodyKind:`none`});return}let n=await s(e),r=e.local?a:await d();e.accountId=r;let i=u({scriptName:e.worker});e.worker=i;let o=await h(`Loading`,async()=>n.send(we,{account_id:r,script_name:i,secret_name:e[`secret-name`],...t}));p(o,{successLabel:`Loaded`})})};var De={method:`GET`,path:e=>r`/accounts/${e.account_id}/workers/scripts/${e.script_name}/secrets`};function Oe(e){return e.usage(`$0 workers secrets list
|
|
28
|
+
|
|
29
|
+
List the names of secrets bound to a Worker script.`).option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ke={command:`list`,describe:`List secrets bound to a Worker script`,builder:Oe,handler:async e=>_({command:`workers secrets list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await l();m({command:`cf workers secrets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/scripts/${e.worker??`<worker>`}/secrets`,pathParams:{"script-name":String(e[`script-name`]??``)},bodyKind:`none`});return}let t=await s(e),n=e.local?a:await d();e.accountId=n;let r=u({scriptName:e.worker});e.worker=r;let i=await h(`Loading`,async()=>t.send(De,{account_id:n,script_name:r}));p(i,{successLabel:`Loaded`})})};var Q={method:`PUT`,path:e=>r`/accounts/${e.account_id}/workers/scripts/${e.script_name}/secrets`,body:`json`,errors:{429:`TooManyRequestsError`}};function Ae(e){return e.usage(`$0 workers secrets update <name>
|
|
30
|
+
|
|
31
|
+
Add a secret to a Worker script by creating a new version with that secret. When changing more than one secret at a time, prefer the "Patch multiple script secrets" API instead of changing many secrets individually.`).positional(`name`,{type:`string`,description:`A JavaScript variable name for the binding.`,demandOption:!0}).option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script.`}).option(`text`,{type:`string`,description:`The secret value to use.`}).option(`type`,{type:`string`,description:`The kind of resource that the binding provides.`,choices:[`secret_text`,`secret_key`]}).coerce(`type`,e=>C(e,`type`,`text`)).option(`algorithm`,{type:`string`,description:`Algorithm-specific key parameters. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#algorithm). Provide as a JSON object or @path/to/file.json.`}).option(`format`,{type:`string`,description:`Data format of the key. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#format).`,choices:[`raw`,`pkcs8`,`spki`,`jwk`]}).coerce(`format`,e=>C(e,`format`,`text`)).option(`key-base64`,{type:`string`,description:'Base64-encoded key data. Required if `format` is "raw", "pkcs8", or "spki".'}).option(`key-jwk`,{type:`string`,description:'Key data in [JSON Web Key](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#json_web_key) format. Required if `format` is "jwk". Provide as a JSON object or @path/to/file.json.'}).option(`usages`,{type:`string`,array:!0,description:`Allowed operations with the key. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#keyUsages).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A secret value accessible through a binding.`}).conflicts(`text`,[`algorithm`,`format`,`key-base64`,`key-jwk`,`usages`]).conflicts(`algorithm`,[`text`]).implies(`algorithm`,[`format`,`usages`]).conflicts(`format`,[`text`]).implies(`format`,[`algorithm`,`usages`]).conflicts(`key-base64`,[`text`]).implies(`key-base64`,[`algorithm`,`format`,`usages`]).conflicts(`key-jwk`,[`text`]).implies(`key-jwk`,[`algorithm`,`format`,`usages`]).conflicts(`usages`,[`text`]).implies(`usages`,[`algorithm`,`format`])}const je={command:`update <name>`,describe:`Add a secret to a Worker script`,builder:Ae,handler:async e=>_({command:`workers secrets update`,classification:{safeFlags:[`type`,`format`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await l();m({command:`cf workers secrets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/scripts/${e.worker??`<worker>`}/secrets`,pathParams:{"script-name":String(e[`script-name`]??``)},bodyKind:`json`,body:e.body===void 0?S({text:C(e.text,`text`,`text`),type:e.type,algorithm:b(e.algorithm,`algorithm`),format:e.format,key_base64:C(e[`key-base64`],`key-base64`,`text`),key_jwk:b(e[`key-jwk`],`key-jwk`),usages:e.usages,name:e.name},[[`algorithm`],[`key_jwk`]]):y(e.body),sensitiveBodyPaths:[[`text`],[`key_base64`],[`key_jwk`]]});return}let t=await s(e),n=e.local?a:await d();e.accountId=n;let r=u({scriptName:e.worker});if(e.worker=r,e.body){let i=y(e.body),a=await h(`Updating`,async()=>t.send(Q,{body:i,account_id:n,script_name:r}));p(a,{successLabel:`Updated`});return}if(e.type===void 0&&(e.type=await E(`type`,`The kind of resource that the binding provides.`,[`secret_text`,`secret_key`])),e.type===`secret_text`&&e.text===void 0&&(e.text=await T(`text`,`The secret value to use.`,{kind:`secret`,question:`Enter value for --text`})),e.type===`secret_key`&&e.algorithm===void 0)throw Error(`--algorithm is required (or pass --body with this field set).`);if(e.type===`secret_key`&&e.format===void 0&&(e.format=await T(`format`,`Data format of the key. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#format).`,{question:`Enter value for --format`})),e.type===`secret_key`&&e.usages===void 0)throw Error(`--usages is required (or pass --body with this field set).`);let i=S({text:C(e.text,`text`,`text`),type:e.type,algorithm:b(e.algorithm,`algorithm`),format:e.format,key_base64:C(e[`key-base64`],`key-base64`,`text`),key_jwk:b(e[`key-jwk`],`key-jwk`),usages:e.usages,name:e.name},[[`algorithm`],[`key_jwk`]]),o=await h(`Updating`,async()=>t.send(Q,{body:i,account_id:n,script_name:r}));p(o,{successLabel:`Updated`})})},Me={command:`secrets`,describe:`Operations for secrets`,builder:e=>e.command(be).command(Ce).command(Ee).command(ke).command(je).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Ne={method:`DELETE`,path:e=>r`/accounts/${e.account_id}/workers/workers/${e.worker_id}/versions/${e.version_id}`};function Pe(e){return e.usage(`$0 workers versions delete <version-id>
|
|
32
|
+
|
|
33
|
+
Delete a Worker version.`).positional(`version-id`,{type:`string`,description:`Identifier for the version, which can be a UUID, a UUID prefix (minimum length 8), or the literal "latest" to operate on the most recently created version.`,demandOption:!0}).option(`worker-id`,{type:`string`,description:`Identifier for the Worker, which can be ID or name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Fe={command:`delete <version-id>`,describe:`Delete Worker Version`,builder:Pe,handler:async e=>_({command:`workers versions delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await l();m({command:`cf workers versions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/workers/${e[`worker-id`]==null?`<worker-id>`:encodeURIComponent(String(e[`worker-id`]))}/versions/${e[`version-id`]==null?`<version-id>`:encodeURIComponent(String(e[`version-id`]))}`,pathParams:{"worker-id":String(e[`worker-id`]??``),"version-id":String(e[`version-id`]??``)},bodyKind:`none`});return}let t=await s(e),n=e.local?a:await d();if(e.accountId=n,!await D({force:!!e.force,message:`This will permanently delete the Worker version.`}))return;let r=await h(`Deleting`,async()=>t.send(Ne,{account_id:n,worker_id:e[`worker-id`],version_id:e[`version-id`]}));p(r,{successLabel:`Deleted`})})};var Ie={method:`GET`,path:e=>r`/accounts/${e.account_id}/workers/workers/${e.worker_id}/versions/${e.version_id}`,query:[`include`]};function Le(e){return e.usage(`$0 workers versions get <version-id>
|
|
34
|
+
|
|
35
|
+
Get details about a specific Worker version.`).positional(`version-id`,{type:`string`,description:`Identifier for the version, which can be a UUID, a UUID prefix (minimum length 8), or the literal "latest" to operate on the most recently created version.`,demandOption:!0}).option(`worker-id`,{type:`string`,description:`Identifier for the Worker, which can be ID or name.`,demandOption:!0}).option(`include`,{type:`string`,description:"Whether to include the `modules` property of the version in the response, which contains code and sourcemap content and may add several megabytes to the response size.",choices:[`modules`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Re={command:`get <version-id>`,describe:`Get Worker Version`,builder:Le,handler:async e=>_({command:`workers versions get`,classification:{safeFlags:[`include`,`dry-run`]}},e,async()=>{let t={include:e.include};if(e.dryRun){let n=await l();m({command:`cf workers versions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/workers/workers/${e[`worker-id`]==null?`<worker-id>`:encodeURIComponent(String(e[`worker-id`]))}/versions/${e[`version-id`]==null?`<version-id>`:encodeURIComponent(String(e[`version-id`]))}`,pathParams:{"worker-id":String(e[`worker-id`]??``),"version-id":String(e[`version-id`]??``)},query:t,bodyKind:`none`});return}let n=await s(e),r=e.local?a:await d();e.accountId=r;let i=await h(`Loading`,async()=>n.send(Ie,{account_id:r,worker_id:e[`worker-id`],version_id:e[`version-id`],...t}));p(i,{successLabel:`Loaded`})})};var ze={method:`GET`,path:e=>r`/accounts/${e.account_id}/workers/workers/${e.worker_id}/versions`,query:[`page`,`per_page`]};function Be(e){return e.usage(`$0 workers versions list
|
|
36
|
+
|
|
37
|
+
List all versions for a Worker.`).option(`worker-id`,{type:`string`,description:`Identifier for the Worker, which can be ID or name.`,demandOption:!0}).option(`page`,{type:`number`,description:`Current page.`}).option(`per-page`,{type:`number`,description:`Items per-page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ve={command:`list`,describe:`List Worker Versions`,builder:Be,handler:async e=>_({command:`workers versions list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={page:e.page,per_page:e[`per-page`]};if(e.dryRun){let n=await l();m({command:`cf workers versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/workers/workers/${e[`worker-id`]==null?`<worker-id>`:encodeURIComponent(String(e[`worker-id`]))}/versions`,pathParams:{"worker-id":String(e[`worker-id`]??``)},query:t,bodyKind:`none`});return}let n=await s(e),r=e.local?a:await d();e.accountId=r;let i=await h(`Loading`,async()=>n.send(ze,{account_id:r,worker_id:e[`worker-id`],...t}));p(i,{successLabel:`Loaded`})})};function $(e){return e.usage(`$0 workers versions profile <version-id>
|
|
38
|
+
|
|
39
|
+
Captures a CPU or heap profile from a recently active isolate running the specified Worker version. This endpoint requires the Worker profiling feature to be enabled for the account.`).positional(`version-id`,{type:`string`,description:`Identifies the version by UUID or UUID prefix with a minimum length of eight characters. Use "latest" to select the most recently created version, which may not be deployed. Use "latest-deployed" to profile a version in the active deployment. Versions are tried in order of traffic share until one has a loaded isolate.`,demandOption:!0}).option(`worker-id`,{type:`string`,description:`Identifies the Worker by ID or name.`,demandOption:!0}).option(`actor-id`,{type:`string`,description:`Identifies the exact Durable Object actor to profile. Must be specified together with namespace_id. The actor must currently be active and running the requested version.`}).option(`duration-ms`,{type:`number`,description:`Profile duration in milliseconds.`}).option(`namespace-id`,{type:`string`,description:`Identifies the Durable Object namespace containing the actor to profile. Must be specified together with actor_id.`}).option(`profile-type`,{type:`string`,description:`The profile_type field`,choices:[`cpu`,`heap`],default:`cpu`}).coerce(`profile-type`,e=>C(e,`profile-type`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const He={command:`profile <version-id>`,describe:`Profile Worker Version`,builder:$,handler:async e=>_({command:`workers versions profile`,classification:{safeFlags:[`profile-type`,`dry-run`,`text`]}},e,async()=>{if(e.dryRun){let t=await l();m({command:`cf workers versions profile`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/workers/${e[`worker-id`]==null?`<worker-id>`:encodeURIComponent(String(e[`worker-id`]))}/versions/${e[`version-id`]==null?`<version-id>`:encodeURIComponent(String(e[`version-id`]))}/profile`,pathParams:{"worker-id":String(e[`worker-id`]??``),"version-id":String(e[`version-id`]??``)},bodyKind:`json`,body:e.body===void 0?S({actor_id:C(e[`actor-id`],`actor-id`,`text`),duration_ms:e[`duration-ms`],namespace_id:C(e[`namespace-id`],`namespace-id`,`text`),profile_type:e[`profile-type`]}):y(e.body)});return}await s(e);let t=e.local?a:await d();if(e.accountId=t,e.body){let n=y(e.body),r=await h(`Creating`,async()=>k(`/accounts/${t}/workers/workers/${encodeURIComponent(String(e[`worker-id`]))}/versions/${encodeURIComponent(String(e[`version-id`]))}/profile`,{method:`POST`,local:e.local===!0,persistTo:e.persistTo,body:JSON.stringify(n),contentType:`application/json`}));O(e.text===!0?r.toString(`utf-8`):r);return}if(e[`duration-ms`]===void 0)throw Error(`--duration-ms is required (or pass --body with this field set).`);let n={};e[`actor-id`]!==void 0&&x(n,[`actor_id`],C(e[`actor-id`],`actor-id`,`text`)),e[`duration-ms`]!==void 0&&x(n,[`duration_ms`],e[`duration-ms`]),e[`namespace-id`]!==void 0&&x(n,[`namespace_id`],C(e[`namespace-id`],`namespace-id`,`text`)),e[`profile-type`]!==void 0&&x(n,[`profile_type`],e[`profile-type`]);let r=await h(`Creating`,async()=>k(`/accounts/${t}/workers/workers/${encodeURIComponent(String(e[`worker-id`]))}/versions/${encodeURIComponent(String(e[`version-id`]))}/profile`,{method:`POST`,local:e.local===!0,persistTo:e.persistTo,body:Object.keys(n).length>0?n:void 0}));O(e.text===!0?r.toString(`utf-8`):r)})};function Ue(e){return R(e).hide(`local`).hide(`persist-to`).epilogue(`Local simulation (--local) is not supported by this command.`).option(`preview-alias`,{type:`string`,description:`Preview alias for this Worker Version`,requiresArg:!0})}var We=g({command:`create`,describe:`Upload a new Worker Version without deploying it`,builder:Ue,handler:async e=>{if(e.local)throw Error(`--local is not supported by cf workers versions create.`);await z(e,{command:`Version upload`})}},{command:`workers versions create`,classification:{safeFlags:[`dry-run`,`prebuilt`]}});const Ge={command:`versions`,describe:`Operations for versions`,builder:e=>e.command(i(We,`native`)).command(Fe).command(Re).command(Ve).command(He).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Ke=e(`check`,`Profile a Worker's startup performance`,()=>import(`./command-C0qCuw03.mjs`),{command:`workers check`,classification:{safeFlags:[`prebuilt`]}});function qe(e){return e.hide(`local`).hide(`persist-to`).epilogue(`Local simulation (--local) is not supported by this command.`).option(`prebuilt`,{type:`boolean`,description:`Use existing Build Output Specification files without building`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Run checks without applying triggers`,default:!1}).option(`worker`,F)}const Je={command:`deploy`,describe:`Apply triggers (Routes, Workflows, Cron triggers etc.)`,builder:qe,handler:async e=>{if(e.local)throw Error(`--local is not supported by cf workers triggers deploy.`);if(!e.prebuilt){if(await N(e.mode,{worker:e.worker,dryRun:e[`dry-run`]})===`setup-needed`){c.success(`--dry-run: exiting now.`);return}c.message(``)}await t(e,()=>Ye(e))}};async function Ye(e){let{workers:t,rootConfig:r}=await B(process.cwd());if(r.buildContext.isPreview){let e=[`cf previews deploy`,`--prebuilt`,...r.buildContext.mode===void 0?[]:[`--mode`,r.buildContext.mode]].join(` `);throw Error(`The Build Output was created for a Preview, but this command deploys production triggers. To use the existing Build Output and deploy the Preview, run "${e}". To deploy production triggers, rebuild without Preview settings before deploying.`)}I(e.mode,r.buildContext.mode),P(r.accountId,e[`temporary-account`]===!0);let i=j(t,e.worker),{wranglerConfig:a}=M(i,r),o=n(a),{authToken:s,accountId:l}=await te({accountId:r.accountId,complianceRegion:o,dryRun:e[`dry-run`]});ne(f(s)),c.section(`Deploy triggers`),await ee({...L(i,a,l,e),queueCreateCommand:e=>`cf queues create --queue-name ${e}`,workersDevConfigFieldName:`workersDev`,workersDevConfigAssignment:e=>`workersDev: ${e}`,previewUrlsConfigFieldName:`previewUrls`,previewUrlsConfigAssignment:e=>`previewUrls: ${e}`}),e[`dry-run`]||c.success(`Trigger deploy complete`)}const Xe={command:`triggers`,describe:`Manage triggers (Routes, Workflows, Cron triggers etc.)`,builder:e=>e.command(g(Je,{command:`workers triggers deploy`,classification:{safeFlags:[`dry-run`,`prebuilt`]}})).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Ze=e(`types`,`Generate types from cloudflare.config.ts`,()=>import(`./command-MxFFWqMg.mjs`),{command:`workers types`,classification:{safeFlags:[`include-runtime`]}});const Qe={command:`workers`,describe:`workers`,builder:e=>e.command(i(Ke,`preview`)).command(U).command(de).command(me).command(i(Ze,`preview`)).command(ce).command(ve).command(Me).command(i(Xe,`native`)).command(Ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Qe as default};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CgBhtmON.mjs";import{n}from"./auth-FK2eLQ02.mjs";import{a as r,t as i}from"./context-Dp4CXG22.mjs";import{t as a}from"./output-BJEgbI0G.mjs";import{t as o}from"./dry-run-gy0Hl9xo.mjs";import{t as s}from"./progress-DLri-rA7.mjs";import{t as c}from"./run-Ciw_GIrC.mjs";import"./telemetry-Pt5GpCKD.mjs";import{a as l,n as u,r as d,t as f}from"./body-parser-BKcZS9iJ.mjs";import{n as p}from"./input-validation-D7z60HJH.mjs";var m={method:`POST`,path:t=>e`/accounts/${t.account_id}/builds/workers/${t.script_tag}/migrate_to_previews`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,404:`NotFoundError`}};function h(e){return e.usage(`$0 workers-builds workers migrate-to-previews <script-tag>
|
|
3
3
|
|
|
4
4
|
Migrate a Worker's legacy non-production trigger to Previews. The legacy build settings become the Previews base config and the legacy trigger is removed.`).positional(`script-tag`,{type:`string`,description:`The Worker script tag (external script ID)`,demandOption:!0}).option(`deploy-command`,{type:`string`,description:`Deploy command for the migrated Preview settings. Omit it to have the existing 'wrangler versions upload' command rewritten to 'wrangler preview' automatically, which fails with 400 when the existing command cannot be rewritten.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for migrating a Worker's legacy non-production trigger to Previews.`})}const g={command:`migrate-to-previews <script-tag>`,describe:`Migrate worker to previews`,builder:h,handler:async e=>c({command:`workers-builds workers migrate-to-previews`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf workers-builds workers migrate-to-previews`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/builds/workers/${e[`script-tag`]==null?`<script-tag>`:encodeURIComponent(String(e[`script-tag`]))}/migrate_to_previews`,pathParams:{"script-tag":String(e[`script-tag`]??``)},bodyKind:`json`,body:e.body===void 0?f({deploy_command:p(e[`deploy-command`],`deploy-command`,`text`)}):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(m,{body:t,account_id:l,script_tag:e[`script-tag`]}));a(n,{successLabel:`Created`});return}let d=f({deploy_command:p(e[`deploy-command`],`deploy-command`,`text`)}),h=await s(`Creating`,async()=>c.send(m,{body:d,account_id:l,script_tag:e[`script-tag`]}));a(h,{successLabel:`Created`})})};var _={method:`POST`,path:t=>e`/accounts/${t.account_id}/builds/workers/${t.script_tag}/previews/${t.preview_id}/builds`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,404:`NotFoundError`}};function v(e){return e.usage(`$0 workers-builds workers previews create-build <preview-id>
|
|
5
5
|
|
|
6
|
-
Trigger a build for a single Preview.`).positional(`preview-id`,{type:`string`,description:`The script tag of the Preview, which is a Worker in its own right`,demandOption:!0}).option(`script-tag`,{type:`string`,description:`The Worker script tag (external script ID)`,demandOption:!0}).option(`branch`,{type:`string`,description:`Git branch name (required if commit_hash not provided)`}).option(`commit-hash`,{type:`string`,description:`Git commit hash (required if branch not provided)`}).option(`seed-repo-branch`,{type:`string`,description:`Repository branch to seed.`}).option(`seed-repo-files`,{type:`string`,description:`Files to add or replace for this build. Maximum 2. Provide as a JSON array of objects or @path/to/file.json.`}).option(`seed-repo-owner`,{type:`string`,description:`Repository owner or namespace.`}).option(`seed-repo-path`,{type:`string`,description:`Path within the repository to seed.`}).option(`seed-repo-provider`,{type:`string`,description:`Source control provider for the seed repository.`,choices:[`github`,`gitlab`]}).coerce(`seed-repo-provider`,e=>p(e,`seed-repo-provider`,`text`)).option(`seed-repo-repository`,{type:`string`,description:`Repository name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{
|
|
6
|
+
Trigger a build for a single Preview.`).positional(`preview-id`,{type:`string`,description:`The script tag of the Preview, which is a Worker in its own right`,demandOption:!0}).option(`script-tag`,{type:`string`,description:`The Worker script tag (external script ID)`,demandOption:!0}).option(`branch`,{type:`string`,description:`Git branch name (required if commit_hash not provided)`}).option(`commit-hash`,{type:`string`,description:`Git commit hash (required if branch not provided)`}).option(`seed-repo-branch`,{type:`string`,description:`Repository branch to seed.`}).option(`seed-repo-files`,{type:`string`,description:`Files to add or replace for this build. Maximum 2. Provide as a JSON array of objects or @path/to/file.json.`}).option(`seed-repo-owner`,{type:`string`,description:`Repository owner or namespace.`}).option(`seed-repo-path`,{type:`string`,description:`Path within the repository to seed.`}).option(`seed-repo-provider`,{type:`string`,description:`Source control provider for the seed repository.`,choices:[`github`,`gitlab`]}).coerce(`seed-repo-provider`,e=>p(e,`seed-repo-provider`,`text`)).option(`seed-repo-repository`,{type:`string`,description:`Repository name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{let t=[`seed-repo-branch`,`seed-repo-files`,`seed-repo-owner`,`seed-repo-path`,`seed-repo-provider`,`seed-repo-repository`].some(t=>e[t]!==void 0);if(!e.body&&t){let t=[`seed-repo-owner`,`seed-repo-provider`,`seed-repo-repository`].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 --seed-repo-* flag is set`)}return!0})}const y={command:`create-build <preview-id>`,describe:`Create preview build`,builder:v,handler:async e=>c({command:`workers-builds workers previews create-build`,classification:{safeFlags:[`seed-repo-provider`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf workers-builds workers previews create-build`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/builds/workers/${e[`script-tag`]==null?`<script-tag>`:encodeURIComponent(String(e[`script-tag`]))}/previews/${e[`preview-id`]==null?`<preview-id>`:encodeURIComponent(String(e[`preview-id`]))}/builds`,pathParams:{"script-tag":String(e[`script-tag`]??``),"preview-id":String(e[`preview-id`]??``)},bodyKind:`json`,body:e.body===void 0?f({branch:p(e.branch,`branch`,`text`),commit_hash:p(e[`commit-hash`],`commit-hash`,`text`),seed_repo:{branch:p(e[`seed-repo-branch`],`seed-repo-branch`,`text`),files:l(e[`seed-repo-files`],`seed-repo-files`),owner:p(e[`seed-repo-owner`],`seed-repo-owner`,`text`),path:p(e[`seed-repo-path`],`seed-repo-path`,`text`),provider:e[`seed-repo-provider`],repository:p(e[`seed-repo-repository`],`seed-repo-repository`,`text`)}}):u(e.body)});return}let c=await n(e),d=e.local?t:await i();if(e.accountId=d,e.body){let t=u(e.body),n=await s(`Creating`,async()=>c.send(_,{body:t,account_id:d,script_tag:e[`script-tag`],preview_id:e[`preview-id`]}));a(n,{successLabel:`Created`});return}let m=f({branch:p(e.branch,`branch`,`text`),commit_hash:p(e[`commit-hash`],`commit-hash`,`text`),seed_repo:{branch:p(e[`seed-repo-branch`],`seed-repo-branch`,`text`),files:l(e[`seed-repo-files`],`seed-repo-files`),owner:p(e[`seed-repo-owner`],`seed-repo-owner`,`text`),path:p(e[`seed-repo-path`],`seed-repo-path`,`text`),provider:e[`seed-repo-provider`],repository:p(e[`seed-repo-repository`],`seed-repo-repository`,`text`)}}),h=await s(`Creating`,async()=>c.send(_,{body:m,account_id:d,script_tag:e[`script-tag`],preview_id:e[`preview-id`]}));a(h,{successLabel:`Created`})})};var b={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/builds/workers/${t.script_tag}/previews/${t.preview_id}`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,404:`NotFoundError`,409:`ConflictError`}};function x(e){return e.usage(`$0 workers-builds workers previews edit <preview-id>
|
|
7
7
|
|
|
8
8
|
Update a single Preview of a Worker. Supports partial updates to the tracked branch, the automation flags, and the build settings.`).positional(`preview-id`,{type:`string`,description:`The script tag of the Preview, which is a Worker in its own right`,demandOption:!0}).option(`script-tag`,{type:`string`,description:`The Worker script tag (external script ID)`,demandOption:!0}).option(`auto-build`,{type:`boolean`,description:`Whether pushes to the git branch build this Preview. Deploy hooks, manual builds, and retries run regardless of this setting.`}).option(`auto-delete`,{type:`boolean`,description:`Whether deleting the git branch also deletes this Preview.`}).option(`branch`,{type:`string`,description:`Git branch this Preview tracks`}).option(`settings-build-caching-enabled`,{type:`boolean`,description:`Whether builds reuse cached dependencies and build artifacts.`}).option(`settings-build-command`,{type:`string`,description:`Command to build the Worker.`}).option(`settings-build-token-uuid`,{type:`string`,description:`UUID of the build token used when deploying the Worker.`}).option(`settings-deploy-command`,{type:`string`,description:`Command to deploy the Worker.`}).option(`settings-environment-variables`,{type:`string`,description:`Environment variable updates. Set the variable entry to null to delete it. Provide as a JSON object or @path/to/file.json.`}).option(`settings-path-excludes`,{type:`string`,array:!0,description:`Path patterns that must not start builds.`}).option(`settings-path-includes`,{type:`string`,array:!0,description:`Path patterns that can start builds.`}).option(`settings-root-directory`,{type:`string`,description:`Repository directory in which build and deploy commands run.`}).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 a Preview. At least one field must be provided, and omitted fields are left unchanged.`})}const S={command:`edit <preview-id>`,describe:`Update preview`,builder:x,handler:async e=>c({command:`workers-builds workers previews edit`,classification:{safeFlags:[`auto-build`,`auto-delete`,`settings-build-caching-enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf workers-builds workers previews edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/builds/workers/${e[`script-tag`]==null?`<script-tag>`:encodeURIComponent(String(e[`script-tag`]))}/previews/${e[`preview-id`]==null?`<preview-id>`:encodeURIComponent(String(e[`preview-id`]))}`,pathParams:{"script-tag":String(e[`script-tag`]??``),"preview-id":String(e[`preview-id`]??``)},bodyKind:`json`,body:e.body===void 0?f({auto_build:e[`auto-build`],auto_delete:e[`auto-delete`],branch:p(e.branch,`branch`,`text`),settings:{build_caching_enabled:e[`settings-build-caching-enabled`],build_command:p(e[`settings-build-command`],`settings-build-command`,`text`),build_token_uuid:p(e[`settings-build-token-uuid`],`settings-build-token-uuid`,`text`),deploy_command:p(e[`settings-deploy-command`],`settings-deploy-command`,`text`),environment_variables:d(e[`settings-environment-variables`],`settings-environment-variables`),path_excludes:e[`settings-path-excludes`],path_includes:e[`settings-path-includes`],root_directory:p(e[`settings-root-directory`],`settings-root-directory`,`text`)}},[[`settings`,`environment_variables`]]):u(e.body)});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,e.body){let t=u(e.body),n=await s(`Updating`,async()=>c.send(b,{body:t,account_id:l,script_tag:e[`script-tag`],preview_id:e[`preview-id`]}));a(n,{successLabel:`Updated`});return}let m=f({auto_build:e[`auto-build`],auto_delete:e[`auto-delete`],branch:p(e.branch,`branch`,`text`),settings:{build_caching_enabled:e[`settings-build-caching-enabled`],build_command:p(e[`settings-build-command`],`settings-build-command`,`text`),build_token_uuid:p(e[`settings-build-token-uuid`],`settings-build-token-uuid`,`text`),deploy_command:p(e[`settings-deploy-command`],`settings-deploy-command`,`text`),environment_variables:d(e[`settings-environment-variables`],`settings-environment-variables`),path_excludes:e[`settings-path-excludes`],path_includes:e[`settings-path-includes`],root_directory:p(e[`settings-root-directory`],`settings-root-directory`,`text`)}},[[`settings`,`environment_variables`]]),h=await s(`Updating`,async()=>c.send(b,{body:m,account_id:l,script_tag:e[`script-tag`],preview_id:e[`preview-id`]}));a(h,{successLabel:`Updated`})})};var C={method:`GET`,path:t=>e`/accounts/${t.account_id}/builds/workers/${t.script_tag}/previews/${t.preview_id}`,errors:{401:`UnauthorizedError`,404:`NotFoundError`}};function w(e){return e.usage(`$0 workers-builds workers previews get <preview-id>
|
|
9
9
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CgBhtmON.mjs";import{i as n,n as r}from"./auth-FK2eLQ02.mjs";import{a as i,t as a}from"./context-Dp4CXG22.mjs";import{t as o}from"./output-BJEgbI0G.mjs";import{t as s}from"./dry-run-gy0Hl9xo.mjs";import{t as c}from"./progress-DLri-rA7.mjs";import{t as l}from"./run-Ciw_GIrC.mjs";import"./telemetry-Pt5GpCKD.mjs";import{n as u,r as d,s as f,t as p}from"./body-parser-BKcZS9iJ.mjs";import{n as m,t as h}from"./input-validation-D7z60HJH.mjs";import{a as g,i as _,n as v}from"./prompt-D0dXwuME.mjs";var y={method:`POST`,path:t=>e`/accounts/${t.account_id}/workers/dispatch/namespaces`,body:`json`};function ee(e){return e.usage(`$0 workers-for-platforms dispatch-namespaces create
|
|
3
3
|
|
|
4
4
|
Create a new Workers for Platforms dispatch namespace.`).option(`name`,{type:`string`,description:`The name of the dispatch namespace.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const te={command:`create`,describe:`Create Workers for Platforms Dispatch Namespace`,builder:ee,handler:async e=>l({command:`workers-for-platforms dispatch-namespaces create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf workers-for-platforms dispatch-namespaces create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/dispatch/namespaces`,pathParams:{},bodyKind:`json`,body:e.body===void 0?p({name:m(e.name,`name`,`text`)}):u(e.body)});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=u(e.body),r=await c(`Creating`,async()=>n.send(y,{body:t,account_id:l}));o(r,{successLabel:`Created`});return}let d=p({name:m(e.name,`name`,`text`)}),f=await c(`Creating`,async()=>n.send(y,{body:d,account_id:l}));o(f,{successLabel:`Created`})})};var b={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/workers/dispatch/namespaces/${t.dispatch_namespace}`};function x(e){return e.usage(`$0 workers-for-platforms dispatch-namespaces delete <dispatch-namespace>
|
|
5
5
|
|
|
@@ -28,7 +28,7 @@ Get a given secret binding (value omitted) on a script uploaded to a Workers for
|
|
|
28
28
|
|
|
29
29
|
List secrets bound to a script uploaded to a Workers for Platforms dispatch namespace.`).option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`script-name`,{type:`string`,description:`Name of the script.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`list`,describe:`List Workers for Platforms Script Secrets`,builder:X,handler:async e=>l({command:`workers-for-platforms dispatch-namespaces scripts secrets list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf workers-for-platforms dispatch-namespaces scripts secrets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/dispatch/namespaces/${e[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${e[`script-name`]==null?`<script-name>`:encodeURIComponent(String(e[`script-name`]))}/secrets`,pathParams:{"dispatch-namespace":String(e[`dispatch-namespace`]??``),"script-name":String(e[`script-name`]??``)},bodyKind:`none`});return}let n=await r(e),l=e.local?t:await a();e.accountId=l;let u=await c(`Loading`,async()=>n.send(Y,{account_id:l,dispatch_namespace:e[`dispatch-namespace`],script_name:e[`script-name`]}));o(u,{successLabel:`Loaded`})})};var Q={method:`PUT`,path:t=>e`/accounts/${t.account_id}/workers/dispatch/namespaces/${t.dispatch_namespace}/scripts/${t.script_name}/secrets`,body:`json`,errors:{429:`TooManyRequestsError`}};function re(e){return e.usage(`$0 workers-for-platforms dispatch-namespaces scripts secrets update <script-name>
|
|
30
30
|
|
|
31
|
-
Add a secret to a Workers for Platforms script by creating a new version with that secret. When changing more than one secret at a time, prefer the "Patch multiple script secrets" API instead of changing many secrets individually.`).positional(`script-name`,{type:`string`,description:`Name of the script.`,demandOption:!0}).option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`name`,{type:`string`,description:`A JavaScript variable name for the binding.`}).option(`text`,{type:`string`,description:`The secret value to use.`}).option(`type`,{type:`string`,description:`The kind of resource that the binding provides.`,choices:[`secret_text`,`secret_key`]}).coerce(`type`,e=>m(e,`type`,`text`)).option(`algorithm`,{type:`string`,description:`Algorithm-specific key parameters. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#algorithm). Provide as a JSON object or @path/to/file.json.`}).option(`format`,{type:`string`,description:`Data format of the key. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#format).`,choices:[`raw`,`pkcs8`,`spki`,`jwk`]}).coerce(`format`,e=>m(e,`format`,`text`)).option(`key-base64`,{type:`string`,description:'Base64-encoded key data. Required if `format` is "raw", "pkcs8", or "spki".'}).option(`key-jwk`,{type:`string`,description:'Key data in [JSON Web Key](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#json_web_key) format. Required if `format` is "jwk". Provide as a JSON object or @path/to/file.json.'}).option(`usages`,{type:`string`,array:!0,description:`Allowed operations with the key. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#keyUsages).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A secret value accessible through a binding.`}).conflicts(`text`,[`algorithm`,`format`,`key-base64`,`key-jwk`,`usages`]).conflicts(`algorithm`,[`text`]).implies(`algorithm`,[`format`,`usages`]).conflicts(`format`,[`text`]).implies(`format`,[`algorithm`,`usages`]).conflicts(`key-base64`,[`text`]).conflicts(`key-jwk`,[`text`]).conflicts(`usages`,[`text`]).implies(`usages`,[`algorithm`,`format`])}const ie={command:`update <script-name>`,describe:`Add a secret to a Workers for Platforms script`,builder:re,handler:async e=>l({command:`workers-for-platforms dispatch-namespaces scripts secrets update`,classification:{safeFlags:[`type`,`format`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf workers-for-platforms dispatch-namespaces scripts secrets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/dispatch/namespaces/${e[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${e[`script-name`]==null?`<script-name>`:encodeURIComponent(String(e[`script-name`]))}/secrets`,pathParams:{"dispatch-namespace":String(e[`dispatch-namespace`]??``),"script-name":String(e[`script-name`]??``)},bodyKind:`json`,body:e.body===void 0?p({name:m(e.name,`name`,`text`),text:m(e.text,`text`,`text`),type:e.type,algorithm:d(e.algorithm,`algorithm`),format:e.format,key_base64:m(e[`key-base64`],`key-base64`,`text`),key_jwk:d(e[`key-jwk`],`key-jwk`),usages:e.usages},[[`algorithm`],[`key_jwk`]]):u(e.body),sensitiveBodyPaths:[[`text`],[`key_base64`],[`key_jwk`]]});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=u(e.body),r=await c(`Updating`,async()=>n.send(Q,{body:t,account_id:l,dispatch_namespace:e[`dispatch-namespace`],script_name:e[`script-name`]}));o(r,{successLabel:`Updated`});return}if(e.name===void 0&&(e.name=await g(`name`,`A JavaScript variable name for the binding.`)),e.type===void 0&&(e.type=await _(`type`,`The kind of resource that the binding provides.`,[`secret_text`,`secret_key`])),e.type===`secret_text`&&e.text===void 0&&(e.text=await g(`text`,`The secret value to use.`,{kind:`secret`,question:`Enter value for --text`})),e.type===`secret_key`&&e.algorithm===void 0)throw Error(`--algorithm is required (or pass --body with this field set).`);if(e.type===`secret_key`&&e.format===void 0&&(e.format=await g(`format`,`Data format of the key. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#format).`,{question:`Enter value for --format`})),e.type===`secret_key`&&e.usages===void 0)throw Error(`--usages is required (or pass --body with this field set).`);let f=p({name:m(e.name,`name`,`text`),text:m(e.text,`text`,`text`),type:e.type,algorithm:d(e.algorithm,`algorithm`),format:e.format,key_base64:m(e[`key-base64`],`key-base64`,`text`),key_jwk:d(e[`key-jwk`],`key-jwk`),usages:e.usages},[[`algorithm`],[`key_jwk`]]),h=await c(`Updating`,async()=>n.send(Q,{body:f,account_id:l,dispatch_namespace:e[`dispatch-namespace`],script_name:e[`script-name`]}));o(h,{successLabel:`Updated`})})},ae={command:`secrets`,describe:`Operations for dispatch-namespaces.scripts.secrets`,builder:e=>e.command(U).command(G).command(J).command(Z).command(ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var oe={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/workers/dispatch/namespaces/${t.dispatch_namespace}/scripts/${t.script_name}/settings`,pathParams:[`account_id`,`dispatch_namespace`,`script_name`],body:`form`};function se(e){return e.usage(`$0 workers-for-platforms dispatch-namespaces scripts settings edit <script-name>
|
|
31
|
+
Add a secret to a Workers for Platforms script by creating a new version with that secret. When changing more than one secret at a time, prefer the "Patch multiple script secrets" API instead of changing many secrets individually.`).positional(`script-name`,{type:`string`,description:`Name of the script.`,demandOption:!0}).option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`name`,{type:`string`,description:`A JavaScript variable name for the binding.`}).option(`text`,{type:`string`,description:`The secret value to use.`}).option(`type`,{type:`string`,description:`The kind of resource that the binding provides.`,choices:[`secret_text`,`secret_key`]}).coerce(`type`,e=>m(e,`type`,`text`)).option(`algorithm`,{type:`string`,description:`Algorithm-specific key parameters. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#algorithm). Provide as a JSON object or @path/to/file.json.`}).option(`format`,{type:`string`,description:`Data format of the key. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#format).`,choices:[`raw`,`pkcs8`,`spki`,`jwk`]}).coerce(`format`,e=>m(e,`format`,`text`)).option(`key-base64`,{type:`string`,description:'Base64-encoded key data. Required if `format` is "raw", "pkcs8", or "spki".'}).option(`key-jwk`,{type:`string`,description:'Key data in [JSON Web Key](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#json_web_key) format. Required if `format` is "jwk". Provide as a JSON object or @path/to/file.json.'}).option(`usages`,{type:`string`,array:!0,description:`Allowed operations with the key. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#keyUsages).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A secret value accessible through a binding.`}).conflicts(`text`,[`algorithm`,`format`,`key-base64`,`key-jwk`,`usages`]).conflicts(`algorithm`,[`text`]).implies(`algorithm`,[`format`,`usages`]).conflicts(`format`,[`text`]).implies(`format`,[`algorithm`,`usages`]).conflicts(`key-base64`,[`text`]).implies(`key-base64`,[`algorithm`,`format`,`usages`]).conflicts(`key-jwk`,[`text`]).implies(`key-jwk`,[`algorithm`,`format`,`usages`]).conflicts(`usages`,[`text`]).implies(`usages`,[`algorithm`,`format`])}const ie={command:`update <script-name>`,describe:`Add a secret to a Workers for Platforms script`,builder:re,handler:async e=>l({command:`workers-for-platforms dispatch-namespaces scripts secrets update`,classification:{safeFlags:[`type`,`format`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf workers-for-platforms dispatch-namespaces scripts secrets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/dispatch/namespaces/${e[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${e[`script-name`]==null?`<script-name>`:encodeURIComponent(String(e[`script-name`]))}/secrets`,pathParams:{"dispatch-namespace":String(e[`dispatch-namespace`]??``),"script-name":String(e[`script-name`]??``)},bodyKind:`json`,body:e.body===void 0?p({name:m(e.name,`name`,`text`),text:m(e.text,`text`,`text`),type:e.type,algorithm:d(e.algorithm,`algorithm`),format:e.format,key_base64:m(e[`key-base64`],`key-base64`,`text`),key_jwk:d(e[`key-jwk`],`key-jwk`),usages:e.usages},[[`algorithm`],[`key_jwk`]]):u(e.body),sensitiveBodyPaths:[[`text`],[`key_base64`],[`key_jwk`]]});return}let n=await r(e),l=e.local?t:await a();if(e.accountId=l,e.body){let t=u(e.body),r=await c(`Updating`,async()=>n.send(Q,{body:t,account_id:l,dispatch_namespace:e[`dispatch-namespace`],script_name:e[`script-name`]}));o(r,{successLabel:`Updated`});return}if(e.name===void 0&&(e.name=await g(`name`,`A JavaScript variable name for the binding.`)),e.type===void 0&&(e.type=await _(`type`,`The kind of resource that the binding provides.`,[`secret_text`,`secret_key`])),e.type===`secret_text`&&e.text===void 0&&(e.text=await g(`text`,`The secret value to use.`,{kind:`secret`,question:`Enter value for --text`})),e.type===`secret_key`&&e.algorithm===void 0)throw Error(`--algorithm is required (or pass --body with this field set).`);if(e.type===`secret_key`&&e.format===void 0&&(e.format=await g(`format`,`Data format of the key. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#format).`,{question:`Enter value for --format`})),e.type===`secret_key`&&e.usages===void 0)throw Error(`--usages is required (or pass --body with this field set).`);let f=p({name:m(e.name,`name`,`text`),text:m(e.text,`text`,`text`),type:e.type,algorithm:d(e.algorithm,`algorithm`),format:e.format,key_base64:m(e[`key-base64`],`key-base64`,`text`),key_jwk:d(e[`key-jwk`],`key-jwk`),usages:e.usages},[[`algorithm`],[`key_jwk`]]),h=await c(`Updating`,async()=>n.send(Q,{body:f,account_id:l,dispatch_namespace:e[`dispatch-namespace`],script_name:e[`script-name`]}));o(h,{successLabel:`Updated`})})},ae={command:`secrets`,describe:`Operations for dispatch-namespaces.scripts.secrets`,builder:e=>e.command(U).command(G).command(J).command(Z).command(ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var oe={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/workers/dispatch/namespaces/${t.dispatch_namespace}/scripts/${t.script_name}/settings`,pathParams:[`account_id`,`dispatch_namespace`,`script_name`],body:`form`};function se(e){return e.usage(`$0 workers-for-platforms dispatch-namespaces scripts settings edit <script-name>
|
|
32
32
|
|
|
33
33
|
Patch metadata for a script uploaded to a Workers for Platforms dispatch namespace, such as bindings.`).positional(`script-name`,{type:`string`,description:`Name of the script.`,demandOption:!0}).option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`settings`,{type:`string`,description:`Script and version settings for Workers for Platforms namespace scripts. Same as script-and-version-settings-item but without annotations, which are not supported for namespace scripts. `})}const ce={command:`edit <script-name>`,describe:`Patch Workers for Platforms Script Settings`,builder:se,handler:async e=>l({command:`workers-for-platforms dispatch-namespaces scripts settings edit`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();s({command:`cf workers-for-platforms dispatch-namespaces scripts settings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/workers/dispatch/namespaces/${e[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${e[`script-name`]==null?`<script-name>`:encodeURIComponent(String(e[`script-name`]))}/settings`,pathParams:{"dispatch-namespace":String(e[`dispatch-namespace`]??``),"script-name":String(e[`script-name`]??``)},bodyKind:`multipart`,body:{body:e.body,file:e.file,settings:e.settings}});return}let l=await r(e),u=e.local?t:await a();if(e.accountId=u,e.file!==void 0||e.body!==void 0||e.settings!==void 0){let t=new FormData;if(e.file){let n=h(e.file);t.append(`file`,new Blob([n]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&t.append(`file`,e.body);if(e.settings!==void 0){let n=typeof e.settings==`string`?m(e.settings,`settings`,`text`):e.settings;t.append(`settings`,typeof n==`string`?n:JSON.stringify(n))}let r=await c(`Updating`,async()=>n(l,`PATCH`,`/accounts/${u}/workers/dispatch/namespaces/${encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${encodeURIComponent(String(e[`script-name`]))}/settings`,{body:t}));o(r,{successLabel:`Updated`});return}if(e.body){let t=m(e.body,`body`,`binary`),r=await c(`Updating`,async()=>n(l,`PATCH`,`/accounts/${u}/workers/dispatch/namespaces/${encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${encodeURIComponent(String(e[`script-name`]))}/settings`,{body:t,headers:{"Content-Type":`multipart/form-data`}}));o(r,{successLabel:`Updated`});return}let d=await c(`Updating`,async()=>l.send(oe,{account_id:u,dispatch_namespace:e[`dispatch-namespace`],script_name:e[`script-name`]}));o(d,{successLabel:`Updated`})})};var le={method:`GET`,path:t=>e`/accounts/${t.account_id}/workers/dispatch/namespaces/${t.dispatch_namespace}/scripts/${t.script_name}/settings`};function ue(e){return e.usage(`$0 workers-for-platforms dispatch-namespaces scripts settings get <script-name>
|
|
34
34
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import"./api-X3wKppsT.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./local-CgBhtmON.mjs";import{n}from"./auth-FK2eLQ02.mjs";import{a as r,t as i}from"./context-Dp4CXG22.mjs";import{t as a}from"./output-BJEgbI0G.mjs";import{t as o}from"./dry-run-gy0Hl9xo.mjs";import{t as s}from"./progress-DLri-rA7.mjs";import{t as c}from"./run-Ciw_GIrC.mjs";import"./telemetry-Pt5GpCKD.mjs";import{n as l,t as u}from"./body-parser-BKcZS9iJ.mjs";import{n as d}from"./input-validation-D7z60HJH.mjs";import{a as f,i as p,n as m}from"./prompt-D0dXwuME.mjs";var h={method:`POST`,path:t=>e`/accounts/${t.account_id}/connectivity/directory/services`,body:`json`};function g(e){return e.usage(`$0 workers-vpc services create
|
|
3
|
+
|
|
4
|
+
Creates a new Workers VPC connectivity service in the account.`).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\n\n`disabled` cannot be combined with `certificate_authority`: a custom CA is\nonly used to verify the server certificate.'}).option(`tls-settings-certificate-authority`,{type:`string`,description:`UUID of the custom CA certificate or chain.`}).option(`tls-settings-client-certificate`,{type:`string`,description:`UUID of the mTLS client certificate and private key.`}).option(`type`,{type:`string`,description:`The type field`,choices:[`tcp`,`http`]}).coerce(`type`,e=>d(e,`type`,`text`)).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`]}).coerce(`app-protocol`,e=>d(e,`app-protocol`,`text`)).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-hostname`,`host-resolver-network-resolver-ips`,`host-resolver-network-tunnel-id`]).implies(`host-ipv4`,[`host-network-tunnel-id`]).conflicts(`host-network-tunnel-id`,[`host-hostname`,`host-resolver-network-resolver-ips`,`host-resolver-network-tunnel-id`]).conflicts(`host-ipv6`,[`host-hostname`,`host-resolver-network-resolver-ips`,`host-resolver-network-tunnel-id`]).implies(`host-ipv6`,[`host-network-tunnel-id`]).conflicts(`host-hostname`,[`host-ipv4`,`host-network-tunnel-id`,`host-ipv6`]).implies(`host-hostname`,[`host-resolver-network-tunnel-id`]).conflicts(`host-resolver-network-resolver-ips`,[`host-ipv4`,`host-network-tunnel-id`,`host-ipv6`]).implies(`host-resolver-network-resolver-ips`,[`host-hostname`,`host-resolver-network-tunnel-id`]).conflicts(`host-resolver-network-tunnel-id`,[`host-ipv4`,`host-network-tunnel-id`,`host-ipv6`]).implies(`host-resolver-network-tunnel-id`,[`host-hostname`]).implies(`tls-settings-certificate-authority`,[`tls-settings-cert-verification-mode`]).implies(`tls-settings-client-certificate`,[`tls-settings-cert-verification-mode`]).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`])}const _={command:`create`,describe:`Create Workers VPC connectivity service`,builder:g,handler:async e=>c({command:`workers-vpc services create`,classification:{safeFlags:[`type`,`app-protocol`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf workers-vpc services create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/connectivity/directory/services`,pathParams:{},bodyKind:`json`,body:e.body===void 0?u({host:{ipv4:d(e[`host-ipv4`],`host-ipv4`,`text`),network:{tunnel_id:d(e[`host-network-tunnel-id`],`host-network-tunnel-id`,`text`)},ipv6:d(e[`host-ipv6`],`host-ipv6`,`text`),hostname:d(e[`host-hostname`],`host-hostname`,`text`),resolver_network:{resolver_ips:e[`host-resolver-network-resolver-ips`],tunnel_id:d(e[`host-resolver-network-tunnel-id`],`host-resolver-network-tunnel-id`,`text`)}},name:d(e.name,`name`,`text`),tls_settings:{cert_verification_mode:d(e[`tls-settings-cert-verification-mode`],`tls-settings-cert-verification-mode`,`text`),certificate_authority:d(e[`tls-settings-certificate-authority`],`tls-settings-certificate-authority`,`text`),client_certificate:d(e[`tls-settings-client-certificate`],`tls-settings-client-certificate`,`text`)},type:e.type,http_port:e[`http-port`],https_port:e[`https-port`],app_protocol:e[`app-protocol`],tcp_port:e[`tcp-port`]}):l(e.body)});return}let c=await n(e),m=e.local?t:await i();if(e.accountId=m,e.body){let t=l(e.body),n=await s(`Creating`,async()=>c.send(h,{body:t,account_id:m}));a(n,{successLabel:`Created`});return}e.name===void 0&&(e.name=await f(`name`,`The name field`)),e.type===void 0&&(e.type=await p(`type`,`The type field`,[`tcp`,`http`]));let g=u({host:{ipv4:d(e[`host-ipv4`],`host-ipv4`,`text`),network:{tunnel_id:d(e[`host-network-tunnel-id`],`host-network-tunnel-id`,`text`)},ipv6:d(e[`host-ipv6`],`host-ipv6`,`text`),hostname:d(e[`host-hostname`],`host-hostname`,`text`),resolver_network:{resolver_ips:e[`host-resolver-network-resolver-ips`],tunnel_id:d(e[`host-resolver-network-tunnel-id`],`host-resolver-network-tunnel-id`,`text`)}},name:d(e.name,`name`,`text`),tls_settings:{cert_verification_mode:d(e[`tls-settings-cert-verification-mode`],`tls-settings-cert-verification-mode`,`text`),certificate_authority:d(e[`tls-settings-certificate-authority`],`tls-settings-certificate-authority`,`text`),client_certificate:d(e[`tls-settings-client-certificate`],`tls-settings-client-certificate`,`text`)},type:e.type,http_port:e[`http-port`],https_port:e[`https-port`],app_protocol:e[`app-protocol`],tcp_port:e[`tcp-port`]}),_=await s(`Creating`,async()=>c.send(h,{body:g,account_id:m}));a(_,{successLabel:`Created`})})};var v={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/connectivity/directory/services/${t.service_id}`,response:!1};function y(e){return e.usage(`$0 workers-vpc services delete <service-id>
|
|
5
|
+
|
|
6
|
+
Removes a single Workers VPC connectivity service by its ID. Any Worker bindings referencing this service will stop working.`).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 b={command:`delete <service-id>`,describe:`Delete Workers VPC connectivity service`,builder:y,handler:async e=>c({command:`workers-vpc services delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf workers-vpc services delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/connectivity/directory/services/${e[`service-id`]==null?`<service-id>`:encodeURIComponent(String(e[`service-id`]))}`,pathParams:{"service-id":String(e[`service-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();if(e.accountId=l,!await m({force:!!e.force,message:`This operation permanently deletes a Workers VPC connectivity service.`}))return;let u=await s(`Deleting`,async()=>c.send(v,{account_id:l,service_id:e[`service-id`]}));a(u,{successLabel:`Deleted`})})};var x={method:`GET`,path:t=>e`/accounts/${t.account_id}/connectivity/directory/services/${t.service_id}`};function S(e){return e.usage(`$0 workers-vpc services get <service-id>
|
|
7
|
+
|
|
8
|
+
Fetches a single Workers VPC connectivity service by its ID.`).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 C={command:`get <service-id>`,describe:`Get Workers VPC connectivity service`,builder:S,handler:async e=>c({command:`workers-vpc services get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf workers-vpc services get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/connectivity/directory/services/${e[`service-id`]==null?`<service-id>`:encodeURIComponent(String(e[`service-id`]))}`,pathParams:{"service-id":String(e[`service-id`]??``)},bodyKind:`none`});return}let c=await n(e),l=e.local?t:await i();e.accountId=l;let u=await s(`Loading`,async()=>c.send(x,{account_id:l,service_id:e[`service-id`]}));a(u,{successLabel:`Loaded`})})};var w={method:`GET`,path:t=>e`/accounts/${t.account_id}/connectivity/directory/services`,query:[`type`,`page`,`per_page`]};function T(e){return e.usage(`$0 workers-vpc services list
|
|
9
|
+
|
|
10
|
+
Lists the Workers VPC connectivity services in the account.`).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 E={command:`list`,describe:`List Workers VPC connectivity services`,builder:T,handler:async e=>c({command:`workers-vpc services list`,classification:{safeFlags:[`type`,`dry-run`]}},e,async()=>{let c={type:e.type,page:e.page,per_page:e[`per-page`]};if(e.dryRun){let e=await r();o({command:`cf workers-vpc services list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/connectivity/directory/services`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(e),u=e.local?t:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(w,{account_id:u,...c}));a(d,{successLabel:`Loaded`})})};var D={method:`PUT`,path:t=>e`/accounts/${t.account_id}/connectivity/directory/services/${t.service_id}`,body:`json`};function O(e){return e.usage(`$0 workers-vpc services update <service-id>
|
|
11
|
+
|
|
12
|
+
Updates an existing Workers VPC connectivity service by its ID.`).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\n\n`disabled` cannot be combined with `certificate_authority`: a custom CA is\nonly used to verify the server certificate.'}).option(`tls-settings-certificate-authority`,{type:`string`,description:`UUID of the custom CA certificate or chain.`}).option(`tls-settings-client-certificate`,{type:`string`,description:`UUID of the mTLS client certificate and private key.`}).option(`type`,{type:`string`,description:`The type field`,choices:[`tcp`,`http`]}).coerce(`type`,e=>d(e,`type`,`text`)).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`]}).coerce(`app-protocol`,e=>d(e,`app-protocol`,`text`)).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-hostname`,`host-resolver-network-resolver-ips`,`host-resolver-network-tunnel-id`]).implies(`host-ipv4`,[`host-network-tunnel-id`]).conflicts(`host-network-tunnel-id`,[`host-hostname`,`host-resolver-network-resolver-ips`,`host-resolver-network-tunnel-id`]).conflicts(`host-ipv6`,[`host-hostname`,`host-resolver-network-resolver-ips`,`host-resolver-network-tunnel-id`]).implies(`host-ipv6`,[`host-network-tunnel-id`]).conflicts(`host-hostname`,[`host-ipv4`,`host-network-tunnel-id`,`host-ipv6`]).implies(`host-hostname`,[`host-resolver-network-tunnel-id`]).conflicts(`host-resolver-network-resolver-ips`,[`host-ipv4`,`host-network-tunnel-id`,`host-ipv6`]).implies(`host-resolver-network-resolver-ips`,[`host-hostname`,`host-resolver-network-tunnel-id`]).conflicts(`host-resolver-network-tunnel-id`,[`host-ipv4`,`host-network-tunnel-id`,`host-ipv6`]).implies(`host-resolver-network-tunnel-id`,[`host-hostname`]).implies(`tls-settings-certificate-authority`,[`tls-settings-cert-verification-mode`]).implies(`tls-settings-client-certificate`,[`tls-settings-cert-verification-mode`]).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`])}const k={command:`update <service-id>`,describe:`Update Workers VPC connectivity service`,builder:O,handler:async e=>c({command:`workers-vpc services update`,classification:{safeFlags:[`type`,`app-protocol`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();o({command:`cf workers-vpc services update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/connectivity/directory/services/${e[`service-id`]==null?`<service-id>`:encodeURIComponent(String(e[`service-id`]))}`,pathParams:{"service-id":String(e[`service-id`]??``)},bodyKind:`json`,body:e.body===void 0?u({host:{ipv4:d(e[`host-ipv4`],`host-ipv4`,`text`),network:{tunnel_id:d(e[`host-network-tunnel-id`],`host-network-tunnel-id`,`text`)},ipv6:d(e[`host-ipv6`],`host-ipv6`,`text`),hostname:d(e[`host-hostname`],`host-hostname`,`text`),resolver_network:{resolver_ips:e[`host-resolver-network-resolver-ips`],tunnel_id:d(e[`host-resolver-network-tunnel-id`],`host-resolver-network-tunnel-id`,`text`)}},name:d(e.name,`name`,`text`),tls_settings:{cert_verification_mode:d(e[`tls-settings-cert-verification-mode`],`tls-settings-cert-verification-mode`,`text`),certificate_authority:d(e[`tls-settings-certificate-authority`],`tls-settings-certificate-authority`,`text`),client_certificate:d(e[`tls-settings-client-certificate`],`tls-settings-client-certificate`,`text`)},type:e.type,http_port:e[`http-port`],https_port:e[`https-port`],app_protocol:e[`app-protocol`],tcp_port:e[`tcp-port`]}):l(e.body)});return}let c=await n(e),m=e.local?t:await i();if(e.accountId=m,e.body){let t=l(e.body),n=await s(`Updating`,async()=>c.send(D,{body:t,account_id:m,service_id:e[`service-id`]}));a(n,{successLabel:`Updated`});return}e.name===void 0&&(e.name=await f(`name`,`The name field`)),e.type===void 0&&(e.type=await p(`type`,`The type field`,[`tcp`,`http`]));let h=u({host:{ipv4:d(e[`host-ipv4`],`host-ipv4`,`text`),network:{tunnel_id:d(e[`host-network-tunnel-id`],`host-network-tunnel-id`,`text`)},ipv6:d(e[`host-ipv6`],`host-ipv6`,`text`),hostname:d(e[`host-hostname`],`host-hostname`,`text`),resolver_network:{resolver_ips:e[`host-resolver-network-resolver-ips`],tunnel_id:d(e[`host-resolver-network-tunnel-id`],`host-resolver-network-tunnel-id`,`text`)}},name:d(e.name,`name`,`text`),tls_settings:{cert_verification_mode:d(e[`tls-settings-cert-verification-mode`],`tls-settings-cert-verification-mode`,`text`),certificate_authority:d(e[`tls-settings-certificate-authority`],`tls-settings-certificate-authority`,`text`),client_certificate:d(e[`tls-settings-client-certificate`],`tls-settings-client-certificate`,`text`)},type:e.type,http_port:e[`http-port`],https_port:e[`https-port`],app_protocol:e[`app-protocol`],tcp_port:e[`tcp-port`]}),g=await s(`Updating`,async()=>c.send(D,{body:h,account_id:m,service_id:e[`service-id`]}));a(g,{successLabel:`Updated`})})},A={command:`services`,describe:`Operations for services`,builder:e=>e.command(_).command(b).command(C).command(E).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},j={command:`workers-vpc`,describe:`workers-vpc`,builder:e=>e.command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{j as default};
|