cf 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_meta/agent-context.json +189 -187
- package/dist/_meta/commands.json +2591 -2248
- package/dist/_meta/hand-written-commands.json +146 -1
- package/dist/_meta/schemas.json +1548 -1313
- package/dist/{abuse-reports-BbaHw4ST.mjs → abuse-reports-CDFjJ2e8.mjs} +1 -1
- package/dist/{access-D6Xz892p.mjs → access-BoT1waG4.mjs} +1 -1
- package/dist/{account-DvxcqeaK.mjs → account-agnMUKWj.mjs} +1 -1
- package/dist/{account-tags-CeqfEWpz.mjs → account-tags-BRMMHCee.mjs} +1 -1
- package/dist/{accounts-Bx-8BMH9.mjs → accounts-Cut77dAt.mjs} +2 -2
- package/dist/{acm--0opdSGE.mjs → acm-C8WgXNCl.mjs} +1 -1
- package/dist/{addressing-BS1ynzLA.mjs → addressing-CR8EV42x.mjs} +1 -1
- package/dist/{agent-context-BPhyrSns.mjs → agent-context-Wj5TRRbW.mjs} +1 -1
- package/dist/{agent-memory-DczzpEw5.mjs → agent-memory-CVJpKKZy.mjs} +1 -1
- package/dist/{ai-CDdCTcQl.mjs → ai-BbNYt-yI.mjs} +1 -1
- package/dist/{ai-audit-Bx9KMQYh.mjs → ai-audit-mVajM-2i.mjs} +1 -1
- package/dist/{ai-gateway-BSXJEaYS.mjs → ai-gateway-BsepSA_v.mjs} +2 -2
- package/dist/{ai-search-DRQj1aMu.mjs → ai-search-DbEJqm5-.mjs} +1 -1
- package/dist/{ai-security-C_Rb0lGT.mjs → ai-security-DmyB5EYk.mjs} +1 -1
- package/dist/{alerting-BAR9eFs2.mjs → alerting-dmy3hd8O.mjs} +3 -3
- package/dist/analytics-B1xBMla0.mjs +5 -0
- package/dist/{analytics_engine-DkEzlhfT.mjs → analytics_engine-DazCn3iC.mjs} +1 -1
- package/dist/{api-security-jA0lOk6a.mjs → api-security-0HXCzfHk.mjs} +1 -1
- package/dist/{argo-Cz4pDagx.mjs → argo-DSHsE8zv.mjs} +1 -1
- package/dist/{artifacts-BcLTGfAv.mjs → artifacts-CwiU9Mxu.mjs} +1 -1
- package/dist/{audit-logs-DbIv4n6u.mjs → audit-logs-DwFtMDwH.mjs} +1 -1
- package/dist/{auth-rW5d3jtr.mjs → auth-B0ZyXc3y.mjs} +1 -1
- package/dist/{auth-tvDdC1J-.mjs → auth-DWxtJ918.mjs} +2 -2
- package/dist/{billing-Md87QjqW.mjs → billing-Cbpadkgu.mjs} +1 -1
- package/dist/{bot-management-VHMo4hpU.mjs → bot-management-B6M2Vyyn.mjs} +1 -1
- package/dist/{botnet-feed-BHqfo3sa.mjs → botnet-feed-Dn8UuE4h.mjs} +1 -1
- package/dist/{brand-protection-HUeR6Pof.mjs → brand-protection-B5R0b3pu.mjs} +1 -1
- package/dist/{browser-extension-199oZg3X.mjs → browser-extension-D55pYZf_.mjs} +1 -1
- package/dist/{browser-run-DDasyux-.mjs → browser-run-C1b2VkGB.mjs} +1 -1
- package/dist/build-CP2JUfV1.mjs +2 -0
- package/dist/{builds-B-lXn6JR.mjs → builds-CVEXO_4a.mjs} +8 -8
- package/dist/{cache-CevKpiTM.mjs → cache-BU5xX82E.mjs} +1 -1
- package/dist/{certificate-authorities-DAg-aO1B.mjs → certificate-authorities--tZTWJWD.mjs} +1 -1
- package/dist/cf-BV2HLCQm.mjs +18 -0
- package/dist/{chunk-QBZBEHZB-BuiXJn8j.mjs → chunk-QBZBEHZB-BcCMlc8C.mjs} +1 -1
- package/dist/chunk-XLADBZ7F-DgFrtUhW.mjs +103 -0
- package/dist/{client-certificates-Bay7oPLE.mjs → client-certificates-DX84qeYG.mjs} +1 -1
- package/dist/{client-side-security-CbU9xn0k.mjs → client-side-security-DsSO2rZQ.mjs} +1 -1
- package/dist/{cloud-connector-AH2ClcSL.mjs → cloud-connector-cf8qlxap.mjs} +1 -1
- package/dist/{cloudforce-one-DwOfS75V.mjs → cloudforce-one-DzVXorbu.mjs} +2 -2
- package/dist/command-BL6weJf3.mjs +3 -0
- package/dist/command-DYrspBc0.mjs +2 -0
- package/dist/{completions-nPO9PdSu.mjs → completions-Dn621okY.mjs} +1 -1
- package/dist/{config-B8lwPpVl.mjs → config-BY6KpMZs.mjs} +1 -1
- package/dist/config.d.mts +1 -1729
- package/dist/config.mjs +1 -1
- package/dist/{connector-interrupts-DcLrqM2V.mjs → connector-interrupts-DqpqPPkp.mjs} +1 -1
- package/dist/{connector-telemetry-events-PrJWgNs9.mjs → connector-telemetry-events-CCD-_B-8.mjs} +1 -1
- package/dist/{connector-telemetry-snapshots-CIjJm5yu.mjs → connector-telemetry-snapshots-D3CeGGhk.mjs} +1 -1
- package/dist/{connectors-CEAy30E-.mjs → connectors-aPQspZdg.mjs} +1 -1
- package/dist/{containers-BsbDqbSn.mjs → containers-D0Kjl8h-.mjs} +1 -1
- package/dist/{content-scan-BdK936iO.mjs → content-scan-BVx18XmS.mjs} +1 -1
- package/dist/{cps-oP97-qkm.mjs → cps-ByazyM0x.mjs} +1 -1
- package/dist/{csamScanner-DUNN4INg.mjs → csamScanner-OG5lQxBC.mjs} +1 -1
- package/dist/{ct-alerting-dV_gsV2w.mjs → ct-alerting-BJx5n8Zf.mjs} +1 -1
- package/dist/{custom-certificates-DYspvjo4.mjs → custom-certificates-BuJ2e9TA.mjs} +1 -1
- package/dist/{custom-csrs-DjSWLQRu.mjs → custom-csrs-CR_5qbST.mjs} +1 -1
- package/dist/{custom-hostnames-df1lH6IY.mjs → custom-hostnames-BzDTsQXb.mjs} +1 -1
- package/dist/{custom-nameservers-CLTbN-9R.mjs → custom-nameservers-OfMPRGkD.mjs} +1 -1
- package/dist/custom-pages-BmGXoTIo.mjs +3 -0
- package/dist/d1-DedC8N0N.mjs +21 -0
- package/dist/data-security-B2UB26ry.mjs +7 -0
- package/dist/{dcv-delegation-_r6Vc6VL.mjs → dcv-delegation-C11vmzbG.mjs} +1 -1
- package/dist/{deploy-QTGENpOM.mjs → deploy-BtETDvDA.mjs} +1 -1
- package/dist/{deploy-input-C7W1Bsji.mjs → deploy-input-BoLTdQzS.mjs} +1 -1
- package/dist/{dev-CAubuxCc.mjs → dev-B5WcIpEr.mjs} +2 -2
- package/dist/{diagnostics-B0DRh714.mjs → diagnostics-Cf6BLpAo.mjs} +1 -1
- package/dist/dialog-Bud0hiYv.mjs +2 -0
- package/dist/{dist-DW5BPGFs.mjs → dist-BRg_z9Ut.mjs} +1 -1
- package/dist/{shared-YJtB5KZB.mjs → dist-CFQREIRi.mjs} +86 -86
- package/dist/dist-CyisSore.mjs +371 -0
- package/dist/dist-Dr4Hg_Up.mjs +48 -0
- package/dist/{dls-CFzTHcZM.mjs → dls-R6PvHbhj.mjs} +1 -1
- package/dist/{dns-Dw6u-NV1.mjs → dns-Cl8se64c.mjs} +1 -1
- package/dist/{dns-firewall-CIPptslp.mjs → dns-firewall-WtmKilDT.mjs} +1 -1
- package/dist/dry-run-YSQndLvt.mjs +2 -0
- package/dist/{durable-objects-CCkeqqBq.mjs → durable-objects-jfVU6yp_.mjs} +1 -1
- package/dist/{email-auth-kdxO51Oz.mjs → email-auth-DPmZ85eW.mjs} +1 -1
- package/dist/{email-routing-BLggZdQq.mjs → email-routing-Bf6DbNTr.mjs} +1 -1
- package/dist/{email-security-DjADlgdM.mjs → email-security-DTifjSxM.mjs} +1 -1
- package/dist/{email-sending-Cz7E7GoP.mjs → email-sending-Dm3WkFHV.mjs} +1 -1
- package/dist/{error-sanitization-DfLijlBJ.mjs → error-sanitization-D8zuyPj_.mjs} +1 -1
- package/dist/{fieldExtractors-BWaMi6lD.mjs → fieldExtractors-CeXZL0-I.mjs} +1 -1
- package/dist/{firewall-5t6OBIOl.mjs → firewall-D5N2APXO.mjs} +1 -1
- package/dist/{flagship-CzG_VoNR.mjs → flagship-sUOy9jei.mjs} +1 -1
- package/dist/{fraud-UOg_69Ob.mjs → fraud-WLW2Ep1Z.mjs} +1 -1
- package/dist/{google-tag-gateway-DirkD-Q2.mjs → google-tag-gateway-lbww1FaJ.mjs} +1 -1
- package/dist/{healthchecks-BkHZGTp1.mjs → healthchecks-0ih8Qjiw.mjs} +1 -1
- package/dist/{hostnames-EUYOZm21.mjs → hostnames-Ba6FuL8K.mjs} +1 -1
- package/dist/{hyperdrive-ZoLJlJCL.mjs → hyperdrive-DMqcU639.mjs} +1 -1
- package/dist/{iam-BQ2xSgYN.mjs → iam-CXlYm0uC.mjs} +1 -1
- package/dist/{images-CkEq6ScP.mjs → images-D_g1oli6.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{intel-DDWEdGyl.mjs → intel-B8bS0ARd.mjs} +1 -1
- package/dist/interactive-CGOh-aYq.mjs +32 -0
- package/dist/{ips-54Qmy-Uw.mjs → ips-68fzniN4.mjs} +1 -1
- package/dist/{keyless-certificates-CXHLc3Qz.mjs → keyless-certificates-CeLnqBvX.mjs} +1 -1
- package/dist/{keys-rvI4TC3Z.mjs → keys-DkVdS2lF.mjs} +1 -1
- package/dist/{kv-CAeN1zBy.mjs → kv-gDAN50BQ.mjs} +1 -1
- package/dist/{leaked-credential-checks-CbbwtG-p.mjs → leaked-credential-checks-DfnvHpvg.mjs} +1 -1
- package/dist/{lifecycle-XswDq0ZB.mjs → lifecycle-CadF_i2n.mjs} +1 -1
- package/dist/{load-balancers-BFwdwAIU.mjs → load-balancers-m0HqyXPZ.mjs} +1 -1
- package/dist/{local-C6XsFD_W.mjs → local-BwL_gesw.mjs} +1 -1
- package/dist/{local-runtime-BUGCbx8r.mjs → local-runtime-Dj8k-p62.mjs} +1 -1
- package/dist/{logo-matches-Y3PxVn7t.mjs → logo-matches-DPbHlsKQ.mjs} +1 -1
- package/dist/{logos-BN8SvJhS.mjs → logos-DFBJFAYJ.mjs} +1 -1
- package/dist/{logpush-BnLA4WVm.mjs → logpush-gzmlZayc.mjs} +1 -1
- package/dist/logs-BuzwQgt5.mjs +18 -0
- package/dist/{magic-cloud-networking-wPuLwu-F.mjs → magic-cloud-networking-BbHCi1Vp.mjs} +1 -1
- package/dist/{magic-network-monitoring-BNERUpxS.mjs → magic-network-monitoring-kWMmnPTG.mjs} +1 -1
- package/dist/{magic-transit-6tvVOECW.mjs → magic-transit-ClSmJDKw.mjs} +1 -1
- package/dist/{managed-defense-AYwBOYIH.mjs → managed-defense-EOihg1UR.mjs} +1 -1
- package/dist/{managed-transforms-HZZNrkC7.mjs → managed-transforms-BZ_XdGE2.mjs} +1 -1
- package/dist/{matches-Dp91L3dL.mjs → matches-B6sG0_fr.mjs} +1 -1
- package/dist/{mcp-P7pcieiT.mjs → mcp--kK0vS5i.mjs} +1 -1
- package/dist/{mesh-DjFrk6PL.mjs → mesh-DfXYUHOO.mjs} +1 -1
- package/dist/{mtls-certificates-DZMoef2H.mjs → mtls-certificates-DZd-0X7l.mjs} +1 -1
- package/dist/{network-7cd1U6-I.mjs → network-U6f_5ihp.mjs} +1 -1
- package/dist/{network-interconnects-CQ7cPZjK.mjs → network-interconnects-DKZGTiYM.mjs} +1 -1
- package/dist/oauth-BdVr2hJp.mjs +14 -0
- package/dist/{oauth-clients-P9t-eMnx.mjs → oauth-clients-CY3OkPhC.mjs} +1 -1
- package/dist/{oauth-scopes-C3r9Qh_y.mjs → oauth-scopes-BTY7_5L-.mjs} +1 -1
- package/dist/{observability-M1DnLhMR.mjs → observability-Bsp-LdmJ.mjs} +1 -1
- package/dist/{open-PBXRGS4R-DARSUDEI.mjs → open-PBXRGS4R-ClEt4E8F.mjs} +3 -3
- package/dist/{organization-cUE7GDCt.mjs → organization-BSeMdj-7.mjs} +1 -1
- package/dist/{organizations-C-Hcpd0w.mjs → organizations-BroR48Nv.mjs} +1 -1
- package/dist/{origin-ca-certificates-C8cJMyQH.mjs → origin-ca-certificates-jC-EMn6W.mjs} +1 -1
- package/dist/{origin-post-quantum-encryption-DjZJCk8M.mjs → origin-post-quantum-encryption-DIspLvA0.mjs} +1 -1
- package/dist/{origin-tls-client-auth-BsjR5EAV.mjs → origin-tls-client-auth-CZ_nUEcM.mjs} +1 -1
- package/dist/{page-rules-B-zq1EUb.mjs → page-rules-ZcdjPohY.mjs} +1 -1
- package/dist/{pages-B6YpkPos.mjs → pages-W4tKa7xk.mjs} +1 -1
- package/dist/pay-per-crawl-BNM1mJmP.mjs +5 -0
- package/dist/pay-per-use-DKxlnkH3.mjs +2 -0
- package/dist/{pipelines-BJc_RylD.mjs → pipelines-Dug0BR-c.mjs} +1 -1
- package/dist/{precursor-CLQu7suY.mjs → precursor-D-11DkRU.mjs} +1 -1
- package/dist/previews-D_Nv4dR6.mjs +4 -0
- package/dist/{progress-V6SZV3Ux.mjs → progress-a5IKeKni.mjs} +1 -1
- package/dist/project-settings-Bc3wYHo8.mjs +3 -0
- package/dist/prompt-BP8XrQSj.mjs +3 -0
- package/dist/{queries-DSrrket-.mjs → queries-BdA2vJoe.mjs} +1 -1
- package/dist/{queues-Tf7kPBpn.mjs → queues-Bu06ZqUE.mjs} +1 -1
- package/dist/{r2-DmKNnxtC.mjs → r2-COC9wMKb.mjs} +1 -1
- package/dist/{r2-data-catalog-DBxoifOq.mjs → r2-data-catalog-CX5Rl5Qx.mjs} +1 -1
- package/dist/{radar-Csk7Ab-b.mjs → radar-L-yoLIHF.mjs} +1 -1
- package/dist/{raw-fetch-BVYQR6C5.mjs → raw-fetch-DNH2V8qH.mjs} +1 -1
- package/dist/{realtime-CDehZVhV.mjs → realtime-JKIiXfzi.mjs} +1 -1
- package/dist/{registrar-vflzeNQ9.mjs → registrar-_dYUZrK0.mjs} +2 -2
- package/dist/{registrar-sandbox-BxVdfnam.mjs → registrar-sandbox-D1yfW_Q_.mjs} +2 -2
- package/dist/{registry-CWUfXloz.mjs → registry-BrtVdMrC.mjs} +1 -1
- package/dist/{reporting-BaPZ1PHN.mjs → reporting-3fyoMcmb.mjs} +1 -1
- package/dist/request-headers-BhQQAfJt.mjs +2 -0
- package/dist/{request-tracers-C_UVBexV.mjs → request-tracers-TisEth2p.mjs} +1 -1
- package/dist/{resolve-B8CyM1mi.mjs → resolve-CYUp6YgC.mjs} +1 -1
- package/dist/{resource-sharing-CoB4S9j1.mjs → resource-sharing-C4-dnohU.mjs} +1 -1
- package/dist/{resource-tagging-CUiUC5g4.mjs → resource-tagging-BRDifKqM.mjs} +1 -1
- package/dist/{rules-4O8076_s.mjs → rules-BCF3gIkw.mjs} +2 -2
- package/dist/{rulesets-C84MxTYo.mjs → rulesets-wp6rllt3.mjs} +1 -1
- package/dist/{rum-Bvwkrntx.mjs → rum-B77awgoB.mjs} +1 -1
- package/dist/run-BS8otL3u.mjs +2 -0
- package/dist/{schema-C8hU6G9R.mjs → schema-DmuJtMN5.mjs} +1 -1
- package/dist/{schema-flags-DC4c6dka.mjs → schema-flags-CUGxFeZe.mjs} +4 -4
- package/dist/{scim-BvxQmde6.mjs → scim-C9BmUYil.mjs} +1 -1
- package/dist/{sdk-C12y5qCN.mjs → sdk-Bvqx-_3z.mjs} +1 -1
- package/dist/{secrets-store-DOKWiC-j.mjs → secrets-store-ckkZR2dM.mjs} +1 -1
- package/dist/{security-center-Bhy_aC-w.mjs → security-center-BCahKT57.mjs} +1 -1
- package/dist/{security-txt-L7HJ9tq5.mjs → security-txt-0SI5du7I.mjs} +1 -1
- package/dist/shared-D0B-7q-D.mjs +2 -0
- package/dist/{smart-shield-COMXuQ1S.mjs → smart-shield-BDPbrZa4.mjs} +1 -1
- package/dist/{snippets-DffQhlKt.mjs → snippets-CVRR_h0i.mjs} +1 -1
- package/dist/spawn-DP4T92ss.mjs +519 -0
- package/dist/{spectrum-Cmf7SqQE.mjs → spectrum-CjNXQIQE.mjs} +3 -3
- package/dist/{speed-m8cdhLFS.mjs → speed-CrXCHk3h.mjs} +1 -1
- package/dist/src-BbnV77C4.mjs +108 -0
- package/dist/{ssl-D4ffsdSw.mjs → ssl-DKORhHkh.mjs} +1 -1
- package/dist/{startup-profile-Dx95Y5cl.mjs → startup-profile-CBIH6yZy.mjs} +3 -3
- package/dist/{state-CHif8Y5I.mjs → state-QUu6HfxC.mjs} +1 -1
- package/dist/{stream-DPF5fojV.mjs → stream-wY3zi3FK.mjs} +1 -1
- package/dist/{submit-Br8hfP0_.mjs → submit-B-4oCBSk.mjs} +1 -1
- package/dist/{tags-Bnt4JuxQ.mjs → tags-5uJEkYJZ.mjs} +1 -1
- package/dist/{telemetry-DjGNSlkU.mjs → telemetry-2s9Y3FaN.mjs} +1 -1
- package/dist/{telemetry-Ch1vCICm.mjs → telemetry-n3NJourL.mjs} +1 -1
- package/dist/{tenant-D8u0CxoC.mjs → tenant-BkFvv2o3.mjs} +1 -1
- package/dist/{tenant-custom-nameservers-BrWMyslZ.mjs → tenant-custom-nameservers-DcjC1q0r.mjs} +1 -1
- package/dist/{tools-D9RZkZRc.mjs → tools-Dz1JCrHd.mjs} +1 -1
- package/dist/tunnel-Cd4ipbvJ.mjs +2 -0
- package/dist/{tunnels-BkNPpTHa.mjs → tunnels-9Zg3ePwD.mjs} +1 -1
- package/dist/{turnstile-MgwRECJv.mjs → turnstile-BTwKYpzD.mjs} +1 -1
- package/dist/{url-info-Ddp7MgcI.mjs → url-info-D7Y61BFd.mjs} +1 -1
- package/dist/{url-normalization-3ptK9ntV.mjs → url-normalization-B4n8HiNQ.mjs} +1 -1
- package/dist/{url-scanner-Psb9ollR.mjs → url-scanner-CiCIltSQ.mjs} +1 -1
- package/dist/{user-DWdshcIu.mjs → user-DDFDGJ0Y.mjs} +1 -1
- package/dist/{values-CDKQL1z2.mjs → values-DRznB_Cl.mjs} +1 -1
- package/dist/{vectorize-CTYYUyQj.mjs → vectorize-CbznPhzq.mjs} +1 -1
- package/dist/waiting-rooms-CKP5hYBK.mjs +11 -0
- package/dist/{web-assets-CpDwDEx8.mjs → web-assets-C-ZoSkkh.mjs} +1 -1
- package/dist/{web3-YsjDyAzH.mjs → web3-DwlN4dOw.mjs} +1 -1
- package/dist/{workers-builds-BWo5vUA9.mjs → workers-builds-ECw_x_kp.mjs} +1 -1
- package/dist/{workers-for-platforms-ASJsxYdM.mjs → workers-for-platforms-BYGy46R6.mjs} +2 -2
- package/dist/{workers-vpc-RkTnRvA2.mjs → workers-vpc-CCosFcxz.mjs} +1 -1
- package/dist/workers-zFMrbUkg.mjs +6 -0
- package/dist/{workflows-KrIFI9ns.mjs → workflows-C8GXGDRW.mjs} +1 -1
- package/dist/{zaraz-DglXbVzZ.mjs → zaraz-B5UIREaz.mjs} +1 -1
- package/dist/{zero-trust-RilTdSjX.mjs → zero-trust-DUp0XoIo.mjs} +50 -50
- package/dist/{zone-DsBtVkvT.mjs → zone-BGLkk-mL.mjs} +1 -1
- package/dist/{zones-BFxvWFQW.mjs → zones-CwYjNXMH.mjs} +1 -1
- package/package.json +11 -11
- package/dist/analytics-BaUZwNc5.mjs +0 -4
- package/dist/build-0QlYUfFS.mjs +0 -2
- package/dist/cf-C11NGkjx.mjs +0 -18
- package/dist/chunk-LQW53VED-CoECHA3R.mjs +0 -119
- package/dist/command-CMzMsll4.mjs +0 -2
- package/dist/custom-pages-DzKnSgL3.mjs +0 -3
- package/dist/d1-JBEqjJoj.mjs +0 -20
- package/dist/data-security-CIktWnXt.mjs +0 -7
- package/dist/dist-12KzRsBM.mjs +0 -387
- package/dist/dist-BCVqQpg2.mjs +0 -2
- package/dist/dist-Cp3uJN1x.mjs +0 -48
- package/dist/dist-S9K_8gq9.mjs +0 -9
- package/dist/dry-run-DiVy1lVo.mjs +0 -2
- package/dist/interactive-B2E03Fs-.mjs +0 -11
- package/dist/interactive-_B-EqD0Y.mjs +0 -23
- package/dist/logexplorer-D8rOPB5I.mjs +0 -17
- package/dist/logs-CDo7Y5sA.mjs +0 -3
- package/dist/oauth-DH3kMXSs.mjs +0 -14
- package/dist/pay-per-crawl-B4wx0lUb.mjs +0 -4
- package/dist/prompt-DjRTpML4.mjs +0 -3
- package/dist/public-BMg6-Hxh-BfUOZTDP.mjs +0 -2
- package/dist/request-headers-CC4eHmI2.mjs +0 -3
- package/dist/run-CRfinkSe.mjs +0 -2
- package/dist/schemas-O_ZNaF8R.mjs +0 -65
- package/dist/spawn-C1AISA2V.mjs +0 -526
- package/dist/src-C8phrg-8.mjs +0 -109
- package/dist/waiting-rooms-BUdmwXDY.mjs +0 -11
- package/dist/workers-BKKxaZcz.mjs +0 -6
- /package/dist/{alerts-B2SJO4nd.mjs → alerts-CarPLL8k.mjs} +0 -0
- /package/dist/{autorag-iNjZXw1n.mjs → autorag-zK-3harf.mjs} +0 -0
- /package/dist/{body-parser-DIlfApuJ.mjs → body-parser-Cmw7PZ7a.mjs} +0 -0
- /package/dist/{brands-BrVnNrT3.mjs → brands-CpgTsX8h.mjs} +0 -0
- /package/dist/{clear-an9o3dJ3.mjs → clear-C5gzBA8G.mjs} +0 -0
- /package/dist/{cli-types-CrSoSMPF.mjs → cli-types-abvWQN3T.mjs} +0 -0
- /package/dist/{connector-telemetry-events-latest-BqWfopFc.mjs → connector-telemetry-events-latest-BY-dbhQZ.mjs} +0 -0
- /package/dist/{connector-telemetry-snapshots-latest-C1m9U1En.mjs → connector-telemetry-snapshots-latest-DoMvHvCO.mjs} +0 -0
- /package/dist/{domain-info-B0Ykqv5l.mjs → domain-info-Cw3G4nap.mjs} +0 -0
- /package/dist/{health-CIUg1C5o.mjs → health-DkEXPkS6.mjs} +0 -0
- /package/dist/{input-validation-BxchZ9jE.mjs → input-validation-nF-0Ze2h.mjs} +0 -0
- /package/dist/{internal-DmpATljO.mjs → internal-4fU2r5en.mjs} +0 -0
- /package/dist/{live-B66u3_0g.mjs → live-B4iGrwY2.mjs} +0 -0
- /package/dist/{metadata-D062SVyy.mjs → metadata-C5fJJr-k.mjs} +0 -0
- /package/dist/{output-COcSQsfn.mjs → output-Z2lQmPUW.mjs} +0 -0
- /package/dist/{rate-limit-analytics-BknoecoM.mjs → rate-limit-analytics-DNsAFIeM.mjs} +0 -0
- /package/dist/{rate-limits-cdChIg_S.mjs → rate-limits-CsOim7bm.mjs} +0 -0
- /package/dist/{ready-C-H2cwp_.mjs → ready-tTe-zcIw.mjs} +0 -0
- /package/dist/{recent-submissions-DyuH_n5u.mjs → recent-submissions-B3eTV5yC.mjs} +0 -0
- /package/dist/{refute-uSlzkQKq.mjs → refute-BY76YVrT.mjs} +0 -0
- /package/dist/{scan-logo-DMk--WT7.mjs → scan-logo-DdoF_a5y.mjs} +0 -0
- /package/dist/{scan-page-DEHnAOJo.mjs → scan-page-sSgLwwZN.mjs} +0 -0
- /package/dist/{search-BlKeSfVD.mjs → search-BFvQr-sl.mjs} +0 -0
- /package/dist/{signed-url-CiGmGkLQ.mjs → signed-url-Cr8hiZPJ.mjs} +0 -0
- /package/dist/{submission-info-DHlTHDrs.mjs → submission-info-DT2mLnu1.mjs} +0 -0
- /package/dist/{total-queries-D5WvVfYi.mjs → total-queries-6gs5iy9T.mjs} +0 -0
- /package/dist/{tracked-domains-9deBK9bp.mjs → tracked-domains-D6XKO2EV.mjs} +0 -0
- /package/dist/{verify-S-TmhUDr.mjs → verify-CM1NakP0.mjs} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n}from"./oauth-DH3kMXSs.mjs";import{a as r,r as i}from"./auth-tvDdC1J-.mjs";import{t as a}from"./output-COcSQsfn.mjs";import{t as o}from"./dry-run-DiVy1lVo.mjs";import{t as s}from"./progress-V6SZV3Ux.mjs";import{t as c}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{i as l,n as u,t as d}from"./body-parser-DIlfApuJ.mjs";import{n as f}from"./input-validation-BxchZ9jE.mjs";import{a as p}from"./prompt-DjRTpML4.mjs";import{t as m}from"./cli-types-CrSoSMPF.mjs";function h(e){return e.positional(`scan-id`,{type:`string`,description:`Scan ID`,demandOption:!0}).option(`repo-id`,{type:`string`,description:`Repo ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get <scan-id>`,describe:"Gets the repository projection of the active operator-reviewed scan report. `scan_id` is the customer scan's stable request ID.",builder:h,handler:async r=>c({command:`managed-defense vulnerability-discovery reports get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf managed-defense vulnerability-discovery reports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/managed-defense/vulnerability-discovery/repos/${r[`repo-id`]==null?`<repo-id>`:encodeURIComponent(String(r[`repo-id`]))}/scans/${r[`scan-id`]==null?`<scan-id>`:encodeURIComponent(String(r[`scan-id`]))}/report`,pathParams:{"repo-id":String(r[`repo-id`]??``),"scan-id":String(r[`scan-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.managedDefense.vulnerabilityDiscovery.reports.get({account_id:l,repo_id:r[`repo-id`],scan_id:r[`scan-id`]})),{successLabel:`Loaded`})})},_={command:`reports`,describe:`Operations for vulnerability-discovery.reports`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.option(`idempotency-key`,{type:`string`,description:"Optional. Supply this header to safely retry a request. Required when `worker_script_name` is supplied."}).option(`name`,{type:`string`,description:`The name field`}).option(`worker-script-name`,{type:`string`,description:`The worker_script_name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`create`,describe:`Creates an upload repository or reserves an asynchronous deployed Worker import by name. Worker imports require Idempotency-Key.`,builder:v,handler:async m=>c({command:`managed-defense vulnerability-discovery repositories create`,classification:{safeFlags:[`dry-run`]}},m,async()=>{let c={};if(m[`idempotency-key`]!==void 0&&(c[`Idempotency-Key`]=String(m[`idempotency-key`])),m.dryRun){o({command:`cf managed-defense vulnerability-discovery repositories create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/managed-defense/vulnerability-discovery/repos`,pathParams:{},bodyKind:`json`,body:m.body===void 0?d({name:f(m.name,`name`,`text`),worker_script_name:f(m[`worker-script-name`],`worker-script-name`,`text`)}):u(m.body)});return}let h=await i(m),g=m.local?e:await t();if(m.accountId=g,m.body){let e=u(m.body);a(await s(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/managed-defense/vulnerability-discovery/repos`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`});return}m.name===void 0&&(m.name=await p(`name`,`The name field`));let _={};m.name!==void 0&&l(_,[`name`],f(m.name,`name`,`text`)),m[`worker-script-name`]!==void 0&&l(_,[`worker_script_name`],f(m[`worker-script-name`],`worker-script-name`,`text`)),a(await s(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/managed-defense/vulnerability-discovery/repos`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`})})};function b(e){return e.positional(`repo-id`,{type:`string`,description:`Repo ID`,demandOption:!0}).option(`scan-limit`,{type:`number`,description:`Scan limit`}).option(`scan-cursor`,{type:`string`,description:`Scan cursor`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get <repo-id>`,describe:`Gets repository metadata, source readiness, and customer scan history.`,builder:b,handler:async r=>c({command:`managed-defense vulnerability-discovery repositories get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={scan_limit:r[`scan-limit`],scan_cursor:r[`scan-cursor`]};if(r.dryRun){o({command:`cf managed-defense vulnerability-discovery repositories get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/managed-defense/vulnerability-discovery/repos/${r[`repo-id`]==null?`<repo-id>`:encodeURIComponent(String(r[`repo-id`]))}`,pathParams:{"repo-id":String(r[`repo-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.managedDefense.vulnerabilityDiscovery.repositories.get({account_id:u,repo_id:r[`repo-id`],...c})),{successLabel:`Loaded`})})};function S(e){return e.option(`limit`,{type:`number`,description:`Limit`}).option(`cursor`,{type:`string`,description:`Cursor`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`list`,describe:`Lists repositories available for vulnerability discovery in an account.`,builder:S,handler:async r=>c({command:`managed-defense vulnerability-discovery repositories list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={limit:r.limit,cursor:r.cursor};if(r.dryRun){o({command:`cf managed-defense vulnerability-discovery repositories list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/managed-defense/vulnerability-discovery/repos`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.managedDefense.vulnerabilityDiscovery.repositories.list({account_id:u,...c})),{successLabel:`Loaded`})})},w={command:`repositories`,describe:`Operations for vulnerability-discovery.repositories`,builder:e=>e.command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.option(`idempotency-key`,{type:`string`,description:"Optional. Supply this header to safely retry a request. Required when `worker_script_name` is supplied."}).option(`repos`,{type:`string`,array:!0,description:`The repos field`}).option(`telemetry-window-end`,{type:`string`,description:`The telemetry_window.end field`}).option(`telemetry-window-start`,{type:`string`,description:`The telemetry_window.start 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)`}).check(e=>{if([`telemetry-window-end`,`telemetry-window-start`].some(t=>e[t]!==void 0)){let t=[`telemetry-window-end`,`telemetry-window-start`].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 --telemetry_window-* flag is set`)}return!0})}const E={command:`create`,describe:"Submits repository intent for operator review. This endpoint does not immediately start execution. Worker-imported repositories must be ready; explicit `repo_hosts` must be authorized before the request is persisted.",builder:T,handler:async p=>c({command:`managed-defense vulnerability-discovery scans create`,classification:{safeFlags:[`dry-run`]}},p,async()=>{let c={};if(p[`idempotency-key`]!==void 0&&(c[`Idempotency-Key`]=String(p[`idempotency-key`])),p.dryRun){o({command:`cf managed-defense vulnerability-discovery scans create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/managed-defense/vulnerability-discovery/scans`,pathParams:{},bodyKind:`json`,body:p.body===void 0?d({repos:p.repos,telemetry_window:{end:f(p[`telemetry-window-end`],`telemetry-window-end`,`text`),start:f(p[`telemetry-window-start`],`telemetry-window-start`,`text`)}}):u(p.body)});return}let m=await i(p),h=p.local?e:await t();if(p.accountId=h,p.body){let e=u(p.body);a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${h}/managed-defense/vulnerability-discovery/scans`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`});return}if(p.repos===void 0)throw Error(`--repos is required (or pass --body with this field set).`);let g={};p.repos!==void 0&&l(g,[`repos`],p.repos),p[`telemetry-window-end`]!==void 0&&l(g,[`telemetry_window`,`end`],f(p[`telemetry-window-end`],`telemetry-window-end`,`text`)),p[`telemetry-window-start`]!==void 0&&l(g,[`telemetry_window`,`start`],f(p[`telemetry-window-start`],`telemetry-window-start`,`text`)),a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${h}/managed-defense/vulnerability-discovery/scans`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`})})};function D(e){return e.positional(`scan-id`,{type:`string`,description:`Scan ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get <scan-id>`,describe:`Gets one customer-requested scan across its review and execution lifecycle.`,builder:D,handler:async r=>c({command:`managed-defense vulnerability-discovery scans get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf managed-defense vulnerability-discovery scans get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/managed-defense/vulnerability-discovery/scans/${r[`scan-id`]==null?`<scan-id>`:encodeURIComponent(String(r[`scan-id`]))}`,pathParams:{"scan-id":String(r[`scan-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.managedDefense.vulnerabilityDiscovery.scans.get({account_id:l,scan_id:r[`scan-id`]})),{successLabel:`Loaded`})})};function k(e){return e.positional(`scan-id`,{type:`string`,description:`Scan ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`getReport <scan-id>`,describe:`Gets the active operator-reviewed scan report. Repository metadata records report readiness even when no publication is available.`,builder:k,handler:async r=>c({command:`managed-defense vulnerability-discovery scans getReport`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf managed-defense vulnerability-discovery scans getReport`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/managed-defense/vulnerability-discovery/scans/${r[`scan-id`]==null?`<scan-id>`:encodeURIComponent(String(r[`scan-id`]))}/report`,pathParams:{"scan-id":String(r[`scan-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.managedDefense.vulnerabilityDiscovery.scans.getReport({account_id:l,scan_id:r[`scan-id`]})),{successLabel:`Loaded`})})};function j(e){return e.option(`limit`,{type:`number`,description:`Limit`}).option(`cursor`,{type:`string`,description:`Cursor`}).option(`status`,{type:`string`,description:`Repeat parameter or provide comma-separated values.`}).option(`repo`,{type:`string`,description:`Repo`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`list`,describe:`Lists customer-requested scans across review and execution lifecycle states.`,builder:m(j),handler:async r=>c({command:`managed-defense vulnerability-discovery scans list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={limit:r.limit,cursor:r.cursor,status:r.status,repo:r.repo};if(r.dryRun){o({command:`cf managed-defense vulnerability-discovery scans list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/managed-defense/vulnerability-discovery/scans`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.managedDefense.vulnerabilityDiscovery.scans.list({account_id:u,...c})),{successLabel:`Loaded`})})},N={command:`scans`,describe:`Operations for vulnerability-discovery.scans`,builder:e=>e.command(E).command(O).command(A).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},P={command:`vulnerability-discovery`,describe:`Operations for vulnerability-discovery`,builder:e=>e.command(_).command(w).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},F={command:`managed-defense`,describe:`managed-defense`,builder:e=>e.command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{F as default};
|
|
2
|
+
import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n}from"./oauth-BdVr2hJp.mjs";import{a as r,r as i}from"./auth-DWxtJ918.mjs";import{t as a}from"./output-Z2lQmPUW.mjs";import{t as o}from"./dry-run-YSQndLvt.mjs";import{t as s}from"./progress-a5IKeKni.mjs";import{t as c}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{i as l,n as u,t as d}from"./body-parser-Cmw7PZ7a.mjs";import{n as f}from"./input-validation-nF-0Ze2h.mjs";import{a as p}from"./prompt-BP8XrQSj.mjs";import{t as m}from"./cli-types-abvWQN3T.mjs";function h(e){return e.positional(`scan-id`,{type:`string`,description:`Scan ID`,demandOption:!0}).option(`repo-id`,{type:`string`,description:`Repo ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get <scan-id>`,describe:"Gets the repository projection of the active operator-reviewed scan report. `scan_id` is the customer scan's stable request ID.",builder:h,handler:async r=>c({command:`managed-defense vulnerability-discovery reports get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf managed-defense vulnerability-discovery reports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/managed-defense/vulnerability-discovery/repos/${r[`repo-id`]==null?`<repo-id>`:encodeURIComponent(String(r[`repo-id`]))}/scans/${r[`scan-id`]==null?`<scan-id>`:encodeURIComponent(String(r[`scan-id`]))}/report`,pathParams:{"repo-id":String(r[`repo-id`]??``),"scan-id":String(r[`scan-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.managedDefense.vulnerabilityDiscovery.reports.get({account_id:l,repo_id:r[`repo-id`],scan_id:r[`scan-id`]})),{successLabel:`Loaded`})})},_={command:`reports`,describe:`Operations for vulnerability-discovery.reports`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.option(`idempotency-key`,{type:`string`,description:"Optional. Supply this header to safely retry a request. Required when `worker_script_name` is supplied."}).option(`name`,{type:`string`,description:`The name field`}).option(`worker-script-name`,{type:`string`,description:`The worker_script_name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`create`,describe:`Creates an upload repository or reserves an asynchronous deployed Worker import by name. Worker imports require Idempotency-Key.`,builder:v,handler:async m=>c({command:`managed-defense vulnerability-discovery repositories create`,classification:{safeFlags:[`dry-run`]}},m,async()=>{let c={};if(m[`idempotency-key`]!==void 0&&(c[`Idempotency-Key`]=String(m[`idempotency-key`])),m.dryRun){o({command:`cf managed-defense vulnerability-discovery repositories create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/managed-defense/vulnerability-discovery/repos`,pathParams:{},bodyKind:`json`,body:m.body===void 0?d({name:f(m.name,`name`,`text`),worker_script_name:f(m[`worker-script-name`],`worker-script-name`,`text`)}):u(m.body)});return}let h=await i(m),g=m.local?e:await t();if(m.accountId=g,m.body){let e=u(m.body);a(await s(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/managed-defense/vulnerability-discovery/repos`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`});return}m.name===void 0&&(m.name=await p(`name`,`The name field`));let _={};m.name!==void 0&&l(_,[`name`],f(m.name,`name`,`text`)),m[`worker-script-name`]!==void 0&&l(_,[`worker_script_name`],f(m[`worker-script-name`],`worker-script-name`,`text`)),a(await s(`Creating`,async()=>r(h,`POST`,`/accounts/${g}/managed-defense/vulnerability-discovery/repos`,{body:Object.keys(_).length>0?_:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`})})};function b(e){return e.positional(`repo-id`,{type:`string`,description:`Repo ID`,demandOption:!0}).option(`scan-limit`,{type:`number`,description:`Scan limit`}).option(`scan-cursor`,{type:`string`,description:`Scan cursor`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get <repo-id>`,describe:`Gets repository metadata, source readiness, and customer scan history.`,builder:b,handler:async r=>c({command:`managed-defense vulnerability-discovery repositories get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={scan_limit:r[`scan-limit`],scan_cursor:r[`scan-cursor`]};if(r.dryRun){o({command:`cf managed-defense vulnerability-discovery repositories get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/managed-defense/vulnerability-discovery/repos/${r[`repo-id`]==null?`<repo-id>`:encodeURIComponent(String(r[`repo-id`]))}`,pathParams:{"repo-id":String(r[`repo-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.managedDefense.vulnerabilityDiscovery.repositories.get({account_id:u,repo_id:r[`repo-id`],...c})),{successLabel:`Loaded`})})};function S(e){return e.option(`limit`,{type:`number`,description:`Limit`}).option(`cursor`,{type:`string`,description:`Cursor`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`list`,describe:`Lists repositories available for vulnerability discovery in an account.`,builder:S,handler:async r=>c({command:`managed-defense vulnerability-discovery repositories list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={limit:r.limit,cursor:r.cursor};if(r.dryRun){o({command:`cf managed-defense vulnerability-discovery repositories list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/managed-defense/vulnerability-discovery/repos`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.managedDefense.vulnerabilityDiscovery.repositories.list({account_id:u,...c})),{successLabel:`Loaded`})})},w={command:`repositories`,describe:`Operations for vulnerability-discovery.repositories`,builder:e=>e.command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.option(`idempotency-key`,{type:`string`,description:"Optional. Supply this header to safely retry a request. Required when `worker_script_name` is supplied."}).option(`repos`,{type:`string`,array:!0,description:`The repos field`}).option(`telemetry-window-end`,{type:`string`,description:`The telemetry_window.end field`}).option(`telemetry-window-start`,{type:`string`,description:`The telemetry_window.start 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)`}).check(e=>{if([`telemetry-window-end`,`telemetry-window-start`].some(t=>e[t]!==void 0)){let t=[`telemetry-window-end`,`telemetry-window-start`].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 --telemetry_window-* flag is set`)}return!0})}const E={command:`create`,describe:"Submits repository intent for operator review. This endpoint does not immediately start execution. Worker-imported repositories must be ready; explicit `repo_hosts` must be authorized before the request is persisted.",builder:T,handler:async p=>c({command:`managed-defense vulnerability-discovery scans create`,classification:{safeFlags:[`dry-run`]}},p,async()=>{let c={};if(p[`idempotency-key`]!==void 0&&(c[`Idempotency-Key`]=String(p[`idempotency-key`])),p.dryRun){o({command:`cf managed-defense vulnerability-discovery scans create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/managed-defense/vulnerability-discovery/scans`,pathParams:{},bodyKind:`json`,body:p.body===void 0?d({repos:p.repos,telemetry_window:{end:f(p[`telemetry-window-end`],`telemetry-window-end`,`text`),start:f(p[`telemetry-window-start`],`telemetry-window-start`,`text`)}}):u(p.body)});return}let m=await i(p),h=p.local?e:await t();if(p.accountId=h,p.body){let e=u(p.body);a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${h}/managed-defense/vulnerability-discovery/scans`,{body:e,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`});return}if(p.repos===void 0)throw Error(`--repos is required (or pass --body with this field set).`);let g={};p.repos!==void 0&&l(g,[`repos`],p.repos),p[`telemetry-window-end`]!==void 0&&l(g,[`telemetry_window`,`end`],f(p[`telemetry-window-end`],`telemetry-window-end`,`text`)),p[`telemetry-window-start`]!==void 0&&l(g,[`telemetry_window`,`start`],f(p[`telemetry-window-start`],`telemetry-window-start`,`text`)),a(await s(`Creating`,async()=>r(m,`POST`,`/accounts/${h}/managed-defense/vulnerability-discovery/scans`,{body:Object.keys(g).length>0?g:void 0,headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Created`})})};function D(e){return e.positional(`scan-id`,{type:`string`,description:`Scan ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get <scan-id>`,describe:`Gets one customer-requested scan across its review and execution lifecycle.`,builder:D,handler:async r=>c({command:`managed-defense vulnerability-discovery scans get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf managed-defense vulnerability-discovery scans get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/managed-defense/vulnerability-discovery/scans/${r[`scan-id`]==null?`<scan-id>`:encodeURIComponent(String(r[`scan-id`]))}`,pathParams:{"scan-id":String(r[`scan-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.managedDefense.vulnerabilityDiscovery.scans.get({account_id:l,scan_id:r[`scan-id`]})),{successLabel:`Loaded`})})};function k(e){return e.positional(`scan-id`,{type:`string`,description:`Scan ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`getReport <scan-id>`,describe:`Gets the active operator-reviewed scan report. Repository metadata records report readiness even when no publication is available.`,builder:k,handler:async r=>c({command:`managed-defense vulnerability-discovery scans getReport`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf managed-defense vulnerability-discovery scans getReport`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/managed-defense/vulnerability-discovery/scans/${r[`scan-id`]==null?`<scan-id>`:encodeURIComponent(String(r[`scan-id`]))}/report`,pathParams:{"scan-id":String(r[`scan-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.managedDefense.vulnerabilityDiscovery.scans.getReport({account_id:l,scan_id:r[`scan-id`]})),{successLabel:`Loaded`})})};function j(e){return e.option(`limit`,{type:`number`,description:`Limit`}).option(`cursor`,{type:`string`,description:`Cursor`}).option(`status`,{type:`string`,description:`Repeat parameter or provide comma-separated values.`}).option(`repo`,{type:`string`,description:`Repo`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`list`,describe:`Lists customer-requested scans across review and execution lifecycle states.`,builder:m(j),handler:async r=>c({command:`managed-defense vulnerability-discovery scans list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={limit:r.limit,cursor:r.cursor,status:r.status,repo:r.repo};if(r.dryRun){o({command:`cf managed-defense vulnerability-discovery scans list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/managed-defense/vulnerability-discovery/scans`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.managedDefense.vulnerabilityDiscovery.scans.list({account_id:u,...c})),{successLabel:`Loaded`})})},N={command:`scans`,describe:`Operations for vulnerability-discovery.scans`,builder:e=>e.command(E).command(O).command(A).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},P={command:`vulnerability-discovery`,describe:`Operations for vulnerability-discovery`,builder:e=>e.command(_).command(w).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},F={command:`managed-defense`,describe:`managed-defense`,builder:e=>e.command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{F as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{h as e}from"./oauth-
|
|
2
|
+
import{h as e}from"./oauth-BdVr2hJp.mjs";import{r as t}from"./auth-DWxtJ918.mjs";import{t as n}from"./output-Z2lQmPUW.mjs";import{t as r}from"./dry-run-YSQndLvt.mjs";import{t as i}from"./progress-a5IKeKni.mjs";import{t as a}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{n as o,r as s,t as c}from"./body-parser-Cmw7PZ7a.mjs";import{n as l}from"./prompt-BP8XrQSj.mjs";function u(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const d={command:`delete`,describe:`Disables all Managed Transforms.`,builder:u,handler:async o=>a({command:`managed-transforms delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},o,async()=>{if(o.dryRun){r({command:`cf managed-transforms delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/managed_headers`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await t(o),s=await e({zone:o.zone},a,{quiet:o.quiet});if(o.zoneId=s,!await l({force:!!o.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}n(await i(`Deleting`,async()=>a.managedTransforms.delete({zone_id:s})),{successLabel:`Deleted`})})};function f(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`list`,describe:`Fetches a list of all Managed Transforms.`,builder:f,handler:async o=>a({command:`managed-transforms list`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf managed-transforms list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/managed_headers`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await t(o),s=await e({zone:o.zone},a,{quiet:o.quiet});o.zoneId=s,n(await i(`Loading`,async()=>a.managedTransforms.list({zone_id:s})),{successLabel:`Loaded`})})};function m(e){return e.option(`managed-request-headers`,{type:`string`,description:`The list of Managed Request Transforms. Provide as a JSON array of objects or @path/to/file.json.`}).option(`managed-response-headers`,{type:`string`,description:`The list of Managed Response Transforms. 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:`A Managed Transforms patch object. Both fields are optional; only the sections provided will be updated.`})}const h={command:`update`,describe:`Updates the status of one or more Managed Transforms.`,builder:m,handler:async l=>a({command:`managed-transforms update`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){r({command:`cf managed-transforms update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/managed_headers`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?c({managed_request_headers:s(l[`managed-request-headers`],`managed-request-headers`),managed_response_headers:s(l[`managed-response-headers`],`managed-response-headers`)}):o(l.body)});return}let a=await t(l),u=await e({zone:l.zone},a,{quiet:l.quiet});if(l.zoneId=u,l.body){let e=o(l.body);n(await i(`Updating`,async()=>a.managedTransforms.update({...e,zone_id:u})),{successLabel:`Updated`});return}let d=c({managed_request_headers:s(l[`managed-request-headers`],`managed-request-headers`),managed_response_headers:s(l[`managed-response-headers`],`managed-response-headers`)});n(await i(`Updating`,async()=>a.managedTransforms.update({...d,zone_id:u})),{successLabel:`Updated`})})},g={command:`managed-transforms`,describe:`managed-transforms`,builder:e=>e.command(d).command(p).command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{g as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n}from"./oauth-BdVr2hJp.mjs";import{r}from"./auth-DWxtJ918.mjs";import{t as i}from"./output-Z2lQmPUW.mjs";import{t as a}from"./dry-run-YSQndLvt.mjs";import{t as o}from"./progress-a5IKeKni.mjs";import{t as s}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";function c(e){return e.option(`id`,{type:`string`,description:`ID`}).option(`offset`,{type:`number`,description:`Offset`}).option(`limit`,{type:`number`,description:`Limit`}).option(`include-domain-id`,{type:`boolean`,description:`Include domain ID`}).option(`include-dismissed`,{type:`boolean`,description:`Include dismissed`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const l={command:`get`,describe:`Return matches as CSV for string queries based on ID`,builder:c,handler:async c=>s({command:`matches download get`,classification:{safeFlags:[`include-domain-id`,`include-dismissed`,`dry-run`]}},c,async()=>{let s={id:c.id,offset:c.offset,limit:c.limit,include_domain_id:c[`include-domain-id`],include_dismissed:c[`include-dismissed`]};if(c.dryRun){a({command:`cf matches download get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/brand-protection/matches/download`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.matches.download.get({account_id:u,...s})),{successLabel:`Loaded`})})},u={command:`download`,describe:`Operations for download`,builder:e=>e.command(l).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function d(e){return e.option(`id`,{type:`string`,description:`ID`}).option(`offset`,{type:`number`,description:`Offset`}).option(`limit`,{type:`number`,description:`Limit`}).option(`include-domain-id`,{type:`boolean`,description:`Include domain ID`}).option(`include-dismissed`,{type:`boolean`,description:`Include dismissed`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`get`,describe:`Return matches for string queries based on ID`,builder:d,handler:async c=>s({command:`matches get`,classification:{safeFlags:[`include-domain-id`,`include-dismissed`,`dry-run`]}},c,async()=>{let s={id:c.id,offset:c.offset,limit:c.limit,include_domain_id:c[`include-domain-id`],include_dismissed:c[`include-dismissed`]};if(c.dryRun){a({command:`cf matches get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/brand-protection/matches`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.matches.get({account_id:u,...s})),{successLabel:`Loaded`})})},p={command:`matches`,describe:`matches`,builder:e=>e.command(f).command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n}from"./oauth-BdVr2hJp.mjs";import{r}from"./auth-DWxtJ918.mjs";import{t as i}from"./output-Z2lQmPUW.mjs";import{t as a}from"./dry-run-YSQndLvt.mjs";import{t as o}from"./progress-a5IKeKni.mjs";import{t as s}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{n as c,r as l,t as u}from"./body-parser-Cmw7PZ7a.mjs";import{n as d}from"./input-validation-nF-0Ze2h.mjs";import{a as f,i as p,n as m}from"./prompt-BP8XrQSj.mjs";import{t as h}from"./cli-types-abvWQN3T.mjs";function g(e){return e.option(`granularity`,{type:`string`,description:`Granularity`,choices:[`daily`,`monthly`]}).option(`aggregate`,{type:`string`,description:`Aggregate`,choices:[`true`,`false`]}).option(`tz`,{type:`string`,description:`Tz`}).option(`days`,{type:`number`,description:`Daily trailing-window size; defaults to 7 and is ignored for monthly`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`account-tool-call-analytics`,describe:`Returns daily or monthly tool-call counts across the account.`,builder:h(g),handler:async c=>s({command:`mcp portals account-tool-call-analytics`,classification:{safeFlags:[`granularity`,`aggregate`,`dry-run`]}},c,async()=>{let s={granularity:c.granularity,aggregate:c.aggregate,tz:c.tz,days:c.days};if(c.dryRun){a({command:`cf mcp portals account-tool-call-analytics`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/analytics/tool-calls/timeseries`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.mcp.portals.accountToolCallAnalytics({account_id:u,...s})),{successLabel:`Loaded`})})};function v(e){return e.option(`allow-code-mode`,{type:`boolean`,description:"Deprecated: use `code_mode` for new integrations. `true` maps to any non-off Code Mode policy; `false` maps to `code_mode: off`. If both fields are sent, they must be consistent or the request returns a 400."}).option(`code-mode`,{type:`string`,description:"Code Mode policy for this portal. `off`: Code Mode is unavailable; query parameters are ignored. `opt_in`: Code Mode is off by default; clients turn it on with `?codemode=search_and_execute`. `default_on`: Code Mode is on by default; clients can opt out with `?codemode=off`. `enforced`: Code Mode is always on; query parameters are ignored. Defaults to `opt_in` when omitted on create. If both `code_mode` and `allow_code_mode` are sent, they must be consistent or the request returns a 400.",choices:[`off`,`opt_in`,`default_on`,`enforced`]}).option(`description`,{type:`string`,description:`Optional description of the MCP portal.`}).option(`hostname`,{type:`string`,description:`Hostname where the MCP portal is available.`}).option(`id`,{type:`string`,description:`Unique identifier for the MCP portal.`}).option(`name`,{type:`string`,description:`Display name for the MCP portal.`}).option(`secure-web-gateway`,{type:`boolean`,description:`Route outbound MCP traffic through Zero Trust Secure Web Gateway.`,default:!1}).option(`servers`,{type:`string`,description:`MCP servers attached to the portal and their portal-specific settings. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`create`,describe:`Creates a new MCP portal for managing AI tool access through Cloudflare Access.`,builder:v,handler:async p=>s({command:`mcp portals create`,classification:{safeFlags:[`allow-code-mode`,`code-mode`,`secure-web-gateway`,`dry-run`]}},p,async()=>{if(p.dryRun){a({command:`cf mcp portals create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/portals`,pathParams:{},bodyKind:`json`,body:p.body===void 0?u({allow_code_mode:p[`allow-code-mode`],code_mode:d(p[`code-mode`],`code-mode`,`text`),description:d(p.description,`description`,`text`),hostname:d(p.hostname,`hostname`,`text`),id:d(p.id,`id`,`text`),name:d(p.name,`name`,`text`),secure_web_gateway:p[`secure-web-gateway`],servers:l(p.servers,`servers`)}):c(p.body)});return}let s=await r(p),m=p.local?e:await t();if(p.accountId=m,p.body){let e=c(p.body);i(await o(`Creating`,async()=>s.mcp.portals.create({...e,account_id:m})),{successLabel:`Created`});return}p.hostname===void 0&&(p.hostname=await f(`hostname`,`Hostname where the MCP portal is available.`)),p.id===void 0&&(p.id=await f(`id`,`Unique identifier for the MCP portal.`)),p.name===void 0&&(p.name=await f(`name`,`Display name for the MCP portal.`));let h=u({allow_code_mode:p[`allow-code-mode`],code_mode:d(p[`code-mode`],`code-mode`,`text`),description:d(p.description,`description`,`text`),hostname:d(p.hostname,`hostname`,`text`),id:d(p.id,`id`,`text`),name:d(p.name,`name`,`text`),secure_web_gateway:p[`secure-web-gateway`],servers:l(p.servers,`servers`)});i(await o(`Creating`,async()=>s.mcp.portals.create({...h,account_id:m})),{successLabel:`Created`})})};function b(e){return e.positional(`id`,{type:`string`,description:`Unique identifier for the MCP portal.`,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 x={command:`delete <id>`,describe:`Deletes an MCP portal from the account.`,builder:b,handler:async c=>s({command:`mcp portals delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf mcp portals delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/portals/${c.id==null?`<id>`:encodeURIComponent(String(c.id))}`,pathParams:{id:String(c.id??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await m({force:!!c.force,message:`This operation permanently deletes the MCP portal.`})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}i(await o(`Deleting`,async()=>s.mcp.portals.delete({account_id:l,id:c.id})),{successLabel:`Deleted`})})};function S(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`search`,{type:`string`,description:`Search by id, name, hostname`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`list`,describe:`Lists all MCP portals configured for the account.`,builder:S,handler:async c=>s({command:`mcp portals list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={page:c.page,per_page:c[`per-page`],search:c.search};if(c.dryRun){a({command:`cf mcp portals list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/portals`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.mcp.portals.list({account_id:u,...s})),{successLabel:`Loaded`})})};function w(e){return e.positional(`id`,{type:`string`,description:`Unique identifier for the MCP portal.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`read <id>`,describe:`Read the details of a single MCP Portal, including its configured servers.`,builder:w,handler:async c=>s({command:`mcp portals read`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf mcp portals read`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/portals/${c.id==null?`<id>`:encodeURIComponent(String(c.id))}`,pathParams:{id:String(c.id??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.mcp.portals.read({account_id:l,id:c.id})),{successLabel:`Loaded`})})};function E(e){return e.positional(`portal-id`,{type:`string`,description:`Portal ID`,demandOption:!0}).option(`granularity`,{type:`string`,description:`Granularity`,choices:[`daily`,`monthly`]}).option(`aggregate`,{type:`string`,description:`Aggregate`,choices:[`true`,`false`]}).option(`tz`,{type:`string`,description:`Tz`}).option(`days`,{type:`number`,description:`Daily trailing-window size; defaults to 7 and is ignored for monthly`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`tool-call-analytics <portal-id>`,describe:`Returns daily or monthly tool-call counts for a portal.`,builder:h(E),handler:async c=>s({command:`mcp portals tool-call-analytics`,classification:{safeFlags:[`granularity`,`aggregate`,`dry-run`]}},c,async()=>{let s={granularity:c.granularity,aggregate:c.aggregate,tz:c.tz,days:c.days};if(c.dryRun){a({command:`cf mcp portals tool-call-analytics`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/analytics/portals/${c[`portal-id`]==null?`<portal-id>`:encodeURIComponent(String(c[`portal-id`]))}/tool-calls/timeseries`,pathParams:{"portal-id":String(c[`portal-id`]??``)},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.mcp.portals.toolCallAnalytics({account_id:u,portal_id:c[`portal-id`],...s})),{successLabel:`Loaded`})})};function O(e){return e.positional(`id`,{type:`string`,description:`Unique identifier for the MCP portal.`,demandOption:!0}).option(`allow-code-mode`,{type:`boolean`,description:"Deprecated: use `code_mode` for new integrations. `true` maps to any non-off Code Mode policy; `false` maps to `code_mode: off`. If both fields are sent, they must be consistent or the request returns a 400."}).option(`code-mode`,{type:`string`,description:"Code Mode policy for this portal. `off`: Code Mode is unavailable; query parameters are ignored. `opt_in`: Code Mode is off by default; clients turn it on with `?codemode=search_and_execute`. `default_on`: Code Mode is on by default; clients can opt out with `?codemode=off`. `enforced`: Code Mode is always on; query parameters are ignored. Defaults to `opt_in` when omitted on create. If both `code_mode` and `allow_code_mode` are sent, they must be consistent or the request returns a 400.",choices:[`off`,`opt_in`,`default_on`,`enforced`]}).option(`description`,{type:`string`,description:`Optional description of the MCP portal.`}).option(`hostname`,{type:`string`,description:`Hostname where the MCP portal is available.`}).option(`name`,{type:`string`,description:`Display name for the MCP portal.`}).option(`secure-web-gateway`,{type:`boolean`,description:`Route outbound MCP traffic through Zero Trust Secure Web Gateway.`}).option(`servers`,{type:`string`,description:`MCP servers attached to the portal and their portal-specific settings. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const k={command:`update <id>`,describe:`Updates an MCP portal configuration.`,builder:O,handler:async f=>s({command:`mcp portals update`,classification:{safeFlags:[`allow-code-mode`,`code-mode`,`secure-web-gateway`,`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf mcp portals update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/portals/${f.id==null?`<id>`:encodeURIComponent(String(f.id))}`,pathParams:{id:String(f.id??``)},bodyKind:`json`,body:f.body===void 0?u({allow_code_mode:f[`allow-code-mode`],code_mode:d(f[`code-mode`],`code-mode`,`text`),description:d(f.description,`description`,`text`),hostname:d(f.hostname,`hostname`,`text`),name:d(f.name,`name`,`text`),secure_web_gateway:f[`secure-web-gateway`],servers:l(f.servers,`servers`)}):c(f.body)});return}let s=await r(f),p=f.local?e:await t();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Updating`,async()=>s.mcp.portals.update({...e,account_id:p,id:f.id})),{successLabel:`Updated`});return}let m=u({allow_code_mode:f[`allow-code-mode`],code_mode:d(f[`code-mode`],`code-mode`,`text`),description:d(f.description,`description`,`text`),hostname:d(f.hostname,`hostname`,`text`),name:d(f.name,`name`,`text`),secure_web_gateway:f[`secure-web-gateway`],servers:l(f.servers,`servers`)});i(await o(`Updating`,async()=>s.mcp.portals.update({...m,account_id:p,id:f.id})),{successLabel:`Updated`})})},A={command:`portals`,describe:`Manage MCP portals, attached servers, and Code Mode settings`,builder:e=>e.command(_).command(y).command(x).command(C).command(T).command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.option(`auth-credentials`,{type:`string`,description:'Static credential for the upstream MCP server. For auth_type "bearer", either a raw token string (e.g. "sk-abc123"), which is wrapped server-side as `Authorization: Bearer <token>`, or a JSON-encoded object of the form `{"headers":{"Header-Name":"value",...}}` for custom or multiple static headers (e.g. Cloudflare Access service tokens: `{"headers":{"cf-access-client-id":"...","cf-access-client-secret":"..."}}`).'}).option(`auth-type`,{type:`string`,description:`Authentication method used to connect to the upstream MCP server.`,choices:[`oauth`,`bearer`,`unauthenticated`]}).option(`client-secret`,{type:`string`,description:`Pre-registered OAuth client_secret. Write-only - accepted on create/update when auth_credentials.auth_mode is 'manual'. Stored AES-GCM-encrypted in server_oauth_secrets; never returned by read endpoints.`}).option(`description`,{type:`string`,description:`Optional description of the MCP server.`}).option(`hostname`,{type:`string`,description:`URL of the upstream MCP endpoint.`}).option(`id`,{type:`string`,description:`Unique identifier for the MCP server.`}).option(`is-shared-oauth-callback-enabled`,{type:`boolean`,description:`When true, the gateway worker uses the shared Cloudflare-owned OAuth callback endpoint as the redirect_uri for upstream on-behalf OAuth, instead of the customer portal hostname. Defaults to false (off); opt in per server by setting true.`,default:!1}).option(`name`,{type:`string`,description:`Display name for the MCP server.`}).option(`secure-web-gateway`,{type:`boolean`,description:`Route outbound traffic to this MCP server through Zero Trust Secure Web Gateway.`,default:!1}).option(`updated-prompts`,{type:`string`,description:`Server-wide prompt capability overrides. Provide as a JSON array of objects or @path/to/file.json.`}).option(`updated-tools`,{type:`string`,description:`Server-wide tool capability overrides. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`create`,describe:`Creates a new MCP server for connecting to an upstream MCP endpoint.`,builder:j,handler:async m=>s({command:`mcp servers create`,classification:{safeFlags:[`auth-type`,`is-shared-oauth-callback-enabled`,`secure-web-gateway`,`dry-run`]}},m,async()=>{if(m.dryRun){a({command:`cf mcp servers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/servers`,pathParams:{},bodyKind:`json`,body:m.body===void 0?u({auth_credentials:d(m[`auth-credentials`],`auth-credentials`,`text`),auth_type:d(m[`auth-type`],`auth-type`,`text`),client_secret:d(m[`client-secret`],`client-secret`,`text`),description:d(m.description,`description`,`text`),hostname:d(m.hostname,`hostname`,`text`),id:d(m.id,`id`,`text`),is_shared_oauth_callback_enabled:m[`is-shared-oauth-callback-enabled`],name:d(m.name,`name`,`text`),secure_web_gateway:m[`secure-web-gateway`],updated_prompts:l(m[`updated-prompts`],`updated-prompts`),updated_tools:l(m[`updated-tools`],`updated-tools`)}):c(m.body)});return}let s=await r(m),h=m.local?e:await t();if(m.accountId=h,m.body){let e=c(m.body);i(await o(`Creating`,async()=>s.mcp.servers.create({...e,account_id:h})),{successLabel:`Created`});return}m[`auth-type`]===void 0&&(m[`auth-type`]=await p(`auth-type`,`Authentication method used to connect to the upstream MCP server.`,[`oauth`,`bearer`,`unauthenticated`])),m.hostname===void 0&&(m.hostname=await f(`hostname`,`URL of the upstream MCP endpoint.`)),m.id===void 0&&(m.id=await f(`id`,`Unique identifier for the MCP server.`)),m.name===void 0&&(m.name=await f(`name`,`Display name for the MCP server.`));let g=u({auth_credentials:d(m[`auth-credentials`],`auth-credentials`,`text`),auth_type:d(m[`auth-type`],`auth-type`,`text`),client_secret:d(m[`client-secret`],`client-secret`,`text`),description:d(m.description,`description`,`text`),hostname:d(m.hostname,`hostname`,`text`),id:d(m.id,`id`,`text`),is_shared_oauth_callback_enabled:m[`is-shared-oauth-callback-enabled`],name:d(m.name,`name`,`text`),secure_web_gateway:m[`secure-web-gateway`],updated_prompts:l(m[`updated-prompts`],`updated-prompts`),updated_tools:l(m[`updated-tools`],`updated-tools`)});i(await o(`Creating`,async()=>s.mcp.servers.create({...g,account_id:h})),{successLabel:`Created`})})};function N(e){return e.positional(`id`,{type:`string`,description:`Unique identifier for the MCP server.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const P={command:`delete <id>`,describe:`Deletes an MCP server from the account.`,builder:N,handler:async c=>s({command:`mcp servers delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf mcp servers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/servers/${c.id==null?`<id>`:encodeURIComponent(String(c.id))}`,pathParams:{id:String(c.id??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await m({force:!!c.force,message:`This operation permanently deletes the MCP server, removes it from every portal, and deletes its stored OAuth secrets.`})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}i(await o(`Deleting`,async()=>s.mcp.servers.delete({account_id:l,id:c.id})),{successLabel:`Deleted`})})};function F(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`search`,{type:`string`,description:`Search by id, name`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`list`,describe:`Lists all MCP servers configured for the account.`,builder:F,handler:async c=>s({command:`mcp servers list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={page:c.page,per_page:c[`per-page`],search:c.search};if(c.dryRun){a({command:`cf mcp servers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/servers`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.mcp.servers.list({account_id:u,...s})),{successLabel:`Loaded`})})};function L(e){return e.positional(`id`,{type:`string`,description:`Unique identifier for the MCP server.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`read <id>`,describe:`Retrieves an MCP server's configuration and capability sync state.`,builder:L,handler:async c=>s({command:`mcp servers read`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf mcp servers read`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/servers/${c.id==null?`<id>`:encodeURIComponent(String(c.id))}`,pathParams:{id:String(c.id??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.mcp.servers.read({account_id:l,id:c.id})),{successLabel:`Loaded`})})};function z(e){return e.positional(`id`,{type:`string`,description:`Unique identifier for the MCP server.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`sync <id>`,describe:`Syncs an MCP server's capabilities and returns the updated server state, including any connection errors.`,builder:z,handler:async c=>s({command:`mcp servers sync`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf mcp servers sync`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/servers/${c.id==null?`<id>`:encodeURIComponent(String(c.id))}/sync`,pathParams:{id:String(c.id??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Creating`,async()=>s.mcp.servers.sync({account_id:l,id:c.id})),{successLabel:`Created`})})};function V(e){return e.positional(`server-id`,{type:`string`,description:`Server ID`,demandOption:!0}).option(`granularity`,{type:`string`,description:`Granularity`,choices:[`daily`,`monthly`]}).option(`aggregate`,{type:`string`,description:`Aggregate`,choices:[`true`,`false`]}).option(`tz`,{type:`string`,description:`Tz`}).option(`days`,{type:`number`,description:`Daily trailing-window size; defaults to 7 and is ignored for monthly`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`tool-call-analytics <server-id>`,describe:`Returns daily or monthly tool-call counts for a server.`,builder:h(V),handler:async c=>s({command:`mcp servers tool-call-analytics`,classification:{safeFlags:[`granularity`,`aggregate`,`dry-run`]}},c,async()=>{let s={granularity:c.granularity,aggregate:c.aggregate,tz:c.tz,days:c.days};if(c.dryRun){a({command:`cf mcp servers tool-call-analytics`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/analytics/servers/${c[`server-id`]==null?`<server-id>`:encodeURIComponent(String(c[`server-id`]))}/tool-calls/timeseries`,pathParams:{"server-id":String(c[`server-id`]??``)},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.mcp.servers.toolCallAnalytics({account_id:u,server_id:c[`server-id`],...s})),{successLabel:`Loaded`})})};function U(e){return e.positional(`id`,{type:`string`,description:`Unique identifier for the MCP server.`,demandOption:!0}).option(`auth-credentials`,{type:`string`,description:'Static credential for the upstream MCP server. For auth_type "bearer", either a raw token string (e.g. "sk-abc123"), which is wrapped server-side as `Authorization: Bearer <token>`, or a JSON-encoded object of the form `{"headers":{"Header-Name":"value",...}}` for custom or multiple static headers (e.g. Cloudflare Access service tokens: `{"headers":{"cf-access-client-id":"...","cf-access-client-secret":"..."}}`).'}).option(`client-secret`,{type:`string`,description:`Pre-registered OAuth client_secret. Write-only - accepted on create/update when auth_credentials.auth_mode is 'manual'. Stored AES-GCM-encrypted in server_oauth_secrets; never returned by read endpoints.`}).option(`description`,{type:`string`,description:`Optional description of the MCP server.`}).option(`is-shared-oauth-callback-enabled`,{type:`boolean`,description:`When true, the gateway worker uses the shared Cloudflare-owned OAuth callback endpoint as the redirect_uri for upstream on-behalf OAuth, instead of the customer portal hostname. Defaults to false (off); opt in per server by setting true.`}).option(`name`,{type:`string`,description:`Display name for the MCP server.`}).option(`secure-web-gateway`,{type:`boolean`,description:`Route outbound traffic to this MCP server through Zero Trust Secure Web Gateway.`}).option(`updated-prompts`,{type:`string`,description:`Server-wide prompt capability overrides. Provide as a JSON array of objects or @path/to/file.json.`}).option(`updated-tools`,{type:`string`,description:`Server-wide tool capability overrides. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const W={command:`update <id>`,describe:`Updates an MCP server's configuration and credentials.`,builder:U,handler:async f=>s({command:`mcp servers update`,classification:{safeFlags:[`is-shared-oauth-callback-enabled`,`secure-web-gateway`,`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf mcp servers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/servers/${f.id==null?`<id>`:encodeURIComponent(String(f.id))}`,pathParams:{id:String(f.id??``)},bodyKind:`json`,body:f.body===void 0?u({auth_credentials:d(f[`auth-credentials`],`auth-credentials`,`text`),client_secret:d(f[`client-secret`],`client-secret`,`text`),description:d(f.description,`description`,`text`),is_shared_oauth_callback_enabled:f[`is-shared-oauth-callback-enabled`],name:d(f.name,`name`,`text`),secure_web_gateway:f[`secure-web-gateway`],updated_prompts:l(f[`updated-prompts`],`updated-prompts`),updated_tools:l(f[`updated-tools`],`updated-tools`)}):c(f.body)});return}let s=await r(f),p=f.local?e:await t();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Updating`,async()=>s.mcp.servers.update({...e,account_id:p,id:f.id})),{successLabel:`Updated`});return}let m=u({auth_credentials:d(f[`auth-credentials`],`auth-credentials`,`text`),client_secret:d(f[`client-secret`],`client-secret`,`text`),description:d(f.description,`description`,`text`),is_shared_oauth_callback_enabled:f[`is-shared-oauth-callback-enabled`],name:d(f.name,`name`,`text`),secure_web_gateway:f[`secure-web-gateway`],updated_prompts:l(f[`updated-prompts`],`updated-prompts`),updated_tools:l(f[`updated-tools`],`updated-tools`)});i(await o(`Updating`,async()=>s.mcp.servers.update({...m,account_id:p,id:f.id})),{successLabel:`Updated`})})},G={command:`servers`,describe:`Manage upstream MCP servers, credentials, capabilities, and sync state`,builder:e=>e.command(M).command(P).command(I).command(R).command(B).command(H).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},K={command:`mcp`,describe:`mcp`,builder:e=>e.command(A).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{K as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n}from"./oauth-BdVr2hJp.mjs";import{r}from"./auth-DWxtJ918.mjs";import{t as i}from"./output-Z2lQmPUW.mjs";import{t as a}from"./dry-run-YSQndLvt.mjs";import{t as o}from"./progress-a5IKeKni.mjs";import{t as s}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{n as c,t as l}from"./body-parser-Cmw7PZ7a.mjs";import{n as u}from"./input-validation-nF-0Ze2h.mjs";import{a as d,i as f,n as p}from"./prompt-BP8XrQSj.mjs";import{t as m}from"./cli-types-abvWQN3T.mjs";function h(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get <tunnel-id>`,describe:`Gets the high-availability configuration for a WARP Connector tunnel.`,builder:h,handler:async c=>s({command:`mesh nodes configurations get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf mesh nodes configurations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${c[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(c[`tunnel-id`]))}/configurations`,pathParams:{"tunnel-id":String(c[`tunnel-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.mesh.nodes.configurations.get({account_id:l,tunnel_id:c[`tunnel-id`]})),{successLabel:`Loaded`})})};function _(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`config-fnr-id`,{type:`string`,description:`Floating Network Resource ID — the secondary ENI that is moved between nodes on failover.`}).option(`ha-mode`,{type:`string`,description:"High-availability mode for the WARP Connector tunnel. `none` means HA is enabled but no provider is configured yet (newly created tunnels default to this). `disabled` means HA is explicitly turned off. `aws` uses AWS ENI move for failover. `local` uses virtual IPs (VIPs) on the local interface.",choices:[`none`,`disabled`,`aws`,`local`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`update <tunnel-id>`,describe:`Adds or updates the high-availability configuration for a WARP Connector tunnel.`,builder:_,handler:async d=>s({command:`mesh nodes configurations update`,classification:{safeFlags:[`ha-mode`,`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf mesh nodes configurations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${d[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(d[`tunnel-id`]))}/configurations`,pathParams:{"tunnel-id":String(d[`tunnel-id`]??``)},bodyKind:`json`,body:d.body===void 0?l({config:{fnr_id:u(d[`config-fnr-id`],`config-fnr-id`,`text`)},ha_mode:u(d[`ha-mode`],`ha-mode`,`text`)}):c(d.body)});return}let s=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=c(d.body);i(await o(`Updating`,async()=>s.mesh.nodes.configurations.update({...e,account_id:p,tunnel_id:d[`tunnel-id`]})),{successLabel:`Updated`});return}d[`ha-mode`]===void 0&&(d[`ha-mode`]=await f(`ha-mode`,"High-availability mode for the WARP Connector tunnel. `none` means HA is enabled but no provider is configured yet (newly created tunnels default to this). `disabled` means HA is explicitly turned off. `aws` uses AWS ENI move for failover. `local` uses virtual IPs (VIPs) on the local interface.",[`none`,`disabled`,`aws`,`local`]));let m=l({config:{fnr_id:u(d[`config-fnr-id`],`config-fnr-id`,`text`)},ha_mode:u(d[`ha-mode`],`ha-mode`,`text`)});i(await o(`Updating`,async()=>s.mesh.nodes.configurations.update({...m,account_id:p,tunnel_id:d[`tunnel-id`]})),{successLabel:`Updated`})})},y={command:`configurations`,describe:`Operations for nodes.configurations`,builder:e=>e.command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Fetches connection details for a WARP Connector Tunnel.`,builder:b,handler:async c=>s({command:`mesh nodes connections list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf mesh nodes connections list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${c[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(c[`tunnel-id`]))}/connections`,pathParams:{"tunnel-id":String(c[`tunnel-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.mesh.nodes.connections.list({account_id:l,tunnel_id:c[`tunnel-id`]})),{successLabel:`Loaded`})})},S={command:`connections`,describe:`Operations for nodes.connections`,builder:e=>e.command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function C(e){return e.positional(`connector-id`,{type:`string`,description:`UUID of the Cloudflare Tunnel connector.`,demandOption:!0}).option(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`get <connector-id>`,describe:`Fetches connector and connection details for a WARP Connector Tunnel.`,builder:C,handler:async c=>s({command:`mesh nodes connectors get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf mesh nodes connectors get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${c[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(c[`tunnel-id`]))}/connectors/${c[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(c[`connector-id`]))}`,pathParams:{"tunnel-id":String(c[`tunnel-id`]??``),"connector-id":String(c[`connector-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.mesh.nodes.connectors.get({account_id:l,tunnel_id:c[`tunnel-id`],connector_id:c[`connector-id`]})),{successLabel:`Loaded`})})},T={command:`connectors`,describe:`Operations for nodes.connectors`,builder:e=>e.command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function E(e){return e.option(`ha`,{type:`boolean`,description:`Indicates that the tunnel will be created to be highly available. If omitted, defaults to false.`,default:!1}).option(`name`,{type:`string`,description:`A user-friendly name for a tunnel.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const D={command:`create`,describe:`Creates a new Warp Connector Tunnel in an account.`,builder:E,handler:async f=>s({command:`mesh nodes create`,classification:{safeFlags:[`ha`,`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf mesh nodes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector`,pathParams:{},bodyKind:`json`,body:f.body===void 0?l({ha:f.ha,name:u(f.name,`name`,`text`)}):c(f.body)});return}let s=await r(f),p=f.local?e:await t();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Creating`,async()=>s.mesh.nodes.create({...e,account_id:p})),{successLabel:`Created`});return}f.name===void 0&&(f.name=await d(`name`,`A user-friendly name for a tunnel.`));let m=l({ha:f.ha,name:u(f.name,`name`,`text`)});i(await o(`Creating`,async()=>s.mesh.nodes.create({...m,account_id:p})),{successLabel:`Created`})})};function O(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,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 k={command:`delete <tunnel-id>`,describe:`Deletes a Warp Connector Tunnel from an account.`,builder:O,handler:async c=>s({command:`mesh nodes delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf mesh nodes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${c[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(c[`tunnel-id`]))}`,pathParams:{"tunnel-id":String(c[`tunnel-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await p({force:!!c.force,message:`This operation permanently deletes a Mesh node (Warp Connector Tunnel).`})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}i(await o(`Deleting`,async()=>s.mesh.nodes.delete({account_id:l,tunnel_id:c[`tunnel-id`]})),{successLabel:`Deleted`})})};function A(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`name`,{type:`string`,description:`A user-friendly name for a tunnel.`}).option(`tunnel-secret`,{type:`string`,description:`Sets the password required to run a locally-managed tunnel. Must be at least 32 bytes and encoded as a base64 string.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const j={command:`edit <tunnel-id>`,describe:`Updates an existing Warp Connector Tunnel.`,builder:A,handler:async d=>s({command:`mesh nodes edit`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf mesh nodes edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${d[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(d[`tunnel-id`]))}`,pathParams:{"tunnel-id":String(d[`tunnel-id`]??``)},bodyKind:`json`,body:d.body===void 0?l({name:u(d.name,`name`,`text`),tunnel_secret:u(d[`tunnel-secret`],`tunnel-secret`,`text`)}):c(d.body)});return}let s=await r(d),f=d.local?e:await t();if(d.accountId=f,d.body){let e=c(d.body);i(await o(`Updating`,async()=>s.mesh.nodes.edit({...e,account_id:f,tunnel_id:d[`tunnel-id`]})),{successLabel:`Updated`});return}let p=l({name:u(d.name,`name`,`text`),tunnel_secret:u(d[`tunnel-secret`],`tunnel-secret`,`text`)});i(await o(`Updating`,async()=>s.mesh.nodes.edit({...p,account_id:f,tunnel_id:d[`tunnel-id`]})),{successLabel:`Updated`})})};function M(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`connector-id`,{type:`string`,description:`UUID of the Cloudflare Tunnel connector.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const N={command:`failover <tunnel-id>`,describe:`Triggers a manual failover for a specific WARP Connector Tunnel, setting the specified client as the active connector. The tunnel must be configured for high availability (HA) and the client must be linked to the tunnel.`,builder:M,handler:async f=>s({command:`mesh nodes failover`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},f,async()=>{if(f.dryRun){a({command:`cf mesh nodes failover`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${f[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(f[`tunnel-id`]))}/failover`,pathParams:{"tunnel-id":String(f[`tunnel-id`]??``)},bodyKind:`json`,body:f.body===void 0?l({client_id:u(f[`connector-id`],`connector-id`,`text`)}):c(f.body)});return}let s=await r(f),m=f.local?e:await t();if(f.accountId=m,!await p({force:!!f.force,message:`This operation triggers a manual failover, changing the active connector for a Mesh node.`})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}if(f.body){let e=c(f.body);i(await o(`Deleting`,async()=>s.mesh.nodes.failover({...e,account_id:m,tunnel_id:f[`tunnel-id`]})),{successLabel:`Deleted`});return}f[`connector-id`]===void 0&&(f[`connector-id`]=await d(`connector-id`,`UUID of the Cloudflare Tunnel connector.`));let h=l({client_id:u(f[`connector-id`],`connector-id`,`text`)});i(await o(`Deleting`,async()=>s.mesh.nodes.failover({...h,account_id:m,tunnel_id:f[`tunnel-id`]})),{successLabel:`Deleted`})})};function P(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`get <tunnel-id>`,describe:`Fetches a single Warp Connector Tunnel.`,builder:P,handler:async c=>s({command:`mesh nodes get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf mesh nodes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${c[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(c[`tunnel-id`]))}`,pathParams:{"tunnel-id":String(c[`tunnel-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.mesh.nodes.get({account_id:l,tunnel_id:c[`tunnel-id`]})),{successLabel:`Loaded`})})};function I(e){return e.option(`name`,{type:`string`,description:`A user-friendly name for the tunnel.`}).option(`is-deleted`,{type:`boolean`,description:"If `true`, only include deleted tunnels. If `false`, exclude deleted tunnels. If empty, all tunnels will be included."}).option(`existed-at`,{type:`string`,description:`If provided, include only resources that were created (and not deleted) before this time. URL encoded.`}).option(`uuid`,{type:`string`,description:`UUID of the tunnel.`}).option(`was-active-at`,{type:`string`,description:`Was active at`}).option(`was-inactive-at`,{type:`string`,description:`Was inactive at`}).option(`include-prefix`,{type:`string`,description:`Include prefix`}).option(`exclude-prefix`,{type:`string`,description:`Exclude prefix`}).option(`status`,{type:`string`,description:"The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).",choices:[`inactive`,`degraded`,`healthy`,`down`]}).option(`per-page`,{type:`number`,description:`Number of results to display.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`list`,describe:`Lists and filters Warp Connector Tunnels in an account.`,builder:m(I),handler:async c=>s({command:`mesh nodes list`,classification:{safeFlags:[`is-deleted`,`status`,`dry-run`]}},c,async()=>{let s={name:c.name,is_deleted:c[`is-deleted`],existed_at:c[`existed-at`],uuid:c.uuid,was_active_at:c[`was-active-at`],was_inactive_at:c[`was-inactive-at`],include_prefix:c[`include-prefix`],exclude_prefix:c[`exclude-prefix`],status:c.status,per_page:c[`per-page`],page:c.page};if(c.dryRun){a({command:`cf mesh nodes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.mesh.nodes.list({account_id:u,...s})),{successLabel:`Loaded`})})};function R(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`get <tunnel-id>`,describe:`Gets the token used to associate warp device with a specific Warp Connector tunnel.`,builder:R,handler:async c=>s({command:`mesh nodes token get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf mesh nodes token get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${c[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(c[`tunnel-id`]))}/token`,pathParams:{"tunnel-id":String(c[`tunnel-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.mesh.nodes.token.get({account_id:l,tunnel_id:c[`tunnel-id`]})),{successLabel:`Loaded`})})},B={command:`token`,describe:`Operations for nodes.token`,builder:e=>e.command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},V={command:`nodes`,describe:`Operations for nodes`,builder:e=>e.command(D).command(k).command(j).command(N).command(F).command(L).command(y).command(S).command(T).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},H={command:`mesh`,describe:`mesh`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{H as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n}from"./oauth-BdVr2hJp.mjs";import{r}from"./auth-DWxtJ918.mjs";import{t as i}from"./output-Z2lQmPUW.mjs";import{t as a}from"./dry-run-YSQndLvt.mjs";import{t as o}from"./progress-a5IKeKni.mjs";import{t as s}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{n as c,t as l}from"./body-parser-Cmw7PZ7a.mjs";import{n as u}from"./input-validation-nF-0Ze2h.mjs";import{a as d,n as f}from"./prompt-BP8XrQSj.mjs";import{t as p}from"./cli-types-abvWQN3T.mjs";function m(e){return e.positional(`mtls-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get <mtls-certificate-id>`,describe:`Lists all active associations between the certificate and Cloudflare services.`,builder:m,handler:async c=>s({command:`mtls-certificates associations get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf mtls-certificates associations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mtls_certificates/${c[`mtls-certificate-id`]==null?`<mtls-certificate-id>`:encodeURIComponent(String(c[`mtls-certificate-id`]))}/associations`,pathParams:{"mtls-certificate-id":String(c[`mtls-certificate-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.mtlsCertificates.associations.get({account_id:l,mtls_certificate_id:c[`mtls-certificate-id`]})),{successLabel:`Loaded`})})},g={command:`associations`,describe:`Operations for associations`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.option(`ca`,{type:`boolean`,description:`Indicates whether the certificate is a CA or leaf certificate.`}).option(`certificates`,{type:`string`,description:`The uploaded root CA certificate.`}).option(`name`,{type:`string`,description:`Optional unique name for the certificate. Only used for human readability.`}).option(`private-key`,{type:`string`,description:`The private key for the certificate. This field is only needed for specific use cases such as using a custom certificate with Zero Trust's block page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`create`,describe:`Upload a certificate that you want to use with mTLS-enabled Cloudflare services, such as Bring Your Own CA (BYO-CA) for mTLS. To create certificates issued by the Cloudflare managed CA, use the [Create Client Certificate endpoint](/api/resources/client_certificates/methods/create/).`,builder:_,handler:async f=>s({command:`mtls-certificates create`,classification:{safeFlags:[`ca`,`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf mtls-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mtls_certificates`,pathParams:{},bodyKind:`json`,body:f.body===void 0?l({ca:f.ca,certificates:u(f.certificates,`certificates`,`text`),name:u(f.name,`name`,`text`),private_key:u(f[`private-key`],`private-key`,`text`)}):c(f.body)});return}let s=await r(f),p=f.local?e:await t();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Creating`,async()=>s.mtlsCertificates.create({...e,account_id:p})),{successLabel:`Created`});return}if(f.ca===void 0)throw Error(`--ca is required (or pass --body with this field set).`);f.certificates===void 0&&(f.certificates=await d(`certificates`,`The uploaded root CA certificate.`));let m=l({ca:f.ca,certificates:u(f.certificates,`certificates`,`text`),name:u(f.name,`name`,`text`),private_key:u(f[`private-key`],`private-key`,`text`)});i(await o(`Creating`,async()=>s.mtlsCertificates.create({...m,account_id:p})),{successLabel:`Created`})})};function y(e){return e.positional(`mtls-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const b={command:`delete <mtls-certificate-id>`,describe:`Deletes the mTLS certificate unless the certificate is in use by one or more Cloudflare services.`,builder:y,handler:async c=>s({command:`mtls-certificates delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf mtls-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mtls_certificates/${c[`mtls-certificate-id`]==null?`<mtls-certificate-id>`:encodeURIComponent(String(c[`mtls-certificate-id`]))}`,pathParams:{"mtls-certificate-id":String(c[`mtls-certificate-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await f({force:!!c.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}i(await o(`Deleting`,async()=>s.mtlsCertificates.delete({account_id:l,mtls_certificate_id:c[`mtls-certificate-id`]})),{successLabel:`Deleted`})})};function x(e){return e.positional(`mtls-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get <mtls-certificate-id>`,describe:`Fetches a single mTLS certificate uploaded to your account. To get a certificate issued by the Cloudflare managed CA, use the [Client Certificate Details endpoint](/api/resources/client_certificates/methods/get/).`,builder:x,handler:async c=>s({command:`mtls-certificates get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf mtls-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mtls_certificates/${c[`mtls-certificate-id`]==null?`<mtls-certificate-id>`:encodeURIComponent(String(c[`mtls-certificate-id`]))}`,pathParams:{"mtls-certificate-id":String(c[`mtls-certificate-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.mtlsCertificates.get({account_id:l,mtls_certificate_id:c[`mtls-certificate-id`]})),{successLabel:`Loaded`})})};function C(e){return e.option(`type`,{type:`string`,description:`Filters results by certificate type. Multiple types can be comma-separated.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`list`,describe:`Lists all mTLS certificates uploaded to your account, such as Bring Your Own CA (BYO-CA) for mTLS. To list certificates issued by the Cloudflare managed CA, use the [List Client Certificates endpoint](/api/resources/client_certificates/methods/list/).`,builder:p(C),handler:async c=>s({command:`mtls-certificates list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={type:c.type};if(c.dryRun){a({command:`cf mtls-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mtls_certificates`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.mtlsCertificates.list({account_id:u,...s})),{successLabel:`Loaded`})})},T={command:`mtls-certificates`,describe:`mtls-certificates`,builder:e=>e.command(v).command(b).command(S).command(w).command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{T as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n}from"./oauth-BdVr2hJp.mjs";import{r}from"./auth-DWxtJ918.mjs";import{t as i}from"./output-Z2lQmPUW.mjs";import{t as a}from"./dry-run-YSQndLvt.mjs";import{t as o}from"./progress-a5IKeKni.mjs";import{t as s}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{n as c,t as l}from"./body-parser-Cmw7PZ7a.mjs";import{n as u}from"./input-validation-nF-0Ze2h.mjs";import{a as d,n as f}from"./prompt-BP8XrQSj.mjs";import{t as p}from"./cli-types-abvWQN3T.mjs";function m(e){return e.option(`comment`,{type:`string`,description:`Optional remark describing the route.`,default:``}).option(`network`,{type:`string`,description:`The private IPv4 or IPv6 range connected by the route, in CIDR notation.`}).option(`virtual-network-id`,{type:`string`,description:`UUID of the virtual network.`}).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 ee={command:`create`,describe:`Routes a private network through a Cloudflare Tunnel.`,builder:m,handler:async f=>s({command:`network routes cidr create`,classification:{safeFlags:[`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf network routes cidr create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/teamnet/routes`,pathParams:{},bodyKind:`json`,body:f.body===void 0?l({comment:u(f.comment,`comment`,`text`),network:u(f.network,`network`,`text`),virtual_network_id:u(f[`virtual-network-id`],`virtual-network-id`,`text`)}):c(f.body)});return}let s=await r(f),p=f.local?e:await t();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Creating`,async()=>s.network.routes.cidr.create({...e,account_id:p})),{successLabel:`Created`});return}f.network===void 0&&(f.network=await d(`network`,`The private IPv4 or IPv6 range connected by the route, in CIDR notation.`));let m=l({comment:u(f.comment,`comment`,`text`),network:u(f.network,`network`,`text`),virtual_network_id:u(f[`virtual-network-id`],`virtual-network-id`,`text`)});i(await o(`Creating`,async()=>s.network.routes.cidr.create({...m,account_id:p})),{successLabel:`Created`})})};function h(e){return e.positional(`route-id`,{type:`string`,description:`UUID of the route.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <route-id>`,describe:`Deletes a private network route from an account.`,builder:h,handler:async c=>s({command:`network routes cidr delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf network routes cidr delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/teamnet/routes/${c[`route-id`]==null?`<route-id>`:encodeURIComponent(String(c[`route-id`]))}`,pathParams:{"route-id":String(c[`route-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await f({force:!!c.force,message:`This operation permanently deletes a private network route.`})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}i(await o(`Deleting`,async()=>s.network.routes.cidr.delete({account_id:l,route_id:c[`route-id`]})),{successLabel:`Deleted`})})};function _(e){return e.positional(`route-id`,{type:`string`,description:`UUID of the route.`,demandOption:!0}).option(`comment`,{type:`string`,description:`Optional remark describing the route.`}).option(`network`,{type:`string`,description:`The private IPv4 or IPv6 range connected by the route, in CIDR notation.`}).option(`virtual-network-id`,{type:`string`,description:`UUID of the virtual network.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`edit <route-id>`,describe:`Updates an existing private network route in an account. The fields that are meant to be updated should be provided in the body of the request.`,builder:_,handler:async d=>s({command:`network routes cidr edit`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf network routes cidr edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/teamnet/routes/${d[`route-id`]==null?`<route-id>`:encodeURIComponent(String(d[`route-id`]))}`,pathParams:{"route-id":String(d[`route-id`]??``)},bodyKind:`json`,body:d.body===void 0?l({comment:u(d.comment,`comment`,`text`),network:u(d.network,`network`,`text`),virtual_network_id:u(d[`virtual-network-id`],`virtual-network-id`,`text`)}):c(d.body)});return}let s=await r(d),f=d.local?e:await t();if(d.accountId=f,d.body){let e=c(d.body);i(await o(`Updating`,async()=>s.network.routes.cidr.edit({...e,account_id:f,route_id:d[`route-id`]})),{successLabel:`Updated`});return}let p=l({comment:u(d.comment,`comment`,`text`),network:u(d.network,`network`,`text`),virtual_network_id:u(d[`virtual-network-id`],`virtual-network-id`,`text`)});i(await o(`Updating`,async()=>s.network.routes.cidr.edit({...p,account_id:f,route_id:d[`route-id`]})),{successLabel:`Updated`})})};function y(e){return e.positional(`route-id`,{type:`string`,description:`UUID of the route.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get <route-id>`,describe:`Get a private network route in an account.`,builder:y,handler:async c=>s({command:`network routes cidr get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf network routes cidr get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/teamnet/routes/${c[`route-id`]==null?`<route-id>`:encodeURIComponent(String(c[`route-id`]))}`,pathParams:{"route-id":String(c[`route-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.network.routes.cidr.get({account_id:l,route_id:c[`route-id`]})),{successLabel:`Loaded`})})};function x(e){return e.option(`comment`,{type:`string`,description:`Optional remark describing the route.`}).option(`is-deleted`,{type:`boolean`,description:"If `true`, only include deleted routes. If `false`, exclude deleted routes. If empty, all routes will be included."}).option(`network-subset`,{type:`string`,description:`If set, only list routes that are contained within this IP range.`}).option(`network-superset`,{type:`string`,description:`If set, only list routes that contain this IP range.`}).option(`existed-at`,{type:`string`,description:`If provided, include only resources that were created (and not deleted) before this time. URL encoded.`}).option(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`}).option(`route-id`,{type:`string`,description:`UUID of the route.`}).option(`tun-types`,{type:`string`,description:`The types of tunnels to filter by, separated by commas.`}).option(`virtual-network-id`,{type:`string`,description:`UUID of the virtual network.`}).option(`per-page`,{type:`number`,description:`Number of results to display.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`list`,describe:`Lists and filters private network routes in an account.`,builder:p(x),handler:async c=>s({command:`network routes cidr list`,classification:{safeFlags:[`is-deleted`,`dry-run`]}},c,async()=>{let s={comment:c.comment,is_deleted:c[`is-deleted`],network_subset:c[`network-subset`],network_superset:c[`network-superset`],existed_at:c[`existed-at`],tunnel_id:c[`tunnel-id`],route_id:c[`route-id`],tun_types:c[`tun-types`],virtual_network_id:c[`virtual-network-id`],per_page:c[`per-page`],page:c.page};if(c.dryRun){a({command:`cf network routes cidr list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/teamnet/routes`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.network.routes.cidr.list({account_id:u,...s})),{successLabel:`Loaded`})})},C={command:`cidr`,describe:`Operations for routes.cidr`,builder:e=>e.command(ee).command(g).command(v).command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`comment`,{type:`string`,description:`An optional description of the hostname route.`}).option(`hostname`,{type:`string`,description:`The hostname of the route.`}).option(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const T={command:`create`,describe:`Create a hostname route.`,builder:w,handler:async d=>s({command:`network routes hostname create`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf network routes hostname create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zerotrust/routes/hostname`,pathParams:{},bodyKind:`json`,body:d.body===void 0?l({comment:u(d.comment,`comment`,`text`),hostname:u(d.hostname,`hostname`,`text`),tunnel_id:u(d[`tunnel-id`],`tunnel-id`,`text`)}):c(d.body)});return}let s=await r(d),f=d.local?e:await t();if(d.accountId=f,d.body){let e=c(d.body);i(await o(`Creating`,async()=>s.network.routes.hostname.create({...e,account_id:f})),{successLabel:`Created`});return}let p=l({comment:u(d.comment,`comment`,`text`),hostname:u(d.hostname,`hostname`,`text`),tunnel_id:u(d[`tunnel-id`],`tunnel-id`,`text`)});i(await o(`Creating`,async()=>s.network.routes.hostname.create({...p,account_id:f})),{successLabel:`Created`})})};function E(e){return e.positional(`hostname-route-id`,{type:`string`,description:`The hostname route 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 D={command:`delete <hostname-route-id>`,describe:`Delete a hostname route.`,builder:E,handler:async c=>s({command:`network routes hostname delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf network routes hostname delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zerotrust/routes/hostname/${c[`hostname-route-id`]==null?`<hostname-route-id>`:encodeURIComponent(String(c[`hostname-route-id`]))}`,pathParams:{"hostname-route-id":String(c[`hostname-route-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await f({force:!!c.force,message:`This operation permanently deletes a hostname route.`})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}i(await o(`Deleting`,async()=>s.network.routes.hostname.delete({account_id:l,hostname_route_id:c[`hostname-route-id`]})),{successLabel:`Deleted`})})};function O(e){return e.positional(`hostname-route-id`,{type:`string`,description:`The hostname route ID.`,demandOption:!0}).option(`comment`,{type:`string`,description:`An optional description of the hostname route.`}).option(`hostname`,{type:`string`,description:`The hostname of the route.`}).option(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const k={command:`edit <hostname-route-id>`,describe:`Updates a hostname route.`,builder:O,handler:async d=>s({command:`network routes hostname edit`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf network routes hostname edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zerotrust/routes/hostname/${d[`hostname-route-id`]==null?`<hostname-route-id>`:encodeURIComponent(String(d[`hostname-route-id`]))}`,pathParams:{"hostname-route-id":String(d[`hostname-route-id`]??``)},bodyKind:`json`,body:d.body===void 0?l({comment:u(d.comment,`comment`,`text`),hostname:u(d.hostname,`hostname`,`text`),tunnel_id:u(d[`tunnel-id`],`tunnel-id`,`text`)}):c(d.body)});return}let s=await r(d),f=d.local?e:await t();if(d.accountId=f,d.body){let e=c(d.body);i(await o(`Updating`,async()=>s.network.routes.hostname.edit({...e,account_id:f,hostname_route_id:d[`hostname-route-id`]})),{successLabel:`Updated`});return}let p=l({comment:u(d.comment,`comment`,`text`),hostname:u(d.hostname,`hostname`,`text`),tunnel_id:u(d[`tunnel-id`],`tunnel-id`,`text`)});i(await o(`Updating`,async()=>s.network.routes.hostname.edit({...p,account_id:f,hostname_route_id:d[`hostname-route-id`]})),{successLabel:`Updated`})})};function A(e){return e.positional(`hostname-route-id`,{type:`string`,description:`The hostname route ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`get <hostname-route-id>`,describe:`Get a hostname route.`,builder:A,handler:async c=>s({command:`network routes hostname get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf network routes hostname get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zerotrust/routes/hostname/${c[`hostname-route-id`]==null?`<hostname-route-id>`:encodeURIComponent(String(c[`hostname-route-id`]))}`,pathParams:{"hostname-route-id":String(c[`hostname-route-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.network.routes.hostname.get({account_id:l,hostname_route_id:c[`hostname-route-id`]})),{successLabel:`Loaded`})})};function M(e){return e.option(`id`,{type:`string`,description:`The hostname route ID.`}).option(`hostname`,{type:`string`,description:`If set, only list hostname routes that contain a substring of the given value, the filter is case-insensitive.`}).option(`tunnel-id`,{type:`string`,description:`If set, only list hostname routes that point to a specific tunnel.`}).option(`comment`,{type:`string`,description:`If set, only list hostname routes with the given comment.`}).option(`existed-at`,{type:`string`,description:`If provided, include only resources that were created (and not deleted) before this time. URL encoded.`}).option(`is-deleted`,{type:`boolean`,description:"If `true`, only return deleted hostname routes. If `false`, exclude deleted hostname routes."}).option(`per-page`,{type:`number`,description:`Number of results to display.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`list`,describe:`Lists and filters hostname routes in an account.`,builder:M,handler:async c=>s({command:`network routes hostname list`,classification:{safeFlags:[`is-deleted`,`dry-run`]}},c,async()=>{let s={id:c.id,hostname:c.hostname,tunnel_id:c[`tunnel-id`],comment:c.comment,existed_at:c[`existed-at`],is_deleted:c[`is-deleted`],per_page:c[`per-page`],page:c.page};if(c.dryRun){a({command:`cf network routes hostname list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zerotrust/routes/hostname`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.network.routes.hostname.list({account_id:u,...s})),{successLabel:`Loaded`})})},P={command:`hostname`,describe:`Operations for routes.hostname`,builder:e=>e.command(T).command(D).command(k).command(j).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function F(e){return e.positional(`ip`,{type:`string`,description:`Ip`,demandOption:!0}).option(`virtual-network-id`,{type:`string`,description:`UUID of the virtual network.`}).option(`default-virtual-network-fallback`,{type:`boolean`,description:`When the virtual_network_id parameter is not provided the request filter will default search routes that are in the default virtual network for the account. If this parameter is set to false, the search will include routes that do not have a virtual network.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`resolve <ip>`,describe:`Fetches routes that contain the given IP address.`,builder:F,handler:async c=>s({command:`network routes resolve`,classification:{safeFlags:[`default-virtual-network-fallback`,`dry-run`]}},c,async()=>{let s={virtual_network_id:c[`virtual-network-id`],default_virtual_network_fallback:c[`default-virtual-network-fallback`]};if(c.dryRun){a({command:`cf network routes resolve`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/teamnet/routes/ip/${c.ip==null?`<ip>`:encodeURIComponent(String(c.ip))}`,pathParams:{ip:String(c.ip??``)},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.network.routes.resolve({account_id:u,ip:c.ip,...s})),{successLabel:`Loaded`})})},L={command:`routes`,describe:`Operations for routes`,builder:e=>e.command(I).command(C).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function R(e){return e.positional(`address-family`,{type:`string`,description:"IP address family, either `v4` (IPv4) or `v6` (IPv6)",demandOption:!0}).option(`comment`,{type:`string`,description:`An optional description of the subnet.`}).option(`name`,{type:`string`,description:`A user-friendly name for the subnet.`}).option(`network`,{type:`string`,description:`The private IPv4 or IPv6 range defining the subnet, in CIDR notation.`}).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:`edit <address-family>`,describe:`Updates the Cloudflare Source subnet of the given address family`,builder:R,handler:async d=>s({command:`network subnets cloudflare-source edit`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf network subnets cloudflare-source edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zerotrust/subnets/cloudflare_source/${d[`address-family`]==null?`<address-family>`:encodeURIComponent(String(d[`address-family`]))}`,pathParams:{"address-family":String(d[`address-family`]??``)},bodyKind:`json`,body:d.body===void 0?l({comment:u(d.comment,`comment`,`text`),name:u(d.name,`name`,`text`),network:u(d.network,`network`,`text`)}):c(d.body)});return}let s=await r(d),f=d.local?e:await t();if(d.accountId=f,d.body){let e=c(d.body);i(await o(`Updating`,async()=>s.network.subnets.cloudflareSource.edit({...e,account_id:f,address_family:d[`address-family`]})),{successLabel:`Updated`});return}let p=l({comment:u(d.comment,`comment`,`text`),name:u(d.name,`name`,`text`),network:u(d.network,`network`,`text`)});i(await o(`Updating`,async()=>s.network.subnets.cloudflareSource.edit({...p,account_id:f,address_family:d[`address-family`]})),{successLabel:`Updated`})})},z={command:`cloudflare-source`,describe:`Operations for subnets.cloudflare-source`,builder:e=>e.command(te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.positional(`address-family`,{type:`string`,description:"IP address family, either `v4` (IPv4) or `v6` (IPv6)",demandOption:!0}).option(`comment`,{type:`string`,description:`An optional description of the subnet.`}).option(`name`,{type:`string`,description:`A user-friendly name for the subnet.`}).option(`network`,{type:`string`,description:`The private IPv4 or IPv6 range defining the subnet, in CIDR notation.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const V={command:`edit <address-family>`,describe:`Updates the CIDR for the account's default Initial Resolved IP Subnet of the given address family. The new CIDR must not conflict with existing private routes in the account.`,builder:B,handler:async d=>s({command:`network subnets initial-resolved-ip edit`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf network subnets initial-resolved-ip edit`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zerotrust/subnets/initial_resolved_ip/${d[`address-family`]==null?`<address-family>`:encodeURIComponent(String(d[`address-family`]))}`,pathParams:{"address-family":String(d[`address-family`]??``)},bodyKind:`json`,body:d.body===void 0?l({comment:u(d.comment,`comment`,`text`),name:u(d.name,`name`,`text`),network:u(d.network,`network`,`text`)}):c(d.body)});return}let s=await r(d),f=d.local?e:await t();if(d.accountId=f,d.body){let e=c(d.body);i(await o(`Updating`,async()=>s.network.subnets.initialResolvedIp.edit({...e,account_id:f,address_family:d[`address-family`]})),{successLabel:`Updated`});return}let p=l({comment:u(d.comment,`comment`,`text`),name:u(d.name,`name`,`text`),network:u(d.network,`network`,`text`)});i(await o(`Updating`,async()=>s.network.subnets.initialResolvedIp.edit({...p,account_id:f,address_family:d[`address-family`]})),{successLabel:`Updated`})})};function H(e){return e.positional(`address-family`,{type:`string`,description:"IP address family, either `v4` (IPv4) or `v6` (IPv6)",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`get <address-family>`,describe:`Returns the account's default Initial Resolved IP Subnet for the given address family.`,builder:H,handler:async c=>s({command:`network subnets initial-resolved-ip get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf network subnets initial-resolved-ip get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zerotrust/subnets/initial_resolved_ip/${c[`address-family`]==null?`<address-family>`:encodeURIComponent(String(c[`address-family`]))}`,pathParams:{"address-family":String(c[`address-family`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.network.subnets.initialResolvedIp.get({account_id:l,address_family:c[`address-family`]})),{successLabel:`Loaded`})})},W={command:`initial-resolved-ip`,describe:`Operations for subnets.initial-resolved-ip`,builder:e=>e.command(V).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function G(e){return e.option(`name`,{type:`string`,description:`If set, only list subnets with the given name`}).option(`comment`,{type:`string`,description:`If set, only list subnets with the given comment.`}).option(`network`,{type:`string`,description:`If set, only list the subnet whose network exactly matches the given CIDR.`}).option(`existed-at`,{type:`string`,description:`If provided, include only resources that were created (and not deleted) before this time. URL encoded.`}).option(`address-family`,{type:`string`,description:"If set, only include subnets in the given address family - `v4` or `v6`",choices:[`v4`,`v6`]}).option(`is-default-network`,{type:`boolean`,description:"If `true`, only include default subnets. If `false`, exclude default subnets subnets. If not set, all subnets will be included."}).option(`is-deleted`,{type:`boolean`,description:"If `true`, only include deleted subnets. If `false`, exclude deleted subnets. If not set, all subnets will be included."}).option(`sort-order`,{type:`string`,description:"Sort order of the results. `asc` means oldest to newest, `desc` means newest to oldest. If not set, they will not be in any particular order.",choices:[`asc`,`desc`]}).option(`subnet-types`,{type:`string`,description:`If set, the types of subnets to include, separated by comma.`,choices:[`cloudflare_source`,`initial_resolved_ip`,`warp`]}).option(`per-page`,{type:`number`,description:`Number of results to display.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`list`,describe:`Lists and filters subnets in an account.`,builder:p(G),handler:async c=>s({command:`network subnets list`,classification:{safeFlags:[`address-family`,`is-default-network`,`is-deleted`,`sort-order`,`subnet-types`,`dry-run`]}},c,async()=>{let s={name:c.name,comment:c.comment,network:c.network,existed_at:c[`existed-at`],address_family:c[`address-family`],is_default_network:c[`is-default-network`],is_deleted:c[`is-deleted`],sort_order:c[`sort-order`],subnet_types:c[`subnet-types`],per_page:c[`per-page`],page:c.page};if(c.dryRun){a({command:`cf network subnets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zerotrust/subnets`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.network.subnets.list({account_id:u,...s})),{successLabel:`Loaded`})})};function q(e){return e.option(`comment`,{type:`string`,description:`An optional description of the subnet.`,default:``}).option(`is-default-network`,{type:`boolean`,description:"If `true`, this is the default subnet for the account. There can only be one default subnet per account.",default:!1}).option(`name`,{type:`string`,description:`A user-friendly name for the subnet.`}).option(`network`,{type:`string`,description:`The private IPv4 or IPv6 range defining the subnet, in CIDR notation.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const J={command:`create`,describe:"Create a WARP IP assignment subnet. Currently, only IPv4 subnets can be created. **Network constraints:** - The network must be within one of the following private IP ranges: - `10.0.0.0/8` (RFC 1918) - `172.16.0.0/12` (RFC 1918) - `192.168.0.0/16` (RFC 1918) - `100.64.0.0/10` (RFC 6598 - CGNAT) - The subnet must have a prefix length of `/24` or larger (e.g., `/16`, `/20`, `/24` are valid; `/25`, `/28` are not)",builder:q,handler:async f=>s({command:`network subnets warp create`,classification:{safeFlags:[`is-default-network`,`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf network subnets warp create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zerotrust/subnets/warp`,pathParams:{},bodyKind:`json`,body:f.body===void 0?l({comment:u(f.comment,`comment`,`text`),is_default_network:f[`is-default-network`],name:u(f.name,`name`,`text`),network:u(f.network,`network`,`text`)}):c(f.body)});return}let s=await r(f),p=f.local?e:await t();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Creating`,async()=>s.network.subnets.warp.create({...e,account_id:p})),{successLabel:`Created`});return}f.name===void 0&&(f.name=await d(`name`,`A user-friendly name for the subnet.`)),f.network===void 0&&(f.network=await d(`network`,`The private IPv4 or IPv6 range defining the subnet, in CIDR notation.`));let m=l({comment:u(f.comment,`comment`,`text`),is_default_network:f[`is-default-network`],name:u(f.name,`name`,`text`),network:u(f.network,`network`,`text`)});i(await o(`Creating`,async()=>s.network.subnets.warp.create({...m,account_id:p})),{successLabel:`Created`})})};function Y(e){return e.positional(`subnet-id`,{type:`string`,description:`The UUID of the subnet.`,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 X={command:`delete <subnet-id>`,describe:`Delete a WARP IP assignment subnet. This operation is idempotent - deleting an already-deleted or non-existent subnet will return success with a null result.`,builder:Y,handler:async c=>s({command:`network subnets warp delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf network subnets warp delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zerotrust/subnets/warp/${c[`subnet-id`]==null?`<subnet-id>`:encodeURIComponent(String(c[`subnet-id`]))}`,pathParams:{"subnet-id":String(c[`subnet-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await f({force:!!c.force,message:`This operation permanently deletes a WARP IP subnet.`})){process.stderr.write(`Aborted.
|
|
5
5
|
`);return}i(await o(`Deleting`,async()=>s.network.subnets.warp.delete({account_id:l,subnet_id:c[`subnet-id`]})),{successLabel:`Deleted`})})};function Z(e){return e.positional(`subnet-id`,{type:`string`,description:`The UUID of the subnet.`,demandOption:!0}).option(`comment`,{type:`string`,description:`An optional description of the subnet.`}).option(`is-default-network`,{type:`boolean`,description:"If `true`, this is the default subnet for the account. There can only be one default subnet per account."}).option(`name`,{type:`string`,description:`A user-friendly name for the subnet.`}).option(`network`,{type:`string`,description:`The private IPv4 or IPv6 range defining the subnet, in CIDR notation.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Q={command:`edit <subnet-id>`,describe:"Updates a WARP IP assignment subnet. **Update constraints:** - The `network` field cannot be modified for WARP subnets. Only `name`, `comment`, and `is_default_network` can be updated. - IPv6 subnets cannot be updated",builder:Z,handler:async d=>s({command:`network subnets warp edit`,classification:{safeFlags:[`is-default-network`,`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf network subnets warp edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zerotrust/subnets/warp/${d[`subnet-id`]==null?`<subnet-id>`:encodeURIComponent(String(d[`subnet-id`]))}`,pathParams:{"subnet-id":String(d[`subnet-id`]??``)},bodyKind:`json`,body:d.body===void 0?l({comment:u(d.comment,`comment`,`text`),is_default_network:d[`is-default-network`],name:u(d.name,`name`,`text`),network:u(d.network,`network`,`text`)}):c(d.body)});return}let s=await r(d),f=d.local?e:await t();if(d.accountId=f,d.body){let e=c(d.body);i(await o(`Updating`,async()=>s.network.subnets.warp.edit({...e,account_id:f,subnet_id:d[`subnet-id`]})),{successLabel:`Updated`});return}let p=l({comment:u(d.comment,`comment`,`text`),is_default_network:d[`is-default-network`],name:u(d.name,`name`,`text`),network:u(d.network,`network`,`text`)});i(await o(`Updating`,async()=>s.network.subnets.warp.edit({...p,account_id:f,subnet_id:d[`subnet-id`]})),{successLabel:`Updated`})})};function ne(e){return e.positional(`subnet-id`,{type:`string`,description:`The UUID of the subnet.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`get <subnet-id>`,describe:`Get a WARP IP assignment subnet.`,builder:ne,handler:async c=>s({command:`network subnets warp get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf network subnets warp get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zerotrust/subnets/warp/${c[`subnet-id`]==null?`<subnet-id>`:encodeURIComponent(String(c[`subnet-id`]))}`,pathParams:{"subnet-id":String(c[`subnet-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.network.subnets.warp.get({account_id:l,subnet_id:c[`subnet-id`]})),{successLabel:`Loaded`})})},ie={command:`warp`,describe:`Operations for subnets.warp`,builder:e=>e.command(J).command(X).command(Q).command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ae={command:`subnets`,describe:`Operations for subnets`,builder:e=>e.command(K).command(z).command(W).command(ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function oe(e){return e.option(`comment`,{type:`string`,description:`Optional remark describing the virtual network.`,default:``}).option(`is-default`,{type:`boolean`,description:"If `true`, this virtual network is the default for the account."}).option(`is-default-network`,{type:`boolean`,description:"If `true`, this virtual network is the default for the account.",default:!1}).option(`name`,{type:`string`,description:`A user-friendly name for the virtual network.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const $={command:`create`,describe:`Adds a new virtual network to an account.`,builder:oe,handler:async f=>s({command:`network virtual-networks create`,classification:{safeFlags:[`is-default`,`is-default-network`,`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf network virtual-networks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/teamnet/virtual_networks`,pathParams:{},bodyKind:`json`,body:f.body===void 0?l({comment:u(f.comment,`comment`,`text`),is_default:f[`is-default`],is_default_network:f[`is-default-network`],name:u(f.name,`name`,`text`)}):c(f.body)});return}let s=await r(f),p=f.local?e:await t();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Creating`,async()=>s.network.virtualNetworks.create({...e,account_id:p})),{successLabel:`Created`});return}f.name===void 0&&(f.name=await d(`name`,`A user-friendly name for the virtual network.`));let m=l({comment:u(f.comment,`comment`,`text`),is_default:f[`is-default`],is_default_network:f[`is-default-network`],name:u(f.name,`name`,`text`)});i(await o(`Creating`,async()=>s.network.virtualNetworks.create({...m,account_id:p})),{successLabel:`Created`})})};function se(e){return e.positional(`virtual-network-id`,{type:`string`,description:`UUID of the virtual network.`,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 ce={command:`delete <virtual-network-id>`,describe:`Deletes an existing virtual network.`,builder:se,handler:async c=>s({command:`network virtual-networks delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf network virtual-networks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/teamnet/virtual_networks/${c[`virtual-network-id`]==null?`<virtual-network-id>`:encodeURIComponent(String(c[`virtual-network-id`]))}`,pathParams:{"virtual-network-id":String(c[`virtual-network-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await f({force:!!c.force,message:`This operation permanently deletes a virtual network.`})){process.stderr.write(`Aborted.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n}from"./oauth-BdVr2hJp.mjs";import{r}from"./auth-DWxtJ918.mjs";import{t as i}from"./output-Z2lQmPUW.mjs";import{t as a}from"./dry-run-YSQndLvt.mjs";import{t as o}from"./progress-a5IKeKni.mjs";import{t as s}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{n as c,t as l}from"./body-parser-Cmw7PZ7a.mjs";import{n as u}from"./input-validation-nF-0Ze2h.mjs";import{a as d,n as f}from"./prompt-BP8XrQSj.mjs";function p(e){return e.option(`account`,{type:`string`,description:`Customer account tag`}).option(`bgp-customer-asn`,{type:`number`,description:`ASN used on the customer end of the BGP session`}).option(`bgp-extra-prefixes`,{type:`string`,array:!0,description:`Extra set of static prefixes to advertise to the customer's end of the session`}).option(`bgp-md5-key`,{type:`string`,description:`MD5 key to use for session authentication.
|
|
3
3
|
|
|
4
4
|
Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the
|
|
5
5
|
key is not treated as a secret value. This is *only* supported for preventing
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{n as e}from"./chunk-vbHwaUoU.mjs";import{a as t,t as n}from"./src-BbnV77C4.mjs";import{o as r,s as i}from"./lifecycle-CadF_i2n.mjs";import{i as a,r as o}from"./project-settings-Bc3wYHo8.mjs";import{t as s}from"./resolve-CYUp6YgC.mjs";import{A as c,n as l}from"./interactive-CGOh-aYq.mjs";import{i as u,o as d}from"./dist-BRg_z9Ut.mjs";import{a as f,n as p,t as m}from"./cf-BV2HLCQm.mjs";function h(e,t){if(t)return{value:t,source:`flag`};let n=process.env[e];if(n)return{value:n,source:`env`}}async function g(e={}){let t=process.env.CLOUDFLARE_ACCOUNT_ID;if(t)return{value:t,source:`env`};let n=o(void 0,e),r=n===void 0?await a(void 0,e):n;if(r?.settings?.accountId)return{value:r.settings.accountId,source:`settings`,path:r.path}}async function _(){let e=await g();if(e)return e.value;let{getActiveAccountId:t}=await Promise.resolve().then(()=>k);try{return t()}catch{return}}async function v(e){let t=await g(e);t&&y(t.value,O(t,`accountId`));let{getOrSelectAccountId:n}=await Promise.resolve().then(()=>k);return n(t?.value,e)}function y(e,t){if(!process.env.DEBUG)return;let n=e.length>12?e.slice(0,12)+`…`:e;process.stderr.write(`Using account: ${n} (${t})\n`)}async function b(e,t,n){if(e?.zoneId)return x(e.zoneId,t);let r=h(`CLOUDFLARE_ZONE_ID`,e?.zone);if(r){if(!n?.quiet&&r.source!==`flag`){let e=O(r);console.error(`Using zone: ${r.value} (from ${e})`)}return x(r.value,t)}throw Error(`No zone specified.
|
|
3
|
+
|
|
4
|
+
Please provide one of the following:
|
|
5
|
+
1. Zone as a positional argument: cf dns records list <zone>
|
|
6
|
+
2. --zone flag (or -z): cf dns records list --zone example.com
|
|
7
|
+
3. CLOUDFLARE_ZONE_ID environment variable`)}async function x(e,t){if(s(e)||!t)return e;let{resolveZoneId:n}=await import(`./resolve-CYUp6YgC.mjs`).then(e=>e.r);return n(t,await v(),e)}function S(e){if(e?.scriptName)return e.scriptName;throw Error("Required Worker name missing. Please specify the Worker name with `--worker <name>`.")}const C=[`public`,`fedramp_high`];let w=!1;async function T(e={}){let t=o(void 0,e),n=(t===void 0?await a(void 0,e):t)?.settings?.complianceRegion,r=D(n,`cloudflare.config.ts`),i=process.env.CLOUDFLARE_COMPLIANCE_REGION,s=D(i,`CLOUDFLARE_COMPLIANCE_REGION`);return s?(r&&r!==s&&!w&&(w=!0,console.warn(`The compliance region was resolved to "${i}" from the \`CLOUDFLARE_COMPLIANCE_REGION\` environment variable, which takes precedence over the configured value "${n}" in \`cloudflare.config.ts\`.`)),s):r}async function E(e){return await T(e)??`public`}function D(e,t){switch(e){case`fedramp-high`:return`fedramp_high`;case`fedramp_high`:case`public`:case void 0:return e;default:throw Error(`Invalid compliance region "${e}" from ${t}. Valid values are: ${C.join(`, `)}`)}}function O(e,t=`zone`){switch(e.source){case`flag`:return t===`zone`?`--zone flag`:`(flag)`;case`env`:return{accountId:`CLOUDFLARE_ACCOUNT_ID`,zone:`CLOUDFLARE_ZONE_ID`,complianceRegion:`CLOUDFLARE_COMPLIANCE_REGION`}[t];case`settings`:return`cloudflare.config.ts`}}var k=e({fetchAuthorizedAccounts:()=>L,getActiveAccountId:()=>I,getActiveProfile:()=>V,getConfigPath:()=>q,getOrSelectAccountId:()=>F,getProfileStore:()=>H,getValidToken:()=>W,isOAuthLoggedIn:()=>G,login:()=>R,logout:()=>z,readAuthCredentials:()=>K,resolveProfile:()=>U,setProfile:()=>B});const A={debug:(...e)=>{process.env.DEBUG&&console.error(...e)},info:(...e)=>console.error(...e),log:(...e)=>console.error(...e),warn:(...e)=>console.error(...e),error:(...e)=>console.error(...e)};var j=class extends Error{};async function M(e){if(l())throw new j;t(i);let r=await d({message:e});if(c(r)||typeof r!=`string`)throw new n(130,{cancelled:!0});return r}async function N(e,r){if(l())throw new j;t(i);let a=await u({message:e,options:r.choices.map(({title:e,value:t})=>({label:e,value:t}))});if(c(a)||typeof a!=`string`)throw new n(130,{cancelled:!0});return A.log(`To have cf automatically use this account for future commands in this project, you can update your \`cloudflare.config.ts\`:
|
|
8
|
+
|
|
9
|
+
import { defineConfig } from "cf/config";
|
|
10
|
+
|
|
11
|
+
export default defineConfig({
|
|
12
|
+
accountId: "${a}",
|
|
13
|
+
});
|
|
14
|
+
`),a}const P=m({logger:A,userAgent:r,prompt:M,select:N,isNoDefaultValueProvidedError:e=>e instanceof j});async function F(e,t){return P.getOrSelectAccountId({account_id:e,compliance_region:await E(t)})}function I(){return P.getActiveAccountId({})}async function L(){return P.fetchAllAccounts({compliance_region:await E()},{throwOnEmpty:!1})}async function R(e){if(e?.scopes&&!f(e.scopes))throw Error(`One or more of the requested scopes are not valid cf OAuth scopes.`);return P.login({compliance_region:await E()},{browser:e?.browser??!0,device:e?.device??!0,...e?.scopes&&{scopes:e.scopes},...e?.profile&&{profile:e.profile}})}function z(e){return P.logout(e)}function B(e){P.setProfile(e)}function V(){return P.getActiveProfile()}function H(){return p({logger:A})}function U(e,t=process.cwd()){let n=H().resolve({profile:e,cwd:t});return B(n),n}function W(){return P.getOAuthTokenFromLocalState()}function G(){return P.readAuthCredentials()?.oauth_token!==void 0}function K(){return P.readAuthCredentials()}function q(){return P.getCredentialStore().path()}export{W as a,z as c,B as d,v as f,_ as g,b as h,H as i,k as l,S as m,V as n,G as o,E as p,q as r,R as s,L as t,K as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n}from"./oauth-BdVr2hJp.mjs";import{r}from"./auth-DWxtJ918.mjs";import{t as i}from"./output-Z2lQmPUW.mjs";import{t as a}from"./dry-run-YSQndLvt.mjs";import{t as o}from"./progress-a5IKeKni.mjs";import{t as s}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{n as c,t as l}from"./body-parser-Cmw7PZ7a.mjs";import{n as u}from"./input-validation-nF-0Ze2h.mjs";import{a as d,i as f,n as p}from"./prompt-BP8XrQSj.mjs";function m(e){return e.option(`allowed-cors-origins`,{type:`string`,array:!0,description:`Array of allowed CORS origins.`}).option(`client-name`,{type:`string`,description:`Human-readable name of the OAuth client.`}).option(`client-uri`,{type:`string`,description:`URL of the home page of the client.`}).option(`grant-types`,{type:`string`,array:!0,description:"Array of OAuth grant types the client is allowed to use. `authorization_code` is required; `refresh_token` may be included optionally."}).option(`logo-uri`,{type:`string`,description:`URL of the client's logo.`}).option(`optional-scopes`,{type:`string`,array:!0,description:"Scopes that the authorizing user may decline during consent. Each value must also appear in `scopes`. The scopes `openid`, `offline`, and `offline_access` cannot be optional."}).option(`policy-uri`,{type:`string`,description:`URL that points to a privacy policy document.`}).option(`post-logout-redirect-uris`,{type:`string`,array:!0,description:`Array of allowed post-logout redirect URIs.`}).option(`redirect-uris`,{type:`string`,array:!0,description:`Array of allowed redirect URIs for the client.`}).option(`response-types`,{type:`string`,array:!0,description:`Array of OAuth response types the client is allowed to use.`}).option(`scopes`,{type:`string`,array:!0,description:"Array of OAuth scopes the client is allowed to request. Colon-delimited scopes are not accepted. Dot-delimited scopes are validated against available OAuth API scopes; simple identity scopes are allowed. Protocol scopes `offline_access` and `openid` are added or removed automatically based on `grant_types` and `response_types`."}).option(`token-endpoint-auth-method`,{type:`string`,description:`The authentication method the client uses at the token endpoint.`,choices:[`none`,`client_secret_basic`,`client_secret_post`]}).option(`tos-uri`,{type:`string`,description:`URL that points to a terms of service document.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`create`,describe:`Create a new OAuth client for an account.`,builder:m,handler:async p=>s({command:`oauth-clients create`,classification:{safeFlags:[`token-endpoint-auth-method`,`dry-run`]}},p,async()=>{if(p.dryRun){a({command:`cf oauth-clients create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/oauth_clients`,pathParams:{},bodyKind:`json`,body:p.body===void 0?l({allowed_cors_origins:p[`allowed-cors-origins`],client_name:u(p[`client-name`],`client-name`,`text`),client_uri:u(p[`client-uri`],`client-uri`,`text`),grant_types:p[`grant-types`],logo_uri:u(p[`logo-uri`],`logo-uri`,`text`),optional_scopes:p[`optional-scopes`],policy_uri:u(p[`policy-uri`],`policy-uri`,`text`),post_logout_redirect_uris:p[`post-logout-redirect-uris`],redirect_uris:p[`redirect-uris`],response_types:p[`response-types`],scopes:p.scopes,token_endpoint_auth_method:u(p[`token-endpoint-auth-method`],`token-endpoint-auth-method`,`text`),tos_uri:u(p[`tos-uri`],`tos-uri`,`text`)}):c(p.body)});return}let s=await r(p),m=p.local?e:await t();if(p.accountId=m,p.body){let e=c(p.body);i(await o(`Creating`,async()=>s.oauthClients.create({...e,account_id:m})),{successLabel:`Created`});return}if(p[`client-name`]===void 0&&(p[`client-name`]=await d(`client-name`,`Human-readable name of the OAuth client.`)),p[`grant-types`]===void 0)throw Error(`--grant-types is required (or pass --body with this field set).`);if(p[`redirect-uris`]===void 0)throw Error(`--redirect-uris is required (or pass --body with this field set).`);if(p[`response-types`]===void 0)throw Error(`--response-types is required (or pass --body with this field set).`);if(p.scopes===void 0)throw Error(`--scopes is required (or pass --body with this field set).`);p[`token-endpoint-auth-method`]===void 0&&(p[`token-endpoint-auth-method`]=await f(`token-endpoint-auth-method`,`The authentication method the client uses at the token endpoint.`,[`none`,`client_secret_basic`,`client_secret_post`]));let h=l({allowed_cors_origins:p[`allowed-cors-origins`],client_name:u(p[`client-name`],`client-name`,`text`),client_uri:u(p[`client-uri`],`client-uri`,`text`),grant_types:p[`grant-types`],logo_uri:u(p[`logo-uri`],`logo-uri`,`text`),optional_scopes:p[`optional-scopes`],policy_uri:u(p[`policy-uri`],`policy-uri`,`text`),post_logout_redirect_uris:p[`post-logout-redirect-uris`],redirect_uris:p[`redirect-uris`],response_types:p[`response-types`],scopes:p.scopes,token_endpoint_auth_method:u(p[`token-endpoint-auth-method`],`token-endpoint-auth-method`,`text`),tos_uri:u(p[`tos-uri`],`tos-uri`,`text`)});i(await o(`Creating`,async()=>s.oauthClients.create({...h,account_id:m})),{successLabel:`Created`})})};function g(e){return e.positional(`oauth-client-id`,{type:`string`,description:`The unique identifier for an OAuth client.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete-rotated-secret <oauth-client-id>`,describe:"Removes the old client secret after a rotation, keeping only the new one. Use this after you have updated your client configuration to use the new secret. The `has_rotated_secret` field on the client indicates whether there is an old secret to delete.",builder:g,handler:async c=>s({command:`oauth-clients delete-rotated-secret`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf oauth-clients delete-rotated-secret`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/oauth_clients/${c[`oauth-client-id`]==null?`<oauth-client-id>`:encodeURIComponent(String(c[`oauth-client-id`]))}/rotate_secret`,pathParams:{"oauth-client-id":String(c[`oauth-client-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await p({force:!!c.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}i(await o(`Deleting`,async()=>s.oauthClients.deleteRotatedSecret({account_id:l,oauth_client_id:c[`oauth-client-id`]})),{successLabel:`Deleted`})})};function v(e){return e.positional(`oauth-client-id`,{type:`string`,description:`The unique identifier for an OAuth client.`,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 <oauth-client-id>`,describe:`Delete an OAuth client.`,builder:v,handler:async c=>s({command:`oauth-clients delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf oauth-clients delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/oauth_clients/${c[`oauth-client-id`]==null?`<oauth-client-id>`:encodeURIComponent(String(c[`oauth-client-id`]))}`,pathParams:{"oauth-client-id":String(c[`oauth-client-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await p({force:!!c.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}i(await o(`Deleting`,async()=>s.oauthClients.delete({account_id:l,oauth_client_id:c[`oauth-client-id`]})),{successLabel:`Deleted`})})};function b(e){return e.positional(`oauth-client-id`,{type:`string`,description:`The unique identifier for an OAuth client.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get <oauth-client-id>`,describe:`Get details of a specific OAuth client.`,builder:b,handler:async c=>s({command:`oauth-clients get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf oauth-clients get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/oauth_clients/${c[`oauth-client-id`]==null?`<oauth-client-id>`:encodeURIComponent(String(c[`oauth-client-id`]))}`,pathParams:{"oauth-client-id":String(c[`oauth-client-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.oauthClients.get({account_id:l,oauth_client_id:c[`oauth-client-id`]})),{successLabel:`Loaded`})})};function S(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`list`,describe:`List all OAuth clients for an account.`,builder:S,handler:async c=>s({command:`oauth-clients list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf oauth-clients list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/oauth_clients`,pathParams:{},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.oauthClients.list({account_id:l})),{successLabel:`Loaded`})})};function w(e){return e.positional(`oauth-client-id`,{type:`string`,description:`The unique identifier for an OAuth client.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`rotate-secret <oauth-client-id>`,describe:"Creates a second client secret so you can update your client configuration before deleting the old one. The `has_rotated_secret` field on the client will be set to `true`.",builder:w,handler:async c=>s({command:`oauth-clients rotate-secret`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf oauth-clients rotate-secret`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/oauth_clients/${c[`oauth-client-id`]==null?`<oauth-client-id>`:encodeURIComponent(String(c[`oauth-client-id`]))}/rotate_secret`,pathParams:{"oauth-client-id":String(c[`oauth-client-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Creating`,async()=>s.oauthClients.rotateSecret({account_id:l,oauth_client_id:c[`oauth-client-id`]})),{successLabel:`Created`})})};function E(e){return e.positional(`oauth-client-id`,{type:`string`,description:`The unique identifier for an OAuth client.`,demandOption:!0}).option(`allowed-cors-origins`,{type:`string`,array:!0,description:`Array of allowed CORS origins.`}).option(`client-name`,{type:`string`,description:`Human-readable name of the OAuth client.`}).option(`client-uri`,{type:`string`,description:`URL of the home page of the client.`}).option(`grant-types`,{type:`string`,array:!0,description:"Array of OAuth grant types the client is allowed to use. `authorization_code` is required; `refresh_token` may be included optionally."}).option(`logo-uri`,{type:`string`,description:`URL of the client's logo.`}).option(`optional-scopes`,{type:`string`,array:!0,description:"Scopes that the authorizing user may decline during consent. Each value must also appear in `scopes`. The scopes `openid`, `offline`, and `offline_access` cannot be optional."}).option(`policy-uri`,{type:`string`,description:`URL that points to a privacy policy document.`}).option(`post-logout-redirect-uris`,{type:`string`,array:!0,description:`Array of allowed post-logout redirect URIs.`}).option(`redirect-uris`,{type:`string`,array:!0,description:`Array of allowed redirect URIs for the client.`}).option(`response-types`,{type:`string`,array:!0,description:`Array of OAuth response types the client is allowed to use.`}).option(`scopes`,{type:`string`,array:!0,description:"Array of OAuth scopes the client is allowed to request. Colon-delimited scopes are not accepted. Dot-delimited scopes are validated against available OAuth API scopes; simple identity scopes are allowed. Protocol scopes `offline_access` and `openid` are added or removed automatically based on `grant_types` and `response_types`."}).option(`token-endpoint-auth-method`,{type:`string`,description:`The authentication method the client uses at the token endpoint.`,choices:[`none`,`client_secret_basic`,`client_secret_post`]}).option(`tos-uri`,{type:`string`,description:`URL that points to a terms of service document.`}).option(`visibility`,{type:`string`,description:"Promote the OAuth client from private to public visibility. Only `public` is accepted; demotion to `private` is not supported. Promotion requires a non-empty client name, logo URI, verified client URI host, and at least one non-identity scope.",choices:[`public`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Partial update request for an OAuth client. Only include fields you want to update.`})}const D={command:`update <oauth-client-id>`,describe:`Update an existing OAuth client. Only include fields you want to update.`,builder:E,handler:async d=>s({command:`oauth-clients update`,classification:{safeFlags:[`token-endpoint-auth-method`,`visibility`,`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf oauth-clients update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/oauth_clients/${d[`oauth-client-id`]==null?`<oauth-client-id>`:encodeURIComponent(String(d[`oauth-client-id`]))}`,pathParams:{"oauth-client-id":String(d[`oauth-client-id`]??``)},bodyKind:`json`,body:d.body===void 0?l({allowed_cors_origins:d[`allowed-cors-origins`],client_name:u(d[`client-name`],`client-name`,`text`),client_uri:u(d[`client-uri`],`client-uri`,`text`),grant_types:d[`grant-types`],logo_uri:u(d[`logo-uri`],`logo-uri`,`text`),optional_scopes:d[`optional-scopes`],policy_uri:u(d[`policy-uri`],`policy-uri`,`text`),post_logout_redirect_uris:d[`post-logout-redirect-uris`],redirect_uris:d[`redirect-uris`],response_types:d[`response-types`],scopes:d.scopes,token_endpoint_auth_method:u(d[`token-endpoint-auth-method`],`token-endpoint-auth-method`,`text`),tos_uri:u(d[`tos-uri`],`tos-uri`,`text`),visibility:u(d.visibility,`visibility`,`text`)}):c(d.body)});return}let s=await r(d),f=d.local?e:await t();if(d.accountId=f,d.body){let e=c(d.body);i(await o(`Updating`,async()=>s.oauthClients.update({...e,account_id:f,oauth_client_id:d[`oauth-client-id`]})),{successLabel:`Updated`});return}let p=l({allowed_cors_origins:d[`allowed-cors-origins`],client_name:u(d[`client-name`],`client-name`,`text`),client_uri:u(d[`client-uri`],`client-uri`,`text`),grant_types:d[`grant-types`],logo_uri:u(d[`logo-uri`],`logo-uri`,`text`),optional_scopes:d[`optional-scopes`],policy_uri:u(d[`policy-uri`],`policy-uri`,`text`),post_logout_redirect_uris:d[`post-logout-redirect-uris`],redirect_uris:d[`redirect-uris`],response_types:d[`response-types`],scopes:d.scopes,token_endpoint_auth_method:u(d[`token-endpoint-auth-method`],`token-endpoint-auth-method`,`text`),tos_uri:u(d[`tos-uri`],`tos-uri`,`text`),visibility:u(d.visibility,`visibility`,`text`)});i(await o(`Updating`,async()=>s.oauthClients.update({...p,account_id:f,oauth_client_id:d[`oauth-client-id`]})),{successLabel:`Updated`})})},O={command:`oauth-clients`,describe:`oauth-clients`,builder:e=>e.command(h).command(y).command(_).command(x).command(C).command(T).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{O as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{r as e}from"./auth-
|
|
2
|
+
import{r as e}from"./auth-DWxtJ918.mjs";import{t}from"./output-Z2lQmPUW.mjs";import{t as n}from"./dry-run-YSQndLvt.mjs";import{t as r}from"./progress-a5IKeKni.mjs";import{t as i}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";function a(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const o={command:`list`,describe:`List all available OAuth scopes. This endpoint requires authentication but has no authorization role requirements.`,builder:a,handler:async a=>i({command:`oauth-scopes list`,classification:{safeFlags:[`dry-run`]}},a,async()=>{if(a.dryRun){n({command:`cf oauth-scopes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/oauth/scopes`,pathParams:{},bodyKind:`none`});return}let i=await e(a);t(await r(`Loading`,async()=>i.oauthScopes.list()),{successLabel:`Loaded`})})},s={command:`oauth-scopes`,describe:`oauth-scopes`,builder:e=>e.command(o).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{s as default};
|