cf 0.14.0 → 1.0.0-beta.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/LICENSE-APACHE +176 -0
- package/LICENSE-MIT +25 -0
- package/README.md +6 -7
- package/dist/_meta/commands.json +4040 -1629
- package/dist/_meta/hand-written-commands.json +16 -43
- package/dist/_meta/schemas.json +445 -756
- package/dist/abuse-reports-BwsJLiPN.mjs +26 -0
- package/dist/access-BVbIajYr.mjs +27 -0
- package/dist/account-DBLarar2.mjs +12 -0
- package/dist/account-tags-BNrSShjj.mjs +15 -0
- package/dist/accounts-CCAnDjFk.mjs +132 -0
- package/dist/acm-ZPYQbZQr.mjs +15 -0
- package/dist/addressing-BFpzLfTn.mjs +93 -0
- package/dist/agent-memory-DEvy2dLU.mjs +34 -0
- package/dist/ai-BF0_0NtS.mjs +31 -0
- package/dist/ai-audit-Dn03zntn.mjs +6 -0
- package/dist/ai-gateway-CVABbCjv.mjs +147 -0
- package/dist/ai-search-g0tR8Cut.mjs +79 -0
- package/dist/ai-security-BXXA0Jnk.mjs +10 -0
- package/dist/alerting-Bst10SOG.mjs +56 -0
- package/dist/analytics-DgEaxta8.mjs +21 -0
- package/dist/analytics_engine-B4DvcYmB.mjs +4 -0
- package/dist/{lifecycle-CadF_i2n.mjs → ansi-styles-eKEZXVwN.mjs} +1 -1
- package/dist/api-security-Dkx1Codr.mjs +154 -0
- package/dist/argo-BvswWPlP.mjs +10 -0
- package/dist/artifacts-D8kZKJq0.mjs +43 -0
- package/dist/audit-logs-Bp_yQpXJ.mjs +4 -0
- package/dist/auth-B9w55oRg.mjs +2 -0
- package/dist/auth-C80y97yu.mjs +8 -0
- package/dist/billing-Cqj64fqz.mjs +23 -0
- package/dist/bot-management-CzZx_aml.mjs +9 -0
- package/dist/botnet-feed-Co0c8Xdj.mjs +11 -0
- package/dist/brand-protection-CDsGaPIl.mjs +27 -0
- package/dist/browser-extension-BRHJm3Qf.mjs +15 -0
- package/dist/browser-run-DFrohJ1p.mjs +46 -0
- package/dist/build-BbjcJxKq.mjs +2 -0
- package/dist/build-DQh5-KK4.mjs +2 -0
- package/dist/builds-CamhClyb.mjs +71 -0
- package/dist/cache-BiTk4-Zc.mjs +45 -0
- package/dist/certificate-authorities-Dal9DNjW.mjs +6 -0
- package/dist/cf-oadujOtC.mjs +18 -0
- package/dist/{chunk-6EUZQHAF-B7bSMYLe.mjs → chunk-6EUZQHAF-QVTL_mC-.mjs} +1 -1
- package/dist/chunk-DL5FNmn1.mjs +2 -0
- package/dist/{chunk-Q72B4Q5Z-CPy_WJKU.mjs → chunk-Q72B4Q5Z-Cr1H_iK6.mjs} +1 -1
- package/dist/chunk-Q72B4Q5Z-DKhx_4ok.mjs +2 -0
- package/dist/chunk-QBZBEHZB-Byagrlop.mjs +2 -0
- package/dist/chunk-XLADBZ7F-BXKOjWbx.mjs +374 -0
- package/dist/client-certificates-DDisXoTE.mjs +13 -0
- package/dist/client-side-security-CIO_YPtN.mjs +63 -0
- package/dist/cloud-connector-vwdixea0.mjs +6 -0
- package/dist/cloudflared-DhItYrCq.mjs +2 -0
- package/dist/cloudforce-one-C1cFVBGK.mjs +456 -0
- package/dist/command-BP7ldws1.mjs +2 -0
- package/dist/command-BtNRBTP6.mjs +2 -0
- package/dist/{command-BL6weJf3.mjs → command-CF0giIIc.mjs} +1 -1
- package/dist/command-Ck9rbHA4.mjs +2 -0
- package/dist/{completions-Dn621okY.mjs → completions-xPLd1cvL.mjs} +3 -3
- package/dist/{config-BY6KpMZs.mjs → config-B4vIa0zp.mjs} +1 -1
- package/dist/connector-interrupts-DQ5T-HMN.mjs +6 -0
- package/dist/connector-telemetry-events-DWam38_9.mjs +6 -0
- package/dist/connector-telemetry-snapshots-DX6AJf9Q.mjs +6 -0
- package/dist/connectors-CBhLWVd-.mjs +15 -0
- package/dist/{dist-CFQREIRi.mjs → containers-Bx_44bmJ.mjs} +84 -83
- package/dist/containers-C7blN-pe.mjs +78 -0
- package/dist/content-scan-CC91dAlv.mjs +14 -0
- package/dist/cps-D9a4N_bH.mjs +6 -0
- package/dist/csamScanner-T7nbCnep.mjs +10 -0
- package/dist/ct-alerting-CkjNJlla.mjs +5 -0
- package/dist/custom-certificates-DnWnt9oJ.mjs +17 -0
- package/dist/custom-csrs-Db2pF9Ib.mjs +11 -0
- package/dist/custom-hostnames-B_N-uSIa.mjs +27 -0
- package/dist/custom-nameservers-DPA_sFY8.mjs +9 -0
- package/dist/custom-pages-D6fxEBoh.mjs +21 -0
- package/dist/d1-DXs1xVmH.mjs +45 -0
- package/dist/data-security-CVZAIzhe.mjs +71 -0
- package/dist/dcv-delegation-as1ue_wx.mjs +4 -0
- package/dist/delegate-GctF_lrq.mjs +2 -0
- package/dist/delegate.mjs +1 -1
- package/dist/{deploy-BtETDvDA.mjs → deploy-D2XXCkqk.mjs} +1 -1
- package/dist/{deploy-input-BoLTdQzS.mjs → deploy-input-BCYyKXpp.mjs} +1 -1
- package/dist/{dev-B5WcIpEr.mjs → dev-nsNxyg2D.mjs} +1 -1
- package/dist/diagnostics-BKH1Oh-C.mjs +15 -0
- package/dist/{dialog-Bud0hiYv.mjs → dialog-Dx4rRcKM.mjs} +1 -1
- package/dist/dist-BDOzKthe.mjs +48 -0
- package/dist/{dist-BRg_z9Ut.mjs → dist-BpadEMNY.mjs} +1 -1
- package/dist/dist-dc4E1u01.mjs +272 -0
- package/dist/dls-C5kAQsN6.mjs +17 -0
- package/dist/dns-CYwXrdJO.mjs +135 -0
- package/dist/dns-firewall-BEw4QcXj.mjs +71 -0
- package/dist/{dot-prop-6SRZBKHT-wIVDg_fl.mjs → dot-prop-6SRZBKHT-Dj7YOlwR.mjs} +1 -1
- package/dist/dry-run-CLX6Pbtq.mjs +2 -0
- package/dist/durable-objects-3jvUgzKd.mjs +8 -0
- package/dist/email-auth-B3MD8FrJ.mjs +6 -0
- package/dist/email-routing-C4YhZGPw.mjs +45 -0
- package/dist/email-security-BcFyWNby.mjs +160 -0
- package/dist/email-sending-BO1GOAho.mjs +47 -0
- package/dist/error-sanitization-BkgUhGVc.mjs +2 -0
- package/dist/error-sanitization-DOlqWkNu.mjs +2 -0
- package/dist/fieldExtractors-BJDnzNCN.mjs +9 -0
- package/dist/firewall-BSMa9aH3.mjs +56 -0
- package/dist/flagship-BJYMb7hb.mjs +28 -0
- package/dist/fraud-C7kS7kP9.mjs +22 -0
- package/dist/google-tag-gateway-8VR-j0sa.mjs +6 -0
- package/dist/healthchecks-BJleItOD.mjs +22 -0
- package/dist/hostnames-CHajvoHa.mjs +11 -0
- package/dist/hyperdrive-DlxQrok-.mjs +37 -0
- package/dist/iam-B7oTr6vW.mjs +52 -0
- package/dist/images-xLAYe436.mjs +71 -0
- package/dist/index.mjs +1 -1
- package/dist/intel-DwZXY1YE.mjs +76 -0
- package/dist/{interactive-CGOh-aYq.mjs → interactive-B6woOLo-.mjs} +23 -23
- package/dist/interactive-DnUvQHjc.mjs +2 -0
- package/dist/ips-BC_9nKE7.mjs +4 -0
- package/dist/keyless-certificates-CtsCsbZ2.mjs +13 -0
- package/dist/keys-K-GFzhku.mjs +4 -0
- package/dist/kv-Bfwz_ULu.mjs +21 -0
- package/dist/leaked-credential-checks-D8UuxztO.mjs +18 -0
- package/dist/lifecycle-Ichnb2x1.mjs +2 -0
- package/dist/load-balancers-B0XeGLhT.mjs +76 -0
- package/dist/local-B6b2OIBW.mjs +2 -0
- package/dist/local-BrfySqnx.mjs +2 -0
- package/dist/{local-runtime-Dj8k-p62.mjs → local-runtime-DD8DAIlm.mjs} +1 -1
- package/dist/login-CAsRUF4c.mjs +2 -0
- package/dist/login-DaglE6WA.mjs +5 -0
- package/dist/logo-matches-DWg5ezsM.mjs +6 -0
- package/dist/logos-6A6gJC5C.mjs +7 -0
- package/dist/logpush-DwehajAw.mjs +46 -0
- package/dist/logs-BWg7YymF.mjs +48 -0
- package/dist/magic-cloud-networking--14hNj2F.mjs +71 -0
- package/dist/magic-network-monitoring-Dzo4L6kd.mjs +36 -0
- package/dist/magic-transit-DDO0A5v4.mjs +387 -0
- package/dist/managed-defense-DQ0iwWdG.mjs +18 -0
- package/dist/managed-transforms-DDIdcPG0.mjs +9 -0
- package/dist/matches-D6ahHNaP.mjs +6 -0
- package/dist/mcp-BcIrLbRv.mjs +32 -0
- package/dist/mesh-wLiPcWyN.mjs +26 -0
- package/dist/mtls-certificates-AEuNOERQ.mjs +13 -0
- package/dist/network-DZsrs_sw.mjs +50 -0
- package/dist/network-interconnects-Cjbu4EMv.mjs +73 -0
- package/dist/oauth-C-QCVfWz.mjs +14 -0
- package/dist/oauth-Cu1twz9z.mjs +2 -0
- package/dist/oauth-clients-DR0hzakz.mjs +16 -0
- package/dist/oauth-scopes-BDNpJJ32.mjs +4 -0
- package/dist/observability-BnHy2M6p.mjs +80 -0
- package/dist/{open-PBXRGS4R-ClEt4E8F.mjs → open-PBXRGS4R-C4CKEADM.mjs} +1 -1
- package/dist/open-PBXRGS4R-C_-G_4DC.mjs +4 -0
- package/dist/organization-iasRm69J.mjs +75 -0
- package/dist/organizations-CUzCIKXV.mjs +4 -0
- package/dist/origin-ca-certificates-iQXSqBI0.mjs +11 -0
- package/dist/origin-post-quantum-encryption-DcMDK6Tz.mjs +6 -0
- package/dist/origin-tls-client-auth-D1X26X7y.mjs +30 -0
- package/dist/{output-Z2lQmPUW.mjs → output-Bia1u2k5.mjs} +1 -1
- package/dist/page-rules-CXa8EYcP.mjs +39 -0
- package/dist/pages-Cu0m9GSH.mjs +60 -0
- package/dist/pay-per-crawl-DmF8xlm_.mjs +65 -0
- package/dist/pay-per-use-DIp2fwJU.mjs +6 -0
- package/dist/pipelines-MmXlsxYO.mjs +44 -0
- package/dist/precursor-jqeEG_mJ.mjs +4 -0
- package/dist/previews-Cg6lc24N.mjs +4 -0
- package/dist/progress-Bpp73hIu.mjs +2 -0
- package/dist/{prompt-BP8XrQSj.mjs → prompt-CpZztV8c.mjs} +1 -1
- package/dist/queries-VzdcSR5H.mjs +9 -0
- package/dist/queues-BZYl2emH.mjs +63 -0
- package/dist/r2-data-catalog-DISnPFPY.mjs +44 -0
- package/dist/r2-omcKF8_A.mjs +127 -0
- package/dist/radar-JzBTD249.mjs +300 -0
- package/dist/{raw-fetch-DNH2V8qH.mjs → raw-fetch-DxGs_eRm.mjs} +1 -1
- package/dist/realtime-yIdAJ0Yf.mjs +172 -0
- package/dist/registrar-D-Li9gNk.mjs +43 -0
- package/dist/registrar-sandbox-CKSSHAyv.mjs +56 -0
- package/dist/{registry-BrtVdMrC.mjs → registry-vreNkX6u.mjs} +1 -1
- package/dist/reporting-Cf-pnw6h.mjs +14 -0
- package/dist/request-headers-DaXBfmVn.mjs +2 -0
- package/dist/request-tracers-BegIQTzt.mjs +4 -0
- package/dist/resolve-BXemCSyA.mjs +2 -0
- package/dist/resolve-CUDKxUrW.mjs +2 -0
- package/dist/resource-sharing-DEVgiYzM.mjs +40 -0
- package/dist/resource-tagging-Cm2yJkU9.mjs +4 -0
- package/dist/rules-DDCa7cYF.mjs +18 -0
- package/dist/rulesets-BhS7Hvtu.mjs +37 -0
- package/dist/rum-EIj9ViSn.mjs +30 -0
- package/dist/run-CSFE1qVX.mjs +2 -0
- package/dist/run-ChM_YpZ0.mjs +2 -0
- package/dist/{schema-DmuJtMN5.mjs → schema-DCBb3Fcs.mjs} +1 -1
- package/dist/{schema-flags-CUGxFeZe.mjs → schema-flags--GosoCMU.mjs} +1 -1
- package/dist/scim-DA83eNe-.mjs +18 -0
- package/dist/{sdk-Bvqx-_3z.mjs → sdk-CvIO3tWS.mjs} +1 -1
- package/dist/secrets-store-BTd3eGIB.mjs +24 -0
- package/dist/security-center-DbH_7h-T.mjs +30 -0
- package/dist/security-txt-DSrHhVEN.mjs +9 -0
- package/dist/shared-CtBkOWGN.mjs +2 -0
- package/dist/smart-shield-DnSTo-OI.mjs +24 -0
- package/dist/snippets-An5kQs33.mjs +20 -0
- package/dist/source-BR4_k2ad.mjs +6 -0
- package/dist/spawn-7IW1UyoH.mjs +523 -0
- package/dist/spectrum-Ci79n7fd.mjs +83 -0
- package/dist/speed-BBL7LrLn.mjs +24 -0
- package/dist/src-CNHNCZpy.mjs +108 -0
- package/dist/ssl-B2psFIRm.mjs +45 -0
- package/dist/startup-profile-CYEokTVe.mjs +2 -0
- package/dist/startup-profile-CgWHy4rE.mjs +17 -0
- package/dist/state-BxCejn42.mjs +2 -0
- package/dist/state-DSzkxXML.mjs +2 -0
- package/dist/stream-Du0Q7UOh.mjs +102 -0
- package/dist/submit-CU8S2jBT.mjs +4 -0
- package/dist/tags-C3l5aZSi.mjs +4 -0
- package/dist/telemetry-CNt8H3aA.mjs +2 -0
- package/dist/{telemetry-2s9Y3FaN.mjs → telemetry-Dk1GcQ0u.mjs} +1 -1
- package/dist/telemetry-PHe8XxA2.mjs +2 -0
- package/dist/tenant-BZ0ysR9L.mjs +12 -0
- package/dist/tenant-custom-nameservers-DtKeyM5J.mjs +9 -0
- package/dist/{tools-Dz1JCrHd.mjs → tools-BMKpYraQ.mjs} +1 -1
- package/dist/tunnels-D1tRWQQi.mjs +29 -0
- package/dist/turnstile-DBa4_Vyz.mjs +33 -0
- package/dist/ui-DH95w1Qk.mjs +5 -0
- package/dist/undici-DTSBJHNS.mjs +96 -0
- package/dist/update-check-AAn7EXw8.mjs +2 -0
- package/dist/update-check-BbIXBq1o.mjs +2 -0
- package/dist/update-check-worker.mjs +2 -0
- package/dist/url-info-BRA0XGT2.mjs +4 -0
- package/dist/url-normalization-B6N2m5s6.mjs +9 -0
- package/dist/url-scanner-CeKkzkhe.mjs +16 -0
- package/dist/user-CftksgmF.mjs +112 -0
- package/dist/values-m7w9PX3o.mjs +4 -0
- package/dist/vectorize-BWBEtsgZ.mjs +32 -0
- package/dist/version-cPq-WKL8.mjs +2 -0
- package/dist/waiting-rooms-BVZSYTNJ.mjs +53 -0
- package/dist/web-assets-CLU5vAgP.mjs +64 -0
- package/dist/web3-Dkd4XRNH.mjs +28 -0
- package/dist/workers-BQi4_SBS.mjs +36 -0
- package/dist/workers-builds-BgtPSDYJ.mjs +14 -0
- package/dist/workers-for-platforms-actLCM6Q.mjs +25 -0
- package/dist/workers-vpc-DjGfJgQn.mjs +13 -0
- package/dist/workflows-Cm7WsAgB.mjs +43 -0
- package/dist/zaraz-DurWe32F.mjs +22 -0
- package/dist/zero-trust-D8SVU8YZ.mjs +795 -0
- package/dist/zone-B3AEAfcd.mjs +4 -0
- package/dist/zones-DiX5LoSU.mjs +124 -0
- package/package.json +26 -11
- package/dist/_meta/agent-context.json +0 -195
- package/dist/abuse-reports-CDFjJ2e8.mjs +0 -8
- package/dist/access-BoT1waG4.mjs +0 -11
- package/dist/account-agnMUKWj.mjs +0 -2
- package/dist/account-tags-BRMMHCee.mjs +0 -9
- package/dist/accounts-Cut77dAt.mjs +0 -30
- package/dist/acm-C8WgXNCl.mjs +0 -3
- package/dist/addressing-CR8EV42x.mjs +0 -13
- package/dist/agent-context-Wj5TRRbW.mjs +0 -8
- package/dist/agent-memory-CVJpKKZy.mjs +0 -6
- package/dist/ai-BbNYt-yI.mjs +0 -5
- package/dist/ai-audit-mVajM-2i.mjs +0 -2
- package/dist/ai-gateway-BsepSA_v.mjs +0 -13
- package/dist/ai-search-DbEJqm5-.mjs +0 -7
- package/dist/ai-security-DmyB5EYk.mjs +0 -4
- package/dist/alerting-dmy3hd8O.mjs +0 -6
- package/dist/analytics-B1xBMla0.mjs +0 -5
- package/dist/analytics_engine-DazCn3iC.mjs +0 -2
- package/dist/api-security-0HXCzfHk.mjs +0 -50
- package/dist/argo-DSHsE8zv.mjs +0 -2
- package/dist/artifacts-CwiU9Mxu.mjs +0 -5
- package/dist/audit-logs-DwFtMDwH.mjs +0 -2
- package/dist/auth-B0ZyXc3y.mjs +0 -5
- package/dist/auth-DWxtJ918.mjs +0 -8
- package/dist/billing-Cbpadkgu.mjs +0 -3
- package/dist/bot-management-B6M2Vyyn.mjs +0 -5
- package/dist/botnet-feed-Dn8UuE4h.mjs +0 -3
- package/dist/brand-protection-B5R0b3pu.mjs +0 -3
- package/dist/browser-extension-D55pYZf_.mjs +0 -3
- package/dist/browser-run-C1b2VkGB.mjs +0 -4
- package/dist/build-CP2JUfV1.mjs +0 -2
- package/dist/builds-CVEXO_4a.mjs +0 -9
- package/dist/cache-BU5xX82E.mjs +0 -9
- package/dist/certificate-authorities--tZTWJWD.mjs +0 -2
- package/dist/cf-BV2HLCQm.mjs +0 -18
- package/dist/chunk-QBZBEHZB-BcCMlc8C.mjs +0 -2
- package/dist/chunk-XLADBZ7F-DgFrtUhW.mjs +0 -103
- package/dist/chunk-vbHwaUoU.mjs +0 -2
- package/dist/client-certificates-DX84qeYG.mjs +0 -3
- package/dist/client-side-security-DsSO2rZQ.mjs +0 -37
- package/dist/cloud-connector-cf8qlxap.mjs +0 -2
- package/dist/cloudforce-one-DzVXorbu.mjs +0 -32
- package/dist/command-DYrspBc0.mjs +0 -2
- package/dist/connector-interrupts-DqpqPPkp.mjs +0 -2
- package/dist/connector-telemetry-events-CCD-_B-8.mjs +0 -2
- package/dist/connector-telemetry-snapshots-D3CeGGhk.mjs +0 -2
- package/dist/connectors-aPQspZdg.mjs +0 -3
- package/dist/containers-D0Kjl8h-.mjs +0 -58
- package/dist/content-scan-BVx18XmS.mjs +0 -4
- package/dist/cps-ByazyM0x.mjs +0 -2
- package/dist/csamScanner-OG5lQxBC.mjs +0 -6
- package/dist/ct-alerting-BJx5n8Zf.mjs +0 -3
- package/dist/custom-certificates-BuJ2e9TA.mjs +0 -5
- package/dist/custom-csrs-CR_5qbST.mjs +0 -3
- package/dist/custom-hostnames-BzDTsQXb.mjs +0 -5
- package/dist/custom-nameservers-OfMPRGkD.mjs +0 -3
- package/dist/custom-pages-BmGXoTIo.mjs +0 -3
- package/dist/d1-DedC8N0N.mjs +0 -21
- package/dist/data-security-B2UB26ry.mjs +0 -7
- package/dist/dcv-delegation-C11vmzbG.mjs +0 -2
- package/dist/diagnostics-Cf6BLpAo.mjs +0 -3
- package/dist/dist-CyisSore.mjs +0 -371
- package/dist/dist-Dr4Hg_Up.mjs +0 -48
- package/dist/dls-R6PvHbhj.mjs +0 -3
- package/dist/dns-Cl8se64c.mjs +0 -29
- package/dist/dns-firewall-WtmKilDT.mjs +0 -57
- package/dist/dry-run-YSQndLvt.mjs +0 -2
- package/dist/durable-objects-jfVU6yp_.mjs +0 -2
- package/dist/email-auth-DPmZ85eW.mjs +0 -2
- package/dist/email-routing-Bf6DbNTr.mjs +0 -6
- package/dist/email-security-DTifjSxM.mjs +0 -18
- package/dist/email-sending-Dm3WkFHV.mjs +0 -7
- package/dist/error-sanitization-D8zuyPj_.mjs +0 -2
- package/dist/fieldExtractors-CeXZL0-I.mjs +0 -3
- package/dist/firewall-D5N2APXO.mjs +0 -8
- package/dist/flagship-sUOy9jei.mjs +0 -4
- package/dist/fraud-WLW2Ep1Z.mjs +0 -20
- package/dist/google-tag-gateway-lbww1FaJ.mjs +0 -2
- package/dist/healthchecks-0ih8Qjiw.mjs +0 -4
- package/dist/hostnames-Ba6FuL8K.mjs +0 -3
- package/dist/hyperdrive-DMqcU639.mjs +0 -21
- package/dist/iam-CXlYm0uC.mjs +0 -6
- package/dist/images-D_g1oli6.mjs +0 -8
- package/dist/intel-B8bS0ARd.mjs +0 -8
- package/dist/ips-68fzniN4.mjs +0 -2
- package/dist/keyless-certificates-CeLnqBvX.mjs +0 -3
- package/dist/keys-DkVdS2lF.mjs +0 -2
- package/dist/kv-gDAN50BQ.mjs +0 -5
- package/dist/leaked-credential-checks-DfnvHpvg.mjs +0 -4
- package/dist/load-balancers-m0HqyXPZ.mjs +0 -6
- package/dist/local-BwL_gesw.mjs +0 -2
- package/dist/logo-matches-DPbHlsKQ.mjs +0 -2
- package/dist/logos-DFBJFAYJ.mjs +0 -3
- package/dist/logpush-gzmlZayc.mjs +0 -4
- package/dist/logs-BuzwQgt5.mjs +0 -18
- package/dist/magic-cloud-networking-BbHCi1Vp.mjs +0 -5
- package/dist/magic-network-monitoring-kWMmnPTG.mjs +0 -4
- package/dist/magic-transit-ClSmJDKw.mjs +0 -111
- package/dist/managed-defense-EOihg1UR.mjs +0 -2
- package/dist/managed-transforms-BZ_XdGE2.mjs +0 -3
- package/dist/matches-B6sG0_fr.mjs +0 -2
- package/dist/mcp--kK0vS5i.mjs +0 -4
- package/dist/mesh-DfXYUHOO.mjs +0 -4
- package/dist/mtls-certificates-DZd-0X7l.mjs +0 -3
- package/dist/network-U6f_5ihp.mjs +0 -6
- package/dist/network-interconnects-DKZGTiYM.mjs +0 -41
- package/dist/oauth-BdVr2hJp.mjs +0 -14
- package/dist/oauth-clients-CY3OkPhC.mjs +0 -4
- package/dist/oauth-scopes-BTY7_5L-.mjs +0 -2
- package/dist/observability-Bsp-LdmJ.mjs +0 -10
- package/dist/organization-BSeMdj-7.mjs +0 -45
- package/dist/organizations-BroR48Nv.mjs +0 -2
- package/dist/origin-ca-certificates-jC-EMn6W.mjs +0 -3
- package/dist/origin-post-quantum-encryption-DIspLvA0.mjs +0 -2
- package/dist/origin-tls-client-auth-CZ_nUEcM.mjs +0 -4
- package/dist/page-rules-ZcdjPohY.mjs +0 -27
- package/dist/pages-W4tKa7xk.mjs +0 -14
- package/dist/pay-per-crawl-BNM1mJmP.mjs +0 -5
- package/dist/pay-per-use-DKxlnkH3.mjs +0 -2
- package/dist/pipelines-Dug0BR-c.mjs +0 -6
- package/dist/precursor-D-11DkRU.mjs +0 -4
- package/dist/previews-D_Nv4dR6.mjs +0 -4
- package/dist/progress-a5IKeKni.mjs +0 -2
- package/dist/queries-BdA2vJoe.mjs +0 -3
- package/dist/queues-Bu06ZqUE.mjs +0 -7
- package/dist/r2-COC9wMKb.mjs +0 -25
- package/dist/r2-data-catalog-CX5Rl5Qx.mjs +0 -16
- package/dist/radar-L-yoLIHF.mjs +0 -2
- package/dist/realtime-JKIiXfzi.mjs +0 -20
- package/dist/registrar-_dYUZrK0.mjs +0 -43
- package/dist/registrar-sandbox-D1yfW_Q_.mjs +0 -56
- package/dist/reporting-3fyoMcmb.mjs +0 -2
- package/dist/request-headers-BhQQAfJt.mjs +0 -2
- package/dist/request-tracers-TisEth2p.mjs +0 -2
- package/dist/resolve-CYUp6YgC.mjs +0 -2
- package/dist/resource-sharing-C4-dnohU.mjs +0 -6
- package/dist/resource-tagging-BRDifKqM.mjs +0 -2
- package/dist/rules-BCF3gIkw.mjs +0 -4
- package/dist/rulesets-wp6rllt3.mjs +0 -5
- package/dist/rum-B77awgoB.mjs +0 -4
- package/dist/run-BS8otL3u.mjs +0 -2
- package/dist/scim-C9BmUYil.mjs +0 -4
- package/dist/secrets-store-ckkZR2dM.mjs +0 -7
- package/dist/security-center-BCahKT57.mjs +0 -2
- package/dist/security-txt-0SI5du7I.mjs +0 -3
- package/dist/shared-D0B-7q-D.mjs +0 -2
- package/dist/smart-shield-BDPbrZa4.mjs +0 -4
- package/dist/snippets-CVRR_h0i.mjs +0 -4
- package/dist/spawn-DP4T92ss.mjs +0 -519
- package/dist/spectrum-CjNXQIQE.mjs +0 -63
- package/dist/speed-CrXCHk3h.mjs +0 -4
- package/dist/src-BbnV77C4.mjs +0 -108
- package/dist/ssl-DKORhHkh.mjs +0 -15
- package/dist/startup-profile-CBIH6yZy.mjs +0 -17
- package/dist/state-QUu6HfxC.mjs +0 -2
- package/dist/stream-wY3zi3FK.mjs +0 -16
- package/dist/submit-B-4oCBSk.mjs +0 -2
- package/dist/tags-5uJEkYJZ.mjs +0 -2
- package/dist/telemetry-n3NJourL.mjs +0 -2
- package/dist/tenant-BkFvv2o3.mjs +0 -2
- package/dist/tenant-custom-nameservers-DcjC1q0r.mjs +0 -3
- package/dist/tunnel-Cd4ipbvJ.mjs +0 -2
- package/dist/tunnels-9Zg3ePwD.mjs +0 -5
- package/dist/turnstile-BTwKYpzD.mjs +0 -23
- package/dist/ui-DQSZeaG5.mjs +0 -5
- package/dist/url-info-D7Y61BFd.mjs +0 -2
- package/dist/url-normalization-B4n8HiNQ.mjs +0 -3
- package/dist/url-scanner-CiCIltSQ.mjs +0 -2
- package/dist/user-DDFDGJ0Y.mjs +0 -12
- package/dist/values-DRznB_Cl.mjs +0 -2
- package/dist/vectorize-CbznPhzq.mjs +0 -4
- package/dist/waiting-rooms-CKP5hYBK.mjs +0 -11
- package/dist/web-assets-C-ZoSkkh.mjs +0 -8
- package/dist/web3-DwlN4dOw.mjs +0 -4
- package/dist/workers-builds-ECw_x_kp.mjs +0 -2
- package/dist/workers-for-platforms-BYGy46R6.mjs +0 -5
- package/dist/workers-vpc-CCosFcxz.mjs +0 -3
- package/dist/workers-zFMrbUkg.mjs +0 -6
- package/dist/workflows-C8GXGDRW.mjs +0 -5
- package/dist/zaraz-B5UIREaz.mjs +0 -2
- package/dist/zero-trust-DUp0XoIo.mjs +0 -91
- package/dist/zone-BGLkk-mL.mjs +0 -2
- package/dist/zones-CwYjNXMH.mjs +0 -44
- /package/dist/{alerts-CarPLL8k.mjs → alerts-CstOk8n0.mjs} +0 -0
- /package/dist/{autorag-zK-3harf.mjs → autorag-PRTwXGgn.mjs} +0 -0
- /package/dist/{body-parser-Cmw7PZ7a.mjs → body-parser-CUWbw_Tq.mjs} +0 -0
- /package/dist/{brands-CpgTsX8h.mjs → brands-BHRXlWDm.mjs} +0 -0
- /package/dist/{clear-C5gzBA8G.mjs → clear-UvKESVx3.mjs} +0 -0
- /package/dist/{cli-types-abvWQN3T.mjs → cli-types-tt_LZMbn.mjs} +0 -0
- /package/dist/{connector-telemetry-events-latest-BY-dbhQZ.mjs → connector-telemetry-events-latest-DwnFeZg0.mjs} +0 -0
- /package/dist/{connector-telemetry-snapshots-latest-DoMvHvCO.mjs → connector-telemetry-snapshots-latest-Dv6rZlxs.mjs} +0 -0
- /package/dist/{domain-info-Cw3G4nap.mjs → domain-info-BqTDXNBo.mjs} +0 -0
- /package/dist/{health-DkEXPkS6.mjs → health-CwPzzrV6.mjs} +0 -0
- /package/dist/{input-validation-nF-0Ze2h.mjs → input-validation-Ch4Vllrm.mjs} +0 -0
- /package/dist/{internal-4fU2r5en.mjs → internal-WLHfxX64.mjs} +0 -0
- /package/dist/{live-B4iGrwY2.mjs → live-D_k7eHdv.mjs} +0 -0
- /package/dist/{metadata-C5fJJr-k.mjs → metadata-APBiectA.mjs} +0 -0
- /package/dist/{project-settings-Bc3wYHo8.mjs → project-settings-DSXevRvj.mjs} +0 -0
- /package/dist/{rate-limit-analytics-DNsAFIeM.mjs → rate-limit-analytics-CDTPxSET.mjs} +0 -0
- /package/dist/{rate-limits-CsOim7bm.mjs → rate-limits-C3K9smdl.mjs} +0 -0
- /package/dist/{ready-tTe-zcIw.mjs → ready-CvwvbdTX.mjs} +0 -0
- /package/dist/{recent-submissions-B3eTV5yC.mjs → recent-submissions-CjzcT-iH.mjs} +0 -0
- /package/dist/{refute-BY76YVrT.mjs → refute-CIAFMj00.mjs} +0 -0
- /package/dist/{scan-logo-DdoF_a5y.mjs → scan-logo-zFkphtQ3.mjs} +0 -0
- /package/dist/{scan-page-sSgLwwZN.mjs → scan-page-CLl2MAkZ.mjs} +0 -0
- /package/dist/{search-BFvQr-sl.mjs → search-12jA1b4l.mjs} +0 -0
- /package/dist/{signed-url-Cr8hiZPJ.mjs → signed-url-U0T_PEMR.mjs} +0 -0
- /package/dist/{submission-info-DT2mLnu1.mjs → submission-info-CZ84a3Nb.mjs} +0 -0
- /package/dist/{theme-CeVf-5qG.mjs → theme-BiIYWOed.mjs} +0 -0
- /package/dist/{total-queries-6gs5iy9T.mjs → total-queries-CJTc9Pde.mjs} +0 -0
- /package/dist/{tracked-domains-D6XKO2EV.mjs → tracked-domains-BKLxnnSv.mjs} +0 -0
- /package/dist/{verify-CM1NakP0.mjs → verify-CZW5Fo1q.mjs} +0 -0
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-BwL_gesw.mjs";import{f as t,g as n,h as r}from"./oauth-BdVr2hJp.mjs";import{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{n as l,r as u,t as d}from"./body-parser-Cmw7PZ7a.mjs";import{n as f}from"./input-validation-nF-0Ze2h.mjs";import{n as p}from"./prompt-BP8XrQSj.mjs";import{t as m}from"./cli-types-abvWQN3T.mjs";function h(e){return e.option(`configuration-target`,{type:`string`,description:"The configuration target. You must set the target to `ip` when specifying an IP address in the rule.",choices:[`ip`,`ip6`,`ip_range`,`asn`,`country`]}).option(`configuration-value`,{type:`string`,description:`The IP address to match. This address will be compared to the IP address of incoming requests.`}).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:`Creates a new IP Access rule for an account or zone. The rule will apply to all zones in the account or zone. Note: To create an IP Access rule that applies to a single zone, refer to the [IP Access rules for a zone](#ip-access-rules-for-a-zone) endpoints.`,builder:h,handler:async u=>c({command:`firewall access-rules create`,classification:{safeFlags:[`configuration-target`,`dry-run`]}},u,async()=>{if(u.dryRun){let e=u.zone===void 0?await n():void 0,t=u.zone===void 0?`accounts`:`zones`,r=u.zone??e??`<account-id>`;o({command:`cf firewall access-rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/firewall/access_rules/rules`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:u.body===void 0?d({configuration:{target:f(u[`configuration-target`],`configuration-target`,`text`),value:f(u[`configuration-value`],`configuration-value`,`text`)}}):l(u.body)});return}let c=await i(u),p=u.zone===void 0?`accounts`:`zones`,m=p===`zones`?await r({zone:u.zone},c,{quiet:u.quiet}):u.local?e:await t();if(p===`zones`?u.zoneId=m:u.accountId=m,u.body){let e=l(u.body);a(await s(`Creating`,async()=>c.firewall.accessRules.create({...e,account_or_zone:p,account_or_zone_id:m})),{successLabel:`Created`});return}let h=d({configuration:{target:f(u[`configuration-target`],`configuration-target`,`text`),value:f(u[`configuration-value`],`configuration-value`,`text`)}});a(await s(`Creating`,async()=>c.firewall.accessRules.create({...h,account_or_zone:p,account_or_zone_id:m})),{successLabel:`Created`})})};function g(e){return e.positional(`rule-id`,{type:`string`,description:`Unique identifier for a rule.`,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 <rule-id>`,describe:`Deletes an existing IP Access rule defined. Note: This operation will affect all zones in the account or zone.`,builder:g,handler:async l=>c({command:`firewall access-rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf firewall access-rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/firewall/access_rules/rules/${l[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(l[`rule-id`]))}`,pathParams:{"account-or-zone":String(t),"rule-id":String(l[`rule-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await t();if(u===`zones`?l.zoneId=d:l.accountId=d,!await p({force:!!l.force,message:`This operation deletes the account-level IP Access Rule and affects every zone in the account.`})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}a(await s(`Deleting`,async()=>c.firewall.accessRules.delete({account_or_zone:u,account_or_zone_id:d,rule_id:l[`rule-id`]})),{successLabel:`Deleted`})})};function v(e){return e.positional(`rule-id`,{type:`string`,description:`Unique identifier for a rule.`,demandOption:!0}).option(`configuration-target`,{type:`string`,description:"The configuration target. You must set the target to `ip` when specifying an IP address in the rule.",choices:[`ip`,`ip6`,`ip_range`,`asn`,`country`]}).option(`configuration-value`,{type:`string`,description:`The IP address to match. This address will be compared to the IP address of incoming requests.`}).option(`notes`,{type:`string`,description:`An informative summary of the rule, typically used as a reminder or explanation.`}).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:`edit <rule-id>`,describe:`Updates an IP Access rule defined. Note: This operation will affect all zones in the account or zone.`,builder:v,handler:async u=>c({command:`firewall access-rules edit`,classification:{safeFlags:[`configuration-target`,`dry-run`]}},u,async()=>{if(u.dryRun){let e=u.zone===void 0?await n():void 0,t=u.zone===void 0?`accounts`:`zones`,r=u.zone??e??`<account-id>`;o({command:`cf firewall access-rules edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/firewall/access_rules/rules/${u[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(u[`rule-id`]))}`,pathParams:{"account-or-zone":String(t),"rule-id":String(u[`rule-id`]??``),"account-or-zone-id":String(r)},bodyKind:`json`,body:u.body===void 0?d({configuration:{target:f(u[`configuration-target`],`configuration-target`,`text`),value:f(u[`configuration-value`],`configuration-value`,`text`)},notes:f(u.notes,`notes`,`text`)}):l(u.body)});return}let c=await i(u),p=u.zone===void 0?`accounts`:`zones`,m=p===`zones`?await r({zone:u.zone},c,{quiet:u.quiet}):u.local?e:await t();if(p===`zones`?u.zoneId=m:u.accountId=m,u.body){let e=l(u.body);a(await s(`Updating`,async()=>c.firewall.accessRules.edit({body:e,account_or_zone:p,account_or_zone_id:m,rule_id:u[`rule-id`]})),{successLabel:`Updated`});return}let h=d({configuration:{target:f(u[`configuration-target`],`configuration-target`,`text`),value:f(u[`configuration-value`],`configuration-value`,`text`)},notes:f(u.notes,`notes`,`text`)});a(await s(`Updating`,async()=>c.firewall.accessRules.edit({body:h,account_or_zone:p,account_or_zone_id:m,rule_id:u[`rule-id`]})),{successLabel:`Updated`})})};function b(e){return e.positional(`rule-id`,{type:`string`,description:`Unique identifier for a rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get <rule-id>`,describe:`Fetches the details of an IP Access rule defined.`,builder:b,handler:async l=>c({command:`firewall access-rules get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf firewall access-rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/firewall/access_rules/rules/${l[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(l[`rule-id`]))}`,pathParams:{"account-or-zone":String(t),"rule-id":String(l[`rule-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await t();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.firewall.accessRules.get({account_or_zone:u,account_or_zone_id:d,rule_id:l[`rule-id`]})),{successLabel:`Loaded`})})};function S(e){return e.option(`configuration-target`,{type:`string`,description:`Defines the target to search in existing rules.`,choices:[`ip`,`ip_range`,`asn`,`country`]}).option(`configuration-value`,{type:`string`,description:"Defines the target value to search for in existing rules: an IP address, an IP address range, or a country code, depending on the provided `configuration.target`.\nNotes: You can search for a single IPv4 address, an IP address range with a subnet of '/16' or '/24', or a two-letter ISO-3166-1 alpha-2 country code."}).option(`notes`,{type:`string`,description:`Defines the string to search for in the notes of existing IP Access rules.
|
|
4
|
-
Notes: For example, the string 'attack' would match IP Access rules with notes 'Attack 26/02' and 'Attack 27/02'. The search is case insensitive.`}).option(`match`,{type:`string`,description:"Defines the search requirements. When set to `all`, all the search requirements must match. When set to `any`, only one of the search requirements has to match.",choices:[`any`,`all`]}).option(`page`,{type:`number`,description:`Defines the requested page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`Defines the maximum number of results requested.`}).option(`order`,{type:`string`,description:`Defines the field used to sort returned rules.`,choices:[`configuration.target`,`configuration.value`,`mode`]}).option(`direction`,{type:`string`,description:`Defines the direction used to sort returned rules.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`list`,describe:`Fetches IP Access rules of an account or zone. These rules apply to all the zones in the account or zone. You can filter the results using several optional parameters.`,builder:m(S),handler:async l=>c({command:`firewall access-rules list`,classification:{safeFlags:[`configuration-target`,`match`,`order`,`direction`,`dry-run`]}},l,async()=>{let c={"configuration.target":l[`configuration-target`],"configuration.value":l[`configuration-value`],notes:l.notes,match:l.match,page:l.page,per_page:l[`per-page`],order:l.order,direction:l.direction};if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf firewall access-rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/firewall/access_rules/rules`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:c,bodyKind:`none`});return}let u=await i(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await t();d===`zones`?l.zoneId=f:l.accountId=f,a(await s(`Loading`,async()=>u.firewall.accessRules.list({account_or_zone:d,account_or_zone_id:f,...c})),{successLabel:`Loaded`})})},w={command:`access-rules`,describe:`IP-based access rules that allow, block, challenge, or whitelist traffic globally or per-zone`,builder:e=>e.command(ee).command(_).command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.option(`id`,{type:`string`,description:`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 E={command:`bulk-delete`,describe:`Deletes one or more existing filters.`,builder:T,handler:async e=>c({command:`firewall filters bulk-delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let t={id:e.id};if(e.dryRun){o({command:`cf firewall filters bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/filters`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await i(e),c=await r({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=c,!await p({force:!!e.force})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}a(await s(`Deleting`,async()=>n.firewall.filters.bulkDelete({zone_id:c,...t})),{successLabel:`Deleted`})})};function D(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const O={command:`bulk-update`,describe:`Updates one or more existing filters.`,builder:D,handler:async e=>c({command:`firewall filters bulk-update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf firewall filters bulk-update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/filters`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:l(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);a(await s(`Updating`,async()=>t.firewall.filters.bulkUpdate({body:r,zone_id:n})),{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function k(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const A={command:`create`,describe:`Creates one or more filters.`,builder:k,handler:async e=>c({command:`firewall filters create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf firewall filters create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/filters`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:l(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);a(await s(`Creating`,async()=>t.firewall.filters.create({body:r,zone_id:n})),{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function j(e){return e.positional(`filter-id`,{type:`string`,description:`The unique identifier of the filter.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const M={command:`delete <filter-id>`,describe:`Deletes an existing filter.`,builder:j,handler:async e=>c({command:`firewall filters delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){o({command:`cf firewall filters delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/filters/${e[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(e[`filter-id`]))}`,pathParams:{"filter-id":String(e[`filter-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await p({force:!!e.force})){process.stderr.write(`Aborted.
|
|
6
|
-
`);return}a(await s(`Deleting`,async()=>t.firewall.filters.delete({zone_id:n,filter_id:e[`filter-id`]})),{successLabel:`Deleted`})})};function N(e){return e.positional(`filter-id`,{type:`string`,description:`The unique identifier of the filter.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get <filter-id>`,describe:`Fetches the details of a filter.`,builder:N,handler:async e=>c({command:`firewall filters get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf firewall filters get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/filters/${e[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(e[`filter-id`]))}`,pathParams:{"filter-id":String(e[`filter-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.firewall.filters.get({zone_id:n,filter_id:e[`filter-id`]})),{successLabel:`Loaded`})})};function F(e){return e.option(`paused`,{type:`boolean`,description:`When true, indicates that the filter is currently paused.`}).option(`expression`,{type:`string`,description:`A case-insensitive string to find in the expression.`}).option(`description`,{type:`string`,description:`A case-insensitive string to find in the description.`}).option(`ref`,{type:`string`,description:`The filter ref (a short reference tag) to search for. Must be an exact match.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of filters per page.`}).option(`id`,{type:`string`,description:`The unique identifier of the filter.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`list`,describe:`Fetches filters in a zone. You can filter the results using several optional parameters.`,builder:m(F),handler:async e=>c({command:`firewall filters list`,classification:{safeFlags:[`paused`,`dry-run`]}},e,async()=>{let t={paused:e.paused,expression:e.expression,description:e.description,ref:e.ref,page:e.page,per_page:e[`per-page`],id:e.id};if(e.dryRun){o({command:`cf firewall filters list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/filters`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await i(e),c=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=c,a(await s(`Loading`,async()=>n.firewall.filters.list({zone_id:c,...t})),{successLabel:`Loaded`})})};function L(e){return e.positional(`filter-id`,{type:`string`,description:`The unique identifier of the filter.`,demandOption:!0}).option(`description`,{type:`string`,description:`An informative summary of the filter.`}).option(`expression`,{type:`string`,description:`The filter expression. For more information, refer to [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/).`}).option(`paused`,{type:`boolean`,description:`When true, indicates that the filter is currently paused.`}).option(`ref`,{type:`string`,description:`A short reference tag. Allows you to select related filters.`}).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 R={command:`update <filter-id>`,describe:`Updates an existing filter.`,builder:L,handler:async e=>c({command:`firewall filters update`,classification:{safeFlags:[`paused`,`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf firewall filters update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/filters/${e[`filter-id`]==null?`<filter-id>`:encodeURIComponent(String(e[`filter-id`]))}`,pathParams:{"filter-id":String(e[`filter-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({description:f(e.description,`description`,`text`),expression:f(e.expression,`expression`,`text`),paused:e.paused,ref:f(e.ref,`ref`,`text`)}):l(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);a(await s(`Updating`,async()=>t.firewall.filters.update({body:r,zone_id:n,filter_id:e[`filter-id`]})),{successLabel:`Updated`});return}let c=d({description:f(e.description,`description`,`text`),expression:f(e.expression,`expression`,`text`),paused:e.paused,ref:f(e.ref,`ref`,`text`)});a(await s(`Updating`,async()=>t.firewall.filters.update({body:c,zone_id:n,filter_id:e[`filter-id`]})),{successLabel:`Updated`})})},z={command:`filters`,describe:`Operations for filters`,builder:e=>e.command(E).command(O).command(A).command(M).command(P).command(I).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function te(e){return e.option(`configurations`,{type:`string`,description:"A list of IP addresses or CIDR ranges that will be allowed to access the URLs specified in the Zone Lockdown rule. You can include any number of `ip` or `ip_range` configurations. Provide as a JSON array of objects or @path/to/file.json."}).option(`description`,{type:`string`,description:`An informative summary of the rule. This value is sanitized and any tags will be removed.`}).option(`paused`,{type:`boolean`,description:`When true, indicates that the rule is currently paused.`}).option(`priority`,{type:`number`,description:`The priority of the rule to control the processing order. A lower number indicates higher priority. If not provided, any rules with a configured priority will be processed before rules without a priority.`}).option(`urls`,{type:`string`,array:!0,description:`The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`create`,describe:`Creates a new Zone Lockdown rule.`,builder:te,handler:async e=>c({command:`firewall lockdowns create`,classification:{safeFlags:[`paused`,`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf firewall lockdowns create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/lockdowns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({configurations:u(e.configurations,`configurations`),description:f(e.description,`description`,`text`),paused:e.paused,priority:e.priority,urls:e.urls}):l(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);a(await s(`Creating`,async()=>t.firewall.lockdowns.create({...r,zone_id:n})),{successLabel:`Created`});return}if(e.configurations===void 0)throw Error(`--configurations is required (or pass --body with this field set).`);if(e.urls===void 0)throw Error(`--urls is required (or pass --body with this field set).`);let c=d({configurations:u(e.configurations,`configurations`),description:f(e.description,`description`,`text`),paused:e.paused,priority:e.priority,urls:e.urls});a(await s(`Creating`,async()=>t.firewall.lockdowns.create({...c,zone_id:n})),{successLabel:`Created`})})};function V(e){return e.positional(`lock-downs-id`,{type:`string`,description:`The unique identifier of the Zone Lockdown rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const H={command:`delete <lock-downs-id>`,describe:`Deletes an existing Zone Lockdown rule.`,builder:V,handler:async e=>c({command:`firewall lockdowns delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){o({command:`cf firewall lockdowns delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/lockdowns/${e[`lock-downs-id`]==null?`<lock-downs-id>`:encodeURIComponent(String(e[`lock-downs-id`]))}`,pathParams:{"lock-downs-id":String(e[`lock-downs-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await p({force:!!e.force,message:`This operation deletes the Zone Lockdown rule from the zone.`})){process.stderr.write(`Aborted.
|
|
7
|
-
`);return}a(await s(`Deleting`,async()=>t.firewall.lockdowns.delete({zone_id:n,lock_downs_id:e[`lock-downs-id`]})),{successLabel:`Deleted`})})};function U(e){return e.positional(`lock-downs-id`,{type:`string`,description:`The unique identifier of the Zone Lockdown rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`get <lock-downs-id>`,describe:`Fetches the details of a Zone Lockdown rule.`,builder:U,handler:async e=>c({command:`firewall lockdowns get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf firewall lockdowns get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/lockdowns/${e[`lock-downs-id`]==null?`<lock-downs-id>`:encodeURIComponent(String(e[`lock-downs-id`]))}`,pathParams:{"lock-downs-id":String(e[`lock-downs-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.firewall.lockdowns.get({zone_id:n,lock_downs_id:e[`lock-downs-id`]})),{successLabel:`Loaded`})})};function G(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`description`,{type:`string`,description:`A string to search for in the description of existing rules.`}).option(`modified-on`,{type:`string`,description:`The timestamp of when the rule was last modified.`}).option(`ip`,{type:`string`,description:`A single IP address to search for in existing rules.`}).option(`priority`,{type:`number`,description:`The priority of the rule to control the processing order. A lower number indicates higher priority. If not provided, any rules with a configured priority will be processed before rules without a priority.`}).option(`uri-search`,{type:`string`,description:`A single URI to search for in the list of URLs of existing rules.`}).option(`ip-range-search`,{type:`string`,description:`A single IP address range to search for in existing rules.`}).option(`per-page`,{type:`number`,description:"The maximum number of results per page. You can only set the value to `1` or to a multiple of 5 such as `5`, `10`, `15`, or `20`."}).option(`created-on`,{type:`string`,description:`The timestamp of when the rule was created.`}).option(`description-search`,{type:`string`,description:`A string to search for in the description of existing rules.`}).option(`ip-search`,{type:`string`,description:`A single IP address to search for in existing rules.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`list`,describe:`Fetches Zone Lockdown rules. You can filter the results using several optional parameters.`,builder:G,handler:async e=>c({command:`firewall lockdowns list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={page:e.page,description:e.description,modified_on:e[`modified-on`],ip:e.ip,priority:e.priority,uri_search:e[`uri-search`],ip_range_search:e[`ip-range-search`],per_page:e[`per-page`],created_on:e[`created-on`],description_search:e[`description-search`],ip_search:e[`ip-search`]};if(e.dryRun){o({command:`cf firewall lockdowns list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/lockdowns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await i(e),c=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=c,a(await s(`Loading`,async()=>n.firewall.lockdowns.list({zone_id:c,...t})),{successLabel:`Loaded`})})};function q(e){return e.positional(`lock-downs-id`,{type:`string`,description:`The unique identifier of the Zone Lockdown rule.`,demandOption:!0}).option(`configurations`,{type:`string`,description:"A list of IP addresses or CIDR ranges that will be allowed to access the URLs specified in the Zone Lockdown rule. You can include any number of `ip` or `ip_range` configurations. Provide as a JSON array of objects or @path/to/file.json."}).option(`urls`,{type:`string`,array:!0,description:`The URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns.`}).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:`update <lock-downs-id>`,describe:`Updates an existing Zone Lockdown rule.`,builder:q,handler:async e=>c({command:`firewall lockdowns update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf firewall lockdowns update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/lockdowns/${e[`lock-downs-id`]==null?`<lock-downs-id>`:encodeURIComponent(String(e[`lock-downs-id`]))}`,pathParams:{"lock-downs-id":String(e[`lock-downs-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({configurations:u(e.configurations,`configurations`),urls:e.urls}):l(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);a(await s(`Updating`,async()=>t.firewall.lockdowns.update({...r,zone_id:n,lock_downs_id:e[`lock-downs-id`]})),{successLabel:`Updated`});return}if(e.configurations===void 0)throw Error(`--configurations is required (or pass --body with this field set).`);if(e.urls===void 0)throw Error(`--urls is required (or pass --body with this field set).`);let c=d({configurations:u(e.configurations,`configurations`),urls:e.urls});a(await s(`Updating`,async()=>t.firewall.lockdowns.update({...c,zone_id:n,lock_downs_id:e[`lock-downs-id`]})),{successLabel:`Updated`})})},Y={command:`lockdowns`,describe:`Zone lockdown rules that restrict access to URLs by IP address or range`,builder:e=>e.command(B).command(H).command(W).command(K).command(J).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function X(e){return e.option(`configuration-target`,{type:`string`,description:"The configuration target. You must set the target to `ua` when specifying a user agent in the rule.",choices:[`ua`]}).option(`configuration-value`,{type:`string`,description:`the user agent to exactly match`}).option(`description`,{type:`string`,description:`An informative summary of the rule. This value is sanitized and any tags will be removed.`}).option(`paused`,{type:`boolean`,description:`When true, indicates that the rule is currently paused.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Z={command:`create`,describe:`Creates a new User Agent Blocking rule in a zone.`,builder:X,handler:async e=>c({command:`firewall ua-rules create`,classification:{safeFlags:[`configuration-target`,`paused`,`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf firewall ua-rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/ua_rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({configuration:{target:f(e[`configuration-target`],`configuration-target`,`text`),value:f(e[`configuration-value`],`configuration-value`,`text`)},description:f(e.description,`description`,`text`),paused:e.paused}):l(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);a(await s(`Creating`,async()=>t.firewall.uaRules.create({...r,zone_id:n})),{successLabel:`Created`});return}let c=d({configuration:{target:f(e[`configuration-target`],`configuration-target`,`text`),value:f(e[`configuration-value`],`configuration-value`,`text`)},description:f(e.description,`description`,`text`),paused:e.paused});a(await s(`Creating`,async()=>t.firewall.uaRules.create({...c,zone_id:n})),{successLabel:`Created`})})};function Q(e){return e.positional(`ua-rule-id`,{type:`string`,description:`The unique identifier of the User Agent Blocking rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ne={command:`delete <ua-rule-id>`,describe:`Deletes an existing User Agent Blocking rule.`,builder:Q,handler:async e=>c({command:`firewall ua-rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){o({command:`cf firewall ua-rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/ua_rules/${e[`ua-rule-id`]==null?`<ua-rule-id>`:encodeURIComponent(String(e[`ua-rule-id`]))}`,pathParams:{"ua-rule-id":String(e[`ua-rule-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await p({force:!!e.force,message:`This operation deletes the User Agent Blocking rule from the zone.`})){process.stderr.write(`Aborted.
|
|
8
|
-
`);return}a(await s(`Deleting`,async()=>t.firewall.uaRules.delete({zone_id:n,ua_rule_id:e[`ua-rule-id`]})),{successLabel:`Deleted`})})};function re(e){return e.positional(`ua-rule-id`,{type:`string`,description:`The unique identifier of the User Agent Blocking rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`get <ua-rule-id>`,describe:`Fetches the details of a User Agent Blocking rule.`,builder:re,handler:async e=>c({command:`firewall ua-rules get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf firewall ua-rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/ua_rules/${e[`ua-rule-id`]==null?`<ua-rule-id>`:encodeURIComponent(String(e[`ua-rule-id`]))}`,pathParams:{"ua-rule-id":String(e[`ua-rule-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.firewall.uaRules.get({zone_id:n,ua_rule_id:e[`ua-rule-id`]})),{successLabel:`Loaded`})})};function ae(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`description`,{type:`string`,description:`A string to search for in the description of existing rules.`}).option(`per-page`,{type:`number`,description:"The maximum number of results per page. You can only set the value to `1` or to a multiple of 5 such as `5`, `10`, `15`, or `20`."}).option(`user-agent`,{type:`string`,description:`A string to search for in the user agent values of existing rules.`}).option(`paused`,{type:`boolean`,description:`When true, indicates that the rule is currently paused.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`list`,describe:`Fetches User Agent Blocking rules in a zone. You can filter the results using several optional parameters.`,builder:ae,handler:async e=>c({command:`firewall ua-rules list`,classification:{safeFlags:[`paused`,`dry-run`]}},e,async()=>{let t={page:e.page,description:e.description,per_page:e[`per-page`],user_agent:e[`user-agent`],paused:e.paused};if(e.dryRun){o({command:`cf firewall ua-rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/ua_rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await i(e),c=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=c,a(await s(`Loading`,async()=>n.firewall.uaRules.list({zone_id:c,...t})),{successLabel:`Loaded`})})};function $(e){return e.positional(`ua-rule-id`,{type:`string`,description:`The unique identifier of the User Agent Blocking rule.`,demandOption:!0}).option(`configuration-target`,{type:`string`,description:"The configuration target. You must set the target to `ip` when specifying an IP address in the rule.",choices:[`ip`,`ip6`,`ip_range`,`asn`,`country`]}).option(`configuration-value`,{type:`string`,description:`The IP address to match. This address will be compared to the IP address of incoming requests.`}).option(`description`,{type:`string`,description:`An informative summary of the rule. This value is sanitized and any tags will be removed.`}).option(`paused`,{type:`boolean`,description:`When true, indicates that the rule is currently paused.`}).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 se={command:`update <ua-rule-id>`,describe:`Updates an existing User Agent Blocking rule.`,builder:$,handler:async e=>c({command:`firewall ua-rules update`,classification:{safeFlags:[`configuration-target`,`paused`,`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf firewall ua-rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/ua_rules/${e[`ua-rule-id`]==null?`<ua-rule-id>`:encodeURIComponent(String(e[`ua-rule-id`]))}`,pathParams:{"ua-rule-id":String(e[`ua-rule-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({configuration:{target:f(e[`configuration-target`],`configuration-target`,`text`),value:f(e[`configuration-value`],`configuration-value`,`text`)},description:f(e.description,`description`,`text`),paused:e.paused}):l(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);a(await s(`Updating`,async()=>t.firewall.uaRules.update({...r,zone_id:n,ua_rule_id:e[`ua-rule-id`]})),{successLabel:`Updated`});return}let c=d({configuration:{target:f(e[`configuration-target`],`configuration-target`,`text`),value:f(e[`configuration-value`],`configuration-value`,`text`)},description:f(e.description,`description`,`text`),paused:e.paused});a(await s(`Updating`,async()=>t.firewall.uaRules.update({...c,zone_id:n,ua_rule_id:e[`ua-rule-id`]})),{successLabel:`Updated`})})},ce={command:`ua-rules`,describe:`Block or challenge requests based on the User-Agent header string`,builder:e=>e.command(Z).command(ne).command(ie).command(oe).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function le(e){return e.positional(`package-id`,{type:`string`,description:`Defines a package identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ue={command:`get <package-id>`,describe:`Fetches the details of a WAF package. **Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).`,builder:le,handler:async e=>c({command:`firewall waf packages get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf firewall waf packages get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/waf/packages/${e[`package-id`]==null?`<package-id>`:encodeURIComponent(String(e[`package-id`]))}`,pathParams:{"package-id":String(e[`package-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.firewall.waf.packages.get({zone_id:n,package_id:e[`package-id`]})),{successLabel:`Loaded`})})};function de(e){return e.option(`page`,{type:`number`,description:`The page number of paginated results.`}).option(`per-page`,{type:`number`,description:`The number of packages per page.`}).option(`order`,{type:`string`,description:`The field used to sort returned packages.`,choices:[`name`]}).option(`direction`,{type:`string`,description:`The direction used to sort returned packages.`,choices:[`asc`,`desc`]}).option(`match`,{type:`string`,description:"When set to `all`, all the search requirements must match. When set to `any`, only one of the search requirements has to match.",choices:[`any`,`all`]}).option(`name`,{type:`string`,description:`The name of the WAF package.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fe={command:`list`,describe:`Fetches WAF packages for a zone. **Note:** Applies only to the [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).`,builder:m(de),handler:async e=>c({command:`firewall waf packages list`,classification:{safeFlags:[`order`,`direction`,`match`,`dry-run`]}},e,async()=>{let t={page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction,match:e.match,name:e.name};if(e.dryRun){o({command:`cf firewall waf packages list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/firewall/waf/packages`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await i(e),c=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=c,a(await s(`Loading`,async()=>n.firewall.waf.packages.list({zone_id:c,...t})),{successLabel:`Loaded`})})},pe={command:`packages`,describe:`Operations for waf.packages`,builder:e=>e.command(ue).command(fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},me={command:`waf`,describe:`Legacy WAF managed rule packages, rule groups, individual rules, and override configurations`,builder:e=>e.command(pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},he={command:`firewall`,describe:`Legacy firewall rules, zone lockdowns, access rules, user-agent blocking, and WAF packages`,builder:e=>e.command(w).command(z).command(Y).command(ce).command(me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{he as default};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
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{n as l,r as u,t as d}from"./body-parser-Cmw7PZ7a.mjs";import{n as f}from"./input-validation-nF-0Ze2h.mjs";import{a as p,n as m}from"./prompt-BP8XrQSj.mjs";function h(e){return e.option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`create`,describe:"Creates an app. The returned `id` is used in all subsequent flag, changelog, and evaluation requests.",builder:h,handler:async r=>c({command:`flagship apps create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf flagship apps create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/flagship/apps`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({name:f(r.name,`name`,`text`)}):l(r.body)});return}let c=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Creating`,async()=>c.flagship.apps.create({...e,account_id:u})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await p(`name`,`The name field`));let m=d({name:f(r.name,`name`,`text`)});a(await s(`Creating`,async()=>c.flagship.apps.create({...m,account_id:u})),{successLabel:`Created`})})};function _(e){return e.positional(`app-id`,{type:`string`,description:`App identifier.`,demandOption:!0}).option(`if-none-match`,{type:`string`,description:"Previously returned ETag, or `*`."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <app-id>`,describe:"Returns an app's evaluation-only flag definitions for SDKs that evaluate locally. Send the returned `ETag` in `If-None-Match` to avoid downloading unchanged definitions.",builder:_,handler:async l=>c({command:`flagship apps definitions get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`if-none-match`]!==void 0&&(c[`If-None-Match`]=String(l[`if-none-match`])),l.dryRun){o({command:`cf flagship apps definitions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/flagship/apps/${l[`app-id`]==null?`<app-id>`:encodeURIComponent(String(l[`app-id`]))}/definitions`,pathParams:{"app-id":String(l[`app-id`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await t();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/flagship/apps/${encodeURIComponent(String(l[`app-id`]))}/definitions`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})},y={command:`definitions`,describe:`Operations for apps.definitions`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.positional(`app-id`,{type:`string`,description:`App 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 x={command:`delete <app-id>`,describe:`Deletes an app and all its flags and changelog history. Returns 409 if any Worker still references this app via a Flagship binding.`,builder:b,handler:async r=>c({command:`flagship apps delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf flagship apps delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/flagship/apps/${r[`app-id`]==null?`<app-id>`:encodeURIComponent(String(r[`app-id`]))}`,pathParams:{"app-id":String(r[`app-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await m({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}a(await s(`Deleting`,async()=>c.flagship.apps.delete({account_id:l,app_id:r[`app-id`]})),{successLabel:`Deleted`})})};function S(e){return e.positional(`app-id`,{type:`string`,description:`App identifier.`,demandOption:!0}).option(`flag-key`,{type:`string`,description:`The flagKey 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 C={command:`create <app-id>`,describe:`Evaluates a flag against the provided context, passed as a JSON request body (OFREP-shaped) rather than query parameters. Returns the same response shape as the GET variant.`,builder:S,handler:async r=>c({command:`flagship apps evaluate create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf flagship apps evaluate create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/flagship/apps/${r[`app-id`]==null?`<app-id>`:encodeURIComponent(String(r[`app-id`]))}/evaluate`,pathParams:{"app-id":String(r[`app-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({flagKey:f(r[`flag-key`],`flag-key`,`text`)}):l(r.body)});return}let c=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Creating`,async()=>c.flagship.apps.evaluate.create({...e,account_id:u,app_id:r[`app-id`]})),{successLabel:`Created`});return}r[`flag-key`]===void 0&&(r[`flag-key`]=await p(`flag-key`,`The flagKey field`));let m=d({flagKey:f(r[`flag-key`],`flag-key`,`text`)});a(await s(`Creating`,async()=>c.flagship.apps.evaluate.create({...m,account_id:u,app_id:r[`app-id`]})),{successLabel:`Created`})})};function w(e){return e.positional(`app-id`,{type:`string`,description:`App identifier.`,demandOption:!0}).option(`flag-key`,{type:`string`,description:`The flag key to evaluate.`,demandOption:!0}).option(`targeting-key`,{type:`string`,description:`Context targeting key (per OpenFeature spec); used for percentage rollout bucketing.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get <app-id>`,describe:`Evaluates a flag against the provided context. Pass context attributes as query parameters; values are forwarded as strings. For low-latency in-Worker evaluation, prefer the Flagship binding over this endpoint.`,builder:w,handler:async r=>c({command:`flagship apps evaluate get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={flagKey:r[`flag-key`],targetingKey:r[`targeting-key`]};if(r.dryRun){o({command:`cf flagship apps evaluate get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/flagship/apps/${r[`app-id`]==null?`<app-id>`:encodeURIComponent(String(r[`app-id`]))}/evaluate`,pathParams:{"app-id":String(r[`app-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.flagship.apps.evaluate.get({account_id:u,app_id:r[`app-id`],...c})),{successLabel:`Loaded`})})},E={command:`evaluate`,describe:`Operations for apps.evaluate`,builder:e=>e.command(C).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function D(e){return e.option(`app-id`,{type:`string`,description:`App identifier.`,demandOption:!0}).option(`flag-key`,{type:`string`,description:`Flag key (slug).`,demandOption:!0}).option(`limit`,{type:`string`,description:`Max items to return (1–200).`}).option(`cursor`,{type:`string`,description:`Pagination cursor from a previous response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`list`,describe:"Returns the audit history for a flag, newest first. Each entry includes the event type and full flag state after the change; `update` entries include a field-level diff. Capped at 200 entries per flag.",builder:D,handler:async r=>c({command:`flagship apps flags changelog list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={limit:r.limit,cursor:r.cursor};if(r.dryRun){o({command:`cf flagship apps flags changelog list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/flagship/apps/${r[`app-id`]==null?`<app-id>`:encodeURIComponent(String(r[`app-id`]))}/flags/${r[`flag-key`]==null?`<flag-key>`:encodeURIComponent(String(r[`flag-key`]))}/changelog`,pathParams:{"app-id":String(r[`app-id`]??``),"flag-key":String(r[`flag-key`]??``)},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.flagship.apps.flags.changelog.list({account_id:u,app_id:r[`app-id`],flag_key:r[`flag-key`],...c})),{successLabel:`Loaded`})})},k={command:`changelog`,describe:`Operations for apps.flags.changelog`,builder:e=>e.command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.positional(`app-id`,{type:`string`,description:`App identifier.`,demandOption:!0}).option(`default-variation`,{type:`string`,description:"Variation the API serves when the flag is off, or when it's on but no rule matches the context. Must be a key in `variations`."}).option(`description`,{type:`string`,description:`The description field`}).option(`enabled`,{type:`boolean`,description:"When false, the flag bypasses all rules and always serves `default_variation`."}).option(`key`,{type:`string`,description:`Unique identifier for the flag within an app. Used in all evaluation and SDK calls.`}).option(`rules`,{type:`string`,description:"Targeting rules evaluated in ascending `priority`; the first matching rule wins. An empty array means the flag always serves `default_variation`. Provide as a JSON array of objects or @path/to/file.json."}).option(`type`,{type:`string`,description:`Deprecated compatibility field. Omit it; the API ignores this value and infers the type from the flag's variations.`,choices:[`boolean`,`string`,`number`,`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 j={command:`create <app-id>`,describe:"Creates a flag. Returns 409 if the key already exists. `type` is always inferred from variation values; legacy request-side values are ignored.",builder:A,handler:async r=>c({command:`flagship apps flags create`,classification:{safeFlags:[`enabled`,`type`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf flagship apps flags create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/flagship/apps/${r[`app-id`]==null?`<app-id>`:encodeURIComponent(String(r[`app-id`]))}/flags`,pathParams:{"app-id":String(r[`app-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({default_variation:f(r[`default-variation`],`default-variation`,`text`),description:f(r.description,`description`,`text`),enabled:r.enabled,key:f(r.key,`key`,`text`),rules:u(r.rules,`rules`),type:f(r.type,`type`,`text`)}):l(r.body)});return}let c=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=l(r.body);a(await s(`Creating`,async()=>c.flagship.apps.flags.create({...e,account_id:m,app_id:r[`app-id`]})),{successLabel:`Created`});return}if(r[`default-variation`]===void 0&&(r[`default-variation`]=await p(`default-variation`,"Variation the API serves when the flag is off, or when it's on but no rule matches the context. Must be a key in `variations`.")),r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);if(r.key===void 0&&(r.key=await p(`key`,`Unique identifier for the flag within an app. Used in all evaluation and SDK calls.`)),r.rules===void 0)throw Error(`--rules is required (or pass --body with this field set).`);let h=d({default_variation:f(r[`default-variation`],`default-variation`,`text`),description:f(r.description,`description`,`text`),enabled:r.enabled,key:f(r.key,`key`,`text`),rules:u(r.rules,`rules`),type:f(r.type,`type`,`text`)});a(await s(`Creating`,async()=>c.flagship.apps.flags.create({...h,account_id:m,app_id:r[`app-id`]})),{successLabel:`Created`})})};function M(e){return e.positional(`flag-key`,{type:`string`,description:`Flag key (slug).`,demandOption:!0}).option(`app-id`,{type:`string`,description:`App 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 N={command:`delete <flag-key>`,describe:`Deletes a flag permanently. Subsequent evaluations fall back to the caller-supplied default. Cannot be undone.`,builder:M,handler:async r=>c({command:`flagship apps flags delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf flagship apps flags delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/flagship/apps/${r[`app-id`]==null?`<app-id>`:encodeURIComponent(String(r[`app-id`]))}/flags/${r[`flag-key`]==null?`<flag-key>`:encodeURIComponent(String(r[`flag-key`]))}`,pathParams:{"app-id":String(r[`app-id`]??``),"flag-key":String(r[`flag-key`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await m({force:!!r.force})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}a(await s(`Deleting`,async()=>c.flagship.apps.flags.delete({account_id:l,app_id:r[`app-id`],flag_key:r[`flag-key`]})),{successLabel:`Deleted`})})};function P(e){return e.positional(`flag-key`,{type:`string`,description:`Flag key (slug).`,demandOption:!0}).option(`app-id`,{type:`string`,description:`App identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`get <flag-key>`,describe:`Returns the full flag definition including rules, variations, and audit fields.`,builder:P,handler:async r=>c({command:`flagship apps flags get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf flagship apps flags get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/flagship/apps/${r[`app-id`]==null?`<app-id>`:encodeURIComponent(String(r[`app-id`]))}/flags/${r[`flag-key`]==null?`<flag-key>`:encodeURIComponent(String(r[`flag-key`]))}`,pathParams:{"app-id":String(r[`app-id`]??``),"flag-key":String(r[`flag-key`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.flagship.apps.flags.get({account_id:l,app_id:r[`app-id`],flag_key:r[`flag-key`]})),{successLabel:`Loaded`})})};function I(e){return e.option(`app-id`,{type:`string`,description:`App identifier.`,demandOption:!0}).option(`limit`,{type:`string`,description:`Max items to return (1–200).`}).option(`cursor`,{type:`string`,description:`Pagination cursor from a previous response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`list`,describe:"Lists an app's flags ordered by key. Pass `cursor` from `result_info` to page forward; a null cursor indicates the last page.",builder:I,handler:async r=>c({command:`flagship apps flags list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={limit:r.limit,cursor:r.cursor};if(r.dryRun){o({command:`cf flagship apps flags list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/flagship/apps/${r[`app-id`]==null?`<app-id>`:encodeURIComponent(String(r[`app-id`]))}/flags`,pathParams:{"app-id":String(r[`app-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.flagship.apps.flags.list({account_id:u,app_id:r[`app-id`],...c})),{successLabel:`Loaded`})})};function R(e){return e.positional(`flag-key`,{type:`string`,description:`Flag key (slug).`,demandOption:!0}).option(`app-id`,{type:`string`,description:`App identifier.`,demandOption:!0}).option(`default-variation`,{type:`string`,description:"Variation the API serves when the flag is off, or when it's on but no rule matches the context. Must be a key in `variations`."}).option(`description`,{type:`string`,description:`The description field`}).option(`enabled`,{type:`boolean`,description:"When false, the flag bypasses all rules and always serves `default_variation`."}).option(`key`,{type:`string`,description:`Unique identifier for the flag within an app. Used in all evaluation and SDK calls.`}).option(`rules`,{type:`string`,description:"Targeting rules evaluated in ascending `priority`; the first matching rule wins. An empty array means the flag always serves `default_variation`. Provide as a JSON array of objects or @path/to/file.json."}).option(`type`,{type:`string`,description:`Deprecated compatibility field. Omit it; the API ignores this value and infers the type from the flag's variations.`,choices:[`boolean`,`string`,`number`,`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 z={command:`update <flag-key>`,describe:`Replaces the entire flag definition. Omitted fields are dropped, not preserved — read before writing. Each update appends a changelog entry.`,builder:R,handler:async r=>c({command:`flagship apps flags update`,classification:{safeFlags:[`enabled`,`type`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf flagship apps flags update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/flagship/apps/${r[`app-id`]==null?`<app-id>`:encodeURIComponent(String(r[`app-id`]))}/flags/${r[`flag-key`]==null?`<flag-key>`:encodeURIComponent(String(r[`flag-key`]))}`,pathParams:{"app-id":String(r[`app-id`]??``),"flag-key":String(r[`flag-key`]??``)},bodyKind:`json`,body:r.body===void 0?d({default_variation:f(r[`default-variation`],`default-variation`,`text`),description:f(r.description,`description`,`text`),enabled:r.enabled,key:f(r.key,`key`,`text`),rules:u(r.rules,`rules`),type:f(r.type,`type`,`text`)}):l(r.body)});return}let c=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.flagship.apps.flags.update({...e,account_id:m,app_id:r[`app-id`],flag_key:r[`flag-key`]})),{successLabel:`Updated`});return}if(r[`default-variation`]===void 0&&(r[`default-variation`]=await p(`default-variation`,"Variation the API serves when the flag is off, or when it's on but no rule matches the context. Must be a key in `variations`.")),r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);if(r.key===void 0&&(r.key=await p(`key`,`Unique identifier for the flag within an app. Used in all evaluation and SDK calls.`)),r.rules===void 0)throw Error(`--rules is required (or pass --body with this field set).`);let h=d({default_variation:f(r[`default-variation`],`default-variation`,`text`),description:f(r.description,`description`,`text`),enabled:r.enabled,key:f(r.key,`key`,`text`),rules:u(r.rules,`rules`),type:f(r.type,`type`,`text`)});a(await s(`Updating`,async()=>c.flagship.apps.flags.update({...h,account_id:m,app_id:r[`app-id`],flag_key:r[`flag-key`]})),{successLabel:`Updated`})})},B={command:`flags`,describe:`Operations for apps.flags`,builder:e=>e.command(j).command(N).command(F).command(L).command(z).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.positional(`app-id`,{type:`string`,description:`App identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get <app-id>`,describe:`Returns an app's name and audit fields. Flag definitions are not included.`,builder:V,handler:async r=>c({command:`flagship apps get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf flagship apps get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/flagship/apps/${r[`app-id`]==null?`<app-id>`:encodeURIComponent(String(r[`app-id`]))}`,pathParams:{"app-id":String(r[`app-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.flagship.apps.get({account_id:l,app_id:r[`app-id`]})),{successLabel:`Loaded`})})};function U(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`list`,describe:`Lists all apps in the account. Returns identity and audit fields only — flag definitions are not included.`,builder:U,handler:async r=>c({command:`flagship apps list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf flagship apps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/flagship/apps`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.flagship.apps.list({account_id:l})),{successLabel:`Loaded`})})};function G(e){return e.positional(`app-id`,{type:`string`,description:`App identifier.`,demandOption:!0}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const K={command:`update <app-id>`,describe:"Updates an app. Only `name` is mutable.",builder:G,handler:async r=>c({command:`flagship apps update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf flagship apps update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/flagship/apps/${r[`app-id`]==null?`<app-id>`:encodeURIComponent(String(r[`app-id`]))}`,pathParams:{"app-id":String(r[`app-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({name:f(r.name,`name`,`text`)}):l(r.body)});return}let c=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.flagship.apps.update({...e,account_id:u,app_id:r[`app-id`]})),{successLabel:`Updated`});return}let p=d({name:f(r.name,`name`,`text`)});a(await s(`Updating`,async()=>c.flagship.apps.update({...p,account_id:u,app_id:r[`app-id`]})),{successLabel:`Updated`})})},q={command:`apps`,describe:`Operations for apps`,builder:e=>e.command(g).command(x).command(H).command(W).command(K).command(y).command(E).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},J={command:`flagship`,describe:`flagship`,builder:e=>e.command(q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{J as default};
|
package/dist/fraud-WLW2Ep1Z.mjs
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
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,t as s}from"./body-parser-Cmw7PZ7a.mjs";import{n as c}from"./input-validation-nF-0Ze2h.mjs";function l(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`get`,describe:`Retrieve Fraud Detection settings for a zone.`,builder:l,handler:async o=>a({command:`fraud get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf fraud get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/fraud_detection/settings`,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.fraud.get({zone_id:s})),{successLabel:`Loaded`})})};function d(e){return e.option(`authentication-settings-failure-criteria-kind`,{type:`string`,description:"The type of criterion. Currently only `status_code` is supported.",choices:[`status_code`]}).option(`authentication-settings-failure-criteria-status-codes`,{type:`string`,array:!0,description:`HTTP status codes to match against the origin response.
|
|
3
|
-
- Maximum of 10 codes per criterion.
|
|
4
|
-
- Each code must be a valid HTTP status code (100-599).
|
|
5
|
-
- Codes are deduplicated and sorted on save.
|
|
6
|
-
- Omit to leave unchanged on update.
|
|
7
|
-
- Provide an empty array \`[]\` to clear codes on update.
|
|
8
|
-
`}).option(`authentication-settings-success-criteria-kind`,{type:`string`,description:"The type of criterion. Currently only `status_code` is supported.",choices:[`status_code`]}).option(`authentication-settings-success-criteria-status-codes`,{type:`string`,array:!0,description:`HTTP status codes to match against the origin response.
|
|
9
|
-
- Maximum of 10 codes per criterion.
|
|
10
|
-
- Each code must be a valid HTTP status code (100-599).
|
|
11
|
-
- Codes are deduplicated and sorted on save.
|
|
12
|
-
- Omit to leave unchanged on update.
|
|
13
|
-
- Provide an empty array \`[]\` to clear codes on update.
|
|
14
|
-
`}).option(`user-profiles`,{type:`string`,description:`Whether Fraud User Profiles is enabled for the zone.`,choices:[`enabled`,`disabled`]}).option(`username-expressions`,{type:`string`,array:!0,description:`List of expressions to detect usernames in write HTTP requests.
|
|
15
|
-
|
|
16
|
-
- Maximum of 10 expressions.
|
|
17
|
-
- Omit or set to null to leave unchanged on update.
|
|
18
|
-
- Provide an empty array \`[]\` to clear all expressions on update.
|
|
19
|
-
- Invalid expressions will result in a 10400 Bad Request with details in the \`messages\` array.
|
|
20
|
-
`}).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([`authentication-settings-failure-criteria-kind`,`authentication-settings-failure-criteria-status-codes`,`authentication-settings-success-criteria-kind`,`authentication-settings-success-criteria-status-codes`].some(t=>e[t]!==void 0)){let t=[`authentication-settings-failure-criteria-kind`,`authentication-settings-success-criteria-kind`].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 --authentication_settings-* flag is set`)}return!0})}const f={command:`update`,describe:"Update Fraud Detection settings for a zone. Notes on `username_expressions` behavior: - If omitted or set to null, expressions are not modified. - If provided as an empty array `[]`, all expressions will be cleared.",builder:d,handler:async l=>a({command:`fraud update`,classification:{safeFlags:[`authentication-settings-failure-criteria-kind`,`authentication-settings-success-criteria-kind`,`user-profiles`,`dry-run`]}},l,async()=>{if(l.dryRun){r({command:`cf fraud update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/fraud_detection/settings`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?s({authentication_settings:{failure_criteria:{kind:c(l[`authentication-settings-failure-criteria-kind`],`authentication-settings-failure-criteria-kind`,`text`),status_codes:l[`authentication-settings-failure-criteria-status-codes`]},success_criteria:{kind:c(l[`authentication-settings-success-criteria-kind`],`authentication-settings-success-criteria-kind`,`text`),status_codes:l[`authentication-settings-success-criteria-status-codes`]}},user_profiles:c(l[`user-profiles`],`user-profiles`,`text`),username_expressions:l[`username-expressions`]}):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.fraud.update({body:e,zone_id:u})),{successLabel:`Updated`});return}let d=s({authentication_settings:{failure_criteria:{kind:c(l[`authentication-settings-failure-criteria-kind`],`authentication-settings-failure-criteria-kind`,`text`),status_codes:l[`authentication-settings-failure-criteria-status-codes`]},success_criteria:{kind:c(l[`authentication-settings-success-criteria-kind`],`authentication-settings-success-criteria-kind`,`text`),status_codes:l[`authentication-settings-success-criteria-status-codes`]}},user_profiles:c(l[`user-profiles`],`user-profiles`,`text`),username_expressions:l[`username-expressions`]});n(await i(`Updating`,async()=>a.fraud.update({body:d,zone_id:u})),{successLabel:`Updated`})})},p={command:`fraud`,describe:`fraud`,builder:e=>e.command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
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,t as s}from"./body-parser-Cmw7PZ7a.mjs";import{n as c}from"./input-validation-nF-0Ze2h.mjs";import{a 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})}const d={command:`get`,describe:`Gets the Google Tag Gateway configuration for a zone.`,builder:u,handler:async o=>a({command:`google-tag-gateway config get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf google-tag-gateway config get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/settings/google-tag-gateway/config`,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.googleTagGateway.config.get({zone_id:s})),{successLabel:`Loaded`})})};function f(e){return e.option(`enabled`,{type:`boolean`,description:`Enables or disables Google Tag Gateway for this zone.`}).option(`endpoint`,{type:`string`,description:`Specifies the endpoint path for proxying Google Tag Manager requests. Use an absolute path starting with '/', with no nested paths and alphanumeric characters only (e.g. /metrics).`}).option(`hide-original-ip`,{type:`boolean`,description:`Hides the original client IP address from Google when enabled.`}).option(`measurement-id`,{type:`string`,description:`Specify the Google Tag Manager container or measurement ID (e.g. GTM-XXXXXXX or G-XXXXXXXXXX).`}).option(`set-up-tag`,{type:`boolean`,description:`Set up the associated Google Tag on the zone automatically when enabled.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Google Tag Gateway configuration for a zone.`})}const p={command:`update`,describe:`Updates the Google Tag Gateway configuration for a zone.`,builder:f,handler:async u=>a({command:`google-tag-gateway config update`,classification:{safeFlags:[`enabled`,`hide-original-ip`,`set-up-tag`,`dry-run`]}},u,async()=>{if(u.dryRun){r({command:`cf google-tag-gateway config update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/settings/google-tag-gateway/config`,pathParams:{"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?s({enabled:u.enabled,endpoint:c(u.endpoint,`endpoint`,`text`),hideOriginalIp:u[`hide-original-ip`],measurementId:c(u[`measurement-id`],`measurement-id`,`text`),setUpTag:u[`set-up-tag`]}):o(u.body)});return}let a=await t(u),d=await e({zone:u.zone},a,{quiet:u.quiet});if(u.zoneId=d,u.body){let e=o(u.body);n(await i(`Updating`,async()=>a.googleTagGateway.config.update({body:e,zone_id:d})),{successLabel:`Updated`});return}if(u.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);if(u.endpoint===void 0&&(u.endpoint=await l(`endpoint`,`Specifies the endpoint path for proxying Google Tag Manager requests. Use an absolute path starting with '/', with no nested paths and alphanumeric characters only (e.g. /metrics).`)),u[`hide-original-ip`]===void 0)throw Error(`--hide-original-ip is required (or pass --body with this field set).`);u[`measurement-id`]===void 0&&(u[`measurement-id`]=await l(`measurement-id`,`Specify the Google Tag Manager container or measurement ID (e.g. GTM-XXXXXXX or G-XXXXXXXXXX).`));let f=s({enabled:u.enabled,endpoint:c(u.endpoint,`endpoint`,`text`),hideOriginalIp:u[`hide-original-ip`],measurementId:c(u[`measurement-id`],`measurement-id`,`text`),setUpTag:u[`set-up-tag`]});n(await i(`Updating`,async()=>a.googleTagGateway.config.update({body:f,zone_id:d})),{successLabel:`Updated`})})},m={command:`config`,describe:`Google Tag Gateway config operations`,builder:e=>e.command(d).command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},h={command:`google-tag-gateway`,describe:`Google Tag Gateway operations`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{h as default};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
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,t as s}from"./body-parser-Cmw7PZ7a.mjs";import{n as c}from"./input-validation-nF-0Ze2h.mjs";import{a as l,n as u}from"./prompt-BP8XrQSj.mjs";function d(e){return e.option(`address`,{type:`string`,description:`The hostname or IP address of the origin server to run health checks on.`}).option(`check-regions`,{type:`string`,array:!0,description:`A list of regions from which to run health checks. Null means Cloudflare will pick a default region.`}).option(`consecutive-fails`,{type:`number`,description:`The number of consecutive fails required from a health check before changing the health to unhealthy.`,default:1}).option(`consecutive-successes`,{type:`number`,description:`The number of consecutive successes required from a health check before changing the health to healthy.`,default:1}).option(`description`,{type:`string`,description:`A human-readable description of the health check.`}).option(`http-config-allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when the health check uses HTTPS.`}).option(`http-config-expected-body`,{type:`string`,description:`A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy.`}).option(`http-config-expected-codes`,{type:`string`,array:!0,description:`The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check.`}).option(`http-config-follow-redirects`,{type:`boolean`,description:`Follow redirects if the origin returns a 3xx status code.`}).option(`http-config-method`,{type:`string`,description:`The HTTP method to use for the health check.`,choices:[`GET`,`HEAD`]}).option(`http-config-path`,{type:`string`,description:`The endpoint path to health check against.`}).option(`http-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS.`}).option(`interval`,{type:`number`,description:`The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations.`,default:60}).option(`name`,{type:`string`,description:`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`}).option(`retries`,{type:`number`,description:`The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.`,default:2}).option(`suspended`,{type:`boolean`,description:`If suspended, no health checks are sent to the origin.`,default:!1}).option(`tcp-config-method`,{type:`string`,description:`The TCP connection method to use for the health check.`,choices:[`connection_established`]}).option(`tcp-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80.`}).option(`timeout`,{type:`number`,description:`The timeout (in seconds) before marking the health check as failed.`,default:5}).option(`type`,{type:`string`,description:`The protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.`,default:`HTTP`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`create`,describe:`Create a new health check.`,builder:d,handler:async u=>a({command:`healthchecks create`,classification:{safeFlags:[`http-config-allow-insecure`,`http-config-follow-redirects`,`http-config-method`,`suspended`,`tcp-config-method`,`dry-run`]}},u,async()=>{if(u.dryRun){r({command:`cf healthchecks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/healthchecks`,pathParams:{"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?s({address:c(u.address,`address`,`text`),check_regions:u[`check-regions`],consecutive_fails:u[`consecutive-fails`],consecutive_successes:u[`consecutive-successes`],description:c(u.description,`description`,`text`),http_config:{allow_insecure:u[`http-config-allow-insecure`],expected_body:c(u[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:u[`http-config-expected-codes`],follow_redirects:u[`http-config-follow-redirects`],method:c(u[`http-config-method`],`http-config-method`,`text`),path:c(u[`http-config-path`],`http-config-path`,`text`),port:u[`http-config-port`]},interval:u.interval,name:c(u.name,`name`,`text`),retries:u.retries,suspended:u.suspended,tcp_config:{method:c(u[`tcp-config-method`],`tcp-config-method`,`text`),port:u[`tcp-config-port`]},timeout:u.timeout,type:c(u.type,`type`,`text`)}):o(u.body)});return}let a=await t(u),d=await e({zone:u.zone},a,{quiet:u.quiet});if(u.zoneId=d,u.body){let e=o(u.body);n(await i(`Creating`,async()=>a.healthchecks.create({body:e,zone_id:d})),{successLabel:`Created`});return}u.address===void 0&&(u.address=await l(`address`,`The hostname or IP address of the origin server to run health checks on.`)),u.name===void 0&&(u.name=await l(`name`,`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`));let f=s({address:c(u.address,`address`,`text`),check_regions:u[`check-regions`],consecutive_fails:u[`consecutive-fails`],consecutive_successes:u[`consecutive-successes`],description:c(u.description,`description`,`text`),http_config:{allow_insecure:u[`http-config-allow-insecure`],expected_body:c(u[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:u[`http-config-expected-codes`],follow_redirects:u[`http-config-follow-redirects`],method:c(u[`http-config-method`],`http-config-method`,`text`),path:c(u[`http-config-path`],`http-config-path`,`text`),port:u[`http-config-port`]},interval:u.interval,name:c(u.name,`name`,`text`),retries:u.retries,suspended:u.suspended,tcp_config:{method:c(u[`tcp-config-method`],`tcp-config-method`,`text`),port:u[`tcp-config-port`]},timeout:u.timeout,type:c(u.type,`type`,`text`)});n(await i(`Creating`,async()=>a.healthchecks.create({body:f,zone_id:d})),{successLabel:`Created`})})};function p(e){return e.positional(`healthcheck-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const m={command:`delete <healthcheck-id>`,describe:`Delete a health check.`,builder:p,handler:async o=>a({command:`healthchecks delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},o,async()=>{if(o.dryRun){r({command:`cf healthchecks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/healthchecks/${o[`healthcheck-id`]==null?`<healthcheck-id>`:encodeURIComponent(String(o[`healthcheck-id`]))}`,pathParams:{"healthcheck-id":String(o[`healthcheck-id`]??``),"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 u({force:!!o.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}n(await i(`Deleting`,async()=>a.healthchecks.delete({zone_id:s,healthcheck_id:o[`healthcheck-id`]})),{successLabel:`Deleted`})})};function h(e){return e.positional(`healthcheck-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`address`,{type:`string`,description:`The hostname or IP address of the origin server to run health checks on.`}).option(`check-regions`,{type:`string`,array:!0,description:`A list of regions from which to run health checks. Null means Cloudflare will pick a default region.`}).option(`consecutive-fails`,{type:`number`,description:`The number of consecutive fails required from a health check before changing the health to unhealthy.`}).option(`consecutive-successes`,{type:`number`,description:`The number of consecutive successes required from a health check before changing the health to healthy.`}).option(`description`,{type:`string`,description:`A human-readable description of the health check.`}).option(`http-config-allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when the health check uses HTTPS.`}).option(`http-config-expected-body`,{type:`string`,description:`A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy.`}).option(`http-config-expected-codes`,{type:`string`,array:!0,description:`The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check.`}).option(`http-config-follow-redirects`,{type:`boolean`,description:`Follow redirects if the origin returns a 3xx status code.`}).option(`http-config-method`,{type:`string`,description:`The HTTP method to use for the health check.`,choices:[`GET`,`HEAD`]}).option(`http-config-path`,{type:`string`,description:`The endpoint path to health check against.`}).option(`http-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS.`}).option(`interval`,{type:`number`,description:`The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations.`}).option(`name`,{type:`string`,description:`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`}).option(`retries`,{type:`number`,description:`The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.`}).option(`suspended`,{type:`boolean`,description:`If suspended, no health checks are sent to the origin.`}).option(`tcp-config-method`,{type:`string`,description:`The TCP connection method to use for the health check.`,choices:[`connection_established`]}).option(`tcp-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80.`}).option(`timeout`,{type:`number`,description:`The timeout (in seconds) before marking the health check as failed.`}).option(`type`,{type:`string`,description:`The protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`edit <healthcheck-id>`,describe:`Patch a configured health check.`,builder:h,handler:async u=>a({command:`healthchecks edit`,classification:{safeFlags:[`http-config-allow-insecure`,`http-config-follow-redirects`,`http-config-method`,`suspended`,`tcp-config-method`,`dry-run`]}},u,async()=>{if(u.dryRun){r({command:`cf healthchecks edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/healthchecks/${u[`healthcheck-id`]==null?`<healthcheck-id>`:encodeURIComponent(String(u[`healthcheck-id`]))}`,pathParams:{"healthcheck-id":String(u[`healthcheck-id`]??``),"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?s({address:c(u.address,`address`,`text`),check_regions:u[`check-regions`],consecutive_fails:u[`consecutive-fails`],consecutive_successes:u[`consecutive-successes`],description:c(u.description,`description`,`text`),http_config:{allow_insecure:u[`http-config-allow-insecure`],expected_body:c(u[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:u[`http-config-expected-codes`],follow_redirects:u[`http-config-follow-redirects`],method:c(u[`http-config-method`],`http-config-method`,`text`),path:c(u[`http-config-path`],`http-config-path`,`text`),port:u[`http-config-port`]},interval:u.interval,name:c(u.name,`name`,`text`),retries:u.retries,suspended:u.suspended,tcp_config:{method:c(u[`tcp-config-method`],`tcp-config-method`,`text`),port:u[`tcp-config-port`]},timeout:u.timeout,type:c(u.type,`type`,`text`)}):o(u.body)});return}let a=await t(u),d=await e({zone:u.zone},a,{quiet:u.quiet});if(u.zoneId=d,u.body){let e=o(u.body);n(await i(`Updating`,async()=>a.healthchecks.edit({body:e,zone_id:d,healthcheck_id:u[`healthcheck-id`]})),{successLabel:`Updated`});return}u.address===void 0&&(u.address=await l(`address`,`The hostname or IP address of the origin server to run health checks on.`)),u.name===void 0&&(u.name=await l(`name`,`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`));let f=s({address:c(u.address,`address`,`text`),check_regions:u[`check-regions`],consecutive_fails:u[`consecutive-fails`],consecutive_successes:u[`consecutive-successes`],description:c(u.description,`description`,`text`),http_config:{allow_insecure:u[`http-config-allow-insecure`],expected_body:c(u[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:u[`http-config-expected-codes`],follow_redirects:u[`http-config-follow-redirects`],method:c(u[`http-config-method`],`http-config-method`,`text`),path:c(u[`http-config-path`],`http-config-path`,`text`),port:u[`http-config-port`]},interval:u.interval,name:c(u.name,`name`,`text`),retries:u.retries,suspended:u.suspended,tcp_config:{method:c(u[`tcp-config-method`],`tcp-config-method`,`text`),port:u[`tcp-config-port`]},timeout:u.timeout,type:c(u.type,`type`,`text`)});n(await i(`Updating`,async()=>a.healthchecks.edit({body:f,zone_id:d,healthcheck_id:u[`healthcheck-id`]})),{successLabel:`Updated`})})};function _(e){return e.positional(`healthcheck-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <healthcheck-id>`,describe:`Fetch a single configured health check.`,builder:_,handler:async o=>a({command:`healthchecks get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf healthchecks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/healthchecks/${o[`healthcheck-id`]==null?`<healthcheck-id>`:encodeURIComponent(String(o[`healthcheck-id`]))}`,pathParams:{"healthcheck-id":String(o[`healthcheck-id`]??``),"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.healthchecks.get({zone_id:s,healthcheck_id:o[`healthcheck-id`]})),{successLabel:`Loaded`})})};function y(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page. Must be a multiple of 5.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`list`,describe:`List configured health checks.`,builder:y,handler:async o=>a({command:`healthchecks list`,classification:{safeFlags:[`dry-run`]}},o,async()=>{let a={page:o.page,per_page:o[`per-page`]};if(o.dryRun){r({command:`cf healthchecks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/healthchecks`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},query:a,bodyKind:`none`});return}let s=await t(o),c=await e({zone:o.zone},s,{quiet:o.quiet});o.zoneId=c,n(await i(`Loading`,async()=>s.healthchecks.list({zone_id:c,...a})),{successLabel:`Loaded`})})};function x(e){return e.option(`address`,{type:`string`,description:`The hostname or IP address of the origin server to run health checks on.`}).option(`check-regions`,{type:`string`,array:!0,description:`A list of regions from which to run health checks. Null means Cloudflare will pick a default region.`}).option(`consecutive-fails`,{type:`number`,description:`The number of consecutive fails required from a health check before changing the health to unhealthy.`,default:1}).option(`consecutive-successes`,{type:`number`,description:`The number of consecutive successes required from a health check before changing the health to healthy.`,default:1}).option(`description`,{type:`string`,description:`A human-readable description of the health check.`}).option(`http-config-allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when the health check uses HTTPS.`}).option(`http-config-expected-body`,{type:`string`,description:`A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy.`}).option(`http-config-expected-codes`,{type:`string`,array:!0,description:`The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check.`}).option(`http-config-follow-redirects`,{type:`boolean`,description:`Follow redirects if the origin returns a 3xx status code.`}).option(`http-config-method`,{type:`string`,description:`The HTTP method to use for the health check.`,choices:[`GET`,`HEAD`]}).option(`http-config-path`,{type:`string`,description:`The endpoint path to health check against.`}).option(`http-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS.`}).option(`interval`,{type:`number`,description:`The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations.`,default:60}).option(`name`,{type:`string`,description:`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`}).option(`retries`,{type:`number`,description:`The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.`,default:2}).option(`suspended`,{type:`boolean`,description:`If suspended, no health checks are sent to the origin.`,default:!1}).option(`tcp-config-method`,{type:`string`,description:`The TCP connection method to use for the health check.`,choices:[`connection_established`]}).option(`tcp-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80.`}).option(`timeout`,{type:`number`,description:`The timeout (in seconds) before marking the health check as failed.`,default:5}).option(`type`,{type:`string`,description:`The protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.`,default:`HTTP`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`create`,describe:`Create a new preview health check.`,builder:x,handler:async u=>a({command:`healthchecks previews create`,classification:{safeFlags:[`http-config-allow-insecure`,`http-config-follow-redirects`,`http-config-method`,`suspended`,`tcp-config-method`,`dry-run`]}},u,async()=>{if(u.dryRun){r({command:`cf healthchecks previews create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/healthchecks/preview`,pathParams:{"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?s({address:c(u.address,`address`,`text`),check_regions:u[`check-regions`],consecutive_fails:u[`consecutive-fails`],consecutive_successes:u[`consecutive-successes`],description:c(u.description,`description`,`text`),http_config:{allow_insecure:u[`http-config-allow-insecure`],expected_body:c(u[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:u[`http-config-expected-codes`],follow_redirects:u[`http-config-follow-redirects`],method:c(u[`http-config-method`],`http-config-method`,`text`),path:c(u[`http-config-path`],`http-config-path`,`text`),port:u[`http-config-port`]},interval:u.interval,name:c(u.name,`name`,`text`),retries:u.retries,suspended:u.suspended,tcp_config:{method:c(u[`tcp-config-method`],`tcp-config-method`,`text`),port:u[`tcp-config-port`]},timeout:u.timeout,type:c(u.type,`type`,`text`)}):o(u.body)});return}let a=await t(u),d=await e({zone:u.zone},a,{quiet:u.quiet});if(u.zoneId=d,u.body){let e=o(u.body);n(await i(`Creating`,async()=>a.healthchecks.previews.create({body:e,zone_id:d})),{successLabel:`Created`});return}u.address===void 0&&(u.address=await l(`address`,`The hostname or IP address of the origin server to run health checks on.`)),u.name===void 0&&(u.name=await l(`name`,`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`));let f=s({address:c(u.address,`address`,`text`),check_regions:u[`check-regions`],consecutive_fails:u[`consecutive-fails`],consecutive_successes:u[`consecutive-successes`],description:c(u.description,`description`,`text`),http_config:{allow_insecure:u[`http-config-allow-insecure`],expected_body:c(u[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:u[`http-config-expected-codes`],follow_redirects:u[`http-config-follow-redirects`],method:c(u[`http-config-method`],`http-config-method`,`text`),path:c(u[`http-config-path`],`http-config-path`,`text`),port:u[`http-config-port`]},interval:u.interval,name:c(u.name,`name`,`text`),retries:u.retries,suspended:u.suspended,tcp_config:{method:c(u[`tcp-config-method`],`tcp-config-method`,`text`),port:u[`tcp-config-port`]},timeout:u.timeout,type:c(u.type,`type`,`text`)});n(await i(`Creating`,async()=>a.healthchecks.previews.create({body:f,zone_id:d})),{successLabel:`Created`})})};function C(e){return e.positional(`healthcheck-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const w={command:`delete <healthcheck-id>`,describe:`Delete a health check.`,builder:C,handler:async o=>a({command:`healthchecks previews delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},o,async()=>{if(o.dryRun){r({command:`cf healthchecks previews delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/healthchecks/preview/${o[`healthcheck-id`]==null?`<healthcheck-id>`:encodeURIComponent(String(o[`healthcheck-id`]))}`,pathParams:{"healthcheck-id":String(o[`healthcheck-id`]??``),"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 u({force:!!o.force})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}n(await i(`Deleting`,async()=>a.healthchecks.previews.delete({zone_id:s,healthcheck_id:o[`healthcheck-id`]})),{successLabel:`Deleted`})})};function T(e){return e.positional(`healthcheck-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get <healthcheck-id>`,describe:`Fetch a single configured health check preview.`,builder:T,handler:async o=>a({command:`healthchecks previews get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf healthchecks previews get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/healthchecks/preview/${o[`healthcheck-id`]==null?`<healthcheck-id>`:encodeURIComponent(String(o[`healthcheck-id`]))}`,pathParams:{"healthcheck-id":String(o[`healthcheck-id`]??``),"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.healthchecks.previews.get({zone_id:s,healthcheck_id:o[`healthcheck-id`]})),{successLabel:`Loaded`})})},D={command:`previews`,describe:`Test a health check configuration before deploying it to production`,builder:e=>e.command(S).command(w).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.positional(`healthcheck-id`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`address`,{type:`string`,description:`The hostname or IP address of the origin server to run health checks on.`}).option(`check-regions`,{type:`string`,array:!0,description:`A list of regions from which to run health checks. Null means Cloudflare will pick a default region.`}).option(`consecutive-fails`,{type:`number`,description:`The number of consecutive fails required from a health check before changing the health to unhealthy.`}).option(`consecutive-successes`,{type:`number`,description:`The number of consecutive successes required from a health check before changing the health to healthy.`}).option(`description`,{type:`string`,description:`A human-readable description of the health check.`}).option(`http-config-allow-insecure`,{type:`boolean`,description:`Do not validate the certificate when the health check uses HTTPS.`}).option(`http-config-expected-body`,{type:`string`,description:`A case-insensitive sub-string to look for in the response body. If this string is not found, the origin will be marked as unhealthy.`}).option(`http-config-expected-codes`,{type:`string`,array:!0,description:`The expected HTTP response codes (e.g. "200") or code ranges (e.g. "2xx" for all codes starting with 2) of the health check.`}).option(`http-config-follow-redirects`,{type:`boolean`,description:`Follow redirects if the origin returns a 3xx status code.`}).option(`http-config-method`,{type:`string`,description:`The HTTP method to use for the health check.`,choices:[`GET`,`HEAD`]}).option(`http-config-path`,{type:`string`,description:`The endpoint path to health check against.`}).option(`http-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80 if type is HTTP or 443 if type is HTTPS.`}).option(`interval`,{type:`number`,description:`The interval between each health check. Shorter intervals may give quicker notifications if the origin status changes, but will increase load on the origin as we check from multiple locations.`}).option(`name`,{type:`string`,description:`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`}).option(`retries`,{type:`number`,description:`The number of retries to attempt in case of a timeout before marking the origin as unhealthy. Retries are attempted immediately.`}).option(`suspended`,{type:`boolean`,description:`If suspended, no health checks are sent to the origin.`}).option(`tcp-config-method`,{type:`string`,description:`The TCP connection method to use for the health check.`,choices:[`connection_established`]}).option(`tcp-config-port`,{type:`number`,description:`Port number to connect to for the health check. Defaults to 80.`}).option(`timeout`,{type:`number`,description:`The timeout (in seconds) before marking the health check as failed.`}).option(`type`,{type:`string`,description:`The protocol to use for the health check. Currently supported protocols are 'HTTP', 'HTTPS' and 'TCP'.`}).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 <healthcheck-id>`,describe:`Update a configured health check.`,builder:O,handler:async u=>a({command:`healthchecks update`,classification:{safeFlags:[`http-config-allow-insecure`,`http-config-follow-redirects`,`http-config-method`,`suspended`,`tcp-config-method`,`dry-run`]}},u,async()=>{if(u.dryRun){r({command:`cf healthchecks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/healthchecks/${u[`healthcheck-id`]==null?`<healthcheck-id>`:encodeURIComponent(String(u[`healthcheck-id`]))}`,pathParams:{"healthcheck-id":String(u[`healthcheck-id`]??``),"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?s({address:c(u.address,`address`,`text`),check_regions:u[`check-regions`],consecutive_fails:u[`consecutive-fails`],consecutive_successes:u[`consecutive-successes`],description:c(u.description,`description`,`text`),http_config:{allow_insecure:u[`http-config-allow-insecure`],expected_body:c(u[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:u[`http-config-expected-codes`],follow_redirects:u[`http-config-follow-redirects`],method:c(u[`http-config-method`],`http-config-method`,`text`),path:c(u[`http-config-path`],`http-config-path`,`text`),port:u[`http-config-port`]},interval:u.interval,name:c(u.name,`name`,`text`),retries:u.retries,suspended:u.suspended,tcp_config:{method:c(u[`tcp-config-method`],`tcp-config-method`,`text`),port:u[`tcp-config-port`]},timeout:u.timeout,type:c(u.type,`type`,`text`)}):o(u.body)});return}let a=await t(u),d=await e({zone:u.zone},a,{quiet:u.quiet});if(u.zoneId=d,u.body){let e=o(u.body);n(await i(`Updating`,async()=>a.healthchecks.update({body:e,zone_id:d,healthcheck_id:u[`healthcheck-id`]})),{successLabel:`Updated`});return}u.address===void 0&&(u.address=await l(`address`,`The hostname or IP address of the origin server to run health checks on.`)),u.name===void 0&&(u.name=await l(`name`,`A short name to identify the health check. Only alphanumeric characters, hyphens and underscores are allowed.`));let f=s({address:c(u.address,`address`,`text`),check_regions:u[`check-regions`],consecutive_fails:u[`consecutive-fails`],consecutive_successes:u[`consecutive-successes`],description:c(u.description,`description`,`text`),http_config:{allow_insecure:u[`http-config-allow-insecure`],expected_body:c(u[`http-config-expected-body`],`http-config-expected-body`,`text`),expected_codes:u[`http-config-expected-codes`],follow_redirects:u[`http-config-follow-redirects`],method:c(u[`http-config-method`],`http-config-method`,`text`),path:c(u[`http-config-path`],`http-config-path`,`text`),port:u[`http-config-port`]},interval:u.interval,name:c(u.name,`name`,`text`),retries:u.retries,suspended:u.suspended,tcp_config:{method:c(u[`tcp-config-method`],`tcp-config-method`,`text`),port:u[`tcp-config-port`]},timeout:u.timeout,type:c(u.type,`type`,`text`)});n(await i(`Updating`,async()=>a.healthchecks.update({body:f,zone_id:d,healthcheck_id:u[`healthcheck-id`]})),{successLabel:`Updated`})})},A={command:`healthchecks`,describe:`Standalone health checks that monitor origin server availability from Cloudflare's edge`,builder:e=>e.command(f).command(m).command(g).command(v).command(b).command(k).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{A as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{h as e}from"./oauth-BdVr2hJp.mjs";import{a as t,r as n}from"./auth-DWxtJ918.mjs";import{t as r}from"./output-Z2lQmPUW.mjs";import{t as i}from"./dry-run-YSQndLvt.mjs";import{t as a}from"./progress-a5IKeKni.mjs";import{t as o}from"./run-BS8otL3u.mjs";import"./telemetry-n3NJourL.mjs";import{n as s}from"./body-parser-Cmw7PZ7a.mjs";import{n as c}from"./prompt-BP8XrQSj.mjs";function l(e){return e.positional(`hostname`,{type:`string`,description:`The hostname for which the tls settings are set.`,demandOption:!0}).option(`setting-id`,{type:`string`,description:'The TLS Setting name.\nThe value type depends on the setting:\n- `ciphers`: value is an array of cipher suite strings (e.g., `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`).\n- `min_tls_version`: value is a TLS version string (`"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"`).\n- `http2`: value is `"on"` or `"off"`.',demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`get <hostname>`,describe:`Get the requested TLS setting for the hostname.`,builder:l,handler:async t=>o({command:`hostnames settings tls-single get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){i({command:`cf hostnames settings tls-single get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/hostnames/settings/${t[`setting-id`]==null?`<setting-id>`:encodeURIComponent(String(t[`setting-id`]))}/${t.hostname==null?`<hostname>`:encodeURIComponent(String(t.hostname))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"setting-id":String(t[`setting-id`]??``),hostname:String(t.hostname??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.hostnames.settings.tlsSingle.get({zone_id:s,setting_id:t[`setting-id`],hostname:t.hostname})),{successLabel:`Loaded`})})},d={command:`tls-single`,describe:`Operations for settings.tls-single`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function f(e){return e.positional(`hostname`,{type:`string`,description:`The hostname for which the tls settings are set.`,demandOption:!0}).option(`setting-id`,{type:`string`,description:'The TLS Setting name.\nThe value type depends on the setting:\n- `ciphers`: value is an array of cipher suite strings (e.g., `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`).\n- `min_tls_version`: value is a TLS version string (`"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"`).\n- `http2`: value is `"on"` or `"off"`.',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 <hostname>`,describe:`Delete the tls setting value for the hostname.`,builder:f,handler:async t=>o({command:`hostnames settings tls delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){i({command:`cf hostnames settings tls delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/hostnames/settings/${t[`setting-id`]==null?`<setting-id>`:encodeURIComponent(String(t[`setting-id`]))}/${t.hostname==null?`<hostname>`:encodeURIComponent(String(t.hostname))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"setting-id":String(t[`setting-id`]??``),hostname:String(t.hostname??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});if(t.zoneId=s,!await c({force:!!t.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}r(await a(`Deleting`,async()=>o.hostnames.settings.tls.delete({zone_id:s,setting_id:t[`setting-id`],hostname:t.hostname})),{successLabel:`Deleted`})})};function m(e){return e.positional(`setting-id`,{type:`string`,description:'The TLS Setting name. The value type depends on the setting: - `ciphers`: value is an array of cipher suite strings (e.g., `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`). - `min_tls_version`: value is a TLS version string (`"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"`). - `http2`: value is `"on"` or `"off"`.',demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get <setting-id>`,describe:`List the requested TLS setting for the hostnames under this zone.`,builder:m,handler:async t=>o({command:`hostnames settings tls get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){i({command:`cf hostnames settings tls get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/hostnames/settings/${t[`setting-id`]==null?`<setting-id>`:encodeURIComponent(String(t[`setting-id`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"setting-id":String(t[`setting-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.hostnames.settings.tls.get({zone_id:s,setting_id:t[`setting-id`]})),{successLabel:`Loaded`})})};function g(e){return e.positional(`hostname`,{type:`string`,description:`The hostname for which the tls settings are set.`,demandOption:!0}).option(`setting-id`,{type:`string`,description:'The TLS Setting name.\nThe value type depends on the setting:\n- `ciphers`: value is an array of cipher suite strings (e.g., `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`).\n- `min_tls_version`: value is a TLS version string (`"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"`).\n- `http2`: value is `"on"` or `"off"`.',demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`update <hostname>`,describe:`Update the tls setting value for the hostname.`,builder:g,handler:async c=>o({command:`hostnames settings tls update`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){i({command:`cf hostnames settings tls update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/hostnames/settings/${c[`setting-id`]==null?`<setting-id>`:encodeURIComponent(String(c[`setting-id`]))}/${c.hostname==null?`<hostname>`:encodeURIComponent(String(c.hostname))}`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``),"setting-id":String(c[`setting-id`]??``),hostname:String(c.hostname??``)},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let o=await n(c),l=await e({zone:c.zone},o,{quiet:c.quiet});if(c.zoneId=l,c.body){let e=s(c.body);r(await a(`Updating`,async()=>o.hostnames.settings.tls.update({...e,zone_id:l,setting_id:c[`setting-id`],hostname:c.hostname})),{successLabel:`Updated`});return}r(await a(`Updating`,async()=>t(o,`PUT`,`/zones/${c.zoneId}/hostnames/settings/${encodeURIComponent(String(c[`setting-id`]))}/${encodeURIComponent(String(c.hostname))}`)),{successLabel:`Updated`})})},v={command:`tls`,describe:`Operations for settings.tls`,builder:e=>e.command(p).command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},y={command:`settings`,describe:`Operations for settings`,builder:e=>e.command(v).command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},b={command:`hostnames`,describe:`hostnames`,builder:e=>e.command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{b as default};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
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.positional(`integration`,{type:`string`,description:`The database integration to authorize against. This value is case-insensitive.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`create-database-signature <integration>`,describe:`Returns a short-lived signed authorization for creating a database that is billed through Cloudflare. The caller passes these values to the integration partner's own CLI, which verifies the signature before creating the database. Requires the account to be entitled to Cloudflare-billed databases for the integration.`,builder:m,handler:async c=>s({command:`hyperdrive create-database-signature`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf hyperdrive create-database-signature`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/hyperdrive/integrationsOperations/${c.integration==null?`<integration>`:encodeURIComponent(String(c.integration))}/createDatabaseSignature`,pathParams:{integration:String(c.integration??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Creating`,async()=>s.hyperdrive.createDatabaseSignature({account_id:l,integration:c.integration})),{successLabel:`Created`})})};function g(e){return e.option(`mtls-ca-certificate-id`,{type:`string`,description:`Define CA certificate ID obtained after uploading CA cert.`}).option(`mtls-certificate-id`,{type:`string`,description:`Define mTLS certificate ID obtained after uploading client cert.`}).option(`mtls-sslmode`,{type:`string`,description:"PostgreSQL accepts `require`, `verify-ca`, and `verify-full`. MySQL accepts `REQUIRED`, `VERIFY_CA`, and `VERIFY_IDENTITY`. The verify modes require a CA certificate; the require modes cannot be used with a CA certificate.",choices:[`require`,`verify-ca`,`verify-full`,`REQUIRED`,`VERIFY_CA`,`VERIFY_IDENTITY`]}).option(`name`,{type:`string`,description:`The name of the Hyperdrive configuration. Used to identify the configuration in the Cloudflare dashboard and API.`}).option(`origin-connection-limit`,{type:`number`,description:`The (soft) maximum number of connections the Hyperdrive is allowed to make to the origin database.
|
|
3
|
-
|
|
4
|
-
Maximum allowed: 20 for free tier accounts, 100 for paid tier accounts.
|
|
5
|
-
If not specified, defaults to 20 for free tier and 60 for paid tier.
|
|
6
|
-
Certain Cloudflare-managed origins may be permitted a higher limit.
|
|
7
|
-
Contact Cloudflare if you need a higher limit.
|
|
8
|
-
`}).option(`integration-custom-database-name`,{type:`string`,description:"The database name to use when connecting. Defaults to `postgres` for PostgreSQL and `mysql` for MySQL."}).option(`integration-database-branch-name`,{type:`string`,description:`The name of the PlanetScale database branch.`}).option(`integration-database-name`,{type:`string`,description:`The name of the PlanetScale database.`}).option(`integration`,{type:`string`,description:`The database integration used by this operation.`,choices:[`planetscale`]}).option(`integration-organization-name`,{type:`string`,description:`The name of the PlanetScale organization.`}).option(`integration-scheme`,{type:`string`,description:`Specifies the URL scheme used to connect to your origin database.`,choices:[`postgres`,`postgresql`,`mysql`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A request to create a Hyperdrive configuration using exactly one of caller-supplied origin credentials or a managed integration.`})}const _={command:`create`,describe:`Creates and returns a new Hyperdrive configuration. For a PlanetScale integration, the Cloudflare account must already be linked to PlanetScale in the Hyperdrive dashboard.`,builder:g,handler:async f=>s({command:`hyperdrive create`,classification:{safeFlags:[`mtls-sslmode`,`integration`,`integration-scheme`,`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf hyperdrive create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/hyperdrive/configs`,pathParams:{},bodyKind:`json`,body:f.body===void 0?l({mtls:{ca_certificate_id:u(f[`mtls-ca-certificate-id`],`mtls-ca-certificate-id`,`text`),mtls_certificate_id:u(f[`mtls-certificate-id`],`mtls-certificate-id`,`text`),sslmode:u(f[`mtls-sslmode`],`mtls-sslmode`,`text`)},name:u(f.name,`name`,`text`),origin_connection_limit:f[`origin-connection-limit`],integration:{custom_database_name:u(f[`integration-custom-database-name`],`integration-custom-database-name`,`text`),database_branch_name:u(f[`integration-database-branch-name`],`integration-database-branch-name`,`text`),database_name:u(f[`integration-database-name`],`integration-database-name`,`text`),integration:u(f.integration,`integration`,`text`),organization_name:u(f[`integration-organization-name`],`integration-organization-name`,`text`),scheme:u(f[`integration-scheme`],`integration-scheme`,`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.hyperdrive.create({body:e,account_id:p})),{successLabel:`Created`});return}f.name===void 0&&(f.name=await d(`name`,`The name of the Hyperdrive configuration. Used to identify the configuration in the Cloudflare dashboard and API.`));let m=l({mtls:{ca_certificate_id:u(f[`mtls-ca-certificate-id`],`mtls-ca-certificate-id`,`text`),mtls_certificate_id:u(f[`mtls-certificate-id`],`mtls-certificate-id`,`text`),sslmode:u(f[`mtls-sslmode`],`mtls-sslmode`,`text`)},name:u(f.name,`name`,`text`),origin_connection_limit:f[`origin-connection-limit`],integration:{custom_database_name:u(f[`integration-custom-database-name`],`integration-custom-database-name`,`text`),database_branch_name:u(f[`integration-database-branch-name`],`integration-database-branch-name`,`text`),database_name:u(f[`integration-database-name`],`integration-database-name`,`text`),integration:u(f.integration,`integration`,`text`),organization_name:u(f[`integration-organization-name`],`integration-organization-name`,`text`),scheme:u(f[`integration-scheme`],`integration-scheme`,`text`)}});i(await o(`Creating`,async()=>s.hyperdrive.create({body:m,account_id:p})),{successLabel:`Created`})})};function v(e){return e.positional(`hyperdrive-id`,{type:`string`,description:`The unique identifier of the Hyperdrive configuration.`,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 <hyperdrive-id>`,describe:`Deletes the specified Hyperdrive.`,builder:v,handler:async c=>s({command:`hyperdrive delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf hyperdrive delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/hyperdrive/configs/${c[`hyperdrive-id`]==null?`<hyperdrive-id>`:encodeURIComponent(String(c[`hyperdrive-id`]))}`,pathParams:{"hyperdrive-id":String(c[`hyperdrive-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 deletes an existing Hyperdrive configuration.`})){process.stderr.write(`Aborted.
|
|
9
|
-
`);return}i(await o(`Deleting`,async()=>s.hyperdrive.delete({account_id:l,hyperdrive_id:c[`hyperdrive-id`]})),{successLabel:`Deleted`})})};function b(e){return e.positional(`hyperdrive-id`,{type:`string`,description:`The unique identifier of the Hyperdrive configuration.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get <hyperdrive-id>`,describe:`Returns the specified Hyperdrive configuration.`,builder:b,handler:async c=>s({command:`hyperdrive get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf hyperdrive get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/hyperdrive/configs/${c[`hyperdrive-id`]==null?`<hyperdrive-id>`:encodeURIComponent(String(c[`hyperdrive-id`]))}`,pathParams:{"hyperdrive-id":String(c[`hyperdrive-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.hyperdrive.get({account_id:l,hyperdrive_id:c[`hyperdrive-id`]})),{successLabel:`Loaded`})})};function S(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`list`,describe:`Returns a list of Hyperdrives.`,builder:S,handler:async c=>s({command:`hyperdrive list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={page:c.page,per_page:c[`per-page`]};if(c.dryRun){a({command:`cf hyperdrive list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/hyperdrive/configs`,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.hyperdrive.list({account_id:u,...s})),{successLabel:`Loaded`})})};function w(e){return e.positional(`hyperdrive-id`,{type:`string`,description:`The unique identifier of the Hyperdrive configuration.`,demandOption:!0}).option(`caching-disabled`,{type:`boolean`,description:`Set to true to disable caching of SQL responses. Default is false.`}).option(`caching-max-age`,{type:`number`,description:`Specify the maximum duration (in seconds) items should persist in the cache. Defaults to 60 seconds if not specified.`}).option(`caching-stale-while-revalidate`,{type:`number`,description:`Specify the number of seconds the cache may serve a stale response. Defaults to 15 seconds if not specified.`}).option(`mtls-ca-certificate-id`,{type:`string`,description:`Define CA certificate ID obtained after uploading CA cert.`}).option(`mtls-certificate-id`,{type:`string`,description:`Define mTLS certificate ID obtained after uploading client cert.`}).option(`mtls-sslmode`,{type:`string`,description:"PostgreSQL accepts `require`, `verify-ca`, and `verify-full`. MySQL accepts `REQUIRED`, `VERIFY_CA`, and `VERIFY_IDENTITY`. The verify modes require a CA certificate; the require modes cannot be used with a CA certificate.",choices:[`require`,`verify-ca`,`verify-full`,`REQUIRED`,`VERIFY_CA`,`VERIFY_IDENTITY`]}).option(`name`,{type:`string`,description:`The name of the Hyperdrive configuration. Used to identify the configuration in the Cloudflare dashboard and API.`}).option(`origin-database`,{type:`string`,description:`Set the name of your origin database.`}).option(`origin-password`,{type:`string`,description:`Set the password needed to access your origin database. The API never returns this write-only value.`}).option(`origin-scheme`,{type:`string`,description:`Specifies the URL scheme used to connect to your origin database.`,choices:[`postgres`,`postgresql`,`mysql`]}).option(`origin-user`,{type:`string`,description:`Set the user of your origin database.`}).option(`origin-host`,{type:`string`,description:`Defines the publicly reachable hostname or IP of your origin database. Private, loopback, and link-local IP addresses are not allowed.`}).option(`origin-port`,{type:`number`,description:`Defines the port of your origin database. Defaults to 5432 for PostgreSQL or 3306 for MySQL if not specified.`}).option(`origin-access-client-id`,{type:`string`,description:`Defines the Client ID of the Access token to use when connecting to the origin database.`}).option(`origin-access-client-secret`,{type:`string`,description:`Defines the Client Secret of the Access Token to use when connecting to the origin database. The API never returns this write-only value.`}).option(`origin-service-id`,{type:`string`,description:`The identifier of the Workers VPC Service to connect through. Hyperdrive will egress through the specified VPC Service to reach the origin database.`}).option(`origin-connection-limit`,{type:`number`,description:`The (soft) maximum number of connections the Hyperdrive is allowed to make to the origin database.
|
|
10
|
-
|
|
11
|
-
Maximum allowed: 20 for free tier accounts, 100 for paid tier accounts.
|
|
12
|
-
If not specified, defaults to 20 for free tier and 60 for paid tier.
|
|
13
|
-
Certain Cloudflare-managed origins may be permitted a higher limit.
|
|
14
|
-
Contact Cloudflare if you need a higher limit.
|
|
15
|
-
`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`origin-host`,[`origin-service-id`]).conflicts(`origin-port`,[`origin-access-client-id`,`origin-access-client-secret`,`origin-service-id`]).implies(`origin-port`,[`origin-host`]).conflicts(`origin-access-client-id`,[`origin-port`,`origin-service-id`]).implies(`origin-access-client-id`,[`origin-host`,`origin-access-client-secret`]).conflicts(`origin-access-client-secret`,[`origin-port`,`origin-service-id`]).implies(`origin-access-client-secret`,[`origin-host`,`origin-access-client-id`]).conflicts(`origin-service-id`,[`origin-host`,`origin-port`,`origin-access-client-id`,`origin-access-client-secret`])}const T={command:`replace <hyperdrive-id>`,describe:`Replaces and returns the specified Hyperdrive configuration. The request must include the name and complete origin connection details. Omitted caching settings are reset to their defaults, while omitted mTLS settings and origin connection limits are preserved. Use the update operation to modify only selected fields.`,builder:w,handler:async p=>s({command:`hyperdrive replace`,classification:{safeFlags:[`caching-disabled`,`mtls-sslmode`,`origin-scheme`,`dry-run`]}},p,async()=>{if(p.dryRun){a({command:`cf hyperdrive replace`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/hyperdrive/configs/${p[`hyperdrive-id`]==null?`<hyperdrive-id>`:encodeURIComponent(String(p[`hyperdrive-id`]))}`,pathParams:{"hyperdrive-id":String(p[`hyperdrive-id`]??``)},bodyKind:`json`,body:p.body===void 0?l({caching:{disabled:p[`caching-disabled`],max_age:p[`caching-max-age`],stale_while_revalidate:p[`caching-stale-while-revalidate`]},mtls:{ca_certificate_id:u(p[`mtls-ca-certificate-id`],`mtls-ca-certificate-id`,`text`),mtls_certificate_id:u(p[`mtls-certificate-id`],`mtls-certificate-id`,`text`),sslmode:u(p[`mtls-sslmode`],`mtls-sslmode`,`text`)},name:u(p.name,`name`,`text`),origin:{database:u(p[`origin-database`],`origin-database`,`text`),password:u(p[`origin-password`],`origin-password`,`text`),scheme:u(p[`origin-scheme`],`origin-scheme`,`text`),user:u(p[`origin-user`],`origin-user`,`text`),host:u(p[`origin-host`],`origin-host`,`text`),port:p[`origin-port`],access_client_id:u(p[`origin-access-client-id`],`origin-access-client-id`,`text`),access_client_secret:u(p[`origin-access-client-secret`],`origin-access-client-secret`,`text`),service_id:u(p[`origin-service-id`],`origin-service-id`,`text`)},origin_connection_limit:p[`origin-connection-limit`]}):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(`Updating`,async()=>s.hyperdrive.replace({...e,account_id:m,hyperdrive_id:p[`hyperdrive-id`]})),{successLabel:`Updated`});return}p.name===void 0&&(p.name=await d(`name`,`The name of the Hyperdrive configuration. Used to identify the configuration in the Cloudflare dashboard and API.`)),p[`origin-database`]===void 0&&(p[`origin-database`]=await d(`origin-database`,`Set the name of your origin database.`)),p[`origin-password`]===void 0&&(p[`origin-password`]=await d(`origin-password`,`Set the password needed to access your origin database. The API never returns this write-only value.`,{kind:`secret`})),p[`origin-scheme`]===void 0&&(p[`origin-scheme`]=await f(`origin-scheme`,`Specifies the URL scheme used to connect to your origin database.`,[`postgres`,`postgresql`,`mysql`])),p[`origin-user`]===void 0&&(p[`origin-user`]=await d(`origin-user`,`Set the user of your origin database.`));let h=l({caching:{disabled:p[`caching-disabled`],max_age:p[`caching-max-age`],stale_while_revalidate:p[`caching-stale-while-revalidate`]},mtls:{ca_certificate_id:u(p[`mtls-ca-certificate-id`],`mtls-ca-certificate-id`,`text`),mtls_certificate_id:u(p[`mtls-certificate-id`],`mtls-certificate-id`,`text`),sslmode:u(p[`mtls-sslmode`],`mtls-sslmode`,`text`)},name:u(p.name,`name`,`text`),origin:{database:u(p[`origin-database`],`origin-database`,`text`),password:u(p[`origin-password`],`origin-password`,`text`),scheme:u(p[`origin-scheme`],`origin-scheme`,`text`),user:u(p[`origin-user`],`origin-user`,`text`),host:u(p[`origin-host`],`origin-host`,`text`),port:p[`origin-port`],access_client_id:u(p[`origin-access-client-id`],`origin-access-client-id`,`text`),access_client_secret:u(p[`origin-access-client-secret`],`origin-access-client-secret`,`text`),service_id:u(p[`origin-service-id`],`origin-service-id`,`text`)},origin_connection_limit:p[`origin-connection-limit`]});i(await o(`Updating`,async()=>s.hyperdrive.replace({...h,account_id:m,hyperdrive_id:p[`hyperdrive-id`]})),{successLabel:`Updated`})})};function E(e){return e.positional(`hyperdrive-id`,{type:`string`,description:`The unique identifier of the Hyperdrive configuration.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`restart <hyperdrive-id>`,describe:`Restarts the connection pool for the specified Hyperdrive configuration without changing its configuration. Existing connections are drained and a new pool is established at the edge.`,builder:E,handler:async c=>s({command:`hyperdrive restart`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf hyperdrive restart`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/hyperdrive/configs/${c[`hyperdrive-id`]==null?`<hyperdrive-id>`:encodeURIComponent(String(c[`hyperdrive-id`]))}/restart`,pathParams:{"hyperdrive-id":String(c[`hyperdrive-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Creating`,async()=>s.hyperdrive.restart({account_id:l,hyperdrive_id:c[`hyperdrive-id`]})),{successLabel:`Created`})})};function O(e){return e.positional(`hyperdrive-id`,{type:`string`,description:`The unique identifier of the Hyperdrive configuration.`,demandOption:!0}).option(`caching-disabled`,{type:`boolean`,description:`Set to true to disable caching of SQL responses. Default is false.`}).option(`caching-max-age`,{type:`number`,description:`Specify the maximum duration (in seconds) items should persist in the cache. Defaults to 60 seconds if not specified.`}).option(`caching-stale-while-revalidate`,{type:`number`,description:`Specify the number of seconds the cache may serve a stale response. Defaults to 15 seconds if not specified.`}).option(`mtls-ca-certificate-id`,{type:`string`,description:`Define CA certificate ID obtained after uploading CA cert.`}).option(`mtls-certificate-id`,{type:`string`,description:`Define mTLS certificate ID obtained after uploading client cert.`}).option(`mtls-sslmode`,{type:`string`,description:"PostgreSQL accepts `require`, `verify-ca`, and `verify-full`. MySQL accepts `REQUIRED`, `VERIFY_CA`, and `VERIFY_IDENTITY`. The verify modes require a CA certificate; the require modes cannot be used with a CA certificate.",choices:[`require`,`verify-ca`,`verify-full`,`REQUIRED`,`VERIFY_CA`,`VERIFY_IDENTITY`]}).option(`name`,{type:`string`,description:`The name of the Hyperdrive configuration. Used to identify the configuration in the Cloudflare dashboard and API. An empty value leaves the name unchanged.`}).option(`origin-connection-limit`,{type:`number`,description:`The (soft) maximum number of connections the Hyperdrive is allowed to make to the origin database.
|
|
16
|
-
|
|
17
|
-
Maximum allowed: 20 for free tier accounts, 100 for paid tier accounts.
|
|
18
|
-
If not specified, defaults to 20 for free tier and 60 for paid tier.
|
|
19
|
-
Certain Cloudflare-managed origins may be permitted a higher limit.
|
|
20
|
-
Contact Cloudflare if you need a higher limit.
|
|
21
|
-
`}).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 <hyperdrive-id>`,describe:`Updates and returns the specified fields of the Hyperdrive configuration. Custom caching settings are not kept if caching is disabled.`,builder:O,handler:async d=>s({command:`hyperdrive update`,classification:{safeFlags:[`caching-disabled`,`mtls-sslmode`,`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf hyperdrive update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/hyperdrive/configs/${d[`hyperdrive-id`]==null?`<hyperdrive-id>`:encodeURIComponent(String(d[`hyperdrive-id`]))}`,pathParams:{"hyperdrive-id":String(d[`hyperdrive-id`]??``)},bodyKind:`json`,body:d.body===void 0?l({caching:{disabled:d[`caching-disabled`],max_age:d[`caching-max-age`],stale_while_revalidate:d[`caching-stale-while-revalidate`]},mtls:{ca_certificate_id:u(d[`mtls-ca-certificate-id`],`mtls-ca-certificate-id`,`text`),mtls_certificate_id:u(d[`mtls-certificate-id`],`mtls-certificate-id`,`text`),sslmode:u(d[`mtls-sslmode`],`mtls-sslmode`,`text`)},name:u(d.name,`name`,`text`),origin_connection_limit:d[`origin-connection-limit`]}):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.hyperdrive.update({...e,account_id:f,hyperdrive_id:d[`hyperdrive-id`]})),{successLabel:`Updated`});return}let p=l({caching:{disabled:d[`caching-disabled`],max_age:d[`caching-max-age`],stale_while_revalidate:d[`caching-stale-while-revalidate`]},mtls:{ca_certificate_id:u(d[`mtls-ca-certificate-id`],`mtls-ca-certificate-id`,`text`),mtls_certificate_id:u(d[`mtls-certificate-id`],`mtls-certificate-id`,`text`),sslmode:u(d[`mtls-sslmode`],`mtls-sslmode`,`text`)},name:u(d.name,`name`,`text`),origin_connection_limit:d[`origin-connection-limit`]});i(await o(`Updating`,async()=>s.hyperdrive.update({...p,account_id:f,hyperdrive_id:d[`hyperdrive-id`]})),{successLabel:`Updated`})})},A={command:`hyperdrive`,describe:`Accelerate access to existing databases by caching queries and pooling connections at the edge`,builder:e=>e.command(_).command(h).command(y).command(x).command(C).command(T).command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{A as default};
|
package/dist/iam-CXlYm0uC.mjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
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,n as p}from"./prompt-BP8XrQSj.mjs";import{t as m}from"./cli-types-abvWQN3T.mjs";function h(e){return e.positional(`permission-group-id`,{type:`string`,description:`Permission Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ee={command:`get <permission-group-id>`,describe:`Get information about a specific permission group in an account.`,builder:h,handler:async c=>s({command:`iam permission-groups get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf iam permission-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/permission_groups/${c[`permission-group-id`]==null?`<permission-group-id>`:encodeURIComponent(String(c[`permission-group-id`]))}`,pathParams:{"permission-group-id":String(c[`permission-group-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.iam.permissionGroups.get({account_id:l,permission_group_id:c[`permission-group-id`]})),{successLabel:`Loaded`})})};function g(e){return e.option(`id`,{type:`string`,description:`ID of the permission group to be fetched.`}).option(`name`,{type:`string`,description:`Name of the permission group to be fetched.`}).option(`label`,{type:`string`,description:`Label of the permission group to be fetched.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`list`,describe:`List all the permissions groups for an account.`,builder:g,handler:async c=>s({command:`iam permission-groups list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={id:c.id,name:c.name,label:c.label,page:c.page,per_page:c[`per-page`]};if(c.dryRun){a({command:`cf iam permission-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/permission_groups`,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.iam.permissionGroups.list({account_id:u,...s})),{successLabel:`Loaded`})})},v={command:`permission-groups`,describe:`View the permission groups that can be assigned to API tokens and policies`,builder:e=>e.command(ee).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`name`,{type:`string`,description:`Name of the resource group`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`create`,describe:`Create a new Resource Group under the specified account.`,builder:y,handler:async l=>s({command:`iam resource-groups create`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf iam resource-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/resource_groups`,pathParams:{},bodyKind:`json`,body:l.body===void 0?u({name:d(l.name,`name`,`text`)}):c(l.body)});return}let s=await r(l),p=l.local?e:await t();if(l.accountId=p,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.iam.resourceGroups.create({...e,account_id:p})),{successLabel:`Created`});return}l.name===void 0&&(l.name=await f(`name`,`Name of the resource group`));let m=u({name:d(l.name,`name`,`text`)});i(await o(`Creating`,async()=>s.iam.resourceGroups.create({...m,account_id:p})),{successLabel:`Created`})})};function x(e){return e.positional(`resource-group-id`,{type:`string`,description:`Resource Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const S={command:`delete <resource-group-id>`,describe:`Remove a resource group from an account.`,builder:x,handler:async c=>s({command:`iam resource-groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf iam resource-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/resource_groups/${c[`resource-group-id`]==null?`<resource-group-id>`:encodeURIComponent(String(c[`resource-group-id`]))}`,pathParams:{"resource-group-id":String(c[`resource-group-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
|
-
`);return}i(await o(`Deleting`,async()=>s.iam.resourceGroups.delete({account_id:l,resource_group_id:c[`resource-group-id`]})),{successLabel:`Deleted`})})};function C(e){return e.positional(`resource-group-id`,{type:`string`,description:`Resource Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`get <resource-group-id>`,describe:`Get information about a specific resource group in an account.`,builder:C,handler:async c=>s({command:`iam resource-groups get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf iam resource-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/resource_groups/${c[`resource-group-id`]==null?`<resource-group-id>`:encodeURIComponent(String(c[`resource-group-id`]))}`,pathParams:{"resource-group-id":String(c[`resource-group-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.iam.resourceGroups.get({account_id:l,resource_group_id:c[`resource-group-id`]})),{successLabel:`Loaded`})})};function T(e){return e.option(`id`,{type:`string`,description:`ID of the resource group to be fetched.`}).option(`name`,{type:`string`,description:`Name of the resource group to be fetched.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`list`,describe:`List all the resource groups for an account.`,builder:T,handler:async c=>s({command:`iam resource-groups list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={id:c.id,name:c.name};if(c.dryRun){a({command:`cf iam resource-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/resource_groups`,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.iam.resourceGroups.list({account_id:u,...s})),{successLabel:`Loaded`})})};function D(e){return e.positional(`resource-group-id`,{type:`string`,description:`Resource Group identifier tag.`,demandOption:!0}).option(`name`,{type:`string`,description:`Name of the resource group`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const O={command:`update <resource-group-id>`,describe:`Modify an existing resource group.`,builder:D,handler:async l=>s({command:`iam resource-groups update`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf iam resource-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/resource_groups/${l[`resource-group-id`]==null?`<resource-group-id>`:encodeURIComponent(String(l[`resource-group-id`]))}`,pathParams:{"resource-group-id":String(l[`resource-group-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({name:d(l.name,`name`,`text`)}):c(l.body)});return}let s=await r(l),f=l.local?e:await t();if(l.accountId=f,l.body){let e=c(l.body);i(await o(`Updating`,async()=>s.iam.resourceGroups.update({...e,account_id:f,resource_group_id:l[`resource-group-id`]})),{successLabel:`Updated`});return}let p=u({name:d(l.name,`name`,`text`)});i(await o(`Updating`,async()=>s.iam.resourceGroups.update({...p,account_id:f,resource_group_id:l[`resource-group-id`]})),{successLabel:`Updated`})})},k={command:`resource-groups`,describe:`Define scopes that limit which account resources a policy or token can access`,builder:e=>e.command(b).command(S).command(w).command(E).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`begin-verification <sso-connector-id>`,describe:`Validates the user has added the DNS TXT record required for validating ownership of the domain they are trying to set up a connector for.`,builder:A,handler:async c=>s({command:`iam sso begin-verification`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf iam sso begin-verification`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/sso_connectors/${c[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(c[`sso-connector-id`]))}/begin_verification`,pathParams:{"sso-connector-id":String(c[`sso-connector-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Creating`,async()=>s.iam.sso.beginVerification({account_id:l,sso_connector_id:c[`sso-connector-id`]})),{successLabel:`Created`})})};function M(e){return e.option(`begin-verification`,{type:`boolean`,description:`Begin the verification process after creation`,default:!0}).option(`email-domain`,{type:`string`,description:`Email domain of the new SSO connector`}).option(`use-fedramp-language`,{type:`boolean`,description:`Controls the display of FedRAMP language to the user during SSO login`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const N={command:`create`,describe:`Creates a new SSO connector for logging into Cloudflare through an identity provider.`,builder:M,handler:async l=>s({command:`iam sso create`,classification:{safeFlags:[`begin-verification`,`use-fedramp-language`,`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf iam sso create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/sso_connectors`,pathParams:{},bodyKind:`json`,body:l.body===void 0?u({begin_verification:l[`begin-verification`],email_domain:d(l[`email-domain`],`email-domain`,`text`),use_fedramp_language:l[`use-fedramp-language`]}):c(l.body)});return}let s=await r(l),p=l.local?e:await t();if(l.accountId=p,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.iam.sso.create({...e,account_id:p})),{successLabel:`Created`});return}l[`email-domain`]===void 0&&(l[`email-domain`]=await f(`email-domain`,`Email domain of the new SSO connector`));let m=u({begin_verification:l[`begin-verification`],email_domain:d(l[`email-domain`],`email-domain`,`text`),use_fedramp_language:l[`use-fedramp-language`]});i(await o(`Creating`,async()=>s.iam.sso.create({...m,account_id:p})),{successLabel:`Created`})})};function P(e){return e.positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const F={command:`delete <sso-connector-id>`,describe:`Deletes an SSO connector from the account.`,builder:P,handler:async c=>s({command:`iam sso delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf iam sso delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/sso_connectors/${c[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(c[`sso-connector-id`]))}`,pathParams:{"sso-connector-id":String(c[`sso-connector-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
|
-
`);return}i(await o(`Deleting`,async()=>s.iam.sso.delete({account_id:l,sso_connector_id:c[`sso-connector-id`]})),{successLabel:`Deleted`})})};function I(e){return e.positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`get <sso-connector-id>`,describe:`Retrieves details for a specific SSO connector.`,builder:I,handler:async c=>s({command:`iam sso get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf iam sso get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/sso_connectors/${c[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(c[`sso-connector-id`]))}`,pathParams:{"sso-connector-id":String(c[`sso-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.iam.sso.get({account_id:l,sso_connector_id:c[`sso-connector-id`]})),{successLabel:`Loaded`})})};function R(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`list`,describe:`Lists all SSO connectors configured for the account.`,builder:R,handler:async c=>s({command:`iam sso list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf iam sso list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/sso_connectors`,pathParams:{},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.iam.sso.list({account_id:l})),{successLabel:`Loaded`})})};function te(e){return e.positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`SSO Connector enabled state`}).option(`use-fedramp-language`,{type:`boolean`,description:`Controls the display of FedRAMP language to the user during SSO login`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`update <sso-connector-id>`,describe:`Updates the state or configuration of an SSO connector.`,builder:te,handler:async l=>s({command:`iam sso update`,classification:{safeFlags:[`enabled`,`use-fedramp-language`,`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf iam sso update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/sso_connectors/${l[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(l[`sso-connector-id`]))}`,pathParams:{"sso-connector-id":String(l[`sso-connector-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({enabled:l.enabled,use_fedramp_language:l[`use-fedramp-language`]}):c(l.body)});return}let s=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=c(l.body);i(await o(`Updating`,async()=>s.iam.sso.update({...e,account_id:d,sso_connector_id:l[`sso-connector-id`]})),{successLabel:`Updated`});return}let f=u({enabled:l.enabled,use_fedramp_language:l[`use-fedramp-language`]});i(await o(`Updating`,async()=>s.iam.sso.update({...f,account_id:d,sso_connector_id:l[`sso-connector-id`]})),{successLabel:`Updated`})})},V={command:`sso`,describe:`Configure single sign-on connectors to authenticate account members through an external identity provider`,builder:e=>e.command(j).command(N).command(F).command(L).command(z).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function H(e){return e.option(`name`,{type:`string`,description:`Name of the User group.`}).option(`policies`,{type:`string`,description:`Policies attached to the User group. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const U={command:`create`,describe:`Create a new user group under the specified account.`,builder:H,handler:async p=>s({command:`iam user-groups create`,classification:{safeFlags:[`dry-run`]}},p,async()=>{if(p.dryRun){a({command:`cf iam user-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups`,pathParams:{},bodyKind:`json`,body:p.body===void 0?u({name:d(p.name,`name`,`text`),policies:l(p.policies,`policies`)}):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.iam.userGroups.create({...e,account_id:m})),{successLabel:`Created`});return}p.name===void 0&&(p.name=await f(`name`,`Name of the User group.`));let h=u({name:d(p.name,`name`,`text`),policies:l(p.policies,`policies`)});i(await o(`Creating`,async()=>s.iam.userGroups.create({...h,account_id:m})),{successLabel:`Created`})})};function W(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const G={command:`delete <user-group-id>`,describe:`Remove a user group from an account.`,builder:W,handler:async c=>s({command:`iam user-groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf iam user-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups/${c[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(c[`user-group-id`]))}`,pathParams:{"user-group-id":String(c[`user-group-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.
|
|
5
|
-
`);return}i(await o(`Deleting`,async()=>s.iam.userGroups.delete({account_id:l,user_group_id:c[`user-group-id`]})),{successLabel:`Deleted`})})};function K(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`get <user-group-id>`,describe:`Get information about a specific user group in an account.`,builder:K,handler:async c=>s({command:`iam user-groups get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf iam user-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups/${c[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(c[`user-group-id`]))}`,pathParams:{"user-group-id":String(c[`user-group-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.iam.userGroups.get({account_id:l,user_group_id:c[`user-group-id`]})),{successLabel:`Loaded`})})};function J(e){return e.option(`id`,{type:`string`,description:`ID of the user group to be fetched.`}).option(`name`,{type:`string`,description:`Name of the user group to be fetched.`}).option(`fuzzy-name`,{type:`string`,description:`A string used for searching for user groups containing that substring.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`direction`,{type:`string`,description:`The sort order of returned user groups by name (ascending or descending).`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`list`,describe:`List all the user groups for an account.`,builder:m(J),handler:async c=>s({command:`iam user-groups list`,classification:{safeFlags:[`direction`,`dry-run`]}},c,async()=>{let s={id:c.id,name:c.name,fuzzyName:c[`fuzzy-name`],page:c.page,per_page:c[`per-page`],direction:c.direction};if(c.dryRun){a({command:`cf iam user-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups`,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.iam.userGroups.list({account_id:u,...s})),{successLabel:`Loaded`})})};function X(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Z={command:`create <user-group-id>`,describe:`Add members to a User Group.`,builder:X,handler:async l=>s({command:`iam user-groups members create`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf iam user-groups members create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups/${l[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(l[`user-group-id`]))}/members`,pathParams:{"user-group-id":String(l[`user-group-id`]??``)},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let s=await r(l),u=l.local?e:await t();if(l.accountId=u,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.iam.userGroups.members.create({body:e,account_id:u,user_group_id:l[`user-group-id`]})),{successLabel:`Created`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function Q(e){return e.positional(`member-id`,{type:`string`,description:`The identifier of an existing account Member.`,demandOption:!0}).option(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ne={command:`delete <member-id>`,describe:`Remove a member from User Group`,builder:Q,handler:async c=>s({command:`iam user-groups members delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf iam user-groups members delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups/${c[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(c[`user-group-id`]))}/members/${c[`member-id`]==null?`<member-id>`:encodeURIComponent(String(c[`member-id`]))}`,pathParams:{"user-group-id":String(c[`user-group-id`]??``),"member-id":String(c[`member-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.
|
|
6
|
-
`);return}i(await o(`Deleting`,async()=>s.iam.userGroups.members.delete({account_id:l,user_group_id:c[`user-group-id`],member_id:c[`member-id`]})),{successLabel:`Deleted`})})};function re(e){return e.positional(`member-id`,{type:`string`,description:`The identifier of an existing account Member.`,demandOption:!0}).option(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`get <member-id>`,describe:`Get details of a specific member in a user group.`,builder:re,handler:async c=>s({command:`iam user-groups members get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf iam user-groups members get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups/${c[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(c[`user-group-id`]))}/members/${c[`member-id`]==null?`<member-id>`:encodeURIComponent(String(c[`member-id`]))}`,pathParams:{"user-group-id":String(c[`user-group-id`]??``),"member-id":String(c[`member-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.iam.userGroups.members.get({account_id:l,user_group_id:c[`user-group-id`],member_id:c[`member-id`]})),{successLabel:`Loaded`})})};function ae(e){return e.option(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`fuzzy-email`,{type:`string`,description:`A string used for filtering members by partial email match.`}).option(`direction`,{type:`string`,description:`The sort order of returned user group members by email.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`list`,describe:`List all the members attached to a user group.`,builder:m(ae),handler:async c=>s({command:`iam user-groups members list`,classification:{safeFlags:[`direction`,`dry-run`]}},c,async()=>{let s={page:c.page,per_page:c[`per-page`],fuzzyEmail:c[`fuzzy-email`],direction:c.direction};if(c.dryRun){a({command:`cf iam user-groups members list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups/${c[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(c[`user-group-id`]))}/members`,pathParams:{"user-group-id":String(c[`user-group-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.iam.userGroups.members.list({account_id:u,user_group_id:c[`user-group-id`],...s})),{successLabel:`Loaded`})})};function $(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Set/Replace members to a user group.`})}const se={command:`update <user-group-id>`,describe:`Replace the set of members attached to a User Group.`,builder:$,handler:async l=>s({command:`iam user-groups members update`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf iam user-groups members update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups/${l[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(l[`user-group-id`]))}/members`,pathParams:{"user-group-id":String(l[`user-group-id`]??``)},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let s=await r(l),u=l.local?e:await t();if(l.accountId=u,l.body){let e=c(l.body);i(await o(`Updating`,async()=>s.iam.userGroups.members.update({body:e,account_id:u,user_group_id:l[`user-group-id`]})),{successLabel:`Updated`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},ce={command:`members`,describe:`Operations for user-groups.members`,builder:e=>e.command(Z).command(ne).command(ie).command(oe).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function le(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`name`,{type:`string`,description:`Name of the User group.`}).option(`policies`,{type:`string`,description:`Policies attached to the User group. 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 ue={command:`update <user-group-id>`,describe:`Modify an existing user group.`,builder:le,handler:async f=>s({command:`iam user-groups update`,classification:{safeFlags:[`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf iam user-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups/${f[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(f[`user-group-id`]))}`,pathParams:{"user-group-id":String(f[`user-group-id`]??``)},bodyKind:`json`,body:f.body===void 0?u({name:d(f.name,`name`,`text`),policies:l(f.policies,`policies`)}):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.iam.userGroups.update({...e,account_id:p,user_group_id:f[`user-group-id`]})),{successLabel:`Updated`});return}let m=u({name:d(f.name,`name`,`text`),policies:l(f.policies,`policies`)});i(await o(`Updating`,async()=>s.iam.userGroups.update({...m,account_id:p,user_group_id:f[`user-group-id`]})),{successLabel:`Updated`})})},de={command:`user-groups`,describe:`Organize account members into groups for easier permission assignment`,builder:e=>e.command(U).command(G).command(q).command(Y).command(ue).command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},fe={command:`iam`,describe:`Identity and access management — permission groups, resource groups, user groups, and SSO connectors`,builder:e=>e.command(v).command(k).command(V).command(de).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{fe as default};
|