cf 1.0.0-beta.14 → 1.0.0-beta.15
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/README.md +10 -0
- package/dist/_meta/commands.json +3409 -621
- package/dist/_meta/hand-written-commands.json +33 -0
- package/dist/_meta/schemas.json +2160 -246
- package/dist/abuse-reports-CnQBtN1G.mjs +24 -0
- package/dist/{access-k1QjF5rE.mjs → access-BzmXSwzj.mjs} +1 -1
- package/dist/account-tags-2qPWbW17.mjs +15 -0
- package/dist/accounts-B0Byg-AV.mjs +132 -0
- package/dist/acm-DgAu0cnk.mjs +15 -0
- package/dist/addressing-J1oa0ML2.mjs +105 -0
- package/dist/agent-memory-4KGou-tm.mjs +34 -0
- package/dist/ai-WY7wVQfA.mjs +31 -0
- package/dist/ai-audit-D38HaEoZ.mjs +6 -0
- package/dist/ai-gateway-C0gIipT8.mjs +80 -0
- package/dist/ai-search-ClwnPU-9.mjs +79 -0
- package/dist/ai-security-BIsvFPYV.mjs +10 -0
- package/dist/alerting-MHhv28oO.mjs +56 -0
- package/dist/analytics-BfBz7bqB.mjs +17 -0
- package/dist/analytics_engine-CXVdBF1n.mjs +4 -0
- package/dist/api-eMuS5GI1.mjs +3 -0
- package/dist/api-security-DUCfcdC1.mjs +154 -0
- package/dist/argo-CUlzI4v3.mjs +14 -0
- package/dist/artifacts-BLfWGzBg.mjs +43 -0
- package/dist/audit-logs-CsfIm2QS.mjs +4 -0
- package/dist/auth-8Sm4uLGM.mjs +2 -0
- package/dist/auth-C6u9qIGO.mjs +2 -0
- package/dist/auth-CGRemu5W.mjs +2 -0
- package/dist/{auth-token-Dop0wLCw.mjs → auth-token-DkkYg4DP.mjs} +1 -1
- package/dist/{autoconfig-RQ3HS4m1.mjs → autoconfig-B0ESZ8DJ.mjs} +2 -2
- package/dist/basin-catalog-CrKRYJ0b.mjs +46 -0
- package/dist/billing-NxehgXrR.mjs +23 -0
- package/dist/blocks-Bat9A8V_.mjs +5 -0
- package/dist/bot-management-C993iQKL.mjs +9 -0
- package/dist/botnet-feed-CZ4vYk5y.mjs +11 -0
- package/dist/brand-protection-ADVgIi0l.mjs +27 -0
- package/dist/browser-run-CEptKZYl.mjs +42 -0
- package/dist/build-Bm6kGyzo.mjs +2 -0
- package/dist/{build-CCe7IrWT.mjs → build-sBpqm9ga.mjs} +1 -1
- package/dist/builds-DqtiTH7p.mjs +71 -0
- package/dist/cache-hX5QxmI0.mjs +45 -0
- package/dist/certificate-authorities-BOcybjc1.mjs +6 -0
- package/dist/cf-Bq4pA4n6.mjs +18 -0
- package/dist/{chunk-TAK63GWY-DdMktrgc.mjs → chunk-2HLTAS5V-D7COzUOd.mjs} +2 -2
- package/dist/chunk-2K52M2W5-CYxfQXUq.mjs +363 -0
- package/dist/{chunk-DSGVRFIS-CPI5cYtB.mjs → chunk-DSGVRFIS-C5SqiTOz.mjs} +1 -1
- package/dist/{cli-ht4q6i2y.mjs → cli-R8h3OKZI.mjs} +1 -1
- package/dist/client-certificates-Bez_ArKE.mjs +13 -0
- package/dist/client-side-security-CSmA50Bv.mjs +63 -0
- package/dist/cloud-connector-0Wivqi7S.mjs +6 -0
- package/dist/{cloudflared-D83U8Yn3.mjs → cloudflared-By8BzYXc.mjs} +1 -1
- package/dist/cloudforce-one-J-rU6k1U.mjs +405 -0
- package/dist/{command-9VAc7b30.mjs → command-0BOb1pgV.mjs} +1 -1
- package/dist/{command-CyJQ40fc.mjs → command-BCJN-ZM2.mjs} +1 -1
- package/dist/{command-OHov3PEc.mjs → command-BG-kLOnS.mjs} +1 -1
- package/dist/{command-B_Ixlz8Q.mjs → command-BIsI-mMX.mjs} +1 -1
- package/dist/{command-SmWD-MeI.mjs → command-BKDbbA-L.mjs} +1 -1
- package/dist/command-BWQIKu6I.mjs +2 -0
- package/dist/{command-Ckb9FufU.mjs → command-Bdy69UFU.mjs} +1 -1
- package/dist/{command-CtVUNm__.mjs → command-Bgb-3yPg.mjs} +1 -1
- package/dist/{command-DtgJilOK.mjs → command-C6w1OdoC.mjs} +1 -1
- package/dist/{command-BtDY_MKv.mjs → command-CKW6UhTh.mjs} +1 -1
- package/dist/{command-Bpzp8Mz2.mjs → command-DCQgsd2U.mjs} +1 -1
- package/dist/{command-DjEJaOwV.mjs → command-DIs-Nqtl.mjs} +1 -1
- package/dist/command-DPn5ANHs.mjs +2 -0
- package/dist/{command-CUNMrMou.mjs → command-DZfKHiru.mjs} +1 -1
- package/dist/{command-DXaRn1ls.mjs → command-DppVezAB.mjs} +1 -1
- package/dist/{completions-CuqAO3N_.mjs → completions-CpNGTlUX.mjs} +1 -1
- package/dist/config.mjs +0 -0
- package/dist/connector-interrupts-CH-DaLuo.mjs +6 -0
- package/dist/connector-telemetry-events-X3Fod9nl.mjs +6 -0
- package/dist/connector-telemetry-snapshots-D-WR4npQ.mjs +6 -0
- package/dist/connectors-CORKD31m.mjs +15 -0
- package/dist/containers-BboUbx3k.mjs +78 -0
- package/dist/containers-Di3_Vopq.mjs +376 -0
- package/dist/content-scan-DXGREAXa.mjs +14 -0
- package/dist/{context-BBLtgdR1.mjs → context-A6T-NKPI.mjs} +2 -2
- package/dist/{cps-C5phNoVU.mjs → cps-1BoOLtTq.mjs} +3 -3
- package/dist/create-OXylMu6m.mjs +2 -0
- package/dist/csamScanner-CHfbfeup.mjs +10 -0
- package/dist/ct-alerting-DlH4ILQo.mjs +5 -0
- package/dist/custom-certificates-zJqJZ2Th.mjs +17 -0
- package/dist/custom-csrs-DoLIGqYL.mjs +11 -0
- package/dist/custom-hostnames-YfV-aoAK.mjs +27 -0
- package/dist/custom-nameservers-BV43gmgt.mjs +9 -0
- package/dist/custom-pages-CoOU1Cdx.mjs +21 -0
- package/dist/{d1-EQMUlHTJ.mjs → d1-DujBmzLa.mjs} +31 -31
- package/dist/dcv-delegation-CPLsVYOl.mjs +4 -0
- package/dist/delegate.mjs +0 -0
- package/dist/deploy-context-tEhwEXnA.mjs +56 -0
- package/dist/{deploy-input-BCjcuP6u.mjs → deploy-input-BqJ7GVZ-.mjs} +1 -1
- package/dist/{deploy-B22sEVHd.mjs → deploy-wNujfGUJ.mjs} +1 -1
- package/dist/{dev-ClhhXuNU.mjs → dev-EtnMYA7K.mjs} +1 -1
- package/dist/diagnostics-B3TYPVRi.mjs +15 -0
- package/dist/{dist-DmRM6WSZ.mjs → dist-DZRTPMMA.mjs} +4 -4
- package/dist/dls-CWm1HRF0.mjs +17 -0
- package/dist/dns-CjAFU7Z9.mjs +144 -0
- package/dist/dns-firewall-BooBP9ap.mjs +71 -0
- package/dist/docs-C5XB7HdG.mjs +3 -0
- package/dist/{dotenv-DpXaxfho.mjs → dotenv-usOKkeW7.mjs} +3 -3
- package/dist/{dry-run-DRj2_uV3.mjs → dry-run-C2KjGX10.mjs} +1 -1
- package/dist/durable-objects-CSrMQDCE.mjs +6 -0
- package/dist/email-auth-Bp1Mui-n.mjs +6 -0
- package/dist/email-routing-CVF6SwQt.mjs +45 -0
- package/dist/email-security-mYZtazae.mjs +158 -0
- package/dist/email-sending-BqaKU_Xu.mjs +47 -0
- package/dist/error-sanitization-CIQOep3I.mjs +2 -0
- package/dist/error-sanitization-pOyzm2F1.mjs +2 -0
- package/dist/fieldExtractors-CAGZVmYg.mjs +9 -0
- package/dist/firewall-DgTDsYOt.mjs +36 -0
- package/dist/flagship-Db3PxxyZ.mjs +28 -0
- package/dist/fraud-BEOQczy8.mjs +22 -0
- package/dist/get-By1q8YlI.mjs +2 -0
- package/dist/get-CRKvqCu6.mjs +2 -0
- package/dist/get-iPUHxD1r.mjs +2 -0
- package/dist/google-tag-gateway-DjLQ9wo0.mjs +6 -0
- package/dist/healthchecks-C3ScnKss.mjs +22 -0
- package/dist/{hostnames-DvaUSzsj.mjs → hostnames-DU0k-xO9.mjs} +6 -6
- package/dist/hyperdrive-IpCCLCRd.mjs +37 -0
- package/dist/iam-96CYM8Vw.mjs +52 -0
- package/dist/images-AB9EgZgT.mjs +71 -0
- package/dist/index.mjs +1 -1
- package/dist/{init-Da8pe296.mjs → init-D2nPoW4f.mjs} +2 -2
- package/dist/intel-BKb4RLvS.mjs +76 -0
- package/dist/ips-z9APCV_b.mjs +4 -0
- package/dist/k2-Bv-HiJ29.mjs +11 -0
- package/dist/keyless-certificates-ChgSGHq4.mjs +13 -0
- package/dist/keys-BhngDsDa.mjs +4 -0
- package/dist/kv-CB5MQVGP.mjs +15 -0
- package/dist/{lazy-command-CDWwCsD2.mjs → lazy-command-CaZ1kdlW.mjs} +1 -1
- package/dist/leaked-credential-checks-Bsi2WpSU.mjs +18 -0
- package/dist/{load-balancers-Bu9pd2SV.mjs → load-balancers-0gXZNCeI.mjs} +40 -40
- package/dist/{local-BcPM4I0s.mjs → local-Dil4fTWX.mjs} +1 -1
- package/dist/local-DxWDQDnG.mjs +2 -0
- package/dist/{local-runtime-BHKyRlCP.mjs → local-runtime-B7TKFu6E.mjs} +1 -1
- package/dist/login-CiQGR8ha.mjs +5 -0
- package/dist/login-Ik98G4K6.mjs +2 -0
- package/dist/logo-matches-DmoF5Otu.mjs +6 -0
- package/dist/logos-BL6ohIMH.mjs +7 -0
- package/dist/logpush-UVopW68t.mjs +46 -0
- package/dist/logs-BVfxiEiM.mjs +36 -0
- package/dist/magic-cloud-networking-B5S3aM6f.mjs +71 -0
- package/dist/magic-network-monitoring-CDSJPP47.mjs +36 -0
- package/dist/magic-transit-TcDTKM43.mjs +386 -0
- package/dist/managed-defense-C88HL0pg.mjs +18 -0
- package/dist/managed-transforms-Ja41Tahl.mjs +9 -0
- package/dist/matches-BL_Y-9Yq.mjs +6 -0
- package/dist/mcp-BWp5Q09R.mjs +32 -0
- package/dist/mesh-lFPLRWhV.mjs +26 -0
- package/dist/{migrate-CZNq63Uj.mjs → migrate-6e5mJ79R.mjs} +1 -1
- package/dist/monetization-BIc4Bwo2.mjs +20 -0
- package/dist/mtls-certificates-CVBw-Jli.mjs +13 -0
- package/dist/network-Wig0qbaC.mjs +50 -0
- package/dist/network-interconnects-C16z1HuQ.mjs +72 -0
- package/dist/o11y-Bhy4qDRm.mjs +93 -0
- package/dist/oauth-CfEedDZi.mjs +4 -0
- package/dist/oauth-clients-eXjmK5yf.mjs +16 -0
- package/dist/{oauth-n8um6MFk.mjs → oauth-oWaW7ICv.mjs} +1 -1
- package/dist/oauth-scopes-DZWn50EA.mjs +4 -0
- package/dist/organization-QdAQTrKa.mjs +71 -0
- package/dist/organizations-CgAQYdK5.mjs +4 -0
- package/dist/origin-ca-certificates-BklXqp8X.mjs +11 -0
- package/dist/origin-post-quantum-encryption-Dg16ueT4.mjs +6 -0
- package/dist/origin-tls-client-auth-d8bDU5zU.mjs +30 -0
- package/dist/output-Co4xdFf6.mjs +2 -0
- package/dist/page-rules-CgMkC6YR.mjs +39 -0
- package/dist/{pages-Bn0Sg1ay.mjs → pages-CkBtOOf8.mjs} +29 -29
- package/dist/path-DRw6Y-nd.mjs +2 -0
- package/dist/pay-per-crawl-CnGXOWyz.mjs +38 -0
- package/dist/pay-per-use-HbfxpATr.mjs +33 -0
- package/dist/pipelines-CnO9CCs0.mjs +44 -0
- package/dist/precursor-Bc55XJdQ.mjs +4 -0
- package/dist/previews-C7vZrajd.mjs +7 -0
- package/dist/progress-D5po7ScB.mjs +2 -0
- package/dist/prompt-BAJpE3jV.mjs +4 -0
- package/dist/queries-BJAH4B74.mjs +9 -0
- package/dist/queues-D4G8vvwi.mjs +57 -0
- package/dist/r2-CJ8rD6Jb.mjs +128 -0
- package/dist/{radar-CdvQL4xm.mjs → radar-DgaxOdcd.mjs} +150 -150
- package/dist/raw-fetch-yY-wX5Xx.mjs +2 -0
- package/dist/realtime-DU09m7L7.mjs +172 -0
- package/dist/registrar-Cj7OfvGs.mjs +43 -0
- package/dist/registrar-sandbox-CA0Mua-j.mjs +56 -0
- package/dist/{registry-PI6sO95I.mjs → registry-CRnk93ur.mjs} +1 -1
- package/dist/reporting-3kDVF5c8.mjs +14 -0
- package/dist/{request-headers-D8L95bEQ.mjs → request-headers-D_eQn93b.mjs} +1 -1
- package/dist/request-tracers-VBD4R3s3.mjs +4 -0
- package/dist/resolve-BpgXeklt.mjs +2 -0
- package/dist/resolve-C3FmNlSO.mjs +2 -0
- package/dist/resource-sharing-BtUF3psS.mjs +40 -0
- package/dist/resource-tagging--90INP8_.mjs +4 -0
- package/dist/rules-CcwPngVo.mjs +18 -0
- package/dist/rulesets-CfdruY82.mjs +37 -0
- package/dist/rum-RLkdfSL7.mjs +30 -0
- package/dist/run-CUNhH5CQ.mjs +2 -0
- package/dist/{run-CW2Cgi0S.mjs → run-DASYqJsY.mjs} +1 -1
- package/dist/{schema-elj12WOx.mjs → schema-S3pUZwpI.mjs} +1 -1
- package/dist/{schema-flags-BTItUu1K.mjs → schema-flags-CShtn7ya.mjs} +1 -1
- package/dist/scim-BZYsTPIL.mjs +18 -0
- package/dist/secrets-store-C_-FkSH_.mjs +24 -0
- package/dist/security-insights-BVBEaZmD.mjs +40 -0
- package/dist/security-txt--IoHrHee.mjs +9 -0
- package/dist/session-Cq3YNLoI.mjs +2 -0
- package/dist/shared-zNQNv1im.mjs +2 -0
- package/dist/smart-shield-CByC4_60.mjs +24 -0
- package/dist/snippets-DB-jiZAV.mjs +20 -0
- package/dist/{spawn-D07wH-MH.mjs → spawn-DQttFH05.mjs} +1 -1
- package/dist/{spectrum-B6qkjR_Z.mjs → spectrum-Bs2g1BmK.mjs} +14 -14
- package/dist/speed-Bq4evEnJ.mjs +24 -0
- package/dist/sql-XGci7hZC.mjs +4 -0
- package/dist/src-GiuwAT55.mjs +125 -0
- package/dist/ssl-KJTLW1NR.mjs +45 -0
- package/dist/{startup-profile-CrtCP-6-.mjs → startup-profile-BOaseXnO.mjs} +1 -1
- package/dist/startup-profile-BwEZFVGS.mjs +2 -0
- package/dist/{state-DIiIGEtR.mjs → state-Boubf1X6.mjs} +1 -1
- package/dist/state-CODDG9Nx.mjs +2 -0
- package/dist/stream-BotgYspF.mjs +102 -0
- package/dist/submit-C5VytaHP.mjs +4 -0
- package/dist/{tags-CX23P4jg.mjs → tags-3Hq-B9qp.mjs} +2 -2
- package/dist/{telemetry-ZlCi5Xhc.mjs → telemetry-3FJOXl_C.mjs} +1 -1
- package/dist/telemetry-BhKfwxyh.mjs +2 -0
- package/dist/tenant-BgX5onPc.mjs +10 -0
- package/dist/tenant-custom-nameservers-BVG8v1Xo.mjs +9 -0
- package/dist/theme-BGHWSKCw.mjs +6 -0
- package/dist/{tools-CSc5DmFi.mjs → tools-BCCRUENY.mjs} +1 -1
- package/dist/{tunnels-NzYpsfi_.mjs → tunnels-CThOI3qH.mjs} +15 -15
- package/dist/turnstile-BgZaUx-g.mjs +33 -0
- package/dist/ui-BtIBQeaG.mjs +2 -0
- package/dist/update-check-Yy7Ivq2V.mjs +2 -0
- package/dist/{update-check-HFkPml6x.mjs → update-check-jb89ih_g.mjs} +1 -1
- package/dist/update-check-worker.mjs +1 -1
- package/dist/url-info-DQERN0Xq.mjs +4 -0
- package/dist/url-normalization-Cb1hofqv.mjs +9 -0
- package/dist/url-scanner-gHgx1bW7.mjs +16 -0
- package/dist/{user-rXca0J9M.mjs → user-CdKzIuSi.mjs} +58 -58
- package/dist/values-EwA8Sx0w.mjs +4 -0
- package/dist/vectorize-DejgIJIv.mjs +32 -0
- package/dist/version-B6MnUIqV.mjs +2 -0
- package/dist/{waiting-rooms-DrA3-0bw.mjs → waiting-rooms-BNR1HvAP.mjs} +25 -25
- package/dist/web-assets-iglnzkTV.mjs +64 -0
- package/dist/web3-JBUU6IVt.mjs +28 -0
- package/dist/workers-CDp4kLTJ.mjs +40 -0
- package/dist/workers-builds-CSb9Dglt.mjs +14 -0
- package/dist/workers-for-platforms-D4srNZvt.mjs +40 -0
- package/dist/workers-vpc-LPC8TadH.mjs +13 -0
- package/dist/workflows-DN_VqWJC.mjs +52 -0
- package/dist/{wrangler-migration-C6FKHER1.mjs → wrangler-migration-DxTB5yPT.mjs} +1 -1
- package/dist/zaraz-DDErl5yc.mjs +22 -0
- package/dist/zero-trust-M88XX3uD.mjs +957 -0
- package/dist/zone-BsGvedmN.mjs +4 -0
- package/dist/zones-l_sRKrVl.mjs +124 -0
- package/package.json +15 -18
- package/dist/Page-BShsqCXr.mjs +0 -2
- package/dist/abuse-reports-CVv52Q2w.mjs +0 -24
- package/dist/account-tags-RhvWOkOf.mjs +0 -15
- package/dist/accounts--3lrEkmu.mjs +0 -125
- package/dist/acm-BJxINEcu.mjs +0 -15
- package/dist/addressing-BqByG9JW.mjs +0 -105
- package/dist/agent-memory-D4dQMGbh.mjs +0 -34
- package/dist/ai-CRkQ4pjC.mjs +0 -31
- package/dist/ai-audit-fMSn4c5L.mjs +0 -6
- package/dist/ai-gateway-CbhvQK4L.mjs +0 -80
- package/dist/ai-search-CvVSnOA0.mjs +0 -79
- package/dist/ai-security-Z_qpI92I.mjs +0 -10
- package/dist/alerting-CpbCB8br.mjs +0 -56
- package/dist/analytics-DkY9dOP1.mjs +0 -17
- package/dist/analytics_engine-DE_jvlx_.mjs +0 -4
- package/dist/api-security-BHnOU5MM.mjs +0 -154
- package/dist/argo-DhC5L_aN.mjs +0 -14
- package/dist/args-CfbYkeXd.mjs +0 -2
- package/dist/artifacts-CrIupY7P.mjs +0 -43
- package/dist/audit-logs-BjeBxTox.mjs +0 -4
- package/dist/auth-BNYfOMl0.mjs +0 -2
- package/dist/auth-CAWalgW0.mjs +0 -2
- package/dist/auth-DOwC01PW.mjs +0 -2
- package/dist/banner-D03JEqRs.mjs +0 -2
- package/dist/basin-catalog-DZ7QV-_N.mjs +0 -46
- package/dist/billing-BFyte9fL.mjs +0 -23
- package/dist/bot-management-DXcbV3am.mjs +0 -9
- package/dist/botnet-feed-bGGp_cwX.mjs +0 -11
- package/dist/brand-protection-DN36XkxH.mjs +0 -27
- package/dist/browser-run-hHD1RT43.mjs +0 -42
- package/dist/build-BhpWYgNm.mjs +0 -2
- package/dist/builds-6aO61R9R.mjs +0 -71
- package/dist/cache-C5YJpMqi.mjs +0 -45
- package/dist/certificate-authorities-CbqDAktQ.mjs +0 -6
- package/dist/cf-oRSQKirD.mjs +0 -18
- package/dist/chunk-NDZDTP46-Civns3WA.mjs +0 -361
- package/dist/cli-types-9oYmRTHJ.mjs +0 -2
- package/dist/client-certificates-balaN_my.mjs +0 -13
- package/dist/client-side-security-3_4Ermmg.mjs +0 -63
- package/dist/cloud-connector-avx27sLw.mjs +0 -6
- package/dist/cloudforce-one-CXdeqJ9l.mjs +0 -405
- package/dist/command-DPX9sJVi.mjs +0 -2
- package/dist/command-OWe3v69l.mjs +0 -2
- package/dist/connector-interrupts-ftd10Du-.mjs +0 -6
- package/dist/connector-telemetry-events-TwDZYdEM.mjs +0 -6
- package/dist/connector-telemetry-snapshots-CZxkOuC3.mjs +0 -6
- package/dist/connectors-6lVSr-fd.mjs +0 -15
- package/dist/containers-Dqs_ZnO2.mjs +0 -78
- package/dist/containers-ncw3bd3a.mjs +0 -376
- package/dist/content-scan-BWFbqfQ0.mjs +0 -14
- package/dist/csamScanner-BwZNZu0A.mjs +0 -10
- package/dist/ct-alerting-DPp3qLqO.mjs +0 -5
- package/dist/custom-certificates-pfpZcr06.mjs +0 -17
- package/dist/custom-csrs-DrvGRAkl.mjs +0 -11
- package/dist/custom-hostnames-wGtmFbz1.mjs +0 -27
- package/dist/custom-nameservers-HTG6MPKv.mjs +0 -9
- package/dist/custom-pages-DqEHBSVt.mjs +0 -21
- package/dist/dcv-delegation-D6nj0Z5N.mjs +0 -4
- package/dist/deploy-context-DmG9rgPO.mjs +0 -56
- package/dist/diagnostics-tqHjq-Pl.mjs +0 -15
- package/dist/dls-BEHj4X9T.mjs +0 -17
- package/dist/dns-firewall-zwbkutyf.mjs +0 -71
- package/dist/dns-n4mfYBZg.mjs +0 -144
- package/dist/durable-objects-CQ2dHhho.mjs +0 -6
- package/dist/email-auth-DOi6yOt3.mjs +0 -6
- package/dist/email-routing-WcSPt22u.mjs +0 -45
- package/dist/email-security-BXu3OGay.mjs +0 -158
- package/dist/email-sending-B9zTlIjt.mjs +0 -47
- package/dist/error-sanitization-DE_zSrXw.mjs +0 -2
- package/dist/error-sanitization-DOCQ9Ykh.mjs +0 -2
- package/dist/errors-_sob7Ihu.mjs +0 -3
- package/dist/fieldExtractors-B37m2lKW.mjs +0 -9
- package/dist/firewall-CRtYO0Ha.mjs +0 -36
- package/dist/flagship-DvTFZSay.mjs +0 -28
- package/dist/fraud-uSyibsit.mjs +0 -22
- package/dist/google-tag-gateway-BFXiiokq.mjs +0 -6
- package/dist/healthchecks-27u7b7Jb.mjs +0 -22
- package/dist/hyperdrive-BzJvPdu6.mjs +0 -37
- package/dist/iam-Dl3cU9GI.mjs +0 -52
- package/dist/images-C2OkI1j7.mjs +0 -71
- package/dist/intel-DoB1g_K7.mjs +0 -76
- package/dist/ips-BRt68epr.mjs +0 -4
- package/dist/k2-_eq5ZY2t.mjs +0 -11
- package/dist/keyless-certificates-DaO2yqYu.mjs +0 -13
- package/dist/keys-7BQ3Zq6Y.mjs +0 -4
- package/dist/kv-BTYCXKML.mjs +0 -15
- package/dist/leaked-credential-checks-CPHOK_dE.mjs +0 -18
- package/dist/local-BundUuDT.mjs +0 -2
- package/dist/login-BBYC_BtH.mjs +0 -2
- package/dist/login-D2uoWhWh.mjs +0 -5
- package/dist/logo-matches-Bc1DQ4-g.mjs +0 -6
- package/dist/logos-X5B8z7Iv.mjs +0 -7
- package/dist/logpush-C2ENi1et.mjs +0 -46
- package/dist/logs-BKDz7kBW.mjs +0 -36
- package/dist/magic-cloud-networking-B60Gld8A.mjs +0 -71
- package/dist/magic-network-monitoring-CxXI3Y-H.mjs +0 -36
- package/dist/magic-transit-ZCSaCbl8.mjs +0 -386
- package/dist/managed-defense-DrxMb7xi.mjs +0 -18
- package/dist/managed-transforms-AI7KrRU1.mjs +0 -9
- package/dist/matches-rPMLS3Ip.mjs +0 -6
- package/dist/mcp-DXUMvEWt.mjs +0 -32
- package/dist/mesh-MmBCQ37q.mjs +0 -26
- package/dist/monetization-DQE5VtUO.mjs +0 -20
- package/dist/mtls-certificates-DwkEb-Hy.mjs +0 -13
- package/dist/network-BcfobxQY.mjs +0 -50
- package/dist/network-interconnects-BU3tN_Ab.mjs +0 -72
- package/dist/o11y-BBv7nedp.mjs +0 -93
- package/dist/oauth-BUr8bPwo.mjs +0 -9
- package/dist/oauth-clients-qWVImhHE.mjs +0 -16
- package/dist/oauth-scopes-CdeIgJIx.mjs +0 -4
- package/dist/organization-CJeOVWH7.mjs +0 -71
- package/dist/organizations-BpfoqZcG.mjs +0 -4
- package/dist/origin-ca-certificates-Bimf07RF.mjs +0 -11
- package/dist/origin-post-quantum-encryption-CM-If38w.mjs +0 -6
- package/dist/origin-tls-client-auth-BPwYPhc9.mjs +0 -30
- package/dist/output-BOe-3AQG.mjs +0 -2
- package/dist/page-rules-DOeekMrj.mjs +0 -39
- package/dist/pay-per-crawl-qJpseNNx.mjs +0 -38
- package/dist/pay-per-use-C1MWKJ4O.mjs +0 -33
- package/dist/pipelines-rCwXQw6S.mjs +0 -44
- package/dist/precursor-Bk8Pp6jT.mjs +0 -4
- package/dist/previews-BEheHO3T.mjs +0 -4
- package/dist/progress-CQqDtgmF.mjs +0 -2
- package/dist/prompt-C8FyienX.mjs +0 -3
- package/dist/queries-DJ8looyq.mjs +0 -9
- package/dist/queues-BBH9Q-Tt.mjs +0 -57
- package/dist/r2-CdJKpP2w.mjs +0 -128
- package/dist/raw-fetch-DbXN3SlE.mjs +0 -2
- package/dist/realtime-onrXppzh.mjs +0 -172
- package/dist/registrar-CbEBc5IE.mjs +0 -43
- package/dist/registrar-sandbox-BJhn1HFT.mjs +0 -56
- package/dist/reporting-bXZY6obP.mjs +0 -14
- package/dist/request-tracers-CihskC2A.mjs +0 -4
- package/dist/resolve-CaTBV-c6.mjs +0 -2
- package/dist/resolve-DCGSzUDQ.mjs +0 -2
- package/dist/resource-sharing-DDqcCHVs.mjs +0 -40
- package/dist/resource-tagging-D63RpBce.mjs +0 -4
- package/dist/rules-CAW0-Wde.mjs +0 -18
- package/dist/rulesets-CPir63Qc.mjs +0 -37
- package/dist/rum-BfwTcuup.mjs +0 -30
- package/dist/run-DEynXvCc.mjs +0 -2
- package/dist/scim-CtZ1FeQE.mjs +0 -18
- package/dist/secrets-store-BIuBYUJT.mjs +0 -24
- package/dist/security-insights-DfUus0bs.mjs +0 -40
- package/dist/security-txt-CgZOsAIZ.mjs +0 -9
- package/dist/session-BcM8Vyyx.mjs +0 -2
- package/dist/shared-CpS23WwR.mjs +0 -2
- package/dist/smart-shield-ClgB7r-9.mjs +0 -24
- package/dist/snippets-DLO3iFAg.mjs +0 -20
- package/dist/speed-DX5X2EIR.mjs +0 -24
- package/dist/sql-CF044HDW.mjs +0 -4
- package/dist/src-BMATTZU_.mjs +0 -125
- package/dist/ssl-CM-rChEC.mjs +0 -45
- package/dist/startup-profile-D662WI9s.mjs +0 -2
- package/dist/state-D7uNYnoi.mjs +0 -2
- package/dist/stream-5EmUOQvy.mjs +0 -102
- package/dist/submit-lEAaRSMR.mjs +0 -4
- package/dist/telemetry-0Y5hAtCX.mjs +0 -2
- package/dist/tenant-DnI7QziH.mjs +0 -10
- package/dist/tenant-custom-nameservers-MR0dlcGm.mjs +0 -9
- package/dist/theme-CQ_TYifs.mjs +0 -6
- package/dist/turnstile-M7sKCEz3.mjs +0 -33
- package/dist/ui-YmjF66Ct.mjs +0 -5
- package/dist/update-check-aTutXNRd.mjs +0 -2
- package/dist/url-info-Dos9VOXV.mjs +0 -4
- package/dist/url-normalization-CZbFOq_v.mjs +0 -9
- package/dist/url-scanner-B7quLPGW.mjs +0 -16
- package/dist/values-D-rrZrDa.mjs +0 -4
- package/dist/vectorize-D2tf_oA8.mjs +0 -32
- package/dist/version-BGnqDvNR.mjs +0 -2
- package/dist/web-assets-DQAfvPT9.mjs +0 -64
- package/dist/web3-MI0GQDnu.mjs +0 -28
- package/dist/workers-By6Pf8fv.mjs +0 -40
- package/dist/workers-builds-6YsWsCmC.mjs +0 -14
- package/dist/workers-for-platforms-DL8fC1qR.mjs +0 -40
- package/dist/workers-vpc-BYx6sbgd.mjs +0 -13
- package/dist/workflows-ByQLnV0E.mjs +0 -52
- package/dist/zaraz-CgbpmA85.mjs +0 -22
- package/dist/zero-trust-CpjTkkWt.mjs +0 -837
- package/dist/zone-DnKIe6po.mjs +0 -4
- package/dist/zones--5ZzsDmQ.mjs +0 -124
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./hand-written-dry-run-B82fRl2N.mjs";import{t}from"./local-
|
|
2
|
+
import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{t}from"./hand-written-dry-run-B82fRl2N.mjs";import{t as n}from"./local-Dil4fTWX.mjs";import{n as r}from"./auth-C6u9qIGO.mjs";import{n as i}from"./resolve-C3FmNlSO.mjs";import{a,t as o}from"./context-A6T-NKPI.mjs";import{t as s}from"./output-Co4xdFf6.mjs";import{t as c}from"./dry-run-C2KjGX10.mjs";import{t as l}from"./progress-D5po7ScB.mjs";import{n as u,t as d}from"./run-DASYqJsY.mjs";import"./telemetry-BhKfwxyh.mjs";import{n as f,r as p,t as m}from"./body-parser-DkHKPkJ7.mjs";import{n as h}from"./input-validation-D7z60HJH.mjs";import{a as g,i as _,n as v,t as y}from"./prompt-BAJpE3jV.mjs";import b from"node:fs";import x from"node:path";var ee={method:`POST`,path:t=>e`/accounts/${t.account_id}/d1/database`,body:`json`};function te(e){return e.usage(`$0 d1 create
|
|
3
3
|
|
|
4
|
-
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`]}).coerce(`jurisdiction`,e=>
|
|
4
|
+
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`]}).coerce(`jurisdiction`,e=>h(e,`jurisdiction`,`text`)).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`]}).coerce(`primary-location-hint`,e=>h(e,`primary-location-hint`,`text`)).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`]}).coerce(`read-replication-mode`,e=>h(e,`read-replication-mode`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).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 ne={command:`create`,describe:`Create D1 Database`,builder:te,handler:async e=>d({command:`d1 create`,classification:{safeFlags:[`jurisdiction`,`primary-location-hint`,`read-replication-mode`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();c({command:`cf d1 create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/d1/database`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({jurisdiction:e.jurisdiction,name:h(e.name,`name`,`text`),primary_location_hint:e[`primary-location-hint`],read_replication:{mode:e[`read-replication-mode`]}}):f(e.body)});return}let t=await r(e),i=e.local?n:await o();if(e.accountId=i,e.body){let n=f(e.body),r=await l(`Creating`,async()=>t.send(ee,{body:n,account_id:i}));s(r,{successLabel:`Created`});return}e.name===void 0&&(e.name=await g(`name`,`D1 database name.`));let u=m({jurisdiction:e.jurisdiction,name:h(e.name,`name`,`text`),primary_location_hint:e[`primary-location-hint`],read_replication:{mode:e[`read-replication-mode`]}}),d=await l(`Creating`,async()=>t.send(ee,{body:u,account_id:i}));s(d,{successLabel:`Created`})})};var re={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}`};function ie(e){return e.usage(`$0 d1 delete <database-id>
|
|
5
5
|
|
|
6
|
-
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
|
|
7
|
-
`);return}let u=await
|
|
6
|
+
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 ae={command:`delete <database-id>`,describe:`Delete D1 Database`,builder:ie,handler:async e=>d({command:`d1 delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await a();c({command:`cf d1 delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}`,pathParams:{"database-id":String(e[`database-id`]??``)},bodyKind:`none`});return}let t=await r(e),i=e.local?n:await o();if(e.accountId=i,!await v({force:!!e.force,message:`This permanently deletes the D1 database and all of its data.`})){process.stderr.write(`Aborted.
|
|
7
|
+
`);return}let u=await l(`Deleting`,async()=>t.send(re,{account_id:i,database_id:e[`database-id`]}));s(u,{successLabel:`Deleted`})})};var oe={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}`,body:`json`};function se(e){return e.usage(`$0 d1 edit <database-id>
|
|
8
8
|
|
|
9
|
-
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`]}).coerce(`read-replication-mode`,e=>
|
|
9
|
+
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`]}).coerce(`read-replication-mode`,e=>h(e,`read-replication-mode`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).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 ce={command:`edit <database-id>`,describe:`Update D1 Database partially`,builder:se,handler:async e=>d({command:`d1 edit`,classification:{safeFlags:[`read-replication-mode`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();c({command:`cf d1 edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}`,pathParams:{"database-id":String(e[`database-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({read_replication:{mode:e[`read-replication-mode`]}}):f(e.body)});return}let t=await r(e),i=e.local?n:await o();if(e.accountId=i,e.body){let n=f(e.body),r=await l(`Updating`,async()=>t.send(oe,{body:n,account_id:i,database_id:e[`database-id`]}));s(r,{successLabel:`Updated`});return}let u=m({read_replication:{mode:e[`read-replication-mode`]}}),d=await l(`Updating`,async()=>t.send(oe,{body:u,account_id:i,database_id:e[`database-id`]}));s(d,{successLabel:`Updated`})})};var le={method:`GET`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}`,query:[`fields`],joined:[`fields`]};function ue(e){return e.usage(`$0 d1 get <database-id>
|
|
10
10
|
|
|
11
11
|
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,
|
|
12
|
-
all fields are returned.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const
|
|
12
|
+
all fields are returned.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`get <database-id>`,describe:`Get D1 Database`,builder:ue,handler:async e=>d({command:`d1 get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={fields:e.fields};if(e.dryRun){let n=await a();c({command:`cf d1 get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}`,pathParams:{"database-id":String(e[`database-id`]??``)},query:t,bodyKind:`none`});return}let i=await r(e),u=e.local?n:await o();e.accountId=u;let d=await l(`Loading`,async()=>i.send(le,{account_id:u,database_id:e[`database-id`],...t}));s(d,{successLabel:`Loaded`})})};var fe={method:`GET`,path:t=>e`/accounts/${t.account_id}/d1/database`,query:[`name`,`page`,`per_page`]};function pe(e){return e.usage(`$0 d1 list
|
|
13
13
|
|
|
14
|
-
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
|
|
14
|
+
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 me={command:`list`,describe:`List D1 Databases`,builder:pe,handler:async e=>d({command:`d1 list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={name:e.name,page:e.page,per_page:e[`per-page`]};if(e.dryRun){let e=await a();c({command:`cf d1 list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/d1/database`,pathParams:{},query:t,bodyKind:`none`});return}let i=await r(e),u=e.local?n:await o();e.accountId=u;let d=await l(`Loading`,async()=>i.send(fe,{account_id:u,...t}));s(d,{successLabel:`Loaded`})})};var S={method:`POST`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}/query`,body:`json`};function he(e){return e.usage(`$0 d1 query <database-id>
|
|
15
15
|
|
|
16
|
-
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
|
|
16
|
+
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 ge={command:`query <database-id>`,describe:`Query D1 Database`,builder:he,handler:async e=>d({command:`d1 query`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();c({command:`cf d1 query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}/query`,pathParams:{"database-id":String(e[`database-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({params:e.params,sql:h(e.sql,`sql`,`text`),batch:p(e.batch,`batch`)}):f(e.body)});return}let t=await r(e),i=e.local?n:await o();if(e.accountId=i,e.body){let n=f(e.body),r=await l(`Loading`,async()=>t.send(S,{body:n,account_id:i,database_id:e[`database-id`]}));s(r,{successLabel:`Loaded`});return}let u=m({params:e.params,sql:h(e.sql,`sql`,`text`),batch:p(e.batch,`batch`)}),d=await l(`Loading`,async()=>t.send(S,{body:u,account_id:i,database_id:e[`database-id`]}));s(d,{successLabel:`Loaded`})})};var C={method:`POST`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}/raw`,body:`json`};function _e(e){return e.usage(`$0 d1 raw <database-id>
|
|
17
17
|
|
|
18
|
-
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
|
|
18
|
+
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 ve={command:`raw <database-id>`,describe:`Raw D1 Database query`,builder:_e,handler:async e=>d({command:`d1 raw`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();c({command:`cf d1 raw`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}/raw`,pathParams:{"database-id":String(e[`database-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({params:e.params,sql:h(e.sql,`sql`,`text`),batch:p(e.batch,`batch`)}):f(e.body)});return}let t=await r(e),i=e.local?n:await o();if(e.accountId=i,e.body){let n=f(e.body),r=await l(`Loading`,async()=>t.send(C,{body:n,account_id:i,database_id:e[`database-id`]}));s(r,{successLabel:`Loaded`});return}let u=m({params:e.params,sql:h(e.sql,`sql`,`text`),batch:p(e.batch,`batch`)}),d=await l(`Loading`,async()=>t.send(C,{body:u,account_id:i,database_id:e[`database-id`]}));s(d,{successLabel:`Loaded`})})};var ye={method:`GET`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}/time_travel/bookmark`,query:[`timestamp`]};function be(e){return e.usage(`$0 d1 time-travel get-bookmark <database-id>
|
|
19
19
|
|
|
20
|
-
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
|
|
20
|
+
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 xe={command:`get-bookmark <database-id>`,describe:`Get D1 database bookmark`,builder:be,handler:async e=>d({command:`d1 time-travel get-bookmark`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={timestamp:e.timestamp};if(e.dryRun){let n=await a();c({command:`cf d1 time-travel get-bookmark`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}/time_travel/bookmark`,pathParams:{"database-id":String(e[`database-id`]??``)},query:t,bodyKind:`none`});return}let i=await r(e),u=e.local?n:await o();e.accountId=u;let d=await l(`Loading`,async()=>i.send(ye,{account_id:u,database_id:e[`database-id`],...t}));s(d,{successLabel:`Loaded`})})};var Se={method:`POST`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}/time_travel/restore`,query:[`bookmark`,`timestamp`]};function Ce(e){return e.usage(`$0 d1 time-travel restore <database-id>
|
|
21
21
|
|
|
22
|
-
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
|
|
23
|
-
`);return}let d=await
|
|
24
|
-
`);return}if(e.body){let
|
|
22
|
+
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 we={command:`restore <database-id>`,describe:`Restore D1 Database to a bookmark or point in time`,builder:Ce,handler:async e=>d({command:`d1 time-travel restore`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{let t={bookmark:e.bookmark,timestamp:e.timestamp};if(e.dryRun){let n=await a();c({command:`cf d1 time-travel restore`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}/time_travel/restore`,pathParams:{"database-id":String(e[`database-id`]??``)},query:t,bodyKind:`none`});return}let i=await r(e),u=e.local?n:await o();if(e.accountId=u,!await v({force:!!e.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.
|
|
23
|
+
`);return}let d=await l(`Deleting`,async()=>i.send(Se,{account_id:u,database_id:e[`database-id`],...t}));s(d,{successLabel:`Deleted`})})},Te={command:`time-travel`,describe:`use specific point-in-time backups of your D1 database`,builder:e=>e.command(xe).command(we).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Ee={method:`POST`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}/undelete`,body:`json`};function De(e){return e.usage("$0 d1 undelete <database-id>\n\nRestore a deleted D1 database. The database is restored with the name it had when it was deleted, unless `new_name` is provided. The restored database counts against the account's limits. Undeleting a database that is not deleted succeeds without changes, unless `new_name` differs from its current name which errors. Once a database is undeleted, Time Travel (point-in-time recovery) cannot restore it to a bookmark or timestamp at or before the undeletion. Only states after the undeletion can be restored.").positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`new-name`,{type:`string`,description:`Restore the database with this name instead of the name it had when it was deleted. Required if another database in the account already uses that name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Oe={command:`undelete <database-id>`,describe:`Undelete D1 Database`,builder:De,handler:async e=>d({command:`d1 undelete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await a();c({command:`cf d1 undelete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}/undelete`,pathParams:{"database-id":String(e[`database-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({new_name:h(e[`new-name`],`new-name`,`text`)}):f(e.body)});return}let t=await r(e),i=e.local?n:await o();if(e.accountId=i,!await v({force:!!e.force,message:`After undeleting, Time Travel cannot restore the D1 database to a point in time at or before the undeletion.`})){process.stderr.write(`Aborted.
|
|
24
|
+
`);return}if(e.body){let n=f(e.body),r=await l(`Deleting`,async()=>t.send(Ee,{body:n,account_id:i,database_id:e[`database-id`]}));s(r,{successLabel:`Deleted`});return}let u=m({new_name:h(e[`new-name`],`new-name`,`text`)}),d=await l(`Deleting`,async()=>t.send(Ee,{body:u,account_id:i,database_id:e[`database-id`]}));s(d,{successLabel:`Deleted`})})};var ke={method:`PUT`,path:t=>e`/accounts/${t.account_id}/d1/database/${t.database_id}`,body:`json`};function Ae(e){return e.usage(`$0 d1 update <database-id>
|
|
25
25
|
|
|
26
|
-
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`]}).coerce(`read-replication-mode`,e=>
|
|
26
|
+
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`]}).coerce(`read-replication-mode`,e=>h(e,`read-replication-mode`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const je={command:`update <database-id>`,describe:`Update D1 Database`,builder:Ae,handler:async e=>d({command:`d1 update`,classification:{safeFlags:[`read-replication-mode`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();c({command:`cf d1 update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}`,pathParams:{"database-id":String(e[`database-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({read_replication:{mode:e[`read-replication-mode`]}}):f(e.body)});return}let t=await r(e),i=e.local?n:await o();if(e.accountId=i,e.body){let n=f(e.body),r=await l(`Updating`,async()=>t.send(ke,{body:n,account_id:i,database_id:e[`database-id`]}));s(r,{successLabel:`Updated`});return}e[`read-replication-mode`]===void 0&&(e[`read-replication-mode`]=await _(`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 u=m({read_replication:{mode:e[`read-replication-mode`]}}),d=await l(`Updating`,async()=>t.send(ke,{body:u,account_id:i,database_id:e[`database-id`]}));s(d,{successLabel:`Updated`})})},Me=(e,t,n)=>{let r=e instanceof RegExp?Ne(e,n):e,i=t instanceof RegExp?Ne(t,n):t,a=r!==null&&i!=null&&Pe(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)}},Ne=(e,t)=>{let n=t.match(e);return n?n[0]:null},Pe=(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},Fe=`\0SLASH`+Math.random()+`\0`,w=`\0OPEN`+Math.random()+`\0`,T=`\0CLOSE`+Math.random()+`\0`,Ie=`\0COMMA`+Math.random()+`\0`,E=`\0PERIOD`+Math.random()+`\0`,Le=new RegExp(Fe,`g`),Re=new RegExp(w,`g`),ze=new RegExp(T,`g`),Be=new RegExp(Ie,`g`),Ve=new RegExp(E,`g`),He=/\\\\/g,Ue=/\\{/g,We=/\\}/g,Ge=/\\,/g,Ke=/\\\./g;function D(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function qe(e){return e.replace(He,Fe).replace(Ue,w).replace(We,T).replace(Ge,Ie).replace(Ke,E)}function Je(e){return e.replace(Le,`\\`).replace(Re,`{`).replace(ze,`}`).replace(Be,`,`).replace(Ve,`.`)}function O(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function Ye(e){let t=[],n=``;for(;;){let r=Me(`{`,`}`,e);if(!r){let r=e.split(`,`);return r[0]=n+r[0],O(t,r),t}let{pre:i,body:a,post:o}=r,s=i.split(`,`);if(s[0]=n+s[0],s[s.length-1]+=`{`+a+`}`,!o.length)return O(t,s),t;n=s.pop(),O(t,s),e=o}}function Xe(e,t={}){if(!e)return[];let{max:n=1e5,maxLength:r=4e6,maxDepth:i=1e3,maxRewrites:a=1e3}=t;return e.slice(0,2)===`{}`&&(e=`\\{\\}`+e.slice(2)),A(qe(e),n,r,i,0,a,!0).map(Je)}function Ze(e){return`{`+e+`}`}function Qe(e){return/^-?0\d/.test(e)}function $e(e,t){return e<=t}function et(e,t){return e>=t}function k(e,t,n,r,i,a){let o=[],s=0;for(let c=0;c<e.length;c++)for(let l=0;l<n.length;l++){if(o.length>=r)return o;let u=e[c]+t+n[l];if(!a||u){if(s+u.length>i)return o;o.push(u),s+=u.length}}return o}function tt(e,t,n,r){let i=e.split(/\.\./),a=[];
|
|
27
27
|
/* c8 ignore start */
|
|
28
28
|
if(i[0]===void 0||i[1]===void 0)return a;
|
|
29
29
|
/* c8 ignore stop */
|
|
30
|
-
let o=D(i[0]),s=D(i[1]),c=Math.max(i[0].length,i[1].length),l=i.length===3&&i[2]!==void 0?Math.max(Math.abs(D(i[2])),1):1,u
|
|
30
|
+
let o=D(i[0]),s=D(i[1]),c=Math.max(i[0].length,i[1].length),l=i.length===3&&i[2]!==void 0?Math.max(Math.abs(D(i[2])),1):1,u=$e;s<o&&(l*=-1,u=et);let d=i.some(Qe),f=0;for(let e=o;u(e,s)&&a.length<n;e+=l){let n;if(t)n=String.fromCharCode(e),n===`\\`&&(n=``);else if(n=String(e),d){let t=c-n.length;if(t>0){let r=Array(t+1).join(`0`);n=e<0?`-`+r+n.slice(1):r+n}}if(f+n.length>r)break;a.push(n),f+=n.length}return a}function A(e,t,n,r,i,a,o){if(i>r)return[e];let s=[``],c=0,l=!1,u=!0;for(;;){let d=Me(`{`,`}`,e);if(!d)return k(s,e,[``],t,n,l);let f=d.pre;if(/\$$/.test(f)){if(s=k(s,f+`{`+d.body+`}`,[``],t,n,l&&!d.post.length),u=!1,!d.post.length)break;e=d.post;continue}let p=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(d.body),m=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(d.body),h=p||m,g=d.body.indexOf(`,`)>=0;if(!h&&!g){if(c<a&&d.post.match(/,(?!,).*\}/)){c++,e=d.pre+`{`+d.body+T+d.post,o=!0;continue}return k(s,f+`{`+d.body+`}`+d.post,[``],t,n,l)}u&&=(l=o&&!h,!1);let _;if(h)_=tt(d.body,m,t,n);else{let o=Ye(d.body);if(o.length===1&&o[0]!==void 0&&(o=A(o[0],t,n,r,i+1,a,!1).map(Ze),o.length===1)){if(s=k(s,f+o[0],[``],t,n,l&&!d.post.length),!d.post.length)break;e=d.post;continue}let c=l&&!d.post.length&&!f;for(let e=0;c&&e<s.length;e++)s[e]&&(c=!1);_=[];let u=0;outer:for(let e=0;e<o.length;e++){let s=A(o[e],t,n,r,i+1,a,!1);for(let e=0;e<s.length;e++){let r=s[e];if(!c||r){if(_.length>=t||u+r.length>n)break outer;_.push(r),u+=r.length}}}}if(s=k(s,f,_,t,n,l&&!d.post.length),!d.post.length)break;e=d.post}return s}const j=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>65536)throw TypeError(`pattern is too long`)},nt={"[: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]},M=e=>e.replace(/[[\]\\-]/g,`\\$&`),rt=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),N=e=>e.join(``),it=(e,t)=>{let n=t;
|
|
31
31
|
/* c8 ignore start */
|
|
32
32
|
if(e.charAt(n)!==`[`)throw Error(`not in a brace expression`);
|
|
33
33
|
/* c8 ignore stop */
|
|
34
|
-
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(
|
|
34
|
+
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(nt))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(M(d)+`-`+M(t)):t===d&&r.push(M(t)),d=``,a++;continue}if(e.startsWith(`-]`,a+1)){r.push(M(t+`-`)),a+=2;continue}if(e.startsWith(`-`,a+1)){d=t,a+=2;continue}r.push(M(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){let e=r[0].length===2?r[0].slice(-1):r[0];return[rt(e),!1,u-n,!1]}let f=`[`+(l?`^`:``)+N(r)+`]`,p=`[`+(l?``:`^`)+N(i)+`]`;return[r.length&&i.length?`(`+f+`|`+p+`)`:r.length?f:p,s,u-n,!0]},P=(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 F;const at=/* @__PURE__ */ new Set([`!`,`?`,`+`,`*`,`@`]),I=e=>at.has(e),L=e=>I(e.type),ot=/* @__PURE__ */ new Map([[`!`,[`@`]],[`?`,[`?`,`@`]],[`@`,[`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`]]]),st=/* @__PURE__ */ new Map([[`!`,[`?`]],[`@`,[`?`]],[`+`,[`?`,`*`]]]),ct=/* @__PURE__ */ new Map([[`!`,[`?`,`@`]],[`?`,[`?`,`@`]],[`@`,[`?`,`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`,`?`,`*`]]]),R=/* @__PURE__ */ new Map([[`!`,/* @__PURE__ */ new Map([[`!`,`@`]])],[`?`,/* @__PURE__ */ new Map([[`*`,`*`],[`+`,`*`]])],[`@`,/* @__PURE__ */ new Map([[`!`,`!`],[`?`,`?`],[`@`,`@`],[`*`,`*`],[`+`,`+`]])],[`+`,/* @__PURE__ */ new Map([[`?`,`*`],[`*`,`*`]])]]),z=`(?!\\.)`,lt=/* @__PURE__ */ new Set([`[`,`.`]),ut=/* @__PURE__ */ new Set([`..`,`.`]),dt=/* @__PURE__ */ new Set(`().*{}+?[]^$\\!`),ft=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),B=`[^/]+?`;let pt=0;var V=class{type;#e;#t;#n=!1;#r=[];#i;#a;#o;#s=!1;#c;#l;#u=!1;id=++pt;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(){
|
|
35
35
|
/* c8 ignore start */
|
|
36
36
|
if(this.#t!==void 0)return this.#t;
|
|
37
37
|
/* c8 ignore stop */
|
|
@@ -51,7 +51,7 @@ let e=this.#i?this.#i.#r.length:0;
|
|
|
51
51
|
/* c8 ignore stop */
|
|
52
52
|
return this.#a===e-1}copyIn(e){typeof e==`string`?this.push(e):this.push(e.clone(this))}clone(e){let t=new F(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}if(n===`[`){s=!0,c=u,l=!1,d+=n;continue}if(!r.noext&&I(n)&&e.charAt(u)===`(`&&i<=a){t.push(d),d=``;let a=new F(n,t);u=F.#f(e,a,u,r,i+1),t.push(a);continue}d+=n}return t.push(d),u}let u=n+1,d=new F(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}if(n===`[`){s=!0,c=u,l=!1,p+=n;continue}
|
|
53
53
|
/* c8 ignore stop */
|
|
54
|
-
if(!r.noext&&I(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 F(n,d);d.push(o),u=F.#f(e,o,u,r,i+a);continue}if(n===`|`){d.push(p),p=``,f.push(d),d=new F(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,
|
|
54
|
+
if(!r.noext&&I(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 F(n,d);d.push(o),u=F.#f(e,o,u,r,i+a);continue}if(n===`|`){d.push(p),p=``,f.push(d),d=new F(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,st)}#m(e,t=ot){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=ct){return!!t.get(this.type)?.includes(e)}#g(e,t){let n=e.#r[0],r=new F(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!!R.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=R.get(this.type),n=e.#r[0],r=t?.get(n.type);
|
|
55
55
|
/* c8 ignore start - impossible */
|
|
56
56
|
if(!r)return!1;
|
|
57
57
|
/* c8 ignore stop */
|
|
@@ -59,36 +59,36 @@ this.#r=n.#r;for(let e of this.#r)typeof e==`object`&&(e.#i=this);this.type=r,th
|
|
|
59
59
|
/* c8 ignore start */
|
|
60
60
|
if(this!==this.#e)return this.#e.toMMPattern();
|
|
61
61
|
/* c8 ignore stop */
|
|
62
|
-
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()),!L(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`?F.#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
|
|
62
|
+
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()),!L(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`?F.#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&&ut.has(this.#r[0]))){let n=lt,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?z:``}let a=``;return this.isEnd()&&this.#e.#s&&this.#i?.type===`!`&&(a=`(?:$|\\/)`),[i+r+a,P(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,P(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?z:``)+B;else{let n=this.type===`!`?`))`+(this.isStart()&&!t&&!e?z:``)+`[^/]*?)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&a?`)`:this.type===`*`&&a?`)?`:`)${this.type}`;o=r+i+n}return[o,P(i),this.#t=!!this.#t,this.#n]}#x(){if(L(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=>{
|
|
63
63
|
/* c8 ignore start */
|
|
64
64
|
if(typeof t==`string`)throw Error(`string type in extglob ast??`);
|
|
65
65
|
/* c8 ignore stop */
|
|
66
|
-
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+=(
|
|
66
|
+
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+=(dt.has(c)?`\\`:``)+c;continue}if(c===`*`){if(o)continue;o=!0,i+=n&&/^[*]+$/.test(e)?B:`[^/]*?`,t=!0;continue}if(o=!1,c===`\\`){s===e.length-1?i+=`\\\\`:r=!0;continue}if(c===`[`){let[n,r,o,c]=it(e,s);if(o){i+=n,a||=r,s+=o-1,t||=c;continue}}if(c===`?`){i+=`[^/]`,t=!0;continue}i+=ft(c)}return[i,P(e),!!t,a]}};F=V;const mt=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,`[$&]`):e.replace(/[?*()[\]\\{}]/g,`\\$&`):t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`),H=(e,t,n={})=>(j(t),!n.nocomment&&t.charAt(0)===`#`?!1:new Y(t,n).match(e)),ht=/^\*+([^+@!?*[(]*)$/,gt=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),_t=e=>t=>t.endsWith(e),vt=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),yt=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),bt=/^\*+\.\*+$/,xt=e=>!e.startsWith(`.`)&&e.includes(`.`),St=e=>e!==`.`&&e!==`..`&&e.includes(`.`),Ct=/^\.\*+$/,wt=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),Tt=/^\*+$/,Et=e=>e.length!==0&&!e.startsWith(`.`),Dt=e=>e.length!==0&&e!==`.`&&e!==`..`,Ot=/^\?+([^+@!?*[(]*)?$/,kt=([e,t=``])=>{let n=U([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},At=([e,t=``])=>{let n=W([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},jt=([e,t=``])=>{let n=W([e]);return t?e=>n(e)&&e.endsWith(t):n},Mt=([e,t=``])=>{let n=U([e]);return t?e=>n(e)&&e.endsWith(t):n},U=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},W=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},G=typeof process==`object`&&process?typeof process.env==`object`&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,K={win32:{sep:`\\`},posix:{sep:`/`}};H.sep=G===`win32`?K.win32.sep:K.posix.sep;const q=Symbol(`globstar **`);H.GLOBSTAR=q,H.filter=(e,t={})=>n=>H(n,e,t);const J=(e,t={})=>Object.assign({},e,t);H.defaults=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return H;let t=H;return Object.assign((n,r,i={})=>t(n,r,J(e,i)),{Minimatch:class extends t.Minimatch{constructor(t,n={}){super(t,J(e,n))}static defaults(n){return t.defaults(J(e,n)).Minimatch}},AST:class extends t.AST{
|
|
67
67
|
/* c8 ignore start */
|
|
68
|
-
constructor(t,n,r={}){super(t,n,
|
|
68
|
+
constructor(t,n,r={}){super(t,n,J(e,r))}
|
|
69
69
|
/* c8 ignore stop */
|
|
70
|
-
static fromGlob(n,r={}){return t.AST.fromGlob(n,
|
|
70
|
+
static fromGlob(n,r={}){return t.AST.fromGlob(n,J(e,r))}},unescape:(n,r={})=>t.unescape(n,J(e,r)),escape:(n,r={})=>t.escape(n,J(e,r)),filter:(n,r={})=>t.filter(n,J(e,r)),defaults:n=>t.defaults(J(e,n)),makeRe:(n,r={})=>t.makeRe(n,J(e,r)),braceExpand:(n,r={})=>t.braceExpand(n,J(e,r)),match:(n,r,i={})=>t.match(n,r,J(e,i)),sep:t.sep,GLOBSTAR:q})};const Nt=(e,t={})=>(j(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Xe(e,{max:t.braceExpandMax}));H.braceExpand=Nt,H.makeRe=(e,t={})=>new Y(e,t).makeRe(),H.match=(e,t,n={})=>{let r=new Y(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e};const Pt=/[?*]|[+@!]\(.*?\)|\[|\]/,Ft=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`);var Y=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){j(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||G,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]===`?`||!Pt.test(e[2]))&&!Pt.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(q)?this.#e(e,t,n,r,i):this.#n(e,t,n,r,i)}#e(e,t,n,r,i){let a=t.indexOf(q,i),o=t.lastIndexOf(q),[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===q?(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];
|
|
71
71
|
/* c8 ignore start */
|
|
72
|
-
if(this.debug(t,n,r),n===!1||n===
|
|
72
|
+
if(this.debug(t,n,r),n===!1||n===q)return!1;
|
|
73
73
|
/* c8 ignore stop */
|
|
74
74
|
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?`)
|
|
75
75
|
/* c8 ignore stop */
|
|
76
|
-
}braceExpand(){return
|
|
76
|
+
}braceExpand(){return Nt(this.pattern,this.options)}parse(e){j(e);let t=this.options;if(e===`**`)return q;if(e===``)return``;let n,r=null;(n=e.match(Tt))?r=t.dot?Dt:Et:(n=e.match(ht))?r=(t.nocase?t.dot?yt:vt:t.dot?_t:gt)(n[1]):(n=e.match(Ot))?r=(t.nocase?t.dot?At:kt:t.dot?jt:Mt)(n):(n=e.match(bt))?r=t.dot?St:xt:(n=e.match(Ct))&&(r=wt);let i=V.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`?Ft(e):e===q?q:e._src});t.forEach((e,r)=>{let i=t[r+1],a=t[r-1];e===q&&a!==q&&(a===void 0?i!==void 0&&i!==q?t[r+1]=`(?:\\/|`+n+`\\/)?`+i:t[r]=n:i===void 0?t[r-1]=a+`(?:\\/|\\/`+n+`)?`:i!==q&&(t[r-1]=a+`(?:\\/|\\/`+n+`\\/)`+i,t[r+1]=q))});let i=t.filter(e=>e!==q);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}
|
|
77
77
|
/* c8 ignore stop */
|
|
78
|
-
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&&this.negate}static defaults(e){return H.defaults(e).Minimatch}};H.AST=V,H.Minimatch=
|
|
78
|
+
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&&this.negate}static defaults(e){return H.defaults(e).Minimatch}};H.AST=V,H.Minimatch=Y,H.escape=mt,H.unescape=P;function X(e){let t=e.replace(/\\/g,`/`),n=x.posix.normalize(t);return n.endsWith(`/`)?n.slice(0,-1):n}function It(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 Z(e){return`"${e.replace(/"/g,`""`)}"`}function Lt(e){return`CREATE TABLE IF NOT EXISTS ${Z(e)}(
|
|
79
79
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
80
80
|
name TEXT UNIQUE,
|
|
81
81
|
applied_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL
|
|
82
|
-
);`}function
|
|
83
|
-
FROM ${
|
|
84
|
-
ORDER BY id`}function
|
|
82
|
+
);`}function Rt(e){return`SELECT *
|
|
83
|
+
FROM ${Z(e)}
|
|
84
|
+
ORDER BY id`}function zt(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=X(e.dir??`./migrations`),n=X(`${t}/*.sql`),r;if(e.pattern===void 0)r=n;else{r=X(e.pattern);try{It(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:x.resolve(e.cwd??process.cwd(),t),migrationsDir:t,migrationsPattern:r,migrationsTableName:e.table??`d1_migrations`}}function Bt(e,t){let n=[],r=[{abs:e,rel:``}];for(;r.length>0;){let{abs:e,rel:i}=r.pop(),a;try{a=b.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:x.join(e,o.name),rel:a}):o.isFile()&&t.match(a)&&n.push(a)}}return n.sort(Ht)}function Q(e){let t=e.split(`/`)[0]??``;return parseInt(t.split(`_`)[0]??``,10)}function Vt(e,t){let n=Q(e),r=Q(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 Ht(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=Vt(n[e]??``,r[e]??``);if(t!==0)return t}return n.length-r.length}function Ut(e){let t=It(e.migrationsPattern,e.migrationsDir);return Bt(e.migrationsPath,new Y(t,{dot:!1}))}function Wt(e,t){let n=[];for(let r of e)t.includes(r)||n.push(r);return n}function Gt(e){let t=Ut(e).map(e=>Q(e)).filter(e=>Number.isFinite(e));return Math.max(...t,0)+1}function Kt(e){if(Bt(e.migrationsPath,new Y(`*/migration.sql`,{dot:!1})).length!==0)return X(`${e.migrationsDir}/*/migration.sql`)}function qt(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===`
|
|
85
85
|
`?(t+=`
|
|
86
86
|
`,a++,r=!1):(t+=o,r=o!==`
|
|
87
87
|
`);continue}if(i){o===`\r`&&s===`
|
|
88
88
|
`?(t+=`
|
|
89
89
|
`,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===`
|
|
90
90
|
`){t+=`
|
|
91
|
-
`,a++;continue}t+=o}return t}function
|
|
92
|
-
INSERT INTO ${
|
|
93
|
-
values ('${t.replace(/'/g,`''`)}');`}function
|
|
94
|
-
`))}
|
|
91
|
+
`,a++;continue}t+=o}return t}function Jt({migrationsPath:e,migrationName:t,migrationsTableName:n}){return`${b.readFileSync(x.join(e,t),`utf8`)}
|
|
92
|
+
INSERT INTO ${Z(n)} (name)
|
|
93
|
+
values ('${t.replace(/'/g,`''`)}');`}function Yt(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 Xt(e){return Yt(e).option(`table`,{type:`string`,description:`Table recording applied migrations`,default:`d1_migrations`})}async function $(e,t,n,r,i,a=!1){return l(i,async()=>{let i={account_id:t,database_id:n,body:{sql:qt(r)}};return a?((await e.send(C,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.send(S,i))?.result??[]})}async function Zt(e){if(!i(e.database))throw Error(`Expected a D1 database ID, but received <database>=${JSON.stringify(e.database)}. Database names and binding names are not accepted.`);let t=zt({dir:e.dir,pattern:e.pattern,table:e.table});if(!b.existsSync(t.migrationsPath))throw Error(`No migrations directory at ${t.migrationsPath}.`+(e.dir===void 0?` Pass --dir to point at one.`:``));return{client:await r(e),accountId:e.local?n:await o(),databaseId:e.database,config:t,local:e.local===!0}}async function Qt(e){let{client:t,accountId:n,databaseId:r,config:i}=e;await $(t,n,r,Lt(i.migrationsTableName),`Preparing`,e.local);let a=(await $(t,n,r,Rt(i.migrationsTableName),`Loading`,e.local))[0].results.map(e=>e.name),o=Ut(i);if(o.length===0){let e=Kt(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:Wt(o,a)}}function $t(e){return Xt(e.positional(`database`,{type:`string`,description:`D1 database ID`,demandOption:!0}))}const en={command:`apply <database>`,describe:`Apply any unapplied D1 migrations`,builder:$t,handler:async e=>{let t=await Zt(e),n=(await Qt(t)).unapplied.map(e=>({name:e,status:`🕒️`}));if(n.length===0){s([],{successLabel:`No migrations to apply`,quiet:e.quiet});return}if(await y(`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=Jt({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(`
|
|
94
|
+
`))}s(n,{quiet:e.quiet})}}};function tn(e){return Yt(e.positional(`message`,{type:`string`,description:`Describes what the migration does`,demandOption:!0}))}const nn={command:`create <message>`,describe:`Create a new empty D1 migration file`,builder:tn,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=zt({dir:e.dir,pattern:e.pattern}),n=rn(Gt(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`,a=X(`${t.migrationsDir}/${i}`);if(!new Y(t.migrationsPattern,{dot:!1}).match(a))throw Error(`Would create "${a}", 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(!b.existsSync(t.migrationsPath)){if(!await y(`No migrations folder found.\nOk to create ${t.migrationsPath}?`))throw Error(`No migrations folder present at ${t.migrationsPath}.`);b.mkdirSync(t.migrationsPath,{recursive:!0})}let o=x.join(t.migrationsPath,i);b.writeFileSync(o,`-- Migration number: ${n} \t ${(/* @__PURE__ */ new Date()).toISOString()}\n`),s({name:i,path:o},{successLabel:`Created ${i}`,quiet:e.quiet})}};function rn(e,t){let n=e.toString();for(;n.length<t;)n=`0`+n;return n}function an(e){return Xt(e.positional(`database`,{type:`string`,description:`D1 database ID`,demandOption:!0}))}const on={command:`list <database>`,describe:`View a list of unapplied migration files`,builder:an,handler:async e=>{let{unapplied:t}=await Qt(await Zt(e));s(t.map(e=>({Name:e})),{quiet:e.quiet})}},sn={command:`migrations`,describe:`Create, list, and apply D1 database migrations`,builder:e=>e.command(u(en,{command:`d1 migrations apply`,classification:{safeFlags:[]}})).command(u(nn,{command:`d1 migrations create`,classification:{safeFlags:[]}})).command(u(on,{command:`d1 migrations list`,classification:{safeFlags:[]}})).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},cn={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(ne).command(ae).command(ce).command(de).command(me).command(ge).command(ve).command(Oe).command(je).command(t(sn,`preview`)).command(Te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{cn as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-C6u9qIGO.mjs";import{i as n}from"./context-A6T-NKPI.mjs";import{t as r}from"./output-Co4xdFf6.mjs";import{t as i}from"./dry-run-C2KjGX10.mjs";import{t as a}from"./progress-D5po7ScB.mjs";import{t as o}from"./run-DASYqJsY.mjs";import"./telemetry-BhKfwxyh.mjs";var s={method:`GET`,path:t=>e`/zones/${t.zone_id}/dcv_delegation/uuid`};function c(e){return e.usage(`$0 dcv-delegation get
|
|
3
|
+
|
|
4
|
+
Retrieve the account and zone specific unique identifier used as part of the CNAME target for DCV Delegation.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const l={command:`get`,describe:`Retrieve the DCV Delegation unique identifier.`,builder:c,handler:async e=>o({command:`dcv-delegation get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf dcv-delegation get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dcv_delegation/uuid`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(e),c=await n({zone:e.zone},o,{quiet:e.quiet});e.zoneId=c;let l=await a(`Loading`,async()=>o.send(s,{zone_id:c}));r(l,{successLabel:`Loaded`})})},u={command:`dcv-delegation`,describe:`dcv-delegation`,builder:e=>e.command(l).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{u as default};
|
package/dist/delegate.mjs
CHANGED
|
File without changes
|