cf 0.13.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_meta/commands.json +6724 -3970
- package/dist/_meta/hand-written-commands.json +150 -32
- package/dist/_meta/schemas.json +2083 -2159
- package/dist/abuse-reports-BAQR1w79.mjs +26 -0
- package/dist/access-C8KMplzp.mjs +27 -0
- package/dist/account-B-KQSR0L.mjs +12 -0
- package/dist/account-tags-EncLJpLc.mjs +15 -0
- package/dist/accounts-BA4Mp3A_.mjs +132 -0
- package/dist/acm-ByxUJcqF.mjs +15 -0
- package/dist/addressing-C-ym0h0G.mjs +93 -0
- package/dist/agent-memory-CkPSiZDI.mjs +34 -0
- package/dist/ai-DkE_Q64s.mjs +31 -0
- package/dist/ai-audit-pPcjYWI5.mjs +6 -0
- package/dist/ai-gateway-DtrwF1lQ.mjs +147 -0
- package/dist/ai-search-DLD_kDS1.mjs +79 -0
- package/dist/ai-security-jyZcBl9g.mjs +10 -0
- package/dist/alerting-DOROjm8E.mjs +56 -0
- package/dist/analytics-rQ-h-plT.mjs +21 -0
- package/dist/analytics_engine-Cg9gCAMt.mjs +4 -0
- package/dist/{lifecycle-XswDq0ZB.mjs → ansi-styles-eKEZXVwN.mjs} +1 -1
- package/dist/api-security-B8p8vp8u.mjs +154 -0
- package/dist/argo-g8SjUb_t.mjs +10 -0
- package/dist/artifacts-B1PaeF5h.mjs +43 -0
- package/dist/audit-logs-DmU_PHy_.mjs +4 -0
- package/dist/auth-CZqics6E.mjs +2 -0
- package/dist/auth-Cp7gT-AF.mjs +8 -0
- package/dist/billing-CvTbUg-H.mjs +23 -0
- package/dist/bot-management-z53tbcbH.mjs +9 -0
- package/dist/botnet-feed-CSBbJdr_.mjs +11 -0
- package/dist/brand-protection-DzV211IQ.mjs +27 -0
- package/dist/browser-extension-C0Hi9CHX.mjs +15 -0
- package/dist/browser-run-DYQvMAyo.mjs +46 -0
- package/dist/build-BPIp8J5F.mjs +2 -0
- package/dist/build-OC77a1zq.mjs +2 -0
- package/dist/builds-CwKRqjQ5.mjs +71 -0
- package/dist/cache-CugNPPsJ.mjs +45 -0
- package/dist/certificate-authorities-DaEnJYge.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-DZUIqBTB.mjs +13 -0
- package/dist/client-side-security-Dk6F1ENG.mjs +63 -0
- package/dist/cloud-connector-avpf86kG.mjs +6 -0
- package/dist/cloudflared-DhItYrCq.mjs +2 -0
- package/dist/cloudforce-one-DNRhUD8z.mjs +456 -0
- package/dist/command-B2Qe-WUa.mjs +2 -0
- package/dist/command-CF0giIIc.mjs +3 -0
- package/dist/command-D45NW-R3.mjs +2 -0
- package/dist/command-DIvPLK8x.mjs +2 -0
- package/dist/{completions-nPO9PdSu.mjs → completions-xPLd1cvL.mjs} +3 -3
- package/dist/{config-B8lwPpVl.mjs → config-B4vIa0zp.mjs} +1 -1
- package/dist/config.d.mts +1 -1729
- package/dist/config.mjs +1 -1
- package/dist/connector-interrupts-BSztJ-Ko.mjs +6 -0
- package/dist/connector-telemetry-events-_M8CCK6_.mjs +6 -0
- package/dist/connector-telemetry-snapshots-DySvmR9a.mjs +6 -0
- package/dist/connectors-BSmhzNB7.mjs +15 -0
- package/dist/containers-B5vDcFzo.mjs +78 -0
- package/dist/{shared-YJtB5KZB.mjs → containers-CFzvhmyz.mjs} +85 -84
- package/dist/content-scan-CeLZAcbT.mjs +14 -0
- package/dist/cps-BlI_Od72.mjs +6 -0
- package/dist/csamScanner-Cn7d0HWS.mjs +10 -0
- package/dist/ct-alerting-lhgFPu-y.mjs +5 -0
- package/dist/custom-certificates-Ba4Do5qt.mjs +17 -0
- package/dist/custom-csrs-MNUIx8yX.mjs +11 -0
- package/dist/custom-hostnames-Dj1SBd0J.mjs +27 -0
- package/dist/custom-nameservers-C7nzhNzV.mjs +9 -0
- package/dist/custom-pages-BgfhGksj.mjs +21 -0
- package/dist/d1-P2kWbdID.mjs +45 -0
- package/dist/data-security-pBIozmRL.mjs +71 -0
- package/dist/dcv-delegation-Bpy9WnKZ.mjs +4 -0
- package/dist/delegate-GctF_lrq.mjs +2 -0
- package/dist/delegate.mjs +1 -1
- package/dist/{deploy-QTGENpOM.mjs → deploy-CVYdt3NK.mjs} +1 -1
- package/dist/{deploy-input-C7W1Bsji.mjs → deploy-input-DpOgndz4.mjs} +1 -1
- package/dist/dev-PPUBjWcm.mjs +4 -0
- package/dist/diagnostics-C62habGQ.mjs +15 -0
- package/dist/dialog-C_ccBiZp.mjs +2 -0
- package/dist/dist-B4pQ4CXK.mjs +48 -0
- package/dist/{dist-DW5BPGFs.mjs → dist-BpadEMNY.mjs} +1 -1
- package/dist/dist-dc4E1u01.mjs +272 -0
- package/dist/dls-CpkcyQ8C.mjs +17 -0
- package/dist/dns-DG1X4Wap.mjs +135 -0
- package/dist/dns-firewall-B1gGHEDo.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-D214VhxH.mjs +8 -0
- package/dist/email-auth-Ba4ONan2.mjs +6 -0
- package/dist/email-routing-BlqKnqNM.mjs +45 -0
- package/dist/email-security-Dl1E1Dko.mjs +160 -0
- package/dist/email-sending-DIRSSRIz.mjs +47 -0
- package/dist/error-sanitization-BkgUhGVc.mjs +2 -0
- package/dist/error-sanitization-DOlqWkNu.mjs +2 -0
- package/dist/fieldExtractors-zqYKMCEn.mjs +9 -0
- package/dist/firewall-DdsDh8GD.mjs +56 -0
- package/dist/flagship-CkUIVW7c.mjs +28 -0
- package/dist/fraud-BUpZgvQT.mjs +22 -0
- package/dist/google-tag-gateway-Bi1uLnEU.mjs +6 -0
- package/dist/healthchecks-DjQWb3EM.mjs +22 -0
- package/dist/hostnames-ClBLPbct.mjs +11 -0
- package/dist/hyperdrive-U54xZsWU.mjs +37 -0
- package/dist/iam-T-wWmOep.mjs +52 -0
- package/dist/images-ia5UG1GW.mjs +71 -0
- package/dist/index.mjs +1 -1
- package/dist/intel-BhswZLMI.mjs +76 -0
- package/dist/interactive-B6woOLo-.mjs +32 -0
- package/dist/interactive-DnUvQHjc.mjs +2 -0
- package/dist/ips-Dad_EvhM.mjs +4 -0
- package/dist/keyless-certificates-BhHaxLjM.mjs +13 -0
- package/dist/keys-DjIPvqj4.mjs +4 -0
- package/dist/kv-DzXVnK94.mjs +21 -0
- package/dist/leaked-credential-checks-B9G_ZTNH.mjs +18 -0
- package/dist/lifecycle-Ichnb2x1.mjs +2 -0
- package/dist/load-balancers-3wGHPsYz.mjs +76 -0
- package/dist/local-B6b2OIBW.mjs +2 -0
- package/dist/local-BrfySqnx.mjs +2 -0
- package/dist/{local-runtime-BUGCbx8r.mjs → local-runtime-DD8DAIlm.mjs} +1 -1
- package/dist/login-CEQbOgBM.mjs +5 -0
- package/dist/login-DEWvGuaU.mjs +2 -0
- package/dist/logo-matches-YGRPstPi.mjs +6 -0
- package/dist/logos-BirufUgo.mjs +7 -0
- package/dist/logpush-BlNbUHyV.mjs +46 -0
- package/dist/logs-DmFlVF9q.mjs +48 -0
- package/dist/magic-cloud-networking-B3Wj2dhJ.mjs +71 -0
- package/dist/magic-network-monitoring-ry63w2Rw.mjs +36 -0
- package/dist/magic-transit-CBVOK2aa.mjs +387 -0
- package/dist/managed-defense-BdW6s483.mjs +18 -0
- package/dist/managed-transforms-BIeiofIS.mjs +9 -0
- package/dist/matches-CAnwci0P.mjs +6 -0
- package/dist/mcp-BfhOMGFE.mjs +32 -0
- package/dist/mesh-CxUL2Wf-.mjs +26 -0
- package/dist/mtls-certificates-CzmTw4zs.mjs +13 -0
- package/dist/network-C68psMbz.mjs +50 -0
- package/dist/network-interconnects-CLsMrTuk.mjs +73 -0
- package/dist/oauth-D4bkeMAw.mjs +14 -0
- package/dist/oauth-DouM-qz0.mjs +2 -0
- package/dist/oauth-clients-DbUmVE_5.mjs +16 -0
- package/dist/oauth-scopes-CQ18rwBg.mjs +4 -0
- package/dist/observability-DpYxkFeZ.mjs +80 -0
- package/dist/{open-PBXRGS4R-DARSUDEI.mjs → open-PBXRGS4R-C4CKEADM.mjs} +3 -3
- package/dist/open-PBXRGS4R-C_-G_4DC.mjs +4 -0
- package/dist/organization-Dg55Xfz7.mjs +75 -0
- package/dist/organizations-QnyzGjB2.mjs +4 -0
- package/dist/origin-ca-certificates-Co5lqIGL.mjs +11 -0
- package/dist/origin-post-quantum-encryption-Cz8JZamC.mjs +6 -0
- package/dist/origin-tls-client-auth-Dd0T1Kfv.mjs +30 -0
- package/dist/{output-COcSQsfn.mjs → output-Bia1u2k5.mjs} +1 -1
- package/dist/page-rules--D3eXrCf.mjs +39 -0
- package/dist/pages-Ce8DDgNr.mjs +60 -0
- package/dist/pay-per-crawl-CpkEbasz.mjs +65 -0
- package/dist/pay-per-use-fyM1DWgY.mjs +6 -0
- package/dist/pipelines-CAqCgBLh.mjs +44 -0
- package/dist/precursor-DBnn4Q35.mjs +4 -0
- package/dist/previews-y_nSqWK5.mjs +4 -0
- package/dist/progress-Bi02B6v4.mjs +2 -0
- package/dist/project-settings-DSXevRvj.mjs +3 -0
- package/dist/prompt-Bx2PB-tt.mjs +3 -0
- package/dist/queries-dg-CVXjf.mjs +9 -0
- package/dist/queues-C_ilLbRI.mjs +63 -0
- package/dist/r2-data-catalog-DGv6aROr.mjs +44 -0
- package/dist/r2-hZAkra-l.mjs +127 -0
- package/dist/radar-BO9b0aZy.mjs +300 -0
- package/dist/{raw-fetch-BVYQR6C5.mjs → raw-fetch-DNTQkXbg.mjs} +1 -1
- package/dist/realtime-eSavuSeE.mjs +172 -0
- package/dist/registrar-Ct30kOXZ.mjs +43 -0
- package/dist/registrar-sandbox-Dmn9zGUk.mjs +56 -0
- package/dist/{registry-CWUfXloz.mjs → registry-vreNkX6u.mjs} +1 -1
- package/dist/reporting-B-F5aWUJ.mjs +14 -0
- package/dist/request-headers-Dnbzv6RZ.mjs +2 -0
- package/dist/request-tracers-CaubpUFV.mjs +4 -0
- package/dist/resolve-BXemCSyA.mjs +2 -0
- package/dist/resolve-CUDKxUrW.mjs +2 -0
- package/dist/resource-sharing-6Snv-b69.mjs +40 -0
- package/dist/resource-tagging-W_LFiX2J.mjs +4 -0
- package/dist/rules-C26eyeA5.mjs +18 -0
- package/dist/rulesets-BKzIwVtJ.mjs +37 -0
- package/dist/rum-Xdw5hyWY.mjs +30 -0
- package/dist/run-BBBMrSrs.mjs +2 -0
- package/dist/run-BRucX7Rz.mjs +2 -0
- package/dist/{schema-C8hU6G9R.mjs → schema-DqtYndhB.mjs} +1 -1
- package/dist/{schema-flags-DC4c6dka.mjs → schema-flags-CebDI0f1.mjs} +4 -4
- package/dist/scim-odJTXiIe.mjs +18 -0
- package/dist/{sdk-C12y5qCN.mjs → sdk-CvIO3tWS.mjs} +1 -1
- package/dist/secrets-store-RYpWWzaw.mjs +24 -0
- package/dist/security-center-B3D95vCa.mjs +30 -0
- package/dist/security-txt-BSytVv-9.mjs +9 -0
- package/dist/shared-D67owd9x.mjs +2 -0
- package/dist/smart-shield-C83Sfnf4.mjs +24 -0
- package/dist/snippets-B6oE9WIa.mjs +20 -0
- package/dist/source-BR4_k2ad.mjs +6 -0
- package/dist/spawn-CKqJ9J4_.mjs +523 -0
- package/dist/spectrum-CfxY--X_.mjs +83 -0
- package/dist/speed-DzK-kiWt.mjs +24 -0
- package/dist/src-B3h6tKMt.mjs +108 -0
- package/dist/ssl-dnjzPcSB.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-oFyhS4Wi.mjs +102 -0
- package/dist/submit-4f-ravmC.mjs +4 -0
- package/dist/tags-DrIP6Uiq.mjs +4 -0
- package/dist/{telemetry-DjGNSlkU.mjs → telemetry-Dk1GcQ0u.mjs} +1 -1
- package/dist/telemetry-Ds4epd3D.mjs +2 -0
- package/dist/telemetry-mKEb8lYB.mjs +2 -0
- package/dist/tenant-C-gc3NWv.mjs +12 -0
- package/dist/tenant-custom-nameservers-DduTQIwh.mjs +9 -0
- package/dist/{tools-D9RZkZRc.mjs → tools-BMKpYraQ.mjs} +1 -1
- package/dist/tunnels-D0QYsskp.mjs +29 -0
- package/dist/turnstile-C6Q3spRB.mjs +33 -0
- package/dist/ui-DH95w1Qk.mjs +5 -0
- package/dist/undici-DTSBJHNS.mjs +96 -0
- package/dist/update-check-BBS1K1jt.mjs +2 -0
- package/dist/update-check-CTLoakFV.mjs +2 -0
- package/dist/update-check-worker.mjs +2 -0
- package/dist/url-info-Cs0V89qq.mjs +4 -0
- package/dist/url-normalization-DaEQYy5h.mjs +9 -0
- package/dist/url-scanner-C4YVeQ4v.mjs +16 -0
- package/dist/user-BV1VY3Kl.mjs +112 -0
- package/dist/values-qDS63E43.mjs +4 -0
- package/dist/vectorize-NFzD3mP5.mjs +32 -0
- package/dist/version-W6_TN_kN.mjs +2 -0
- package/dist/waiting-rooms-Y9YGj3ih.mjs +53 -0
- package/dist/web-assets-Gd6z8dbt.mjs +64 -0
- package/dist/web3-DCJx4NRp.mjs +28 -0
- package/dist/workers-B-j-1ygi.mjs +36 -0
- package/dist/workers-builds-DPrNKjZW.mjs +14 -0
- package/dist/workers-for-platforms-BjKAhMLA.mjs +25 -0
- package/dist/workers-vpc-C5YoCnQK.mjs +13 -0
- package/dist/workflows-C2KKIJjl.mjs +43 -0
- package/dist/zaraz-CVLCs1IX.mjs +22 -0
- package/dist/zero-trust-BtJi4OXF.mjs +795 -0
- package/dist/zone-hKgt0WzO.mjs +4 -0
- package/dist/zones-CCNyaD3J.mjs +124 -0
- package/package.json +15 -12
- package/dist/_meta/agent-context.json +0 -193
- package/dist/abuse-reports-BbaHw4ST.mjs +0 -8
- package/dist/access-D6Xz892p.mjs +0 -11
- package/dist/account-DvxcqeaK.mjs +0 -2
- package/dist/account-tags-CeqfEWpz.mjs +0 -9
- package/dist/accounts-Bx-8BMH9.mjs +0 -30
- package/dist/acm--0opdSGE.mjs +0 -3
- package/dist/addressing-BS1ynzLA.mjs +0 -13
- package/dist/agent-context-BPhyrSns.mjs +0 -8
- package/dist/agent-memory-DczzpEw5.mjs +0 -6
- package/dist/ai-CDdCTcQl.mjs +0 -5
- package/dist/ai-audit-Bx9KMQYh.mjs +0 -2
- package/dist/ai-gateway-BSXJEaYS.mjs +0 -13
- package/dist/ai-search-DRQj1aMu.mjs +0 -7
- package/dist/ai-security-C_Rb0lGT.mjs +0 -4
- package/dist/alerting-BAR9eFs2.mjs +0 -6
- package/dist/analytics-BaUZwNc5.mjs +0 -4
- package/dist/analytics_engine-DkEzlhfT.mjs +0 -2
- package/dist/api-security-jA0lOk6a.mjs +0 -50
- package/dist/argo-Cz4pDagx.mjs +0 -2
- package/dist/artifacts-BcLTGfAv.mjs +0 -5
- package/dist/audit-logs-DbIv4n6u.mjs +0 -2
- package/dist/auth-rW5d3jtr.mjs +0 -5
- package/dist/auth-tvDdC1J-.mjs +0 -8
- package/dist/billing-Md87QjqW.mjs +0 -3
- package/dist/bot-management-VHMo4hpU.mjs +0 -5
- package/dist/botnet-feed-BHqfo3sa.mjs +0 -3
- package/dist/brand-protection-HUeR6Pof.mjs +0 -3
- package/dist/browser-extension-199oZg3X.mjs +0 -3
- package/dist/browser-run-DDasyux-.mjs +0 -4
- package/dist/build-0QlYUfFS.mjs +0 -2
- package/dist/builds-B-lXn6JR.mjs +0 -9
- package/dist/cache-CevKpiTM.mjs +0 -9
- package/dist/certificate-authorities-DAg-aO1B.mjs +0 -2
- package/dist/cf-C11NGkjx.mjs +0 -18
- package/dist/chunk-LQW53VED-CoECHA3R.mjs +0 -119
- package/dist/chunk-QBZBEHZB-BuiXJn8j.mjs +0 -2
- package/dist/chunk-vbHwaUoU.mjs +0 -2
- package/dist/client-certificates-Bay7oPLE.mjs +0 -3
- package/dist/client-side-security-CbU9xn0k.mjs +0 -37
- package/dist/cloud-connector-AH2ClcSL.mjs +0 -2
- package/dist/cloudforce-one-DwOfS75V.mjs +0 -32
- package/dist/command-CMzMsll4.mjs +0 -2
- package/dist/connector-interrupts-DcLrqM2V.mjs +0 -2
- package/dist/connector-telemetry-events-PrJWgNs9.mjs +0 -2
- package/dist/connector-telemetry-snapshots-CIjJm5yu.mjs +0 -2
- package/dist/connectors-CEAy30E-.mjs +0 -3
- package/dist/containers-BsbDqbSn.mjs +0 -58
- package/dist/content-scan-BdK936iO.mjs +0 -4
- package/dist/cps-oP97-qkm.mjs +0 -2
- package/dist/csamScanner-DUNN4INg.mjs +0 -6
- package/dist/ct-alerting-dV_gsV2w.mjs +0 -3
- package/dist/custom-certificates-DYspvjo4.mjs +0 -5
- package/dist/custom-csrs-DjSWLQRu.mjs +0 -3
- package/dist/custom-hostnames-df1lH6IY.mjs +0 -5
- package/dist/custom-nameservers-CLTbN-9R.mjs +0 -3
- package/dist/custom-pages-DzKnSgL3.mjs +0 -3
- package/dist/d1-JBEqjJoj.mjs +0 -20
- package/dist/data-security-CIktWnXt.mjs +0 -7
- package/dist/dcv-delegation-_r6Vc6VL.mjs +0 -2
- package/dist/dev-CAubuxCc.mjs +0 -4
- package/dist/diagnostics-B0DRh714.mjs +0 -3
- package/dist/dist-12KzRsBM.mjs +0 -387
- package/dist/dist-BCVqQpg2.mjs +0 -2
- package/dist/dist-Cp3uJN1x.mjs +0 -48
- package/dist/dist-S9K_8gq9.mjs +0 -9
- package/dist/dls-CFzTHcZM.mjs +0 -3
- package/dist/dns-Dw6u-NV1.mjs +0 -29
- package/dist/dns-firewall-CIPptslp.mjs +0 -57
- package/dist/dry-run-DiVy1lVo.mjs +0 -2
- package/dist/durable-objects-CCkeqqBq.mjs +0 -2
- package/dist/email-auth-kdxO51Oz.mjs +0 -2
- package/dist/email-routing-BLggZdQq.mjs +0 -6
- package/dist/email-security-DjADlgdM.mjs +0 -18
- package/dist/email-sending-Cz7E7GoP.mjs +0 -7
- package/dist/error-sanitization-DfLijlBJ.mjs +0 -2
- package/dist/fieldExtractors-BWaMi6lD.mjs +0 -3
- package/dist/firewall-5t6OBIOl.mjs +0 -8
- package/dist/flagship-CzG_VoNR.mjs +0 -4
- package/dist/fraud-UOg_69Ob.mjs +0 -20
- package/dist/google-tag-gateway-DirkD-Q2.mjs +0 -2
- package/dist/healthchecks-BkHZGTp1.mjs +0 -4
- package/dist/hostnames-EUYOZm21.mjs +0 -3
- package/dist/hyperdrive-ZoLJlJCL.mjs +0 -21
- package/dist/iam-BQ2xSgYN.mjs +0 -6
- package/dist/images-CkEq6ScP.mjs +0 -8
- package/dist/intel-DDWEdGyl.mjs +0 -8
- package/dist/interactive-B2E03Fs-.mjs +0 -11
- package/dist/interactive-_B-EqD0Y.mjs +0 -23
- package/dist/ips-54Qmy-Uw.mjs +0 -2
- package/dist/keyless-certificates-CXHLc3Qz.mjs +0 -3
- package/dist/keys-rvI4TC3Z.mjs +0 -2
- package/dist/kv-CAeN1zBy.mjs +0 -5
- package/dist/leaked-credential-checks-CbbwtG-p.mjs +0 -4
- package/dist/load-balancers-BFwdwAIU.mjs +0 -6
- package/dist/local-C6XsFD_W.mjs +0 -2
- package/dist/logexplorer-D8rOPB5I.mjs +0 -17
- package/dist/logo-matches-Y3PxVn7t.mjs +0 -2
- package/dist/logos-BN8SvJhS.mjs +0 -3
- package/dist/logpush-BnLA4WVm.mjs +0 -4
- package/dist/logs-CDo7Y5sA.mjs +0 -3
- package/dist/magic-cloud-networking-wPuLwu-F.mjs +0 -5
- package/dist/magic-network-monitoring-BNERUpxS.mjs +0 -4
- package/dist/magic-transit-6tvVOECW.mjs +0 -111
- package/dist/managed-defense-AYwBOYIH.mjs +0 -2
- package/dist/managed-transforms-HZZNrkC7.mjs +0 -3
- package/dist/matches-Dp91L3dL.mjs +0 -2
- package/dist/mcp-P7pcieiT.mjs +0 -4
- package/dist/mesh-DjFrk6PL.mjs +0 -4
- package/dist/mtls-certificates-DZMoef2H.mjs +0 -3
- package/dist/network-7cd1U6-I.mjs +0 -6
- package/dist/network-interconnects-CQ7cPZjK.mjs +0 -41
- package/dist/oauth-DH3kMXSs.mjs +0 -14
- package/dist/oauth-clients-P9t-eMnx.mjs +0 -4
- package/dist/oauth-scopes-C3r9Qh_y.mjs +0 -2
- package/dist/observability-M1DnLhMR.mjs +0 -10
- package/dist/organization-cUE7GDCt.mjs +0 -45
- package/dist/organizations-C-Hcpd0w.mjs +0 -2
- package/dist/origin-ca-certificates-C8cJMyQH.mjs +0 -3
- package/dist/origin-post-quantum-encryption-DjZJCk8M.mjs +0 -2
- package/dist/origin-tls-client-auth-BsjR5EAV.mjs +0 -4
- package/dist/page-rules-B-zq1EUb.mjs +0 -27
- package/dist/pages-B6YpkPos.mjs +0 -14
- package/dist/pay-per-crawl-B4wx0lUb.mjs +0 -4
- package/dist/pipelines-BJc_RylD.mjs +0 -6
- package/dist/precursor-CLQu7suY.mjs +0 -4
- package/dist/progress-V6SZV3Ux.mjs +0 -2
- package/dist/prompt-DjRTpML4.mjs +0 -3
- package/dist/public-BMg6-Hxh-BfUOZTDP.mjs +0 -2
- package/dist/queries-DSrrket-.mjs +0 -3
- package/dist/queues-Tf7kPBpn.mjs +0 -7
- package/dist/r2-DmKNnxtC.mjs +0 -25
- package/dist/r2-data-catalog-DBxoifOq.mjs +0 -16
- package/dist/radar-Csk7Ab-b.mjs +0 -2
- package/dist/realtime-CDehZVhV.mjs +0 -20
- package/dist/registrar-sandbox-BxVdfnam.mjs +0 -56
- package/dist/registrar-vflzeNQ9.mjs +0 -43
- package/dist/reporting-BaPZ1PHN.mjs +0 -2
- package/dist/request-headers-CC4eHmI2.mjs +0 -3
- package/dist/request-tracers-C_UVBexV.mjs +0 -2
- package/dist/resolve-B8CyM1mi.mjs +0 -2
- package/dist/resource-sharing-CoB4S9j1.mjs +0 -6
- package/dist/resource-tagging-CUiUC5g4.mjs +0 -2
- package/dist/rules-4O8076_s.mjs +0 -4
- package/dist/rulesets-C84MxTYo.mjs +0 -5
- package/dist/rum-Bvwkrntx.mjs +0 -4
- package/dist/run-CRfinkSe.mjs +0 -2
- package/dist/schemas-O_ZNaF8R.mjs +0 -65
- package/dist/scim-BvxQmde6.mjs +0 -4
- package/dist/secrets-store-DOKWiC-j.mjs +0 -7
- package/dist/security-center-Bhy_aC-w.mjs +0 -2
- package/dist/security-txt-L7HJ9tq5.mjs +0 -3
- package/dist/smart-shield-COMXuQ1S.mjs +0 -4
- package/dist/snippets-DffQhlKt.mjs +0 -4
- package/dist/spawn-C1AISA2V.mjs +0 -526
- package/dist/spectrum-Cmf7SqQE.mjs +0 -63
- package/dist/speed-m8cdhLFS.mjs +0 -4
- package/dist/src-C8phrg-8.mjs +0 -109
- package/dist/ssl-D4ffsdSw.mjs +0 -15
- package/dist/startup-profile-Dx95Y5cl.mjs +0 -17
- package/dist/state-CHif8Y5I.mjs +0 -2
- package/dist/stream-DPF5fojV.mjs +0 -16
- package/dist/submit-Br8hfP0_.mjs +0 -2
- package/dist/tags-Bnt4JuxQ.mjs +0 -2
- package/dist/telemetry-Ch1vCICm.mjs +0 -2
- package/dist/tenant-D8u0CxoC.mjs +0 -2
- package/dist/tenant-custom-nameservers-BrWMyslZ.mjs +0 -3
- package/dist/tunnels-BkNPpTHa.mjs +0 -5
- package/dist/turnstile-MgwRECJv.mjs +0 -23
- package/dist/ui-DQSZeaG5.mjs +0 -5
- package/dist/url-info-Ddp7MgcI.mjs +0 -2
- package/dist/url-normalization-3ptK9ntV.mjs +0 -3
- package/dist/url-scanner-Psb9ollR.mjs +0 -2
- package/dist/user-DWdshcIu.mjs +0 -12
- package/dist/values-CDKQL1z2.mjs +0 -2
- package/dist/vectorize-CTYYUyQj.mjs +0 -4
- package/dist/waiting-rooms-BUdmwXDY.mjs +0 -11
- package/dist/web-assets-CpDwDEx8.mjs +0 -8
- package/dist/web3-YsjDyAzH.mjs +0 -4
- package/dist/workers-BKKxaZcz.mjs +0 -6
- package/dist/workers-builds-BWo5vUA9.mjs +0 -2
- package/dist/workers-for-platforms-ASJsxYdM.mjs +0 -5
- package/dist/workers-vpc-RkTnRvA2.mjs +0 -3
- package/dist/workflows-KrIFI9ns.mjs +0 -5
- package/dist/zaraz-DglXbVzZ.mjs +0 -2
- package/dist/zero-trust-RilTdSjX.mjs +0 -91
- package/dist/zone-DsBtVkvT.mjs +0 -2
- package/dist/zones-BFxvWFQW.mjs +0 -44
- /package/dist/{alerts-B2SJO4nd.mjs → alerts-CstOk8n0.mjs} +0 -0
- /package/dist/{autorag-iNjZXw1n.mjs → autorag-PRTwXGgn.mjs} +0 -0
- /package/dist/{body-parser-DIlfApuJ.mjs → body-parser-CUWbw_Tq.mjs} +0 -0
- /package/dist/{brands-BrVnNrT3.mjs → brands-BHRXlWDm.mjs} +0 -0
- /package/dist/{clear-an9o3dJ3.mjs → clear-UvKESVx3.mjs} +0 -0
- /package/dist/{cli-types-CrSoSMPF.mjs → cli-types-tt_LZMbn.mjs} +0 -0
- /package/dist/{connector-telemetry-events-latest-BqWfopFc.mjs → connector-telemetry-events-latest-DwnFeZg0.mjs} +0 -0
- /package/dist/{connector-telemetry-snapshots-latest-C1m9U1En.mjs → connector-telemetry-snapshots-latest-Dv6rZlxs.mjs} +0 -0
- /package/dist/{domain-info-B0Ykqv5l.mjs → domain-info-BqTDXNBo.mjs} +0 -0
- /package/dist/{health-CIUg1C5o.mjs → health-CwPzzrV6.mjs} +0 -0
- /package/dist/{input-validation-BxchZ9jE.mjs → input-validation-Ch4Vllrm.mjs} +0 -0
- /package/dist/{internal-DmpATljO.mjs → internal-WLHfxX64.mjs} +0 -0
- /package/dist/{live-B66u3_0g.mjs → live-D_k7eHdv.mjs} +0 -0
- /package/dist/{metadata-D062SVyy.mjs → metadata-APBiectA.mjs} +0 -0
- /package/dist/{rate-limit-analytics-BknoecoM.mjs → rate-limit-analytics-CDTPxSET.mjs} +0 -0
- /package/dist/{rate-limits-cdChIg_S.mjs → rate-limits-C3K9smdl.mjs} +0 -0
- /package/dist/{ready-C-H2cwp_.mjs → ready-CvwvbdTX.mjs} +0 -0
- /package/dist/{recent-submissions-DyuH_n5u.mjs → recent-submissions-CjzcT-iH.mjs} +0 -0
- /package/dist/{refute-uSlzkQKq.mjs → refute-CIAFMj00.mjs} +0 -0
- /package/dist/{scan-logo-DMk--WT7.mjs → scan-logo-zFkphtQ3.mjs} +0 -0
- /package/dist/{scan-page-DEHnAOJo.mjs → scan-page-CLl2MAkZ.mjs} +0 -0
- /package/dist/{search-BlKeSfVD.mjs → search-12jA1b4l.mjs} +0 -0
- /package/dist/{signed-url-CiGmGkLQ.mjs → signed-url-U0T_PEMR.mjs} +0 -0
- /package/dist/{submission-info-DHlTHDrs.mjs → submission-info-CZ84a3Nb.mjs} +0 -0
- /package/dist/{theme-CeVf-5qG.mjs → theme-BiIYWOed.mjs} +0 -0
- /package/dist/{total-queries-D5WvVfYi.mjs → total-queries-CJTc9Pde.mjs} +0 -0
- /package/dist/{tracked-domains-9deBK9bp.mjs → tracked-domains-BKLxnnSv.mjs} +0 -0
- /package/dist/{verify-S-TmhUDr.mjs → verify-CZW5Fo1q.mjs} +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{_ as e}from"./oauth-D4bkeMAw.mjs";import{r as t}from"./auth-Cp7gT-AF.mjs";import{t as n}from"./output-Bia1u2k5.mjs";import{t as r}from"./dry-run-CLX6Pbtq.mjs";import{t as i}from"./progress-Bi02B6v4.mjs";import{t as a}from"./run-BBBMrSrs.mjs";import"./telemetry-mKEb8lYB.mjs";import{n as o,t as s}from"./body-parser-CUWbw_Tq.mjs";import{n as c}from"./input-validation-Ch4Vllrm.mjs";import{a as l,i as u,n as d}from"./prompt-Bx2PB-tt.mjs";function f(e){return e.usage(`$0 content-scan expressions create
|
|
3
|
+
|
|
4
|
+
Create one or more Content Scanning custom expressions, appending them to the existing list of the zone, and return the updated list. Each expression reaches content objects the scanner cannot find automatically, for example \`lookup_json_string(http.request.body.raw, "file")\`.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Array of Content Scanning custom expressions to create.`})}const p={command:`create`,describe:`Create Content Scanning custom expressions for a zone.`,builder:f,handler:async s=>a({command:`content-scan expressions create`,classification:{safeFlags:[`dry-run`]}},s,async()=>{if(s.dryRun){r({command:`cf content-scan expressions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/content-upload-scan/payloads`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?void 0:o(s.body)});return}let a=await t(s),c=await e({zone:s.zone},a,{quiet:s.quiet});if(s.zoneId=c,s.body){let e=o(s.body);n(await i(`Creating`,async()=>a.contentScan.expressions.create({body:e,zone_id:c})),{successLabel:`Created`});return}if(s.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function m(e){return e.usage(`$0 content-scan expressions delete <expression-id>
|
|
5
|
+
|
|
6
|
+
Delete the Content Scanning custom expression with the given identifier and return the expressions that remain. Content objects reached only by the deleted expression are no longer scanned.`).positional(`expression-id`,{type:`string`,description:`Defines the unique ID for this Content Scanning custom expression.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const h={command:`delete <expression-id>`,describe:`Delete a Content Scanning custom expression from a zone.`,builder:m,handler:async o=>a({command:`content-scan expressions delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},o,async()=>{if(o.dryRun){r({command:`cf content-scan expressions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/content-upload-scan/payloads/${o[`expression-id`]==null?`<expression-id>`:encodeURIComponent(String(o[`expression-id`]))}`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``),"expression-id":String(o[`expression-id`]??``)},bodyKind:`none`});return}let a=await t(o),s=await e({zone:o.zone},a,{quiet:o.quiet});if(o.zoneId=s,!await d({force:!!o.force,message:`This operation deletes a Content Scanning custom expression.`})){process.stderr.write(`Aborted.
|
|
7
|
+
`);return}n(await i(`Deleting`,async()=>a.contentScan.expressions.delete({zone_id:s,expression_id:o[`expression-id`]})),{successLabel:`Deleted`})})};function g(e){return e.usage(`$0 content-scan expressions list
|
|
8
|
+
|
|
9
|
+
List the Content Scanning custom expressions configured for the zone, each with its own identifier. A custom expression tells the scanner how to reach content objects in a request it cannot parse on its own, such as files Base64-encoded inside a JSON body.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`list`,describe:`List the Content Scanning custom expressions of a zone.`,builder:g,handler:async o=>a({command:`content-scan expressions list`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf content-scan expressions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/content-upload-scan/payloads`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`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.contentScan.expressions.list({zone_id:s})),{successLabel:`Loaded`})})};function v(e){return e.usage(`$0 content-scan expressions update <expression-id>
|
|
10
|
+
|
|
11
|
+
Update the Content Scanning custom expression with the given identifier and return the updated list of expressions.`).positional(`expression-id`,{type:`string`,description:`Defines the unique ID for this Content Scanning custom expression.`,demandOption:!0}).option(`payload`,{type:`string`,description:`Defines the custom content extraction expression used to reach content objects in the request.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Content Scanning custom expression to update.`})}const y={command:`update <expression-id>`,describe:`Update a Content Scanning custom expression for a zone.`,builder:v,handler:async u=>a({command:`content-scan expressions update`,classification:{safeFlags:[`dry-run`]}},u,async()=>{if(u.dryRun){r({command:`cf content-scan expressions update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/content-upload-scan/payloads/${u[`expression-id`]==null?`<expression-id>`:encodeURIComponent(String(u[`expression-id`]))}`,pathParams:{"zone-id":String(u.zone??u[`zone-id`]??``),"expression-id":String(u[`expression-id`]??``)},bodyKind:`json`,body:u.body===void 0?s({payload:c(u.payload,`payload`,`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.contentScan.expressions.update({...e,zone_id:d,expression_id:u[`expression-id`]})),{successLabel:`Updated`});return}u.payload===void 0&&(u.payload=await l(`payload`,`Defines the custom content extraction expression used to reach content objects in the request.`));let f=s({payload:c(u.payload,`payload`,`text`)});n(await i(`Updating`,async()=>a.contentScan.expressions.update({...f,zone_id:d,expression_id:u[`expression-id`]})),{successLabel:`Updated`})})},b={command:`expressions`,describe:`Custom expressions that tell the scanner how to reach content objects it cannot parse on its own`,builder:e=>e.command(p).command(h).command(_).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(e){return e.usage(`$0 content-scan get
|
|
12
|
+
|
|
13
|
+
Get the current Content Scanning status for the zone, together with the date the status was last modified.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get`,describe:`Get the Content Scanning status for a zone.`,builder:x,handler:async o=>a({command:`content-scan get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf content-scan get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/content-upload-scan/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.contentScan.get({zone_id:s})),{successLabel:`Loaded`})})};function C(e){return e.usage("$0 content-scan update\n\nUpdate the Content Scanning status by setting the status value to `enabled` or `disabled`. This is equivalent to calling the dedicated enable and disable endpoints.").option(`value`,{type:`string`,description:`The status value for Content Scanning.`,choices:[`enabled`,`disabled`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Content Scanning settings to update.`})}const w={command:`update`,describe:`Update the Content Scanning status for a zone.`,builder:C,handler:async l=>a({command:`content-scan update`,classification:{safeFlags:[`value`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{if(l.dryRun){r({command:`cf content-scan update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/content-upload-scan/settings`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?s({value:c(l.value,`value`,`text`)}):o(l.body)});return}let a=await t(l),f=await e({zone:l.zone},a,{quiet:l.quiet});if(l.zoneId=f,!await d({force:!!l.force,message:`This operation toggles Content Scanning for a zone.`})){process.stderr.write(`Aborted.
|
|
14
|
+
`);return}if(l.body){let e=o(l.body);n(await i(`Deleting`,async()=>a.contentScan.update({...e,zone_id:f})),{successLabel:`Deleted`});return}l.value===void 0&&(l.value=await u(`value`,`The status value for Content Scanning.`,[`enabled`,`disabled`]));let p=s({value:c(l.value,`value`,`text`)});n(await i(`Deleting`,async()=>a.contentScan.update({...p,zone_id:f})),{successLabel:`Deleted`})})},T={command:`content-scan`,describe:`Malicious uploads detection, scan uploaded content in HTTP requests for malware and malicious payloads`,builder:e=>e.command(S).command(w).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{T as default};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{r as e}from"./auth-Cp7gT-AF.mjs";import{t}from"./output-Bia1u2k5.mjs";import{t as n}from"./dry-run-CLX6Pbtq.mjs";import{t as r}from"./progress-Bi02B6v4.mjs";import{t as i}from"./run-BBBMrSrs.mjs";import"./telemetry-mKEb8lYB.mjs";import{n as a,t as o}from"./body-parser-CUWbw_Tq.mjs";import{n as s}from"./input-validation-Ch4Vllrm.mjs";function c(e){return e.usage(`$0 cps get
|
|
3
|
+
|
|
4
|
+
Retrieve the communication preferences for the authenticated user, including email verification status, marketing subscription opt-in/opt-out state, and language locale. Callers authenticate with standard Cloudflare API tokens or keys.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const l={command:`get`,describe:`Get communication preferences`,builder:c,handler:async a=>i({command:`cps get`,classification:{safeFlags:[`dry-run`]}},a,async()=>{if(a.dryRun){n({command:`cf cps get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/user/communication_preferences`,pathParams:{},bodyKind:`none`});return}let i=await e(a);t(await r(`Loading`,async()=>i.cps.get()),{successLabel:`Loaded`})})};function u(e){return e.usage(`$0 cps update
|
|
5
|
+
|
|
6
|
+
Set one or more communication preferences for the authenticated user. Supply a map of preference keys to subscription states, and an optional language locale. This endpoint does not modify email verification settings. Callers authenticate with standard Cloudflare API tokens or keys.`).option(`language-locale`,{type:`string`,description:`The user's preferred language locale for communications. If omitted, the language locale does not change.`,choices:[`en-US`,`es-ES`,`de-DE`,`fr-FR`,`it-IT`,`ja-JP`,`ko-KR`,`pt-BR`,`zh-CN`,`zh-TW`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for updating communication preferences. An email field in the payload is ignored; email verification state is managed separately, so the field is excluded from this schema.`})}const d={command:`update`,describe:`Update communication preferences`,builder:u,handler:async c=>i({command:`cps update`,classification:{safeFlags:[`language-locale`,`dry-run`]}},c,async()=>{if(c.dryRun){n({command:`cf cps update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/user/communication_preferences`,pathParams:{},bodyKind:`json`,body:c.body===void 0?o({"language-locale":s(c[`language-locale`],`language-locale`,`text`)}):a(c.body)});return}let i=await e(c);if(c.body){let e=a(c.body);t(await r(`Updating`,async()=>i.cps.update({...e})),{successLabel:`Updated`});return}let l=o({"language-locale":s(c[`language-locale`],`language-locale`,`text`)});t(await r(`Updating`,async()=>i.cps.update({...l})),{successLabel:`Updated`})})},f={command:`cps`,describe:`cps`,builder:e=>e.command(l).command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{f as default};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{_ as e}from"./oauth-D4bkeMAw.mjs";import{r as t}from"./auth-Cp7gT-AF.mjs";import{t as n}from"./output-Bia1u2k5.mjs";import{t as r}from"./dry-run-CLX6Pbtq.mjs";import{t as i}from"./progress-Bi02B6v4.mjs";import{t as a}from"./run-BBBMrSrs.mjs";import"./telemetry-mKEb8lYB.mjs";import{n as o,t as s}from"./body-parser-CUWbw_Tq.mjs";import{n as c}from"./input-validation-Ch4Vllrm.mjs";function l(e){return e.usage(`$0 csamScanner edit
|
|
3
|
+
|
|
4
|
+
Update the CSAM Scanner configuration for a zone. Allows enabling or disabling CSAM scanning, updating the notification email, and configuring scanning sources. When a new email is provided, email verification is triggered automatically. The \`enabled\` field is a toggle; the server may adjust it based on whether the notification email is verified. Returns 403 if the zone or account is locked by Trust & Safety.`).option(`id`,{type:`string`,description:`The feature identifier.`,choices:[`csam_scanner`]}).option(`value-email`,{type:`string`,description:`Notification email address for CSAM scan results. When changed,
|
|
5
|
+
email verification is triggered automatically.
|
|
6
|
+
`}).option(`value-enabled`,{type:`boolean`,description:`Whether CSAM scanning is enabled for this zone.`}).option(`value-resend-email`,{type:`boolean`,description:`Set to true to trigger re-sending the email verification.
|
|
7
|
+
Write-only; never appears in responses (omitted when false).
|
|
8
|
+
`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for updating CSAM Scanner configuration. `})}const u={command:`edit`,describe:`Update CSAM Scanner setting`,builder:l,handler:async l=>a({command:`csamScanner edit`,classification:{safeFlags:[`id`,`value-enabled`,`value-resend-email`,`dry-run`]}},l,async()=>{if(l.dryRun){r({command:`cf csamScanner edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/settings/csam_scanner_third_party`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?s({id:c(l.id,`id`,`text`),value:{email:c(l[`value-email`],`value-email`,`text`),enabled:l[`value-enabled`],resend_email:l[`value-resend-email`]}}):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.csamScanner.edit({...e,zone_id:u})),{successLabel:`Updated`});return}let d=s({id:c(l.id,`id`,`text`),value:{email:c(l[`value-email`],`value-email`,`text`),enabled:l[`value-enabled`],resend_email:l[`value-resend-email`]}});n(await i(`Updating`,async()=>a.csamScanner.edit({...d,zone_id:u})),{successLabel:`Updated`})})};function d(e){return e.usage(`$0 csamScanner get
|
|
9
|
+
|
|
10
|
+
Retrieve the current CSAM Scanner configuration for a zone. The notification email is masked by default in responses.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`get`,describe:`Get CSAM Scanner setting`,builder:d,handler:async o=>a({command:`csamScanner get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf csamScanner get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/settings/csam_scanner_third_party`,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.csamScanner.get({zone_id:s})),{successLabel:`Loaded`})})},p={command:`csamScanner`,describe:`csamScanner`,builder:e=>e.command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{_ as e}from"./oauth-D4bkeMAw.mjs";import{r as t}from"./auth-Cp7gT-AF.mjs";import{t as n}from"./output-Bia1u2k5.mjs";import{t as r}from"./dry-run-CLX6Pbtq.mjs";import{t as i}from"./progress-Bi02B6v4.mjs";import{t as a}from"./run-BBBMrSrs.mjs";import"./telemetry-mKEb8lYB.mjs";import{n as o,t as s}from"./body-parser-CUWbw_Tq.mjs";function c(e){return e.usage(`$0 ct-alerting get
|
|
3
|
+
|
|
4
|
+
Retrieve the Certificate Transparency alerting subscription settings for a zone. Returns whether CT monitoring is enabled and the list of email addresses that receive alerts, if any have been configured.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const l={command:`get`,describe:`Get CT Alerting Subscription`,builder:c,handler:async o=>a({command:`ct-alerting get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf ct-alerting get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/ct/alerting`,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.ctAlerting.get({zone_id:s})),{successLabel:`Loaded`})})};function u(e){return e.usage("$0 ct-alerting update\n\nCreate or update the Certificate Transparency alerting subscription for a zone. Enables or disables email notifications when certificates are issued for the zone's domains. The `enabled` field is required on every request and controls whether the subscription is active. The `emails` field is optional and, when provided, replaces the stored recipient list for the zone. When `emails` is omitted, the stored recipient list is preserved and only the enabled state is toggled. A maximum of 100 email addresses may be configured per zone. Requests that omit `enabled` are rejected with error code 1008. Subscribe and unsubscribe notification emails are only sent for recipients whose effective subscription state changes. Idempotent requests (no state change) send no notification email.").option(`emails`,{type:`string`,array:!0,description:`Email addresses that receive CT alert notifications for the zone. A maximum of 100 addresses may be configured. Each address must be a valid RFC 5322 email address and must not contain a comma.
|
|
5
|
+
`}).option(`enabled`,{type:`boolean`,description:`Whether CT alerting is enabled for the zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for updating CT alerting subscription settings.`})}const d={command:`update`,describe:`Update CT Alerting Subscription`,builder:u,handler:async c=>a({command:`ct-alerting update`,classification:{safeFlags:[`enabled`,`dry-run`]}},c,async()=>{if(c.dryRun){r({command:`cf ct-alerting update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/ct/alerting`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?s({emails:c.emails,enabled:c.enabled}):o(c.body)});return}let a=await t(c),l=await e({zone:c.zone},a,{quiet:c.quiet});if(c.zoneId=l,c.body){let e=o(c.body);n(await i(`Updating`,async()=>a.ctAlerting.update({...e,zone_id:l})),{successLabel:`Updated`});return}if(c.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=s({emails:c.emails,enabled:c.enabled});n(await i(`Updating`,async()=>a.ctAlerting.update({...u,zone_id:l})),{successLabel:`Updated`})})},f={command:`ct-alerting`,describe:`ct-alerting`,builder:e=>e.command(l).command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{f as default};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{_ as e}from"./oauth-D4bkeMAw.mjs";import{r as t}from"./auth-Cp7gT-AF.mjs";import{t as n}from"./output-Bia1u2k5.mjs";import{t as r}from"./dry-run-CLX6Pbtq.mjs";import{t as i}from"./progress-Bi02B6v4.mjs";import{t as a}from"./run-BBBMrSrs.mjs";import"./telemetry-mKEb8lYB.mjs";import{n as o,r as s,t as c}from"./body-parser-CUWbw_Tq.mjs";import{n as l}from"./input-validation-Ch4Vllrm.mjs";import{a as u,n as d}from"./prompt-Bx2PB-tt.mjs";import{t as f}from"./cli-types-tt_LZMbn.mjs";function p(e){return e.usage(`$0 custom-certificates create
|
|
3
|
+
|
|
4
|
+
Upload a new SSL certificate for a zone.`).option(`bundle-method`,{type:`string`,description:`A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.`,choices:[`ubiquitous`,`optimal`,`force`],default:`ubiquitous`}).option(`certificate`,{type:`string`,description:`The zone's SSL certificate or certificate and the intermediate(s).`}).option(`custom-csr-id`,{type:`string`,description:`The identifier for the Custom CSR that was used.`}).option(`deploy`,{type:`string`,description:`The environment to deploy the certificate to, defaults to production.`,choices:[`staging`,`production`],default:`production`}).option(`geo-restrictions-label`,{type:`string`,description:`The geo_restrictions.label field`,choices:[`us`,`eu`,`highest_security`]}).option(`policy`,{type:`string`,description:`Specify the policy that determines the region where your private key will be held locally. HTTPS connections to any excluded data center will still be fully encrypted, but will incur some latency while Keyless SSL is used to complete the handshake with the nearest allowed data center. Any combination of countries, specified by their two letter country code (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) can be chosen, such as 'country: IN', as well as 'region: EU' which refers to the EU region. If there are too few data centers satisfying the policy, it will be rejected.
|
|
5
|
+
Note: The API accepts this field as either "policy" or "policy_restrictions" in requests. Responses return this field as "policy_restrictions".`}).option(`private-key`,{type:`string`,description:`The zone's private key. Not required if custom_csr_id is provided, in which case the private key is retrieved from the CSR record held by Cloudflare.`}).option(`type`,{type:`string`,description:`The type 'legacy_custom' enables support for legacy clients which do not include SNI in the TLS handshake.`,choices:[`legacy_custom`,`sni_custom`],default:`legacy_custom`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`create`,describe:`Create SSL Configuration`,builder:p,handler:async s=>a({command:`custom-certificates create`,classification:{safeFlags:[`bundle-method`,`deploy`,`geo-restrictions-label`,`type`,`dry-run`]}},s,async()=>{if(s.dryRun){r({command:`cf custom-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/custom_certificates`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?c({bundle_method:l(s[`bundle-method`],`bundle-method`,`text`),certificate:l(s.certificate,`certificate`,`text`),custom_csr_id:l(s[`custom-csr-id`],`custom-csr-id`,`text`),deploy:l(s.deploy,`deploy`,`text`),geo_restrictions:{label:l(s[`geo-restrictions-label`],`geo-restrictions-label`,`text`)},policy:l(s.policy,`policy`,`text`),private_key:l(s[`private-key`],`private-key`,`text`),type:l(s.type,`type`,`text`)}):o(s.body)});return}let a=await t(s),d=await e({zone:s.zone},a,{quiet:s.quiet});if(s.zoneId=d,s.body){let e=o(s.body);n(await i(`Creating`,async()=>a.customCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}s.certificate===void 0&&(s.certificate=await u(`certificate`,`The zone's SSL certificate or certificate and the intermediate(s).`));let f=c({bundle_method:l(s[`bundle-method`],`bundle-method`,`text`),certificate:l(s.certificate,`certificate`,`text`),custom_csr_id:l(s[`custom-csr-id`],`custom-csr-id`,`text`),deploy:l(s.deploy,`deploy`,`text`),geo_restrictions:{label:l(s[`geo-restrictions-label`],`geo-restrictions-label`,`text`)},policy:l(s.policy,`policy`,`text`),private_key:l(s[`private-key`],`private-key`,`text`),type:l(s.type,`type`,`text`)});n(await i(`Creating`,async()=>a.customCertificates.create({...f,zone_id:d})),{successLabel:`Created`})})};function h(e){return e.usage(`$0 custom-certificates delete <custom-certificate-id>
|
|
6
|
+
|
|
7
|
+
Remove a SSL certificate from a zone.`).positional(`custom-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <custom-certificate-id>`,describe:`Delete SSL Configuration`,builder:h,handler:async o=>a({command:`custom-certificates delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},o,async()=>{if(o.dryRun){r({command:`cf custom-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/custom_certificates/${o[`custom-certificate-id`]==null?`<custom-certificate-id>`:encodeURIComponent(String(o[`custom-certificate-id`]))}`,pathParams:{"custom-certificate-id":String(o[`custom-certificate-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 d({force:!!o.force})){process.stderr.write(`Aborted.
|
|
8
|
+
`);return}n(await i(`Deleting`,async()=>a.customCertificates.delete({zone_id:s,custom_certificate_id:o[`custom-certificate-id`]})),{successLabel:`Deleted`})})};function _(e){return e.usage(`$0 custom-certificates edit <custom-certificate-id>
|
|
9
|
+
|
|
10
|
+
Upload a new private key and/or PEM/CRT for the SSL certificate. Note: PATCHing a configuration for sni_custom certificates will result in a new resource id being returned, and the previous one being deleted.`).positional(`custom-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`bundle-method`,{type:`string`,description:`A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.`,choices:[`ubiquitous`,`optimal`,`force`]}).option(`certificate`,{type:`string`,description:`The zone's SSL certificate or certificate and the intermediate(s).`}).option(`custom-csr-id`,{type:`string`,description:`The identifier for the Custom CSR that was used.`}).option(`deploy`,{type:`string`,description:`The environment to deploy the certificate to, defaults to production.`,choices:[`staging`,`production`]}).option(`geo-restrictions-label`,{type:`string`,description:`The geo_restrictions.label field`,choices:[`us`,`eu`,`highest_security`]}).option(`policy`,{type:`string`,description:`Specify the policy that determines the region where your private key will be held locally. HTTPS connections to any excluded data center will still be fully encrypted, but will incur some latency while Keyless SSL is used to complete the handshake with the nearest allowed data center. Any combination of countries, specified by their two letter country code (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) can be chosen, such as 'country: IN', as well as 'region: EU' which refers to the EU region. If there are too few data centers satisfying the policy, it will be rejected.
|
|
11
|
+
Note: The API accepts this field as either "policy" or "policy_restrictions" in requests. Responses return this field as "policy_restrictions".`}).option(`private-key`,{type:`string`,description:`The zone's private key. Not required if custom_csr_id is provided, in which case the private key is retrieved from the CSR record held by Cloudflare.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`edit <custom-certificate-id>`,describe:`Edit SSL Configuration`,builder:_,handler:async s=>a({command:`custom-certificates edit`,classification:{safeFlags:[`bundle-method`,`deploy`,`geo-restrictions-label`,`dry-run`]}},s,async()=>{if(s.dryRun){r({command:`cf custom-certificates edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/custom_certificates/${s[`custom-certificate-id`]==null?`<custom-certificate-id>`:encodeURIComponent(String(s[`custom-certificate-id`]))}`,pathParams:{"custom-certificate-id":String(s[`custom-certificate-id`]??``),"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?c({bundle_method:l(s[`bundle-method`],`bundle-method`,`text`),certificate:l(s.certificate,`certificate`,`text`),custom_csr_id:l(s[`custom-csr-id`],`custom-csr-id`,`text`),deploy:l(s.deploy,`deploy`,`text`),geo_restrictions:{label:l(s[`geo-restrictions-label`],`geo-restrictions-label`,`text`)},policy:l(s.policy,`policy`,`text`),private_key:l(s[`private-key`],`private-key`,`text`)}):o(s.body)});return}let a=await t(s),u=await e({zone:s.zone},a,{quiet:s.quiet});if(s.zoneId=u,s.body){let e=o(s.body);n(await i(`Updating`,async()=>a.customCertificates.edit({...e,zone_id:u,custom_certificate_id:s[`custom-certificate-id`]})),{successLabel:`Updated`});return}let d=c({bundle_method:l(s[`bundle-method`],`bundle-method`,`text`),certificate:l(s.certificate,`certificate`,`text`),custom_csr_id:l(s[`custom-csr-id`],`custom-csr-id`,`text`),deploy:l(s.deploy,`deploy`,`text`),geo_restrictions:{label:l(s[`geo-restrictions-label`],`geo-restrictions-label`,`text`)},policy:l(s.policy,`policy`,`text`),private_key:l(s[`private-key`],`private-key`,`text`)});n(await i(`Updating`,async()=>a.customCertificates.edit({...d,zone_id:u,custom_certificate_id:s[`custom-certificate-id`]})),{successLabel:`Updated`})})};function y(e){return e.usage(`$0 custom-certificates get <custom-certificate-id>
|
|
12
|
+
|
|
13
|
+
Retrieves details for a specific custom SSL certificate, including certificate metadata, bundle method, geographic restrictions, and associated keyless server configuration.`).positional(`custom-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get <custom-certificate-id>`,describe:`SSL Configuration Details`,builder:y,handler:async o=>a({command:`custom-certificates get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf custom-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/custom_certificates/${o[`custom-certificate-id`]==null?`<custom-certificate-id>`:encodeURIComponent(String(o[`custom-certificate-id`]))}`,pathParams:{"custom-certificate-id":String(o[`custom-certificate-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.customCertificates.get({zone_id:s,custom_certificate_id:o[`custom-certificate-id`]})),{successLabel:`Loaded`})})};function x(e){return e.usage(`$0 custom-certificates list
|
|
14
|
+
|
|
15
|
+
List, search, and filter all of your custom SSL certificates. The higher priority will break ties across overlapping 'legacy_custom' certificates, but 'legacy_custom' certificates will always supercede 'sni_custom' certificates.`).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of zones per page.`}).option(`match`,{type:`string`,description:`Whether to match all search requirements or at least one (any).`,choices:[`any`,`all`]}).option(`status`,{type:`string`,description:`Status of the zone's custom SSL.`,choices:[`active`,`expired`,`deleted`,`pending`,`initializing`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`list`,describe:`List SSL Configurations`,builder:f(x),handler:async o=>a({command:`custom-certificates list`,classification:{safeFlags:[`match`,`status`,`dry-run`]}},o,async()=>{let a={page:o.page,per_page:o[`per-page`],match:o.match,status:o.status};if(o.dryRun){r({command:`cf custom-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/custom_certificates`,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.customCertificates.list({zone_id:c,...a})),{successLabel:`Loaded`})})};function C(e){return e.usage(`$0 custom-certificates prioritize update
|
|
16
|
+
|
|
17
|
+
If a zone has multiple SSL certificates, you can set the order in which they should be used during a request. The higher priority will break ties across overlapping 'legacy_custom' certificates.`).option(`certificates`,{type:`string`,description:`Array of ordered certificates. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const w={command:`update`,describe:`Re-prioritize SSL Certificates`,builder:C,handler:async l=>a({command:`custom-certificates prioritize update`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){r({command:`cf custom-certificates prioritize update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/custom_certificates/prioritize`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?c({certificates:s(l.certificates,`certificates`)}):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.customCertificates.prioritize.update({...e,zone_id:u})),{successLabel:`Updated`});return}if(l.certificates===void 0)throw Error(`--certificates is required (or pass --body with this field set).`);let d=c({certificates:s(l.certificates,`certificates`)});n(await i(`Updating`,async()=>a.customCertificates.prioritize.update({...d,zone_id:u})),{successLabel:`Updated`})})},T={command:`prioritize`,describe:`Operations for prioritize`,builder:e=>e.command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},E={command:`custom-certificates`,describe:`custom-certificates`,builder:e=>e.command(m).command(g).command(v).command(b).command(S).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{E as default};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-B6b2OIBW.mjs";import{_ as t,m as n,v as r}from"./oauth-D4bkeMAw.mjs";import{r as i}from"./auth-Cp7gT-AF.mjs";import{t as a}from"./output-Bia1u2k5.mjs";import{t as o}from"./dry-run-CLX6Pbtq.mjs";import{t as s}from"./progress-Bi02B6v4.mjs";import{t as c}from"./run-BBBMrSrs.mjs";import"./telemetry-mKEb8lYB.mjs";import{n as l,t as u}from"./body-parser-CUWbw_Tq.mjs";import{n as d}from"./input-validation-Ch4Vllrm.mjs";import{a as f,n as p}from"./prompt-Bx2PB-tt.mjs";import{t as m}from"./cli-types-tt_LZMbn.mjs";function h(e){return e.usage(`$0 custom-csrs create
|
|
3
|
+
|
|
4
|
+
Generate a new custom Certificate Signing Request (CSR) for an account or zone. Cloudflare generates and securely stores the private key associated with the CSR.`).option(`common-name`,{type:`string`,description:`The common name (domain) for the CSR. Must be at most 64 characters.`}).option(`country`,{type:`string`,description:`Two-letter ISO 3166-1 alpha-2 country code.`}).option(`description`,{type:`string`,description:`Optional description for the CSR.`}).option(`key-type`,{type:`string`,description:`Key algorithm to use for the CSR. Defaults to rsa2048 if not specified.`,choices:[`rsa2048`,`p256v1`],default:`rsa2048`}).option(`locality`,{type:`string`,description:`City or locality name.`}).option(`name`,{type:`string`,description:`Human-readable name for the CSR.`}).option(`organization`,{type:`string`,description:`Organization name.`}).option(`organizational-unit`,{type:`string`,description:`Organizational unit name.`}).option(`sans`,{type:`string`,array:!0,description:`Subject Alternative Names for the CSR. At least one SAN is required.`}).option(`state`,{type:`string`,description:`State or province name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating a custom CSR.`})}const g={command:`create`,describe:`Create Custom CSR`,builder:h,handler:async p=>c({command:`custom-csrs create`,classification:{safeFlags:[`key-type`,`dry-run`]}},p,async()=>{if(p.dryRun){let e=p.zone===void 0?await r():void 0,t=p.zone===void 0?`accounts`:`zones`,n=p.zone??e??`<account-id>`;o({command:`cf custom-csrs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/custom_csrs`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n)},bodyKind:`json`,body:p.body===void 0?u({common_name:d(p[`common-name`],`common-name`,`text`),country:d(p.country,`country`,`text`),description:d(p.description,`description`,`text`),key_type:d(p[`key-type`],`key-type`,`text`),locality:d(p.locality,`locality`,`text`),name:d(p.name,`name`,`text`),organization:d(p.organization,`organization`,`text`),organizational_unit:d(p[`organizational-unit`],`organizational-unit`,`text`),sans:p.sans,state:d(p.state,`state`,`text`)}):l(p.body)});return}let c=await i(p),m=p.zone===void 0?`accounts`:`zones`,h=m===`zones`?await t({zone:p.zone},c,{quiet:p.quiet}):p.local?e:await n();if(m===`zones`?p.zoneId=h:p.accountId=h,p.body){let e=l(p.body);a(await s(`Creating`,async()=>c.customCsrs.create({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}if(p[`common-name`]===void 0&&(p[`common-name`]=await f(`common-name`,`The common name (domain) for the CSR. Must be at most 64 characters.`)),p.country===void 0&&(p.country=await f(`country`,`Two-letter ISO 3166-1 alpha-2 country code.`)),p.locality===void 0&&(p.locality=await f(`locality`,`City or locality name.`)),p.organization===void 0&&(p.organization=await f(`organization`,`Organization name.`)),p.sans===void 0)throw Error(`--sans is required (or pass --body with this field set).`);p.state===void 0&&(p.state=await f(`state`,`State or province name.`));let g=u({common_name:d(p[`common-name`],`common-name`,`text`),country:d(p.country,`country`,`text`),description:d(p.description,`description`,`text`),key_type:d(p[`key-type`],`key-type`,`text`),locality:d(p.locality,`locality`,`text`),name:d(p.name,`name`,`text`),organization:d(p.organization,`organization`,`text`),organizational_unit:d(p[`organizational-unit`],`organizational-unit`,`text`),sans:p.sans,state:d(p.state,`state`,`text`)});a(await s(`Creating`,async()=>c.customCsrs.create({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})})};function _(e){return e.usage(`$0 custom-csrs delete <custom-csr-id>
|
|
5
|
+
|
|
6
|
+
Delete a custom Certificate Signing Request (CSR) and its associated private key.`).positional(`custom-csr-id`,{type:`string`,description:`Custom CSR identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const v={command:`delete <custom-csr-id>`,describe:`Delete Custom CSR`,builder:_,handler:async l=>c({command:`custom-csrs delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await r():void 0,t=l.zone===void 0?`accounts`:`zones`,n=l.zone??e??`<account-id>`;o({command:`cf custom-csrs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/custom_csrs/${l[`custom-csr-id`]==null?`<custom-csr-id>`:encodeURIComponent(String(l[`custom-csr-id`]))}`,pathParams:{"account-or-zone":String(t),"custom-csr-id":String(l[`custom-csr-id`]??``),"account-or-zone-id":String(n)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await t({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await n();if(u===`zones`?l.zoneId=d:l.accountId=d,!await p({force:!!l.force})){process.stderr.write(`Aborted.
|
|
7
|
+
`);return}a(await s(`Deleting`,async()=>c.customCsrs.delete({account_or_zone:u,account_or_zone_id:d,custom_csr_id:l[`custom-csr-id`]})),{successLabel:`Deleted`})})};function y(e){return e.usage(`$0 custom-csrs get <custom-csr-id>
|
|
8
|
+
|
|
9
|
+
Retrieve details for a specific custom Certificate Signing Request (CSR).`).positional(`custom-csr-id`,{type:`string`,description:`Custom CSR identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get <custom-csr-id>`,describe:`Custom CSR Details`,builder:y,handler:async l=>c({command:`custom-csrs get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await r():void 0,t=l.zone===void 0?`accounts`:`zones`,n=l.zone??e??`<account-id>`;o({command:`cf custom-csrs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/custom_csrs/${l[`custom-csr-id`]==null?`<custom-csr-id>`:encodeURIComponent(String(l[`custom-csr-id`]))}`,pathParams:{"account-or-zone":String(t),"custom-csr-id":String(l[`custom-csr-id`]??``),"account-or-zone-id":String(n)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await t({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await n();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.customCsrs.get({account_or_zone:u,account_or_zone_id:d,custom_csr_id:l[`custom-csr-id`]})),{successLabel:`Loaded`})})};function x(e){return e.usage(`$0 custom-csrs list
|
|
10
|
+
|
|
11
|
+
List all custom Certificate Signing Requests (CSRs) for an account or zone.`).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of custom CSRs per page.`}).option(`order`,{type:`string`,description:`The field to sort the returned custom CSRs by.`,choices:[`name`,`account_tag`,`created_at`]}).option(`direction`,{type:`string`,description:`The direction to sort by.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`list`,describe:`List Custom CSRs`,builder:m(x),handler:async l=>c({command:`custom-csrs list`,classification:{safeFlags:[`order`,`direction`,`dry-run`]}},l,async()=>{let c={page:l.page,per_page:l[`per-page`],order:l.order,direction:l.direction};if(l.dryRun){let e=l.zone===void 0?await r():void 0,t=l.zone===void 0?`accounts`:`zones`,n=l.zone??e??`<account-id>`;o({command:`cf custom-csrs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/custom_csrs`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n)},query:c,bodyKind:`none`});return}let u=await i(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await t({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await n();d===`zones`?l.zoneId=f:l.accountId=f,a(await s(`Loading`,async()=>u.customCsrs.list({account_or_zone:d,account_or_zone_id:f,...c})),{successLabel:`Loaded`})})},C={command:`custom-csrs`,describe:`custom-csrs`,builder:e=>e.command(g).command(v).command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{C as default};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{_ as e}from"./oauth-D4bkeMAw.mjs";import{r as t}from"./auth-Cp7gT-AF.mjs";import{t as n}from"./output-Bia1u2k5.mjs";import{t as r}from"./dry-run-CLX6Pbtq.mjs";import{t as i}from"./progress-Bi02B6v4.mjs";import{t as a}from"./run-BBBMrSrs.mjs";import"./telemetry-mKEb8lYB.mjs";import{n as o,t as s}from"./body-parser-CUWbw_Tq.mjs";import{n as c}from"./input-validation-Ch4Vllrm.mjs";import{a as l,n as u}from"./prompt-Bx2PB-tt.mjs";import{t as d}from"./cli-types-tt_LZMbn.mjs";function f(e){return e.usage(`$0 custom-hostnames certificate-pack certificates delete <certificate-id>
|
|
3
|
+
|
|
4
|
+
Delete a single custom certificate from a certificate pack that contains two bundled certificates. Deletion is subject to the following constraints. You cannot delete a certificate if it is the only remaining certificate in the pack. At least one certificate must remain in the pack.`).positional(`certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`custom-hostname-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`certificate-pack-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const p={command:`delete <certificate-id>`,describe:`Delete Single Certificate And Key For Custom Hostname`,builder:f,handler:async o=>a({command:`custom-hostnames certificate-pack certificates delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},o,async()=>{if(o.dryRun){r({command:`cf custom-hostnames certificate-pack certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/custom_hostnames/${o[`custom-hostname-id`]==null?`<custom-hostname-id>`:encodeURIComponent(String(o[`custom-hostname-id`]))}/certificate_pack/${o[`certificate-pack-id`]==null?`<certificate-pack-id>`:encodeURIComponent(String(o[`certificate-pack-id`]))}/certificates/${o[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(o[`certificate-id`]))}`,pathParams:{"custom-hostname-id":String(o[`custom-hostname-id`]??``),"certificate-pack-id":String(o[`certificate-pack-id`]??``),"certificate-id":String(o[`certificate-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.
|
|
5
|
+
`);return}n(await i(`Deleting`,async()=>a.customHostnames.certificatePack.certificates.delete({zone_id:s,custom_hostname_id:o[`custom-hostname-id`],certificate_pack_id:o[`certificate-pack-id`],certificate_id:o[`certificate-id`]})),{successLabel:`Deleted`})})};function m(e){return e.usage(`$0 custom-hostnames certificate-pack certificates update <certificate-id>
|
|
6
|
+
|
|
7
|
+
Replace a single custom certificate within a certificate pack that contains two bundled certificates. The replacement must adhere to the following constraints. You can only replace an RSA certificate with another RSA certificate or an ECDSA certificate with another ECDSA certificate.`).positional(`certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`custom-hostname-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`certificate-pack-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`custom-certificate`,{type:`string`,description:`If a custom uploaded certificate is used.`}).option(`custom-key`,{type:`string`,description:`The key for a custom uploaded certificate.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`update <certificate-id>`,describe:`Replace Custom Certificate and Custom Key In Custom Hostname`,builder:m,handler:async u=>a({command:`custom-hostnames certificate-pack certificates update`,classification:{safeFlags:[`dry-run`]}},u,async()=>{if(u.dryRun){r({command:`cf custom-hostnames certificate-pack certificates update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/custom_hostnames/${u[`custom-hostname-id`]==null?`<custom-hostname-id>`:encodeURIComponent(String(u[`custom-hostname-id`]))}/certificate_pack/${u[`certificate-pack-id`]==null?`<certificate-pack-id>`:encodeURIComponent(String(u[`certificate-pack-id`]))}/certificates/${u[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(u[`certificate-id`]))}`,pathParams:{"custom-hostname-id":String(u[`custom-hostname-id`]??``),"certificate-pack-id":String(u[`certificate-pack-id`]??``),"certificate-id":String(u[`certificate-id`]??``),"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?s({custom_certificate:c(u[`custom-certificate`],`custom-certificate`,`text`),custom_key:c(u[`custom-key`],`custom-key`,`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.customHostnames.certificatePack.certificates.update({body:e,zone_id:d,custom_hostname_id:u[`custom-hostname-id`],certificate_pack_id:u[`certificate-pack-id`],certificate_id:u[`certificate-id`]})),{successLabel:`Updated`});return}u[`custom-certificate`]===void 0&&(u[`custom-certificate`]=await l(`custom-certificate`,`If a custom uploaded certificate is used.`)),u[`custom-key`]===void 0&&(u[`custom-key`]=await l(`custom-key`,`The key for a custom uploaded certificate.`,{kind:`secret`}));let f=s({custom_certificate:c(u[`custom-certificate`],`custom-certificate`,`text`),custom_key:c(u[`custom-key`],`custom-key`,`text`)});n(await i(`Updating`,async()=>a.customHostnames.certificatePack.certificates.update({body:f,zone_id:d,custom_hostname_id:u[`custom-hostname-id`],certificate_pack_id:u[`certificate-pack-id`],certificate_id:u[`certificate-id`]})),{successLabel:`Updated`})})},g={command:`certificates`,describe:`Operations for certificate-pack.certificates`,builder:e=>e.command(p).command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},_={command:`certificate-pack`,describe:`Operations for certificate-pack`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.usage(`$0 custom-hostnames create
|
|
8
|
+
|
|
9
|
+
Add a new custom hostname and request that an SSL certificate be issued for it. One of three validation methods—http, txt, email—should be used, with 'http' recommended if the CNAME is already in place (or will be soon). Specifying 'email' will send an email to the WHOIS contacts on file for the base domain plus hostmaster, postmaster, webmaster, admin, administrator. If http is used and the domain is not already pointing to the Managed CNAME host, the PATCH method must be used once it is (to complete validation). Enable bundling of certificates using the custom_cert_bundle field. The bundling process requires the following condition One certificate in the bundle must use an RSA, and the other must use an ECDSA.`).option(`custom-origin-server`,{type:`string`,description:`a valid hostname that’s been added to your DNS zone as an A, AAAA, or CNAME record.`}).option(`custom-origin-sni`,{type:`string`,description:`A hostname that will be sent to your custom origin server as SNI for TLS handshake. This can be a valid subdomain of the zone or custom origin server name or the string ':request_host_header:' which will cause the host header in the request to be used as SNI. Not configurable with default/fallback origin server.`}).option(`hostname`,{type:`string`,description:`The custom hostname that will point to your hostname via CNAME.`}).option(`ssl-bundle-method`,{type:`string`,description:`A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.`,choices:[`ubiquitous`,`optimal`,`force`]}).option(`ssl-certificate-authority`,{type:`string`,description:`The Certificate Authority that will issue the certificate.`,choices:[`digicert`,`google`,`lets_encrypt`,`ssl_com`]}).option(`ssl-cloudflare-branding`,{type:`boolean`,description:`Whether or not to add Cloudflare Branding for the order. This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to true.`}).option(`ssl-custom-certificate`,{type:`string`,description:`If a custom uploaded certificate is used.`}).option(`ssl-custom-csr-id`,{type:`string`,description:`The identifier for the Custom CSR that was used.`}).option(`ssl-custom-key`,{type:`string`,description:`The key for a custom uploaded certificate.`}).option(`ssl-method`,{type:`string`,description:`Domain control validation (DCV) method used for this hostname.`,choices:[`http`,`txt`,`email`]}).option(`ssl-settings-ciphers`,{type:`string`,array:!0,description:`An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format.`}).option(`ssl-settings-early-hints`,{type:`string`,description:`Whether or not Early Hints is enabled.`,choices:[`on`,`off`]}).option(`ssl-settings-http2`,{type:`string`,description:`Whether or not HTTP2 is enabled.`,choices:[`on`,`off`]}).option(`ssl-settings-min-tls-version`,{type:`string`,description:`The minimum TLS version supported.`,choices:[`1.0`,`1.1`,`1.2`,`1.3`]}).option(`ssl-settings-tls-1-3`,{type:`string`,description:`Whether or not TLS 1.3 is enabled.`,choices:[`on`,`off`]}).option(`ssl-type`,{type:`string`,description:`Level of validation to be used for this hostname. Domain validation (dv) must be used.`,choices:[`dv`]}).option(`ssl-wildcard`,{type:`boolean`,description:`Indicates whether the certificate covers a wildcard.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`create`,describe:`Create Custom Hostname`,builder:v,handler:async u=>a({command:`custom-hostnames create`,classification:{safeFlags:[`ssl-bundle-method`,`ssl-certificate-authority`,`ssl-cloudflare-branding`,`ssl-method`,`ssl-settings-early-hints`,`ssl-settings-http2`,`ssl-settings-min-tls-version`,`ssl-settings-tls-1-3`,`ssl-type`,`ssl-wildcard`,`dry-run`]}},u,async()=>{if(u.dryRun){r({command:`cf custom-hostnames create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/custom_hostnames`,pathParams:{"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?s({custom_origin_server:c(u[`custom-origin-server`],`custom-origin-server`,`text`),custom_origin_sni:c(u[`custom-origin-sni`],`custom-origin-sni`,`text`),hostname:c(u.hostname,`hostname`,`text`),ssl:{bundle_method:c(u[`ssl-bundle-method`],`ssl-bundle-method`,`text`),certificate_authority:c(u[`ssl-certificate-authority`],`ssl-certificate-authority`,`text`),cloudflare_branding:u[`ssl-cloudflare-branding`],custom_certificate:c(u[`ssl-custom-certificate`],`ssl-custom-certificate`,`text`),custom_csr_id:c(u[`ssl-custom-csr-id`],`ssl-custom-csr-id`,`text`),custom_key:c(u[`ssl-custom-key`],`ssl-custom-key`,`text`),method:c(u[`ssl-method`],`ssl-method`,`text`),settings:{ciphers:u[`ssl-settings-ciphers`],early_hints:c(u[`ssl-settings-early-hints`],`ssl-settings-early-hints`,`text`),http2:c(u[`ssl-settings-http2`],`ssl-settings-http2`,`text`),min_tls_version:c(u[`ssl-settings-min-tls-version`],`ssl-settings-min-tls-version`,`text`),tls_1_3:c(u[`ssl-settings-tls-1-3`],`ssl-settings-tls-1-3`,`text`)},type:c(u[`ssl-type`],`ssl-type`,`text`),wildcard:u[`ssl-wildcard`]}}):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.customHostnames.create({...e,zone_id:d})),{successLabel:`Created`});return}u.hostname===void 0&&(u.hostname=await l(`hostname`,`The custom hostname that will point to your hostname via CNAME.`));let f=s({custom_origin_server:c(u[`custom-origin-server`],`custom-origin-server`,`text`),custom_origin_sni:c(u[`custom-origin-sni`],`custom-origin-sni`,`text`),hostname:c(u.hostname,`hostname`,`text`),ssl:{bundle_method:c(u[`ssl-bundle-method`],`ssl-bundle-method`,`text`),certificate_authority:c(u[`ssl-certificate-authority`],`ssl-certificate-authority`,`text`),cloudflare_branding:u[`ssl-cloudflare-branding`],custom_certificate:c(u[`ssl-custom-certificate`],`ssl-custom-certificate`,`text`),custom_csr_id:c(u[`ssl-custom-csr-id`],`ssl-custom-csr-id`,`text`),custom_key:c(u[`ssl-custom-key`],`ssl-custom-key`,`text`),method:c(u[`ssl-method`],`ssl-method`,`text`),settings:{ciphers:u[`ssl-settings-ciphers`],early_hints:c(u[`ssl-settings-early-hints`],`ssl-settings-early-hints`,`text`),http2:c(u[`ssl-settings-http2`],`ssl-settings-http2`,`text`),min_tls_version:c(u[`ssl-settings-min-tls-version`],`ssl-settings-min-tls-version`,`text`),tls_1_3:c(u[`ssl-settings-tls-1-3`],`ssl-settings-tls-1-3`,`text`)},type:c(u[`ssl-type`],`ssl-type`,`text`),wildcard:u[`ssl-wildcard`]}});n(await i(`Creating`,async()=>a.customHostnames.create({...f,zone_id:d})),{successLabel:`Created`})})};function b(e){return e.usage(`$0 custom-hostnames delete <custom-hostname-id>
|
|
10
|
+
|
|
11
|
+
Permanently deletes a custom hostname and revokes any SSL certificates that were issued for it. This action cannot be undone.`).positional(`custom-hostname-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const x={command:`delete <custom-hostname-id>`,describe:`Delete Custom Hostname (and any issued SSL certificates)`,builder:b,handler:async o=>a({command:`custom-hostnames delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},o,async()=>{if(o.dryRun){r({command:`cf custom-hostnames delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/custom_hostnames/${o[`custom-hostname-id`]==null?`<custom-hostname-id>`:encodeURIComponent(String(o[`custom-hostname-id`]))}`,pathParams:{"custom-hostname-id":String(o[`custom-hostname-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.
|
|
12
|
+
`);return}n(await i(`Deleting`,async()=>a.customHostnames.delete({zone_id:s,custom_hostname_id:o[`custom-hostname-id`]})),{successLabel:`Deleted`})})};function S(e){return e.usage(`$0 custom-hostnames edit <custom-hostname-id>
|
|
13
|
+
|
|
14
|
+
Modify SSL configuration for a custom hostname. When sent with SSL config that matches existing config, used to indicate that hostname should pass domain control validation (DCV). Can also be used to change validation type, e.g., from 'http' to 'email'. Bundle an existing certificate with another certificate by using the "custom_cert_bundle" field. The bundling process supports combining certificates as long as the following condition is met. One certificate must use the RSA algorithm, and the other must use the ECDSA algorithm.`).positional(`custom-hostname-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`custom-origin-server`,{type:`string`,description:`a valid hostname that’s been added to your DNS zone as an A, AAAA, or CNAME record.`}).option(`custom-origin-sni`,{type:`string`,description:`A hostname that will be sent to your custom origin server as SNI for TLS handshake. This can be a valid subdomain of the zone or custom origin server name or the string ':request_host_header:' which will cause the host header in the request to be used as SNI. Not configurable with default/fallback origin server.`}).option(`ssl-bundle-method`,{type:`string`,description:`A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.`,choices:[`ubiquitous`,`optimal`,`force`]}).option(`ssl-certificate-authority`,{type:`string`,description:`The Certificate Authority that will issue the certificate.`,choices:[`digicert`,`google`,`lets_encrypt`,`ssl_com`]}).option(`ssl-cloudflare-branding`,{type:`boolean`,description:`Whether or not to add Cloudflare Branding for the order. This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to true.`}).option(`ssl-custom-certificate`,{type:`string`,description:`If a custom uploaded certificate is used.`}).option(`ssl-custom-csr-id`,{type:`string`,description:`The identifier for the Custom CSR that was used.`}).option(`ssl-custom-key`,{type:`string`,description:`The key for a custom uploaded certificate.`}).option(`ssl-method`,{type:`string`,description:`Domain control validation (DCV) method used for this hostname.`,choices:[`http`,`txt`,`email`]}).option(`ssl-settings-ciphers`,{type:`string`,array:!0,description:`An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format.`}).option(`ssl-settings-early-hints`,{type:`string`,description:`Whether or not Early Hints is enabled.`,choices:[`on`,`off`]}).option(`ssl-settings-http2`,{type:`string`,description:`Whether or not HTTP2 is enabled.`,choices:[`on`,`off`]}).option(`ssl-settings-min-tls-version`,{type:`string`,description:`The minimum TLS version supported.`,choices:[`1.0`,`1.1`,`1.2`,`1.3`]}).option(`ssl-settings-tls-1-3`,{type:`string`,description:`Whether or not TLS 1.3 is enabled.`,choices:[`on`,`off`]}).option(`ssl-type`,{type:`string`,description:`Level of validation to be used for this hostname. Domain validation (dv) must be used.`,choices:[`dv`]}).option(`ssl-wildcard`,{type:`boolean`,description:`Indicates whether the certificate covers a wildcard.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`edit <custom-hostname-id>`,describe:`Edit Custom Hostname`,builder:S,handler:async l=>a({command:`custom-hostnames edit`,classification:{safeFlags:[`ssl-bundle-method`,`ssl-certificate-authority`,`ssl-cloudflare-branding`,`ssl-method`,`ssl-settings-early-hints`,`ssl-settings-http2`,`ssl-settings-min-tls-version`,`ssl-settings-tls-1-3`,`ssl-type`,`ssl-wildcard`,`dry-run`]}},l,async()=>{if(l.dryRun){r({command:`cf custom-hostnames edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/custom_hostnames/${l[`custom-hostname-id`]==null?`<custom-hostname-id>`:encodeURIComponent(String(l[`custom-hostname-id`]))}`,pathParams:{"custom-hostname-id":String(l[`custom-hostname-id`]??``),"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?s({custom_origin_server:c(l[`custom-origin-server`],`custom-origin-server`,`text`),custom_origin_sni:c(l[`custom-origin-sni`],`custom-origin-sni`,`text`),ssl:{bundle_method:c(l[`ssl-bundle-method`],`ssl-bundle-method`,`text`),certificate_authority:c(l[`ssl-certificate-authority`],`ssl-certificate-authority`,`text`),cloudflare_branding:l[`ssl-cloudflare-branding`],custom_certificate:c(l[`ssl-custom-certificate`],`ssl-custom-certificate`,`text`),custom_csr_id:c(l[`ssl-custom-csr-id`],`ssl-custom-csr-id`,`text`),custom_key:c(l[`ssl-custom-key`],`ssl-custom-key`,`text`),method:c(l[`ssl-method`],`ssl-method`,`text`),settings:{ciphers:l[`ssl-settings-ciphers`],early_hints:c(l[`ssl-settings-early-hints`],`ssl-settings-early-hints`,`text`),http2:c(l[`ssl-settings-http2`],`ssl-settings-http2`,`text`),min_tls_version:c(l[`ssl-settings-min-tls-version`],`ssl-settings-min-tls-version`,`text`),tls_1_3:c(l[`ssl-settings-tls-1-3`],`ssl-settings-tls-1-3`,`text`)},type:c(l[`ssl-type`],`ssl-type`,`text`),wildcard:l[`ssl-wildcard`]}}):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.customHostnames.edit({...e,zone_id:u,custom_hostname_id:l[`custom-hostname-id`]})),{successLabel:`Updated`});return}let d=s({custom_origin_server:c(l[`custom-origin-server`],`custom-origin-server`,`text`),custom_origin_sni:c(l[`custom-origin-sni`],`custom-origin-sni`,`text`),ssl:{bundle_method:c(l[`ssl-bundle-method`],`ssl-bundle-method`,`text`),certificate_authority:c(l[`ssl-certificate-authority`],`ssl-certificate-authority`,`text`),cloudflare_branding:l[`ssl-cloudflare-branding`],custom_certificate:c(l[`ssl-custom-certificate`],`ssl-custom-certificate`,`text`),custom_csr_id:c(l[`ssl-custom-csr-id`],`ssl-custom-csr-id`,`text`),custom_key:c(l[`ssl-custom-key`],`ssl-custom-key`,`text`),method:c(l[`ssl-method`],`ssl-method`,`text`),settings:{ciphers:l[`ssl-settings-ciphers`],early_hints:c(l[`ssl-settings-early-hints`],`ssl-settings-early-hints`,`text`),http2:c(l[`ssl-settings-http2`],`ssl-settings-http2`,`text`),min_tls_version:c(l[`ssl-settings-min-tls-version`],`ssl-settings-min-tls-version`,`text`),tls_1_3:c(l[`ssl-settings-tls-1-3`],`ssl-settings-tls-1-3`,`text`)},type:c(l[`ssl-type`],`ssl-type`,`text`),wildcard:l[`ssl-wildcard`]}});n(await i(`Updating`,async()=>a.customHostnames.edit({...d,zone_id:u,custom_hostname_id:l[`custom-hostname-id`]})),{successLabel:`Updated`})})};function w(e){return e.usage(`$0 custom-hostnames fallback-origin delete
|
|
15
|
+
|
|
16
|
+
Removes the fallback origin configuration for custom hostnames on a zone. Custom hostnames without specific origins will no longer have a fallback.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const T={command:`delete`,describe:`Delete Fallback Origin for Custom Hostnames`,builder:w,handler:async o=>a({command:`custom-hostnames fallback-origin delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},o,async()=>{if(o.dryRun){r({command:`cf custom-hostnames fallback-origin delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/custom_hostnames/fallback_origin`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await t(o),s=await e({zone:o.zone},a,{quiet:o.quiet});if(o.zoneId=s,!await u({force:!!o.force})){process.stderr.write(`Aborted.
|
|
17
|
+
`);return}n(await i(`Deleting`,async()=>a.customHostnames.fallbackOrigin.delete({zone_id:s})),{successLabel:`Deleted`})})};function E(e){return e.usage(`$0 custom-hostnames fallback-origin get
|
|
18
|
+
|
|
19
|
+
Retrieves the current fallback origin configuration for custom hostnames on a zone. The fallback origin handles traffic when specific custom hostname origins are unavailable.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get`,describe:`Get Fallback Origin for Custom Hostnames`,builder:E,handler:async o=>a({command:`custom-hostnames fallback-origin get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf custom-hostnames fallback-origin get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/custom_hostnames/fallback_origin`,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.customHostnames.fallbackOrigin.get({zone_id:s})),{successLabel:`Loaded`})})};function O(e){return e.usage(`$0 custom-hostnames fallback-origin update
|
|
20
|
+
|
|
21
|
+
Updates the fallback origin configuration for custom hostnames on a zone. Sets the default origin server for custom hostname traffic.`).option(`origin`,{type:`string`,description:`Your origin hostname that requests to your custom hostnames will be sent to.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const k={command:`update`,describe:`Update Fallback Origin for Custom Hostnames`,builder:O,handler:async u=>a({command:`custom-hostnames fallback-origin update`,classification:{safeFlags:[`dry-run`]}},u,async()=>{if(u.dryRun){r({command:`cf custom-hostnames fallback-origin update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/custom_hostnames/fallback_origin`,pathParams:{"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?s({origin:c(u.origin,`origin`,`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.customHostnames.fallbackOrigin.update({...e,zone_id:d})),{successLabel:`Updated`});return}u.origin===void 0&&(u.origin=await l(`origin`,`Your origin hostname that requests to your custom hostnames will be sent to.`));let f=s({origin:c(u.origin,`origin`,`text`)});n(await i(`Updating`,async()=>a.customHostnames.fallbackOrigin.update({...f,zone_id:d})),{successLabel:`Updated`})})},A={command:`fallback-origin`,describe:`Operations for fallback-origin`,builder:e=>e.command(T).command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.usage(`$0 custom-hostnames get <custom-hostname-id>
|
|
22
|
+
|
|
23
|
+
Retrieves detailed information about a specific custom hostname, including SSL certificate status, ownership verification, and origin configuration.`).positional(`custom-hostname-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`get <custom-hostname-id>`,describe:`Custom Hostname Details`,builder:j,handler:async o=>a({command:`custom-hostnames get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf custom-hostnames get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/custom_hostnames/${o[`custom-hostname-id`]==null?`<custom-hostname-id>`:encodeURIComponent(String(o[`custom-hostname-id`]))}`,pathParams:{"custom-hostname-id":String(o[`custom-hostname-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.customHostnames.get({zone_id:s,custom_hostname_id:o[`custom-hostname-id`]})),{successLabel:`Loaded`})})};function N(e){return e.usage(`$0 custom-hostnames list
|
|
24
|
+
|
|
25
|
+
List, search, sort, and filter all of your custom hostnames.`).option(`hostname`,{type:`string`,description:`Fully qualified domain name to match against. This parameter cannot be used with the 'id', 'hostname.exact', 'hostname.contain', or 'hostname.startsWith' parameters.`}).option(`hostname-exact`,{type:`string`,description:`Fully qualified domain name to match against. This parameter cannot be used with the 'id', 'hostname', 'hostname.contain', or 'hostname.startsWith' parameters.`}).option(`hostname-starts-with`,{type:`string`,description:`Filters hostnames by a prefix match on the hostname value. This parameter cannot be used with the 'id', 'hostname', 'hostname.exact', or 'hostname.contain' parameters.`}).option(`hostname-contain`,{type:`string`,description:`Filters hostnames by a substring match on the hostname value. This parameter cannot be used with the 'id', 'hostname', 'hostname.exact', or 'hostname.startsWith' parameters.`}).option(`id`,{type:`string`,description:`Hostname ID to match against. This ID was generated and returned during the initial custom_hostname creation. This parameter cannot be used with the 'hostname', 'hostname.exact', 'hostname.contain', or 'hostname.startsWith' parameters.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of hostnames per page.`}).option(`order`,{type:`string`,description:`Field to order hostnames by.`,choices:[`ssl`,`ssl_status`]}).option(`direction`,{type:`string`,description:`Direction to order hostnames.`,choices:[`asc`,`desc`]}).option(`ssl-status`,{type:`string`,description:`Filter by SSL certificate status.`,choices:[`initializing`,`pending_validation`,`deleted`,`pending_issuance`,`pending_deployment`,`pending_deletion`,`pending_expiration`,`expired`,`active`,`initializing_timed_out`,`validation_timed_out`,`issuance_timed_out`,`deployment_timed_out`,`deletion_timed_out`,`pending_cleanup`,`staging_deployment`,`staging_active`,`deactivating`,`inactive`,`backup_issued`,`holding_deployment`]}).option(`hostname-status`,{type:`string`,description:`Filter by the hostname's activation status.`,choices:[`active`,`pending`,`active_redeploying`,`moved`,`pending_deletion`,`deleted`,`pending_blocked`,`pending_migration`,`pending_provisioned`,`test_pending`,`test_active`,`test_active_apex`,`test_blocked`,`test_failed`,`provisioned`,`blocked`]}).option(`certificate-authority`,{type:`string`,description:`Filter by the certificate authority that issued the SSL certificate.`,choices:[`google`,`lets_encrypt`,`ssl_com`]}).option(`wildcard`,{type:`boolean`,description:`Filter by whether the custom hostname is a wildcard hostname.`}).option(`custom-origin-server`,{type:`string`,description:`Filter by custom origin server name.`}).option(`ssl`,{type:`string`,description:`Whether to filter hostnames based on if they have SSL enabled.`,choices:[`0`,`1`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`list`,describe:`List Custom Hostnames`,builder:d(N),handler:async o=>a({command:`custom-hostnames list`,classification:{safeFlags:[`order`,`direction`,`ssl-status`,`hostname-status`,`certificate-authority`,`wildcard`,`ssl`,`dry-run`]}},o,async()=>{let a={hostname:o.hostname,"hostname.exact":o[`hostname-exact`],"hostname.startsWith":o[`hostname-starts-with`],"hostname.contain":o[`hostname-contain`],id:o.id,page:o.page,per_page:o[`per-page`],order:o.order,direction:o.direction,ssl_status:o[`ssl-status`],hostname_status:o[`hostname-status`],certificate_authority:o[`certificate-authority`],wildcard:o.wildcard,custom_origin_server:o[`custom-origin-server`],ssl:o.ssl};if(o.dryRun){r({command:`cf custom-hostnames list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/custom_hostnames`,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.customHostnames.list({zone_id:c,...a})),{successLabel:`Loaded`})})};function F(e){return e.usage(`$0 custom-hostnames quota get
|
|
26
|
+
|
|
27
|
+
Returns custom hostname quota usage for a zone. The allocated quota is a soft limit; creating custom hostnames after usage exceeds this limit can still succeed until the hard cap is reached. Use the exceeded and hard_cap fields to track when usage is above the soft limit and when new custom hostname creation will be rejected.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`get`,describe:`Get Custom Hostname Quota`,builder:F,handler:async o=>a({command:`custom-hostnames quota get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf custom-hostnames quota get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/custom_hostnames/quota`,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.customHostnames.quota.get({zone_id:s})),{successLabel:`Loaded`})})},L={command:`quota`,describe:`Operations for quota`,builder:e=>e.command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},R={command:`custom-hostnames`,describe:`custom-hostnames`,builder:e=>e.command(y).command(x).command(C).command(M).command(P).command(_).command(A).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{R as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-B6b2OIBW.mjs";import{_ as t,m as n,v as r}from"./oauth-D4bkeMAw.mjs";import{r as i}from"./auth-Cp7gT-AF.mjs";import{t as a}from"./output-Bia1u2k5.mjs";import{t as o}from"./dry-run-CLX6Pbtq.mjs";import{t as s}from"./progress-Bi02B6v4.mjs";import{t as c}from"./run-BBBMrSrs.mjs";import"./telemetry-mKEb8lYB.mjs";import{n as l,t as u}from"./body-parser-CUWbw_Tq.mjs";import{n as d}from"./input-validation-Ch4Vllrm.mjs";import{a as f,n as p}from"./prompt-Bx2PB-tt.mjs";function m(e){return e.usage(`$0 custom-nameservers create
|
|
3
|
+
|
|
4
|
+
Adds a custom nameserver to the account or zone for use as a vanity nameserver on zones.`).option(`ns-name`,{type:`string`,description:`The FQDN of the name server.`}).option(`ns-set`,{type:`number`,description:`The number of the set that this name server belongs to.`,default:1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`create`,describe:`Add account or zone Custom Nameserver`,builder:m,handler:async p=>c({command:`custom-nameservers create`,classification:{safeFlags:[`dry-run`]}},p,async()=>{if(p.dryRun){let e=p.zone===void 0?await r():void 0,t=p.zone===void 0?`accounts`:`zones`,n=p.zone??e??`<account-id>`;o({command:`cf custom-nameservers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/custom_ns`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n)},bodyKind:`json`,body:p.body===void 0?u({ns_name:d(p[`ns-name`],`ns-name`,`text`),ns_set:p[`ns-set`]}):l(p.body)});return}let c=await i(p),m=p.zone===void 0?`accounts`:`zones`,h=m===`zones`?await t({zone:p.zone},c,{quiet:p.quiet}):p.local?e:await n();if(m===`zones`?p.zoneId=h:p.accountId=h,p.body){let e=l(p.body);a(await s(`Creating`,async()=>c.customNameservers.create({body:e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}p[`ns-name`]===void 0&&(p[`ns-name`]=await f(`ns-name`,`The FQDN of the name server.`));let g=u({ns_name:d(p[`ns-name`],`ns-name`,`text`),ns_set:p[`ns-set`]});a(await s(`Creating`,async()=>c.customNameservers.create({body:g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})})};function g(e){return e.usage(`$0 custom-nameservers delete <custom-ns-id>
|
|
5
|
+
|
|
6
|
+
Removes a custom nameserver from the account.`).positional(`custom-ns-id`,{type:`string`,description:`The FQDN of the name server.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <custom-ns-id>`,describe:`Delete Account Custom Nameserver`,builder:g,handler:async t=>c({command:`custom-nameservers delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){o({command:`cf custom-nameservers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/custom_ns/${t[`custom-ns-id`]==null?`<custom-ns-id>`:encodeURIComponent(String(t[`custom-ns-id`]))}`,pathParams:{"custom-ns-id":String(t[`custom-ns-id`]??``)},bodyKind:`none`});return}let c=await i(t),l=t.local?e:await n();if(t.accountId=l,!await p({force:!!t.force})){process.stderr.write(`Aborted.
|
|
7
|
+
`);return}a(await s(`Deleting`,async()=>c.customNameservers.delete({account_id:l,custom_ns_id:t[`custom-ns-id`]})),{successLabel:`Deleted`})})};function v(e){return e.usage(`$0 custom-nameservers get
|
|
8
|
+
|
|
9
|
+
List an account or zone's custom nameservers.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get`,describe:`List account or zone Custom Nameservers`,builder:v,handler:async l=>c({command:`custom-nameservers get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await r():void 0,t=l.zone===void 0?`accounts`:`zones`,n=l.zone??e??`<account-id>`;o({command:`cf custom-nameservers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/custom_ns`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await t({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await n();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.customNameservers.get({account_or_zone:u,account_or_zone_id:d})),{successLabel:`Loaded`})})},b={command:`custom-nameservers`,describe:`custom-nameservers`,builder:e=>e.command(h).command(_).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{b as default};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-B6b2OIBW.mjs";import{_ as t,m as n,v as r}from"./oauth-D4bkeMAw.mjs";import{r as i}from"./auth-Cp7gT-AF.mjs";import{t as a}from"./output-Bia1u2k5.mjs";import{t as o}from"./dry-run-CLX6Pbtq.mjs";import{t as s}from"./progress-Bi02B6v4.mjs";import{t as c}from"./run-BBBMrSrs.mjs";import"./telemetry-mKEb8lYB.mjs";import{n as l,t as u}from"./body-parser-CUWbw_Tq.mjs";import{n as d}from"./input-validation-Ch4Vllrm.mjs";import{a as f,i as p,n as m}from"./prompt-Bx2PB-tt.mjs";function h(e){return e.usage(`$0 custom-pages account-custom-pages preview-tokens create
|
|
3
|
+
|
|
4
|
+
Creates a signed JWT for previewing an account or zone-level custom page before it is published.`).option(`act`,{type:`string`,description:`The preview action type. Required for request parsing but not used in token generation. Typically set to "preview".`}).option(`target`,{type:`string`,description:`The target custom page type to preview (e.g. "block:waf"). Encoded as the "endpoint" claim in the resulting JWT.`}).option(`url`,{type:`string`,description:`The URL of the custom page content to preview. Encoded as the "zone" claim in the resulting JWT.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`create`,describe:`Create a preview token`,builder:h,handler:async p=>c({command:`custom-pages account-custom-pages preview-tokens create`,classification:{safeFlags:[`dry-run`]}},p,async()=>{if(p.dryRun){let e=p.zone===void 0?await r():void 0,t=p.zone===void 0?`accounts`:`zones`,n=p.zone??e??`<account-id>`;o({command:`cf custom-pages account-custom-pages preview-tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/custom_pages/preview_tokens`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n)},bodyKind:`json`,body:p.body===void 0?u({act:d(p.act,`act`,`text`),target:d(p.target,`target`,`text`),url:d(p.url,`url`,`text`)}):l(p.body)});return}let c=await i(p),m=p.zone===void 0?`accounts`:`zones`,h=m===`zones`?await t({zone:p.zone},c,{quiet:p.quiet}):p.local?e:await n();if(m===`zones`?p.zoneId=h:p.accountId=h,p.body){let e=l(p.body);a(await s(`Creating`,async()=>c.customPages.accountCustomPages.previewTokens.create({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}p.act===void 0&&(p.act=await f(`act`,`The preview action type. Required for request parsing but not used in token generation. Typically set to "preview".`)),p.target===void 0&&(p.target=await f(`target`,`The target custom page type to preview (e.g. "block:waf"). Encoded as the "endpoint" claim in the resulting JWT.`)),p.url===void 0&&(p.url=await f(`url`,`The URL of the custom page content to preview. Encoded as the "zone" claim in the resulting JWT.`));let g=u({act:d(p.act,`act`,`text`),target:d(p.target,`target`,`text`),url:d(p.url,`url`,`text`)});a(await s(`Creating`,async()=>c.customPages.accountCustomPages.previewTokens.create({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})})},_={command:`preview-tokens`,describe:`Preview tokens for account-level custom pages`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.usage(`$0 custom-pages account-custom-pages update <identifier>
|
|
5
|
+
|
|
6
|
+
Updates the configuration for a custom page type.`).positional(`identifier`,{type:`string`,description:`Custom page type.`,demandOption:!0}).option(`state`,{type:`string`,description:`The custom page state.`,choices:[`default`,`customized`]}).option(`url`,{type:`string`,description:`The URL associated with the custom page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`update <identifier>`,describe:`Update a custom page`,builder:v,handler:async m=>c({command:`custom-pages account-custom-pages update`,classification:{safeFlags:[`state`,`dry-run`]}},m,async()=>{if(m.dryRun){let e=m.zone===void 0?await r():void 0,t=m.zone===void 0?`accounts`:`zones`,n=m.zone??e??`<account-id>`;o({command:`cf custom-pages account-custom-pages update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/custom_pages/${m.identifier==null?`<identifier>`:encodeURIComponent(String(m.identifier))}`,pathParams:{"account-or-zone":String(t),identifier:String(m.identifier??``),"account-or-zone-id":String(n)},bodyKind:`json`,body:m.body===void 0?u({state:d(m.state,`state`,`text`),url:d(m.url,`url`,`text`)}):l(m.body)});return}let c=await i(m),h=m.zone===void 0?`accounts`:`zones`,g=h===`zones`?await t({zone:m.zone},c,{quiet:m.quiet}):m.local?e:await n();if(h===`zones`?m.zoneId=g:m.accountId=g,m.body){let e=l(m.body);a(await s(`Updating`,async()=>c.customPages.accountCustomPages.update({...e,account_or_zone:h,account_or_zone_id:g,identifier:m.identifier})),{successLabel:`Updated`});return}m.state===void 0&&(m.state=await p(`state`,`The custom page state.`,[`default`,`customized`])),m.url===void 0&&(m.url=await f(`url`,`The URL associated with the custom page.`));let _=u({state:d(m.state,`state`,`text`),url:d(m.url,`url`,`text`)});a(await s(`Updating`,async()=>c.customPages.accountCustomPages.update({..._,account_or_zone:h,account_or_zone_id:g,identifier:m.identifier})),{successLabel:`Updated`})})},b={command:`account-custom-pages`,describe:`Manage account-level custom pages`,builder:e=>e.command(y).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(e){return e.usage(`$0 custom-pages assets create custom asset
|
|
7
|
+
|
|
8
|
+
Creates a custom asset for an account or zone.`).option(`description`,{type:`string`,description:`A short description of the custom asset.`}).option(`name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`}).option(`url`,{type:`string`,description:`The URL where the asset content is fetched from.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`asset`,describe:`Create a custom asset`,builder:x,handler:async p=>c({command:`custom-pages assets create custom asset`,classification:{safeFlags:[`dry-run`]}},p,async()=>{if(p.dryRun){let e=p.zone===void 0?await r():void 0,t=p.zone===void 0?`accounts`:`zones`,n=p.zone??e??`<account-id>`;o({command:`cf custom-pages assets create custom asset`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/custom_pages/assets`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n)},bodyKind:`json`,body:p.body===void 0?u({description:d(p.description,`description`,`text`),name:d(p.name,`name`,`text`),url:d(p.url,`url`,`text`)}):l(p.body)});return}let c=await i(p),m=p.zone===void 0?`accounts`:`zones`,h=m===`zones`?await t({zone:p.zone},c,{quiet:p.quiet}):p.local?e:await n();if(m===`zones`?p.zoneId=h:p.accountId=h,p.body){let e=l(p.body);a(await s(`Creating`,async()=>c.customPages.assets.create.custom.asset({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}p.description===void 0&&(p.description=await f(`description`,`A short description of the custom asset.`)),p.name===void 0&&(p.name=await f(`name`,`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`)),p.url===void 0&&(p.url=await f(`url`,`The URL where the asset content is fetched from.`));let g=u({description:d(p.description,`description`,`text`),name:d(p.name,`name`,`text`),url:d(p.url,`url`,`text`)});a(await s(`Creating`,async()=>c.customPages.assets.create.custom.asset({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})})},C={command:`custom`,describe:`Operations for assets.create.custom`,builder:e=>e.command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},w={command:`create`,describe:`Operations for assets.create`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.usage(`$0 custom-pages assets delete custom asset <asset-name>
|
|
9
|
+
|
|
10
|
+
Deletes a custom asset from an account or zone.`).positional(`asset-name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const E={command:`asset <asset-name>`,describe:`Delete a custom asset`,builder:T,handler:async l=>c({command:`custom-pages assets delete custom asset`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await r():void 0,t=l.zone===void 0?`accounts`:`zones`,n=l.zone??e??`<account-id>`;o({command:`cf custom-pages assets delete custom asset`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/custom_pages/assets/${l[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(l[`asset-name`]))}`,pathParams:{"account-or-zone":String(t),"asset-name":String(l[`asset-name`]??``),"account-or-zone-id":String(n)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await t({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await n();if(u===`zones`?l.zoneId=d:l.accountId=d,!await m({force:!!l.force})){process.stderr.write(`Aborted.
|
|
11
|
+
`);return}a(await s(`Deleting`,async()=>c.customPages.assets.delete.custom.asset({account_or_zone:u,account_or_zone_id:d,asset_name:l[`asset-name`]})),{successLabel:`Deleted`})})},D={command:`custom`,describe:`Operations for assets.delete.custom`,builder:e=>e.command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},O={command:`delete`,describe:`Operations for assets.delete`,builder:e=>e.command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(e){return e.usage(`$0 custom-pages assets get custom asset <asset-name>
|
|
12
|
+
|
|
13
|
+
Returns a custom asset for an account or zone.`).positional(`asset-name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`asset <asset-name>`,describe:`Get a custom asset`,builder:k,handler:async l=>c({command:`custom-pages assets get custom asset`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await r():void 0,t=l.zone===void 0?`accounts`:`zones`,n=l.zone??e??`<account-id>`;o({command:`cf custom-pages assets get custom asset`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/custom_pages/assets/${l[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(l[`asset-name`]))}`,pathParams:{"account-or-zone":String(t),"asset-name":String(l[`asset-name`]??``),"account-or-zone-id":String(n)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await t({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await n();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.customPages.assets.get.custom.asset({account_or_zone:u,account_or_zone_id:d,asset_name:l[`asset-name`]})),{successLabel:`Loaded`})})},j={command:`custom`,describe:`Operations for assets.get.custom`,builder:e=>e.command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},M={command:`get`,describe:`Operations for assets.get`,builder:e=>e.command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.usage(`$0 custom-pages assets list custom assets
|
|
14
|
+
|
|
15
|
+
Lists custom assets for an account or zone.`).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of custom assets per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`assets`,describe:`List custom assets`,builder:N,handler:async l=>c({command:`custom-pages assets list custom assets`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={page:l.page,per_page:l[`per-page`]};if(l.dryRun){let e=l.zone===void 0?await r():void 0,t=l.zone===void 0?`accounts`:`zones`,n=l.zone??e??`<account-id>`;o({command:`cf custom-pages assets list custom assets`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/custom_pages/assets`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n)},query:c,bodyKind:`none`});return}let u=await i(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await t({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await n();d===`zones`?l.zoneId=f:l.accountId=f,a(await s(`Loading`,async()=>u.customPages.assets.list.custom.assets({account_or_zone:d,account_or_zone_id:f,...c})),{successLabel:`Loaded`})})},F={command:`custom`,describe:`Operations for assets.list.custom`,builder:e=>e.command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},I={command:`list`,describe:`Operations for assets.list`,builder:e=>e.command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(e){return e.usage(`$0 custom-pages assets update custom asset <asset-name>
|
|
16
|
+
|
|
17
|
+
Updates a custom asset for an account or zone.`).positional(`asset-name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`,demandOption:!0}).option(`description`,{type:`string`,description:`A short description of the custom asset.`}).option(`url`,{type:`string`,description:`The URL where the asset content is fetched from.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={command:`asset <asset-name>`,describe:`Update a custom asset`,builder:L,handler:async p=>c({command:`custom-pages assets update custom asset`,classification:{safeFlags:[`dry-run`]}},p,async()=>{if(p.dryRun){let e=p.zone===void 0?await r():void 0,t=p.zone===void 0?`accounts`:`zones`,n=p.zone??e??`<account-id>`;o({command:`cf custom-pages assets update custom asset`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/custom_pages/assets/${p[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(p[`asset-name`]))}`,pathParams:{"account-or-zone":String(t),"asset-name":String(p[`asset-name`]??``),"account-or-zone-id":String(n)},bodyKind:`json`,body:p.body===void 0?u({description:d(p.description,`description`,`text`),url:d(p.url,`url`,`text`)}):l(p.body)});return}let c=await i(p),m=p.zone===void 0?`accounts`:`zones`,h=m===`zones`?await t({zone:p.zone},c,{quiet:p.quiet}):p.local?e:await n();if(m===`zones`?p.zoneId=h:p.accountId=h,p.body){let e=l(p.body);a(await s(`Updating`,async()=>c.customPages.assets.update.custom.asset({...e,account_or_zone:m,account_or_zone_id:h,asset_name:p[`asset-name`]})),{successLabel:`Updated`});return}p.description===void 0&&(p.description=await f(`description`,`A short description of the custom asset.`)),p.url===void 0&&(p.url=await f(`url`,`The URL where the asset content is fetched from.`));let g=u({description:d(p.description,`description`,`text`),url:d(p.url,`url`,`text`)});a(await s(`Updating`,async()=>c.customPages.assets.update.custom.asset({...g,account_or_zone:m,account_or_zone_id:h,asset_name:p[`asset-name`]})),{successLabel:`Updated`})})},z={command:`custom`,describe:`Operations for assets.update.custom`,builder:e=>e.command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},B={command:`update`,describe:`Operations for assets.update`,builder:e=>e.command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},V={command:`assets`,describe:`Manage account- and zone-level custom assets`,builder:e=>e.command(w).command(O).command(M).command(I).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function H(e){return e.usage(`$0 custom-pages get <identifier>
|
|
18
|
+
|
|
19
|
+
Returns the configuration for a custom page type.`).positional(`identifier`,{type:`string`,description:`Custom page type.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`get <identifier>`,describe:`Get a custom page`,builder:H,handler:async l=>c({command:`custom-pages get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await r():void 0,t=l.zone===void 0?`accounts`:`zones`,n=l.zone??e??`<account-id>`;o({command:`cf custom-pages get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/custom_pages/${l.identifier==null?`<identifier>`:encodeURIComponent(String(l.identifier))}`,pathParams:{"account-or-zone":String(t),identifier:String(l.identifier??``),"account-or-zone-id":String(n)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await t({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await n();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.customPages.get({account_or_zone:u,account_or_zone_id:d,identifier:l.identifier})),{successLabel:`Loaded`})})};function W(e){return e.usage(`$0 custom-pages list
|
|
20
|
+
|
|
21
|
+
Lists all custom page configurations for an account or zone.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`list`,describe:`List custom pages`,builder:W,handler:async l=>c({command:`custom-pages list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await r():void 0,t=l.zone===void 0?`accounts`:`zones`,n=l.zone??e??`<account-id>`;o({command:`cf custom-pages list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${n}/custom_pages`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(n)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await t({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await n();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.customPages.list({account_or_zone:u,account_or_zone_id:d})),{successLabel:`Loaded`})})},K={command:`custom-pages`,describe:`Manage custom error and challenge pages and their assets for accounts and zones`,builder:e=>e.command(U).command(G).command(b).command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{K as default};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-B6b2OIBW.mjs";import{n as t}from"./resolve-CUDKxUrW.mjs";import{m as n,v as r}from"./oauth-D4bkeMAw.mjs";import{r as i}from"./auth-Cp7gT-AF.mjs";import{t as a}from"./output-Bia1u2k5.mjs";import{t as o}from"./dry-run-CLX6Pbtq.mjs";import{t as s}from"./progress-Bi02B6v4.mjs";import{n as c,t as l}from"./run-BBBMrSrs.mjs";import"./telemetry-mKEb8lYB.mjs";import{n as u,r as d,t as f}from"./body-parser-CUWbw_Tq.mjs";import{n as p}from"./input-validation-Ch4Vllrm.mjs";import{a as m,i as h,n as g,t as _}from"./prompt-Bx2PB-tt.mjs";import{t as ee}from"./cli-types-tt_LZMbn.mjs";import v from"node:fs";import y from"node:path";const te=(e,t,n)=>{let r=e instanceof RegExp?b(e,n):e,i=t instanceof RegExp?b(t,n):t,a=r!==null&&i!=null&&ne(r,i,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+r.length,a[1]),post:n.slice(a[1]+i.length)}},b=(e,t)=>{let n=t.match(e);return n?n[0]:null},ne=(e,t,n)=>{let r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;){if(u===c)r.push(u),c=n.indexOf(e,u+1);else if(r.length===1){let e=r.pop();e!==void 0&&(s=[e,l])}else i=r.pop(),i!==void 0&&i<a&&(a=i,o=l),l=n.indexOf(t,u+1);u=c<l&&c>=0?c:l}r.length&&o!==void 0&&(s=[a,o])}return s},x=`\0SLASH`+Math.random()+`\0`,S=`\0OPEN`+Math.random()+`\0`,C=`\0CLOSE`+Math.random()+`\0`,w=`\0COMMA`+Math.random()+`\0`,re=`\0PERIOD`+Math.random()+`\0`,ie=new RegExp(x,`g`),ae=new RegExp(S,`g`),oe=new RegExp(C,`g`),se=new RegExp(w,`g`),ce=new RegExp(re,`g`),le=/\\\\/g,ue=/\\{/g,de=/\\}/g,fe=/\\,/g,pe=/\\\./g;function T(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function me(e){return e.replace(le,x).replace(ue,S).replace(de,C).replace(fe,w).replace(pe,re)}function he(e){return e.replace(ie,`\\`).replace(ae,`{`).replace(oe,`}`).replace(se,`,`).replace(ce,`.`)}function ge(e){if(!e)return[``];let t=[],n=te(`{`,`}`,e);if(!n)return e.split(`,`);let{pre:r,body:i,post:a}=n,o=r.split(`,`);o[o.length-1]+=`{`+i+`}`;let s=ge(a);return a.length&&(o[o.length-1]+=s.shift(),o.push.apply(o,s)),t.push.apply(t,o),t}function _e(e,t={}){if(!e)return[];let{max:n=1e5}=t;return e.slice(0,2)===`{}`&&(e=`\\{\\}`+e.slice(2)),E(me(e),n,!0).map(he)}function ve(e){return`{`+e+`}`}function ye(e){return/^-?0\d/.test(e)}function be(e,t){return e<=t}function xe(e,t){return e>=t}function E(e,t,n){let r=[],i=te(`{`,`}`,e);if(!i)return[e];let a=i.pre,o=i.post.length?E(i.post,t,!1):[``];if(/\$$/.test(i.pre))for(let e=0;e<o.length&&e<t;e++){let t=a+`{`+i.body+`}`+o[e];r.push(t)}else{let s=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),l=s||c,u=i.body.indexOf(`,`)>=0;if(!l&&!u)return i.post.match(/,(?!,).*\}/)?(e=i.pre+`{`+i.body+C+i.post,E(e,t,!0)):[e];let d;if(l)d=i.body.split(/\.\./);else if(d=ge(i.body),d.length===1&&d[0]!==void 0&&(d=E(d[0],t,!1).map(ve),d.length===1))return o.map(e=>i.pre+d[0]+e);let f;if(l&&d[0]!==void 0&&d[1]!==void 0){let e=T(d[0]),n=T(d[1]),r=Math.max(d[0].length,d[1].length),i=d.length===3&&d[2]!==void 0?Math.max(Math.abs(T(d[2])),1):1,a=be;n<e&&(i*=-1,a=xe);let o=d.some(ye);f=[];for(let s=e;a(s,n)&&f.length<t;s+=i){let e;if(c)e=String.fromCharCode(s),e===`\\`&&(e=``);else if(e=String(s),o){let t=r-e.length;if(t>0){let n=Array(t+1).join(`0`);e=s<0?`-`+n+e.slice(1):n+e}}f.push(e)}}else{f=[];for(let e=0;e<d.length;e++)f.push.apply(f,E(d[e],t,!1))}for(let e=0;e<f.length;e++)for(let i=0;i<o.length&&r.length<t;i++){let t=a+f[e]+o[i];(!n||l||t)&&r.push(t)}}return r}const D=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>65536)throw TypeError(`pattern is too long`)},Se={"[:alnum:]":[`\\p{L}\\p{Nl}\\p{Nd}`,!0],"[:alpha:]":[`\\p{L}\\p{Nl}`,!0],"[:ascii:]":[`\\x00-\\x7f`,!1],"[:blank:]":[`\\p{Zs}\\t`,!0],"[:cntrl:]":[`\\p{Cc}`,!0],"[:digit:]":[`\\p{Nd}`,!0],"[:graph:]":[`\\p{Z}\\p{C}`,!0,!0],"[:lower:]":[`\\p{Ll}`,!0],"[:print:]":[`\\p{C}`,!0],"[:punct:]":[`\\p{P}`,!0],"[:space:]":[`\\p{Z}\\t\\r\\n\\v\\f`,!0],"[:upper:]":[`\\p{Lu}`,!0],"[:word:]":[`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`,!0],"[:xdigit:]":[`A-Fa-f0-9`,!1]},O=e=>e.replace(/[[\]\\-]/g,`\\$&`),Ce=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),k=e=>e.join(``),we=(e,t)=>{let n=t;if(e.charAt(n)!==`[`)throw Error(`not in a brace expression`);let r=[],i=[],a=n+1,o=!1,s=!1,c=!1,l=!1,u=n,d=``;WHILE:for(;a<e.length;){let t=e.charAt(a);if((t===`!`||t===`^`)&&a===n+1){l=!0,a++;continue}if(t===`]`&&o&&!c){u=a+1;break}if(o=!0,t===`\\`&&!c){c=!0,a++;continue}if(t===`[`&&!c){for(let[t,[o,c,l]]of Object.entries(Se))if(e.startsWith(t,a)){if(d)return[`$.`,!1,e.length-n,!0];a+=t.length,l?i.push(o):r.push(o),s||=c;continue WHILE}}if(c=!1,d){t>d?r.push(O(d)+`-`+O(t)):t===d&&r.push(O(t)),d=``,a++;continue}if(e.startsWith(`-]`,a+1)){r.push(O(t+`-`)),a+=2;continue}if(e.startsWith(`-`,a+1)){d=t,a+=2;continue}r.push(O(t)),a++}if(u<a)return[``,!1,0,!1];if(!r.length&&!i.length)return[`$.`,!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l)return[Ce(r[0].length===2?r[0].slice(-1):r[0]),!1,u-n,!1];let f=`[`+(l?`^`:``)+k(r)+`]`,p=`[`+(l?``:`^`)+k(i)+`]`;return[r.length&&i.length?`(`+f+`|`+p+`)`:r.length?f:p,s,u-n,!0]},A=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^/\\])\]/g,`$1$2`).replace(/\\([^/])/g,`$1`):t?e.replace(/\[([^/\\{}])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,`$1$2`).replace(/\\([^/{}])/g,`$1`);var j;const Te=new Set([`!`,`?`,`+`,`*`,`@`]),M=e=>Te.has(e),Ee=e=>M(e.type),De=new Map([[`!`,[`@`]],[`?`,[`?`,`@`]],[`@`,[`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`]]]),Oe=new Map([[`!`,[`?`]],[`@`,[`?`]],[`+`,[`?`,`*`]]]),ke=new Map([[`!`,[`?`,`@`]],[`?`,[`?`,`@`]],[`@`,[`?`,`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`,`?`,`*`]]]),Ae=new Map([[`!`,new Map([[`!`,`@`]])],[`?`,new Map([[`*`,`*`],[`+`,`*`]])],[`@`,new Map([[`!`,`!`],[`?`,`?`],[`@`,`@`],[`*`,`*`],[`+`,`+`]])],[`+`,new Map([[`?`,`*`],[`*`,`*`]])]]),N=`(?!\\.)`,je=new Set([`[`,`.`]),Me=new Set([`..`,`.`]),Ne=new Set(`().*{}+?[]^$\\!`),Pe=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),P=`[^/]`,F=P+`*?`,I=P+`+?`;let Fe=0;var L=class{type;#e;#t;#n=!1;#r=[];#i;#a;#o;#s=!1;#c;#l;#u=!1;id=++Fe;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for(`nodejs.util.inspect.custom`)](){return{"@@type":`AST`,id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#r.length,parts:this.#r}}constructor(e,t,n={}){this.type=e,e&&(this.#t=!0),this.#i=t,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#o=this.#e===this?[]:this.#e.#o,e===`!`&&!this.#e.#s&&this.#o.push(this),this.#a=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!=`string`&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#l===void 0?this.type?this.#l=this.type+`(`+this.#r.map(e=>String(e)).join(`|`)+`)`:this.#l=this.#r.map(e=>String(e)).join(``):this.#l}#d(){if(this!==this.#e)throw Error(`should only call on root`);if(this.#s)return this;this.toString(),this.#s=!0;let e;for(;e=this.#o.pop();){if(e.type!==`!`)continue;let t=e,n=t.#i;for(;n;){for(let r=t.#a+1;!n.type&&r<n.#r.length;r++)for(let t of e.#r){if(typeof t==`string`)throw Error(`string part in extglob AST??`);t.copyIn(n.#r[r])}t=n,n=t.#i}}return this}push(...e){for(let t of e)if(t!==``){if(typeof t!=`string`&&!(t instanceof j&&t.#i===this))throw Error(`invalid part: `+t);this.#r.push(t)}}toJSON(){let e=this.type===null?this.#r.slice().map(e=>typeof e==`string`?e:e.toJSON()):[this.type,...this.#r.map(e=>e.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#s&&this.#i?.type===`!`)&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let e=this.#i;for(let t=0;t<this.#a;t++){let n=e.#r[t];if(!(n instanceof j&&n.type===`!`))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type===`!`)return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#r.length:0;return this.#a===e-1}copyIn(e){typeof e==`string`?this.push(e):this.push(e.clone(this))}clone(e){let t=new j(this.type,e);for(let e of this.#r)t.copyIn(e);return t}static#f(e,t,n,r,i){let a=r.maxExtglobRecursion??2,o=!1,s=!1,c=-1,l=!1;if(t.type===null){let u=n,d=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,d+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),d+=n;continue}else if(n===`[`){s=!0,c=u,l=!1,d+=n;continue}if(!r.noext&&M(n)&&e.charAt(u)===`(`&&i<=a){t.push(d),d=``;let a=new j(n,t);u=j.#f(e,a,u,r,i+1),t.push(a);continue}d+=n}return t.push(d),u}let u=n+1,d=new j(null,t),f=[],p=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,p+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),p+=n;continue}else if(n===`[`){s=!0,c=u,l=!1,p+=n;continue}if(!r.noext&&M(n)&&e.charAt(u)===`(`&&(i<=a||t&&t.#h(n))){let a=t&&t.#h(n)?0:1;d.push(p),p=``;let o=new j(n,d);d.push(o),u=j.#f(e,o,u,r,i+a);continue}if(n===`|`){d.push(p),p=``,f.push(d),d=new j(null,t);continue}if(n===`)`)return p===``&&t.#r.length===0&&(t.#u=!0),d.push(p),p=``,t.push(...f,d),u;p+=n}return t.type=null,t.#t=void 0,t.#r=[e.substring(n-1)],u}#p(e){return this.#m(e,Oe)}#m(e,t=De){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null)return!1;let n=e.#r[0];return!n||typeof n!=`object`||n.type===null?!1:this.#h(n.type,t)}#h(e,t=ke){return!!t.get(this.type)?.includes(e)}#g(e,t){let n=e.#r[0],r=new j(null,n,this.options);r.#r.push(``),n.push(r),this.#_(e,t)}#_(e,t){let n=e.#r[0];this.#r.splice(t,1,...n.#r);for(let e of n.#r)typeof e==`object`&&(e.#i=this);this.#l=void 0}#v(e){return!!Ae.get(this.type)?.has(e)}#y(e){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null||this.#r.length!==1)return!1;let t=e.#r[0];return!t||typeof t!=`object`||t.type===null?!1:this.#v(t.type)}#b(e){let t=Ae.get(this.type),n=e.#r[0],r=t?.get(n.type);if(!r)return!1;this.#r=n.#r;for(let e of this.#r)typeof e==`object`&&(e.#i=this);this.type=r,this.#l=void 0,this.#u=!1}static fromGlob(e,t={}){let n=new j(null,void 0,t);return j.#f(e,n,0,t,0),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,n,r,i]=this.toRegExpSource();if(!(r||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#c.nocase?`i`:``)+(i?`u`:``);return Object.assign(RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(e){let t=e??!!this.#c.dot;if(this.#e===this&&(this.#x(),this.#d()),!Ee(this)){let n=this.isStart()&&this.isEnd()&&!this.#r.some(e=>typeof e!=`string`),r=this.#r.map(t=>{let[r,i,a,o]=typeof t==`string`?j.#C(t,this.#t,n):t.toRegExpSource(e);return this.#t=this.#t||a,this.#n=this.#n||o,r}).join(``),i=``;if(this.isStart()&&typeof this.#r[0]==`string`&&!(this.#r.length===1&&Me.has(this.#r[0]))){let n=je,a=t&&n.has(r.charAt(0))||r.startsWith(`\\.`)&&n.has(r.charAt(2))||r.startsWith(`\\.\\.`)&&n.has(r.charAt(4)),o=!t&&!e&&n.has(r.charAt(0));i=a?`(?!(?:^|/)\\.\\.?(?:$|/))`:o?N:``}let a=``;return this.isEnd()&&this.#e.#s&&this.#i?.type===`!`&&(a=`(?:$|\\/)`),[i+r+a,A(r),this.#t=!!this.#t,this.#n]}let n=this.type===`*`||this.type===`+`,r=this.type===`!`?`(?:(?!(?:`:`(?:`,i=this.#S(t);if(this.isStart()&&this.isEnd()&&!i&&this.type!==`!`){let e=this.toString(),t=this;return t.#r=[e],t.type=null,t.#t=void 0,[e,A(this.toString()),!1,!1]}let a=!n||e||t?``:this.#S(!0);a===i&&(a=``),a&&(i=`(?:${i})(?:${a})*?`);let o=``;if(this.type===`!`&&this.#u)o=(this.isStart()&&!t?N:``)+I;else{let n=this.type===`!`?`))`+(this.isStart()&&!t&&!e?N:``)+F+`)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&a?`)`:this.type===`*`&&a?`)?`:`)${this.type}`;o=r+i+n}return[o,A(i),this.#t=!!this.#t,this.#n]}#x(){if(Ee(this)){let e=0,t=!1;do{t=!0;for(let e=0;e<this.#r.length;e++){let n=this.#r[e];typeof n==`object`&&(n.#x(),this.#m(n)?(t=!1,this.#_(n,e)):this.#p(n)?(t=!1,this.#g(n,e)):this.#y(n)&&(t=!1,this.#b(n)))}}while(!t&&++e<10)}else for(let e of this.#r)typeof e==`object`&&e.#x();this.#l=void 0}#S(e){return this.#r.map(t=>{if(typeof t==`string`)throw Error(`string type in extglob ast??`);let[n,r,i,a]=t.toRegExpSource(e);return this.#n=this.#n||a,n}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join(`|`)}static#C(e,t,n=!1){let r=!1,i=``,a=!1,o=!1;for(let s=0;s<e.length;s++){let c=e.charAt(s);if(r){r=!1,i+=(Ne.has(c)?`\\`:``)+c;continue}if(c===`*`){if(o)continue;o=!0,i+=n&&/^[*]+$/.test(e)?I:F,t=!0;continue}else o=!1;if(c===`\\`){s===e.length-1?i+=`\\\\`:r=!0;continue}if(c===`[`){let[n,r,o,c]=we(e,s);if(o){i+=n,a||=r,s+=o-1,t||=c;continue}}if(c===`?`){i+=P,t=!0;continue}i+=Pe(c)}return[i,A(e),!!t,a]}};j=L;const Ie=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,`[$&]`):e.replace(/[?*()[\]\\{}]/g,`\\$&`):t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`),R=(e,t,n={})=>(D(t),!n.nocomment&&t.charAt(0)===`#`?!1:new q(t,n).match(e)),Le=/^\*+([^+@!?*[(]*)$/,Re=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),ze=e=>t=>t.endsWith(e),Be=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),Ve=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),He=/^\*+\.\*+$/,Ue=e=>!e.startsWith(`.`)&&e.includes(`.`),We=e=>e!==`.`&&e!==`..`&&e.includes(`.`),Ge=/^\.\*+$/,Ke=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),qe=/^\*+$/,Je=e=>e.length!==0&&!e.startsWith(`.`),Ye=e=>e.length!==0&&e!==`.`&&e!==`..`,Xe=/^\?+([^+@!?*[(]*)?$/,Ze=([e,t=``])=>{let n=z([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},Qe=([e,t=``])=>{let n=B([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},$e=([e,t=``])=>{let n=B([e]);return t?e=>n(e)&&e.endsWith(t):n},et=([e,t=``])=>{let n=z([e]);return t?e=>n(e)&&e.endsWith(t):n},z=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},B=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},V=typeof process==`object`&&process?typeof process.env==`object`&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,H={win32:{sep:`\\`},posix:{sep:`/`}};R.sep=V===`win32`?H.win32.sep:H.posix.sep;const U=Symbol(`globstar **`);R.GLOBSTAR=U,R.filter=(e,t={})=>n=>R(n,e,t);const W=(e,t={})=>Object.assign({},e,t);R.defaults=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return R;let t=R;return Object.assign((n,r,i={})=>t(n,r,W(e,i)),{Minimatch:class extends t.Minimatch{constructor(t,n={}){super(t,W(e,n))}static defaults(n){return t.defaults(W(e,n)).Minimatch}},AST:class extends t.AST{constructor(t,n,r={}){super(t,n,W(e,r))}static fromGlob(n,r={}){return t.AST.fromGlob(n,W(e,r))}},unescape:(n,r={})=>t.unescape(n,W(e,r)),escape:(n,r={})=>t.escape(n,W(e,r)),filter:(n,r={})=>t.filter(n,W(e,r)),defaults:n=>t.defaults(W(e,n)),makeRe:(n,r={})=>t.makeRe(n,W(e,r)),braceExpand:(n,r={})=>t.braceExpand(n,W(e,r)),match:(n,r,i={})=>t.match(n,r,W(e,i)),sep:t.sep,GLOBSTAR:U})};const G=(e,t={})=>(D(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:_e(e,{max:t.braceExpandMax}));R.braceExpand=G,R.makeRe=(e,t={})=>new q(e,t).makeRe(),R.match=(e,t,n={})=>{let r=new q(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e};const K=/[?*]|[+@!]\(.*?\)|\[|\]/,tt=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`);var q=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){D(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||V,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(e=>this.slashSplit(e));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[0]===``&&e[1]===``&&(e[2]===`?`||!K.test(e[2]))&&!K.test(e[3]),n=/^[a-z]:/i.test(e[0]);if(t)return[...e.slice(0,4),...e.slice(4).map(e=>this.parse(e))];if(n)return[e[0],...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.debug(this.pattern,r),this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e<this.set.length;e++){let t=this.set[e];t[0]===``&&t[1]===``&&this.globParts[e][2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3])&&(t[2]=`?`)}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let t of e)for(let e=0;e<t.length;e++)t[e]===`**`&&(t[e]=`*`);let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>(e=e.reduce((e,t)=>{let n=e[e.length-1];return t===`**`&&n===`**`?e:t===`..`&&n&&n!==`..`&&n!==`.`&&n!==`**`?(e.pop(),e):(e.push(t),e)},[]),e.length===0?[``]:e))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let r=e[n];n===1&&r===``&&e[0]===``||(r===`.`||r===``)&&(t=!0,e.splice(n,1),n--)}e[0]===`.`&&e.length===2&&(e[1]===`.`||e[1]===``)&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf(`..`,n+1))!==-1;){let r=e[n-1];r&&r!==`.`&&r!==`..`&&r!==`**`&&!(this.isWindows&&/^[a-z]:$/i.test(r))&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[``]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let r=-1;for(;(r=n.indexOf(`**`,r+1))!==-1;){let i=r;for(;n[i+1]===`**`;)i++;i>r&&n.splice(r+1,i-r);let a=n[r+1],o=n[r+2],s=n[r+3];if(a!==`..`||!o||o===`.`||o===`..`||!s||s===`.`||s===`..`)continue;t=!0,n.splice(r,1);let c=n.slice(0);c[r]=`**`,e.push(c),r--}if(!this.preserveMultipleSlashes){for(let e=1;e<n.length-1;e++){let r=n[e];e===1&&r===``&&n[0]===``||(r===`.`||r===``)&&(t=!0,n.splice(e,1),e--)}n[0]===`.`&&n.length===2&&(n[1]===`.`||n[1]===``)&&(t=!0,n.pop())}let i=0;for(;(i=n.indexOf(`..`,i+1))!==-1;){let e=n[i-1];if(e&&e!==`.`&&e!==`..`&&e!==`**`){t=!0;let e=i===1&&n[i+1]===`**`?[`.`]:[];n.splice(i-1,2,...e),n.length===0&&n.push(``),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let r=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(r){e[t]=[],e[n]=r;break}}return e.filter(e=>e.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r<e.length&&i<t.length;)if(e[r]===t[i])a.push(o===`b`?t[i]:e[r]),r++,i++;else if(n&&e[r]===`**`&&t[i]===e[r+1])a.push(e[r]),r++;else if(n&&t[i]===`**`&&e[r]===t[i+1])a.push(t[i]),i++;else if(e[r]===`*`&&t[i]&&(this.options.dot||!t[i].startsWith(`.`))&&t[i]!==`**`){if(o===`b`)return!1;o=`a`,a.push(e[r]),r++,i++}else if(t[i]===`*`&&e[r]&&(this.options.dot||!e[r].startsWith(`.`))&&e[r]!==`**`){if(o===`a`)return!1;o=`b`,a.push(t[i]),r++,i++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let r=0,i=0;if(this.isWindows){let n=typeof e[0]==`string`&&/^[a-z]:$/i.test(e[0]),a=!n&&e[0]===``&&e[1]===``&&e[2]===`?`&&/^[a-z]:$/i.test(e[3]),o=typeof t[0]==`string`&&/^[a-z]:$/i.test(t[0]),s=!o&&t[0]===``&&t[1]===``&&t[2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3]),c=a?3:n?0:void 0,l=s?3:o?0:void 0;if(typeof c==`number`&&typeof l==`number`){let[n,a]=[e[c],t[l]];n.toLowerCase()===a.toLowerCase()&&(t[l]=n,i=l,r=c)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(U)?this.#e(e,t,n,r,i):this.#n(e,t,n,r,i)}#e(e,t,n,r,i){let a=t.indexOf(U,i),o=t.lastIndexOf(U),[s,c,l]=n?[t.slice(i,a),t.slice(a+1),[]]:[t.slice(i,a),t.slice(a+1,o),t.slice(o+1)];if(s.length){let t=e.slice(r,r+s.length);if(!this.#n(t,s,n,0,0))return!1;r+=s.length,i+=s.length}let u=0;if(l.length){if(l.length+r>e.length)return!1;let t=e.length-l.length;if(this.#n(e,l,n,t,0))u=l.length;else{if(e[e.length-1]!==``||r+l.length===e.length||(t--,!this.#n(e,l,n,t,0)))return!1;u=l.length+1}}if(!c.length){let t=!!u;for(let n=r;n<e.length-u;n++){let r=String(e[n]);if(t=!0,r===`.`||r===`..`||!this.options.dot&&r.startsWith(`.`))return!1}return n||t}let d=[[[],0]],f=d[0],p=0,m=[0];for(let e of c)e===U?(m.push(p),f=[[],0],d.push(f)):(f[0].push(e),p++);let h=d.length-1,g=e.length-u;for(let e of d)e[1]=g-(m[h--]+e[0].length);return!!this.#t(e,d,r,0,n,0,!!u)}#t(e,t,n,r,i,a,o){let s=t[r];if(!s){for(let t=n;t<e.length;t++){o=!0;let n=e[t];if(n===`.`||n===`..`||!this.options.dot&&n.startsWith(`.`))return!1}return o}let[c,l]=s;for(;n<=l;){if(this.#n(e.slice(0,n+c.length),c,i,n,0)&&a<this.maxGlobstarRecursion){let s=this.#t(e,t,n+c.length,r+1,i,a+1,o);if(s!==!1)return s}let s=e[n];if(s===`.`||s===`..`||!this.options.dot&&s.startsWith(`.`))return!1;n++}return i||null}#n(e,t,n,r,i){let a,o,s,c;for(a=r,o=i,c=e.length,s=t.length;a<c&&o<s;a++,o++){this.debug(`matchOne loop`);let n=t[o],r=e[a];if(this.debug(t,n,r),n===!1||n===U)return!1;let i;if(typeof n==`string`?(i=r===n,this.debug(`string match`,n,r,i)):(i=n.test(r),this.debug(`pattern match`,n,r,i)),!i)return!1}if(a===c&&o===s)return!0;if(a===c)return n;if(o===s)return a===c-1&&e[a]===``;throw Error(`wtf?`)}braceExpand(){return G(this.pattern,this.options)}parse(e){D(e);let t=this.options;if(e===`**`)return U;if(e===``)return``;let n,r=null;(n=e.match(qe))?r=t.dot?Ye:Je:(n=e.match(Le))?r=(t.nocase?t.dot?Ve:Be:t.dot?ze:Re)(n[1]):(n=e.match(Xe))?r=(t.nocase?t.dot?Qe:Ze:t.dot?$e:et)(n):(n=e.match(He))?r=t.dot?We:Ue:(n=e.match(Ge))&&(r=Ke);let i=L.fromGlob(e,this.options).toMMPattern();return r&&typeof i==`object`&&Reflect.defineProperty(i,`test`,{value:r}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?`[^/]*?`:t.dot?`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`:`(?:(?!(?:\\/|^)\\.).)*?`,r=new Set(t.nocase?[`i`]:[]),i=e.map(e=>{let t=e.map(e=>{if(e instanceof RegExp)for(let t of e.flags.split(``))r.add(t);return typeof e==`string`?tt(e):e===U?U:e._src});t.forEach((e,r)=>{let i=t[r+1],a=t[r-1];e!==U||a===U||(a===void 0?i!==void 0&&i!==U?t[r+1]=`(?:\\/|`+n+`\\/)?`+i:t[r]=n:i===void 0?t[r-1]=a+`(?:\\/|\\/`+n+`)?`:i!==U&&(t[r-1]=a+`(?:\\/|\\/`+n+`\\/)`+i,t[r+1]=U))});let i=t.filter(e=>e!==U);if(this.partial&&i.length>=1){let e=[];for(let t=1;t<=i.length;t++)e.push(i.slice(0,t).join(`/`));return`(?:`+e.join(`|`)+`)`}return i.join(`/`)}).join(`|`),[a,o]=e.length>1?[`(?:`,`)`]:[``,``];i=`^`+a+i+o+`$`,this.partial&&(i=`^(?:\\/|`+a+i.slice(1,-1)+o+`)$`),this.negate&&(i=`^(?!`+i+`).+$`);try{this.regexp=new RegExp(i,[...r].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e of i){let i=r;if(n.matchBase&&e.length===1&&(i=[a]),this.matchOne(i,e,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return R.defaults(e).Minimatch}};R.AST=L,R.Minimatch=q,R.escape=Ie,R.unescape=A;function J(e){let t=e.replace(/\\/g,`/`),n=y.posix.normalize(t);return n.endsWith(`/`)?n.slice(0,-1):n}function Y(e,t){if(t===`.`)return e;let n=`${t}/`;if(!e.startsWith(n))throw Error(`Expected migrations pattern ${JSON.stringify(e)} to start with ${JSON.stringify(n)}`);return e.slice(n.length)}function X(e){return`"${e.replace(/"/g,`""`)}"`}function nt(e){return`CREATE TABLE IF NOT EXISTS ${X(e)}(
|
|
3
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
4
|
+
name TEXT UNIQUE,
|
|
5
|
+
applied_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL
|
|
6
|
+
);`}function rt(e){return`SELECT *
|
|
7
|
+
FROM ${X(e)}
|
|
8
|
+
ORDER BY id`}function it(e){if(e.pattern!==void 0&&e.dir===void 0)throw Error(`You have set --pattern "${e.pattern}" but have not set --dir.\n\nWhen --pattern is set, --dir must also be set, and --pattern must start with "<dir>/".`);let t=J(e.dir??`./migrations`),n=J(`${t}/*.sql`),r;if(e.pattern===void 0)r=n;else{r=J(e.pattern);try{Y(r,t)}catch{throw Error(`--pattern "${e.pattern}" must start with "${t}/" to match --dir "${t}".\nEither change --pattern so it starts with "${t}/" (for example, "${n}"), or change --dir to match the start of your pattern.`)}}return{migrationsPath:y.resolve(e.cwd??process.cwd(),t),migrationsDir:t,migrationsPattern:r,migrationsTableName:e.table??`d1_migrations`}}function at(e,t){let n=[],r=[{abs:e,rel:``}];for(;r.length>0;){let{abs:e,rel:i}=r.pop(),a;try{a=v.readdirSync(e,{withFileTypes:!0})}catch{continue}for(let o of a){let a=i===``?o.name:`${i}/${o.name}`;o.isDirectory()?t.match(a,!0)&&r.push({abs:y.join(e,o.name),rel:a}):o.isFile()&&t.match(a)&&n.push(a)}}return n.sort(st)}function Z(e){let t=e.split(`/`)[0]??``;return parseInt(t.split(`_`)[0]??``,10)}function ot(e,t){let n=Z(e),r=Z(t);if(n!==r){if(Number.isFinite(n)&&Number.isFinite(r))return n-r;if(Number.isFinite(n))return-1;if(Number.isFinite(r))return 1}return e<t?-1:+(e>t)}function st(e,t){let n=e.split(`/`),r=t.split(`/`),i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=ot(n[e]??``,r[e]??``);if(t!==0)return t}return n.length-r.length}function ct(e){let t=Y(e.migrationsPattern,e.migrationsDir);return at(e.migrationsPath,new q(t,{dot:!1}))}function lt(e,t){let n=[];for(let r of e)t.includes(r)||n.push(r);return n}function ut(e){let t=ct(e).map(e=>Z(e)).filter(e=>Number.isFinite(e));return Math.max(...t,0)+1}function dt(e){if(at(e.migrationsPath,new q(`*/migration.sql`,{dot:!1})).length!==0)return J(`${e.migrationsDir}/*/migration.sql`)}function ft(e){let t=``,n,r=!1,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=e[a+1];if(n!==void 0){t+=o,o===n&&(s===n?(t+=s,a++):n=void 0);continue}if(r){o===`\r`&&s===`
|
|
9
|
+
`?(t+=`
|
|
10
|
+
`,a++,r=!1):(t+=o,r=o!==`
|
|
11
|
+
`);continue}if(i){o===`\r`&&s===`
|
|
12
|
+
`?(t+=`
|
|
13
|
+
`,a++):(t+=o,o===`*`&&s===`/`&&(t+=s,a++,i=!1));continue}if(o===`-`&&s===`-`){t+=`--`,a++,r=!0;continue}if(o===`/`&&s===`*`){t+=`/*`,a++,i=!0;continue}if(o===`'`||o===`"`||o==="`"){t+=o,n=o;continue}if(o===`[`){t+=o,n=`]`;continue}if(o===`\r`&&s===`
|
|
14
|
+
`){t+=`
|
|
15
|
+
`,a++;continue}t+=o}return t}function pt({migrationsPath:e,migrationName:t,migrationsTableName:n}){return`${v.readFileSync(y.join(e,t),`utf8`)}
|
|
16
|
+
INSERT INTO ${X(n)} (name)
|
|
17
|
+
values ('${t.replace(/'/g,`''`)}');`}function mt(e){return e.option(`dir`,{type:`string`,description:`Directory containing migration files (default: ./migrations)`}).option(`pattern`,{type:`string`,description:`Glob for discovering migration files under --dir. Defaults to "<dir>/*.sql"; Drizzle's nested layout uses "<dir>/*/migration.sql"`})}function Q(e){return mt(e).option(`table`,{type:`string`,description:`Table recording applied migrations`,default:`d1_migrations`})}async function $(e,t,n,r,i,a=!1){return s(i,async()=>{let i={account_id:t,database_id:n,body:{sql:ft(r)}};return a?((await e.d1.raw(i))?.result??[]).map(e=>{let t=e.results?.columns??[],n=e.results?.rows??[];return{...e,results:n.map(e=>Object.fromEntries(t.map((t,n)=>[t,e[n]])))}}):(await e.d1.query(i))?.result??[]})}async function ht(r){if(!t(r.database))throw Error(`Expected a D1 database ID, but received <database>=${JSON.stringify(r.database)}. Database names and binding names are not accepted.`);let a=it({dir:r.dir,pattern:r.pattern,table:r.table});if(!v.existsSync(a.migrationsPath))throw Error(`No migrations directory at ${a.migrationsPath}.`+(r.dir===void 0?` Pass --dir to point at one.`:``));return{client:await i(r),accountId:r.local?e:await n(),databaseId:r.database,config:a,local:r.local===!0}}async function gt(e){let{client:t,accountId:n,databaseId:r,config:i}=e;await $(t,n,r,nt(i.migrationsTableName),`Preparing`,e.local);let a=(await $(t,n,r,rt(i.migrationsTableName),`Loading`,e.local))[0].results.map(e=>e.name),o=ct(i);if(o.length===0){let e=dt(i);e!==void 0&&process.stderr.write(`No files matched --pattern "${i.migrationsPattern}", but "${e}" does match. If an ORM such as drizzle manages your migrations, pass --pattern "${e}".\n`)}return{applied:a,all:o,unapplied:lt(o,a)}}function _t(e){return Q(e.positional(`database`,{type:`string`,description:`D1 database ID`,demandOption:!0}))}const vt={command:`apply <database>`,describe:`Apply any unapplied D1 migrations`,builder:_t,handler:async e=>{let t=await ht(e),n=(await gt(t)).unapplied.map(e=>({name:e,status:`🕒️`}));if(n.length===0){a([],{successLabel:`No migrations to apply`,quiet:e.quiet});return}if(await _(`About to apply ${n.length} migration(s)\nYour database may not be available to serve requests during the migration, continue?`)){for(let e of n){let n=pt({migrationsPath:t.config.migrationsPath,migrationName:e.name,migrationsTableName:t.config.migrationsTableName}),r=!0,i=[];try{let i=await $(t.client,t.accountId,t.databaseId,n,`Applying ${e.name}`,t.local);for(let e of i)e.success||(r=!1)}catch(e){r=!1,i=[e instanceof Error?e.message:String(e)]}if(e.status=r?`✅`:`❌`,i.length>0)throw Error(i.join(`
|
|
18
|
+
`))}a(n,{quiet:e.quiet})}}};function yt(e){return mt(e.positional(`message`,{type:`string`,description:`Describes what the migration does`,demandOption:!0}))}const bt={command:`create <message>`,describe:`Create a new empty D1 migration file`,builder:yt,handler:async e=>{if(e.local)throw Error("--local is not supported with `cf d1 migrations create`. This command only creates a migration file on your local filesystem, so you do not need --local.");let t=it({dir:e.dir,pattern:e.pattern}),n=xt(ut(t),4),r=e.message.replaceAll(` `,`_`);if(/[\\/]/.test(r))throw Error(`The migration name ${JSON.stringify(e.message)} contains a path separator ("/" or "\\"). Remove it and try again.`);let i=`${n}_${r}.sql`,o=J(`${t.migrationsDir}/${i}`);if(!new q(t.migrationsPattern,{dot:!1}).match(o))throw Error(`Would create "${o}", but --pattern "${t.migrationsPattern}" would not match it, so \`cf d1 migrations apply\` would skip it.\n\`cf d1 migrations create\` only writes top-level files inside --dir. If you are using an ORM like Drizzle, use \`drizzle-kit generate\` instead — it writes the nested layout your pattern expects.`);if(!v.existsSync(t.migrationsPath)){if(!await _(`No migrations folder found.\nOk to create ${t.migrationsPath}?`))throw Error(`No migrations folder present at ${t.migrationsPath}.`);v.mkdirSync(t.migrationsPath,{recursive:!0})}let s=y.join(t.migrationsPath,i);v.writeFileSync(s,`-- Migration number: ${n} \t ${new Date().toISOString()}\n`),a({name:i,path:s},{successLabel:`Created ${i}`,quiet:e.quiet})}};function xt(e,t){let n=e.toString();for(;n.length<t;)n=`0`+n;return n}function St(e){return Q(e.positional(`database`,{type:`string`,description:`D1 database ID`,demandOption:!0}))}const Ct={command:`list <database>`,describe:`View a list of unapplied migration files`,builder:St,handler:async e=>{let{unapplied:t}=await gt(await ht(e));a(t.map(e=>({Name:e})),{quiet:e.quiet})}},wt={command:`migrations`,describe:`Create, list, and apply D1 database migrations`,builder:e=>e.command(c(vt,{command:`d1 migrations apply`,classification:{safeFlags:[]}})).command(c(bt,{command:`d1 migrations create`,classification:{safeFlags:[]}})).command(c(Ct,{command:`d1 migrations list`,classification:{safeFlags:[]}})).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Tt(e){return e.usage(`$0 d1 create
|
|
19
|
+
|
|
20
|
+
Create a new D1 database in your account.`).option(`jurisdiction`,{type:`string`,description:`Specify the location to restrict the D1 database to run and store data. If this option is present, the location hint is ignored.`,choices:[`eu`,`fedramp`,`us`]}).option(`name`,{type:`string`,description:`D1 database name.`}).option(`primary-location-hint`,{type:`string`,description:`Specify the region to create the D1 primary, if available. If this option is omitted, the D1 will be created as close as possible to the current user.`,choices:[`wnam`,`enam`,`weur`,`eeur`,`apac`,`oc`]}).option(`read-replication-mode`,{type:`string`,description:`The read replication mode for the database. Use 'auto' to create replicas and allow D1 automatically place them around the world, or 'disabled' to not use any database replicas (it can take a few hours for all replicas to be deleted).`,choices:[`auto`,`disabled`]}).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([`read-replication-mode`].some(t=>e[t]!==void 0)){let t=[`read-replication-mode`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --read_replication-* flag is set`)}return!0})}const Et={command:`create`,describe:`Create D1 Database`,builder:Tt,handler:async t=>l({command:`d1 create`,classification:{safeFlags:[`jurisdiction`,`primary-location-hint`,`read-replication-mode`,`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf d1 create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/d1/database`,pathParams:{},bodyKind:`json`,body:t.body===void 0?f({jurisdiction:p(t.jurisdiction,`jurisdiction`,`text`),name:p(t.name,`name`,`text`),primary_location_hint:p(t[`primary-location-hint`],`primary-location-hint`,`text`),read_replication:{mode:p(t[`read-replication-mode`],`read-replication-mode`,`text`)}}):u(t.body)});return}let c=await i(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=u(t.body);a(await s(`Creating`,async()=>c.d1.create({...e,account_id:l})),{successLabel:`Created`});return}t.name===void 0&&(t.name=await m(`name`,`D1 database name.`));let d=f({jurisdiction:p(t.jurisdiction,`jurisdiction`,`text`),name:p(t.name,`name`,`text`),primary_location_hint:p(t[`primary-location-hint`],`primary-location-hint`,`text`),read_replication:{mode:p(t[`read-replication-mode`],`read-replication-mode`,`text`)}});a(await s(`Creating`,async()=>c.d1.create({...d,account_id:l})),{successLabel:`Created`})})};function Dt(e){return e.usage(`$0 d1 delete <database-id>
|
|
21
|
+
|
|
22
|
+
Delete a D1 database.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,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 Ot={command:`delete <database-id>`,describe:`Delete D1 Database`,builder:Dt,handler:async t=>l({command:`d1 delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){o({command:`cf d1 delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}`,pathParams:{"database-id":String(t[`database-id`]??``)},bodyKind:`none`});return}let c=await i(t),l=t.local?e:await n();if(t.accountId=l,!await g({force:!!t.force,message:`This permanently deletes the D1 database and all of its data.`})){process.stderr.write(`Aborted.
|
|
23
|
+
`);return}a(await s(`Deleting`,async()=>c.d1.delete({account_id:l,database_id:t[`database-id`]})),{successLabel:`Deleted`})})};function kt(e){return e.usage(`$0 d1 edit <database-id>
|
|
24
|
+
|
|
25
|
+
Partially update a D1 database's configuration.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`read-replication-mode`,{type:`string`,description:`The read replication mode for the database. Use 'auto' to create replicas and allow D1 automatically place them around the world, or 'disabled' to not use any database replicas (it can take a few hours for all replicas to be deleted).`,choices:[`auto`,`disabled`]}).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([`read-replication-mode`].some(t=>e[t]!==void 0)){let t=[`read-replication-mode`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --read_replication-* flag is set`)}return!0})}const At={command:`edit <database-id>`,describe:`Update D1 Database partially`,builder:kt,handler:async t=>l({command:`d1 edit`,classification:{safeFlags:[`read-replication-mode`,`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf d1 edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}`,pathParams:{"database-id":String(t[`database-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({read_replication:{mode:p(t[`read-replication-mode`],`read-replication-mode`,`text`)}}):u(t.body)});return}let c=await i(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=u(t.body);a(await s(`Updating`,async()=>c.d1.edit({...e,account_id:l,database_id:t[`database-id`]})),{successLabel:`Updated`});return}let d=f({read_replication:{mode:p(t[`read-replication-mode`],`read-replication-mode`,`text`)}});a(await s(`Updating`,async()=>c.d1.edit({...d,account_id:l,database_id:t[`database-id`]})),{successLabel:`Updated`})})};function jt(e){return e.usage(`$0 d1 export <database-id>
|
|
26
|
+
|
|
27
|
+
Export the SQL contents of a D1 database and return a URL where they can be downloaded. Note: this process may take some time for larger DBs, during which your D1 will be unavailable to serve queries. To avoid blocking your DB unnecessarily, an in-progress export must be continually polled or will automatically cancel.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`current-bookmark`,{type:`string`,description:`To poll an in-progress export, provide the current bookmark (returned by your first polling response)`}).option(`dump-options-no-data`,{type:`boolean`,description:`Export only the table definitions, not their contents`}).option(`dump-options-no-schema`,{type:`boolean`,description:`Export only each table's contents, not its definition`}).option(`dump-options-tables`,{type:`string`,array:!0,description:`Filter the export to just one or more tables. Passing an empty array is the same as not passing anything and means: export all tables.`}).option(`output-format`,{type:`string`,description:`Specifies that you will poll this endpoint until the export completes`,choices:[`polling`]}).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 Mt={command:`export <database-id>`,describe:`Export D1 Database as SQL`,builder:jt,handler:async t=>l({command:`d1 export`,classification:{safeFlags:[`dump-options-no-data`,`dump-options-no-schema`,`output-format`,`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf d1 export`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}/export`,pathParams:{"database-id":String(t[`database-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({current_bookmark:p(t[`current-bookmark`],`current-bookmark`,`text`),dump_options:{no_data:t[`dump-options-no-data`],no_schema:t[`dump-options-no-schema`],tables:t[`dump-options-tables`]},output_format:p(t[`output-format`],`output-format`,`text`)}):u(t.body)});return}let c=await i(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=u(t.body);a(await s(`Loading`,async()=>c.d1.export({...e,account_id:l,database_id:t[`database-id`]})),{successLabel:`Loaded`});return}t[`output-format`]===void 0&&(t[`output-format`]=await h(`output-format`,`Specifies that you will poll this endpoint until the export completes`,[`polling`]));let d=f({current_bookmark:p(t[`current-bookmark`],`current-bookmark`,`text`),dump_options:{no_data:t[`dump-options-no-data`],no_schema:t[`dump-options-no-schema`],tables:t[`dump-options-tables`]},output_format:p(t[`output-format`],`output-format`,`text`)});a(await s(`Loading`,async()=>c.d1.export({...d,account_id:l,database_id:t[`database-id`]})),{successLabel:`Loaded`})})};function Nt(e){return e.usage(`$0 d1 get <database-id>
|
|
28
|
+
|
|
29
|
+
Get details for a specific D1 database.`).positional(`database-id`,{type:`string`,description:`Database ID`,demandOption:!0}).option(`fields`,{type:`string`,description:`Comma-separated list of fields to include in the response. When omitted,
|
|
30
|
+
all fields are returned.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Pt={command:`get <database-id>`,describe:`Get D1 Database`,builder:ee(Nt),handler:async t=>l({command:`d1 get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let c={fields:t.fields};if(t.dryRun){o({command:`cf d1 get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}`,pathParams:{"database-id":String(t[`database-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(t),u=t.local?e:await n();t.accountId=u,a(await s(`Loading`,async()=>l.d1.get({account_id:u,database_id:t[`database-id`],...c})),{successLabel:`Loaded`})})};function Ft(e){return e.usage(`$0 d1 import <database-id>
|
|
31
|
+
|
|
32
|
+
Generate a temporary URL for uploading an SQL file to, then instruct the D1 to import it and poll it for status updates. Imports block the D1 for their duration.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`action`,{type:`string`,description:`Indicates you have a new SQL file to upload.`,choices:[`init`,`ingest`,`poll`]}).option(`etag`,{type:`string`,description:`Required when action is 'init' or 'ingest'. An md5 hash of the file you're uploading. Used to check if it already exists, and validate its contents before ingesting.`}).option(`filename`,{type:`string`,description:`The filename you have successfully uploaded.`}).option(`current-bookmark`,{type:`string`,description:`This identifies the currently-running import, checking its status.`}).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(`etag`,[`current-bookmark`]).conflicts(`filename`,[`current-bookmark`]).implies(`filename`,[`etag`]).conflicts(`current-bookmark`,[`etag`,`filename`])}const It={command:`import <database-id>`,describe:`Import SQL into your D1 Database`,builder:Ft,handler:async t=>l({command:`d1 import`,classification:{safeFlags:[`action`,`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf d1 import`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}/import`,pathParams:{"database-id":String(t[`database-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({action:p(t.action,`action`,`text`),etag:p(t.etag,`etag`,`text`),filename:p(t.filename,`filename`,`text`),current_bookmark:p(t[`current-bookmark`],`current-bookmark`,`text`)}):u(t.body)});return}let c=await i(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=u(t.body);a(await s(`Creating`,async()=>c.d1.import({body:e,account_id:l,database_id:t[`database-id`]})),{successLabel:`Created`});return}t.action===void 0&&(t.action=await h(`action`,`Indicates you have a new SQL file to upload.`,[`init`,`ingest`,`poll`]));let d=f({action:p(t.action,`action`,`text`),etag:p(t.etag,`etag`,`text`),filename:p(t.filename,`filename`,`text`),current_bookmark:p(t[`current-bookmark`],`current-bookmark`,`text`)});a(await s(`Creating`,async()=>c.d1.import({body:d,account_id:l,database_id:t[`database-id`]})),{successLabel:`Created`})})};function Lt(e){return e.usage(`$0 d1 list
|
|
33
|
+
|
|
34
|
+
List D1 databases in your account.`).option(`name`,{type:`string`,description:`a database name to search for.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of items per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Rt={command:`list`,describe:`List D1 Databases`,builder:Lt,handler:async t=>l({command:`d1 list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let c={name:t.name,page:t.page,per_page:t[`per-page`]};if(t.dryRun){o({command:`cf d1 list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/d1/database`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(t),u=t.local?e:await n();t.accountId=u,a(await s(`Loading`,async()=>l.d1.list({account_id:u,...c})),{successLabel:`Loaded`})})};function zt(e){return e.usage(`$0 d1 query <database-id>
|
|
35
|
+
|
|
36
|
+
Execute a SQL query against a D1 database and return results as objects.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`params`,{type:`string`,array:!0,description:`The params field`}).option(`sql`,{type:`string`,description:`Your SQL query. Supports multiple statements, joined by semicolons, which will be executed as a batch.`}).option(`batch`,{type:`string`,description:`The batch field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A single query object or a batch query object`}).conflicts(`params`,[`batch`]).conflicts(`sql`,[`batch`]).conflicts(`batch`,[`params`,`sql`])}const Bt={command:`query <database-id>`,describe:`Query D1 Database`,builder:zt,handler:async t=>l({command:`d1 query`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf d1 query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}/query`,pathParams:{"database-id":String(t[`database-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({params:t.params,sql:p(t.sql,`sql`,`text`),batch:d(t.batch,`batch`)}):u(t.body)});return}let c=await i(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=u(t.body);a(await s(`Loading`,async()=>c.d1.query({body:e,account_id:l,database_id:t[`database-id`]})),{successLabel:`Loaded`});return}let m=f({params:t.params,sql:p(t.sql,`sql`,`text`),batch:d(t.batch,`batch`)});a(await s(`Loading`,async()=>c.d1.query({body:m,account_id:l,database_id:t[`database-id`]})),{successLabel:`Loaded`})})};function Vt(e){return e.usage(`$0 d1 raw <database-id>
|
|
37
|
+
|
|
38
|
+
Execute a SQL query against a D1 database and return result rows as arrays rather than objects. This is a performance-optimized version of the /query endpoint.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`params`,{type:`string`,array:!0,description:`The params field`}).option(`sql`,{type:`string`,description:`Your SQL query. Supports multiple statements, joined by semicolons, which will be executed as a batch.`}).option(`batch`,{type:`string`,description:`The batch field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A single query object or a batch query object`}).conflicts(`params`,[`batch`]).conflicts(`sql`,[`batch`]).conflicts(`batch`,[`params`,`sql`])}const Ht={command:`raw <database-id>`,describe:`Raw D1 Database query`,builder:Vt,handler:async t=>l({command:`d1 raw`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf d1 raw`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}/raw`,pathParams:{"database-id":String(t[`database-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({params:t.params,sql:p(t.sql,`sql`,`text`),batch:d(t.batch,`batch`)}):u(t.body)});return}let c=await i(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=u(t.body);a(await s(`Loading`,async()=>c.d1.raw({body:e,account_id:l,database_id:t[`database-id`]})),{successLabel:`Loaded`});return}let m=f({params:t.params,sql:p(t.sql,`sql`,`text`),batch:d(t.batch,`batch`)});a(await s(`Loading`,async()=>c.d1.raw({body:m,account_id:l,database_id:t[`database-id`]})),{successLabel:`Loaded`})})};function Ut(e){return e.usage(`$0 d1 time-travel get-bookmark <database-id>
|
|
39
|
+
|
|
40
|
+
Retrieve the current bookmark, or the nearest bookmark at or before a provided timestamp. Bookmarks can be used with the restore endpoint to revert the database to a previous point in time.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`timestamp`,{type:`string`,description:`An optional ISO 8601 timestamp. If provided, returns the nearest available bookmark at or before this timestamp. If omitted, returns the current bookmark.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Wt={command:`get-bookmark <database-id>`,describe:`Get D1 database bookmark`,builder:Ut,handler:async t=>l({command:`d1 time-travel get-bookmark`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let c={timestamp:t.timestamp};if(t.dryRun){o({command:`cf d1 time-travel get-bookmark`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}/time_travel/bookmark`,pathParams:{"database-id":String(t[`database-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(t),u=t.local?e:await n();t.accountId=u,a(await s(`Loading`,async()=>l.d1.timeTravel.getBookmark({account_id:u,database_id:t[`database-id`],...c})),{successLabel:`Loaded`})})};function Gt(e){return e.usage(`$0 d1 time-travel restore <database-id>
|
|
41
|
+
|
|
42
|
+
Restore a D1 database to a previous point in time either via a bookmark or a timestamp.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`bookmark`,{type:`string`,description:"A bookmark to restore the database to. Required if `timestamp` is not provided."}).option(`timestamp`,{type:`string`,description:"An ISO 8601 timestamp to restore the database to. Required if `bookmark` is not provided."}).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 Kt={command:`restore <database-id>`,describe:`Restore D1 Database to a bookmark or point in time`,builder:Gt,handler:async t=>l({command:`d1 time-travel restore`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{let c={bookmark:t.bookmark,timestamp:t.timestamp};if(t.dryRun){o({command:`cf d1 time-travel restore`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}/time_travel/restore`,pathParams:{"database-id":String(t[`database-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(t),u=t.local?e:await n();if(t.accountId=u,!await g({force:!!t.force,message:`This reverts the D1 database to a previous point in time. Data written after the bookmark will be lost.`})){process.stderr.write(`Aborted.
|
|
43
|
+
`);return}a(await s(`Deleting`,async()=>l.d1.timeTravel.restore({account_id:u,database_id:t[`database-id`],...c})),{successLabel:`Deleted`})})},qt={command:`time-travel`,describe:`use specific point-in-time backups of your D1 database`,builder:e=>e.command(Wt).command(Kt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Jt(e){return e.usage(`$0 d1 update <database-id>
|
|
44
|
+
|
|
45
|
+
Update a D1 database's configuration.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`read-replication-mode`,{type:`string`,description:`The read replication mode for the database. Use 'auto' to create replicas and allow D1 automatically place them around the world, or 'disabled' to not use any database replicas (it can take a few hours for all replicas to be deleted).`,choices:[`auto`,`disabled`]}).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 Yt={command:`update <database-id>`,describe:`Update D1 Database`,builder:Jt,handler:async t=>l({command:`d1 update`,classification:{safeFlags:[`read-replication-mode`,`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf d1 update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}`,pathParams:{"database-id":String(t[`database-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({read_replication:{mode:p(t[`read-replication-mode`],`read-replication-mode`,`text`)}}):u(t.body)});return}let c=await i(t),l=t.local?e:await n();if(t.accountId=l,t.body){let e=u(t.body);a(await s(`Updating`,async()=>c.d1.update({...e,account_id:l,database_id:t[`database-id`]})),{successLabel:`Updated`});return}t[`read-replication-mode`]===void 0&&(t[`read-replication-mode`]=await h(`read-replication-mode`,`The read replication mode for the database. Use 'auto' to create replicas and allow D1 automatically place them around the world, or 'disabled' to not use any database replicas (it can take a few hours for all replicas to be deleted).`,[`auto`,`disabled`]));let d=f({read_replication:{mode:p(t[`read-replication-mode`],`read-replication-mode`,`text`)}});a(await s(`Updating`,async()=>c.d1.update({...d,account_id:l,database_id:t[`database-id`]})),{successLabel:`Updated`})})},Xt={command:`d1`,describe:`D1 is Cloudflare's managed, serverless database with SQLite's SQL semantics, built-in disaster recovery, and Worker and HTTP API access.`,builder:e=>e.command(Et).command(Ot).command(At).command(Mt).command(Pt).command(It).command(Rt).command(Bt).command(Ht).command(Yt).command(wt).command(qt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Xt as default};
|