cf 1.0.0-beta.11 → 1.0.0-beta.13
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/bin/cf +1 -1
- package/dist/_meta/commands.json +3119 -2067
- package/dist/_meta/hand-written-commands.json +14 -1
- package/dist/_meta/schemas.json +1856 -1132
- package/dist/abuse-reports-BjU1s8cf.mjs +24 -0
- package/dist/{access-DuHs0Mii.mjs → access-C_G2MZnA.mjs} +1 -1
- package/dist/account-tags-CaXDDeZ4.mjs +15 -0
- package/dist/accounts-BALwxDQY.mjs +131 -0
- package/dist/{acm-BgSr3Ig4.mjs → acm-CP9EaXQN.mjs} +7 -7
- package/dist/addressing-DRlaxqrI.mjs +93 -0
- package/dist/agent-context-DFEgYjEQ.mjs +2 -0
- package/dist/agent-memory-vGhlfZBx.mjs +34 -0
- package/dist/ai-CJtbWfB9.mjs +31 -0
- package/dist/{ai-audit-Bn_BfMFS.mjs → ai-audit-C0BJNqZZ.mjs} +3 -3
- package/dist/ai-gateway-BQtv3U3x.mjs +80 -0
- package/dist/ai-search-DGU1Y5By.mjs +79 -0
- package/dist/ai-security-CFTaYk_X.mjs +10 -0
- package/dist/alerting-1hun27JC.mjs +56 -0
- package/dist/analytics-DXUSjvzT.mjs +17 -0
- package/dist/analytics_engine-CQsnL09C.mjs +4 -0
- package/dist/ansi-styles-kSC6bEIq.mjs +2 -0
- package/dist/{api-security-gB1FHrHq.mjs → api-security-BXhrfR6-.mjs} +57 -57
- package/dist/argo-LPUCTnee.mjs +14 -0
- package/dist/artifacts-Dt6easua.mjs +43 -0
- package/dist/{audit-logs-CpPUjMUP.mjs → audit-logs-CVznAM2Z.mjs} +2 -2
- package/dist/auth-CGLsxbc6.mjs +2 -0
- package/dist/auth-CrmVwfpJ.mjs +2 -0
- package/dist/{auth-7Fk7PVIC.mjs → auth-eQr-kQCH.mjs} +1 -1
- package/dist/{auth-token-DeG33BMQ.mjs → auth-token-pNQrX_9O.mjs} +1 -1
- package/dist/autoconfig-sD7Frryg.mjs +532 -0
- package/dist/{banner-Xk4xBN8U.mjs → banner-D03JEqRs.mjs} +1 -1
- package/dist/basin-catalog-ZQICw-zF.mjs +46 -0
- package/dist/billing-Dy1-dV_B.mjs +23 -0
- package/dist/bot-management-DTgPwL7O.mjs +9 -0
- package/dist/botnet-feed-xb98Cj3Y.mjs +11 -0
- package/dist/brand-protection-Ck3okE2k.mjs +27 -0
- package/dist/browser-run-DJGJSzFX.mjs +42 -0
- package/dist/build-B1L6xrgC.mjs +2 -0
- package/dist/build-HmSXqjGn.mjs +2 -0
- package/dist/builds-CYxcZtkG.mjs +71 -0
- package/dist/cache-D9tSfovH.mjs +45 -0
- package/dist/{certificate-authorities-NUQzCDK8.mjs → certificate-authorities-CpiveTFC.mjs} +3 -3
- package/dist/cf-BxsXrVeh.mjs +18 -0
- package/dist/chunk-DSGVRFIS-C1_SEtRK.mjs +2 -0
- package/dist/chunk-NDZDTP46-Bjx_wtJe.mjs +361 -0
- package/dist/chunk-TAK63GWY-DdMktrgc.mjs +319 -0
- package/dist/chunk-U6NEESU5-DqqRCaWH.mjs +2 -0
- package/dist/chunk-WMOON6TZ-C0dmPHpM.mjs +2 -0
- package/dist/{cli-aChy8ou_.mjs → cli-DeJc9U8z.mjs} +1 -1
- package/dist/cli-exit-CstFZ1eJ.mjs +2 -0
- package/dist/{client-certificates-qgLpBn8t.mjs → client-certificates-CF6YZyvP.mjs} +6 -6
- package/dist/{client-side-security-DZO6Xw14.mjs → client-side-security-BLoe9kS5.mjs} +14 -14
- package/dist/{cloud-connector-C7vGDCzX.mjs → cloud-connector-DXRUHsjt.mjs} +3 -3
- package/dist/cloudflared--1Ws1RJy.mjs +2 -0
- package/dist/cloudforce-one-CBLxXi6v.mjs +447 -0
- package/dist/{command-07vhr56i.mjs → command-83uVfXh9.mjs} +1 -1
- package/dist/{command-Cdx___59.mjs → command-BDe67N_n.mjs} +1 -1
- package/dist/command-BlIb6RR2.mjs +2 -0
- package/dist/{command-dAYWrB5y.mjs → command-Bpzp8Mz2.mjs} +1 -1
- package/dist/{command-eM48o0J6.mjs → command-BvfKhMl7.mjs} +1 -1
- package/dist/command-CG6RvZs0.mjs +2 -0
- package/dist/{command-D0MKPucK.mjs → command-CcuLC6CJ.mjs} +1 -1
- package/dist/{command-Ds5OVat3.mjs → command-Cu7dcaHT.mjs} +1 -1
- package/dist/{command-BsmF3J_l.mjs → command-D3fyhdy-.mjs} +1 -1
- package/dist/{command-Dv6YavZa.mjs → command-DUhX8Dcr.mjs} +1 -1
- package/dist/{command-maDJWJgu.mjs → command-Dh7RmjFu.mjs} +1 -1
- package/dist/{command-C2pNxAeL.mjs → command-DwXiDOeH.mjs} +1 -1
- package/dist/{command-CrtDkZNs.mjs → command-UiHLJ8Ji.mjs} +1 -1
- package/dist/command-_rqD0hXF.mjs +2 -0
- package/dist/{command-B6TpINoN.mjs → command-oNVwyjGB.mjs} +1 -1
- package/dist/{completions-D0280hul.mjs → completions-D06AO7A8.mjs} +12 -12
- package/dist/connector-interrupts-DelTmNyw.mjs +6 -0
- package/dist/connector-telemetry-events-BwxR3G8d.mjs +6 -0
- package/dist/connector-telemetry-snapshots-Bqq-hrpJ.mjs +6 -0
- package/dist/connectors-D-m3rEpk.mjs +15 -0
- package/dist/containers-CVNfEjJs.mjs +78 -0
- package/dist/containers-DeoZyeQe.mjs +375 -0
- package/dist/{content-scan-BCtWBCqd.mjs → content-scan-W0BNzbQp.mjs} +7 -7
- package/dist/{context-CquYYyS3.mjs → context-q7UaYK69.mjs} +2 -2
- package/dist/{cps-C8BbnbuD.mjs → cps-BZ6hqRb5.mjs} +3 -3
- package/dist/{csamScanner-CsJ9H2fA.mjs → csamScanner-Bo1t3CLh.mjs} +3 -3
- package/dist/ct-alerting-E03faC7p.mjs +5 -0
- package/dist/{custom-certificates-CA8HqolM.mjs → custom-certificates-CUySSPzi.mjs} +7 -7
- package/dist/{custom-csrs-D0P2vWJE.mjs → custom-csrs-gNpWkJPQ.mjs} +5 -5
- package/dist/{custom-hostnames-CzYMChbh.mjs → custom-hostnames-abGBAbx7.mjs} +12 -12
- package/dist/{custom-nameservers-Cet3oF56.mjs → custom-nameservers-BgNXol1P.mjs} +5 -5
- package/dist/{custom-pages-DUkHIaTP.mjs → custom-pages-DMKX3aoD.mjs} +10 -10
- package/dist/d1-CE08YqYk.mjs +93 -0
- package/dist/{dcv-delegation-BkdRVEAH.mjs → dcv-delegation-B5YUEWu0.mjs} +2 -2
- package/dist/delegate.mjs +1 -1
- package/dist/deploy-CWNm1-5v.mjs +2 -0
- package/dist/deploy-context-Dr6bxNcB.mjs +56 -0
- package/dist/deploy-input-Cc0_2QlW.mjs +2 -0
- package/dist/{dev-BHkVwAea.mjs → dev-ZA8itQE7.mjs} +2 -2
- package/dist/diagnostics-UMbG6m4n.mjs +15 -0
- package/dist/dialog-D4Y9ocuF.mjs +2 -0
- package/dist/discover-DIDEGKo3.mjs +2 -0
- package/dist/discover-P20XeGBF.mjs +2 -0
- package/dist/dist-BHEmAAHr.mjs +487 -0
- package/dist/dist-uRuGmkMB.mjs +60 -0
- package/dist/dls-DIl16mLp.mjs +17 -0
- package/dist/{dns-BLNa0GrP.mjs → dns-QUpgljRG.mjs} +63 -63
- package/dist/{dns-firewall-ChCvC5rT.mjs → dns-firewall-BZwJXHLj.mjs} +9 -9
- package/dist/dot-prop-IITUZ2XW-BnPfnQkb.mjs +2 -0
- package/dist/dotenv-DpXaxfho.mjs +4 -0
- package/dist/dry-run-DRj2_uV3.mjs +2 -0
- package/dist/durable-objects-BCj4ykpU.mjs +6 -0
- package/dist/{email-auth-C28s03aI.mjs → email-auth-DlHIYhCk.mjs} +3 -3
- package/dist/{email-routing-Ci-xjXIN.mjs → email-routing-UKVS4DYy.mjs} +22 -22
- package/dist/email-security-CZjfRIg0.mjs +158 -0
- package/dist/{email-sending-kTVAlVKO.mjs → email-sending-Dquc880C.mjs} +22 -22
- package/dist/error-sanitization-DE_zSrXw.mjs +2 -0
- package/dist/error-sanitization-DOCQ9Ykh.mjs +2 -0
- package/dist/fieldExtractors-BbwDRquU.mjs +9 -0
- package/dist/{firewall-BND3qSY2.mjs → firewall--mTfDnCJ.mjs} +17 -17
- package/dist/flagship-cfoSwwM9.mjs +28 -0
- package/dist/{fraud-DgyYv_CC.mjs → fraud-Dcsq3EYK.mjs} +3 -3
- package/dist/{generate-VxmGG8BF.mjs → generate-CeeWW3eX.mjs} +1 -1
- package/dist/generate-D80-1GnZ.mjs +2 -0
- package/dist/{google-tag-gateway-v3p7murv.mjs → google-tag-gateway-DPKSkZQi.mjs} +3 -3
- package/dist/gt-3bcLGJ7V.mjs +3 -0
- package/dist/{healthchecks-CByb4qYA.mjs → healthchecks-D78hIIBC.mjs} +10 -10
- package/dist/{hostnames-3CqeMF5g.mjs → hostnames-sF999-6H.mjs} +5 -5
- package/dist/{hyperdrive-CmyYTE-K.mjs → hyperdrive-qWACKfA4.mjs} +10 -10
- package/dist/iam-Bvg_PayW.mjs +52 -0
- package/dist/images-DI_lEZ4L.mjs +71 -0
- package/dist/index.mjs +1 -1
- package/dist/init-1w_mcgk3.mjs +43 -0
- package/dist/intel-BxElBUMP.mjs +76 -0
- package/dist/interactive-BW9T1D1q.mjs +48 -0
- package/dist/interactive-DGUWZ2Gk.mjs +2 -0
- package/dist/{ips-WWvPwSBc.mjs → ips-DWoaKxi7.mjs} +2 -2
- package/dist/k2-tFjaftl-.mjs +11 -0
- package/dist/{keyless-certificates-DqILy3t9.mjs → keyless-certificates-BrvxHU4J.mjs} +6 -6
- package/dist/keys-DcwTYKRf.mjs +4 -0
- package/dist/kv-htXS-7uP.mjs +15 -0
- package/dist/{lazy-command--5YpWUVY.mjs → lazy-command-BDiIwpss.mjs} +1 -1
- package/dist/{leaked-credential-checks-C0U1oYM5.mjs → leaked-credential-checks-bvGrLOmQ.mjs} +8 -8
- package/dist/lifecycle-oud60haK.mjs +2 -0
- package/dist/{load-balancers-BJKI9lm7.mjs → load-balancers-BNTUt4yG.mjs} +40 -40
- package/dist/local-DlDumOSC.mjs +2 -0
- package/dist/{local-rYpzEQb-.mjs → local-DlT72Xpn.mjs} +1 -1
- package/dist/{local-runtime-DZTTIe6x.mjs → local-runtime-CokO6qaX.mjs} +1 -1
- package/dist/{login-bnylLTit.mjs → login-BGF_I_LT.mjs} +1 -1
- package/dist/login-Ccw-mYwT.mjs +2 -0
- package/dist/logo-matches-tE8LTKgg.mjs +6 -0
- package/dist/logos-Bj845Mcw.mjs +7 -0
- package/dist/logpush-Cs8JdvKi.mjs +46 -0
- package/dist/{logs-c3b3USyS.mjs → logs-C92XZvNu.mjs} +11 -11
- package/dist/magic-cloud-networking-hNp5MMw-.mjs +71 -0
- package/dist/magic-network-monitoring-68GuWAnv.mjs +36 -0
- package/dist/magic-transit-DNd7gu4j.mjs +383 -0
- package/dist/managed-defense-B_wCAuFD.mjs +18 -0
- package/dist/{managed-transforms-DcYAvqTe.mjs → managed-transforms-DZdxHPOh.mjs} +4 -4
- package/dist/{matches-hnU16rSJ.mjs → matches-B65CkflD.mjs} +3 -3
- package/dist/mcp-DrJW5ayK.mjs +32 -0
- package/dist/mesh-DfVzYTn1.mjs +26 -0
- package/dist/metadata-Df5kCWJv.mjs +2 -0
- package/dist/{migrate-BNvUWrjy.mjs → migrate-CZNq63Uj.mjs} +1 -1
- package/dist/{monetization-Dsqj9DCA.mjs → monetization-BGaI8CMO.mjs} +9 -9
- package/dist/mtls-certificates-BsU2emDD.mjs +13 -0
- package/dist/network-BEMD8P0U.mjs +50 -0
- package/dist/network-interconnects-DMu_fcbo.mjs +68 -0
- package/dist/o11y-C1a4gDGF.mjs +93 -0
- package/dist/{oauth-CeZ3d_dB.mjs → oauth-Bj5Ne1o8.mjs} +1 -1
- package/dist/oauth-clients-p4Etdqy_.mjs +16 -0
- package/dist/{oauth-w0fWmrwU.mjs → oauth-mspHHU5U.mjs} +1 -1
- package/dist/{oauth-scopes-CxpRD6d7.mjs → oauth-scopes-B2IabFza.mjs} +2 -2
- package/dist/open-PCXX3ZDZ-D55O2jpQ.mjs +4 -0
- package/dist/{organization-DNieJ1xJ.mjs → organization-CdXt7AVZ.mjs} +16 -16
- package/dist/{organizations-BIXPmTy5.mjs → organizations-5S6xEp7T.mjs} +2 -2
- package/dist/{origin-ca-certificates-dVJvSIH8.mjs → origin-ca-certificates-_VJAoK1D.mjs} +5 -5
- package/dist/{origin-post-quantum-encryption-CO6tDW1t.mjs → origin-post-quantum-encryption-GcldDsT2.mjs} +3 -3
- package/dist/{origin-tls-client-auth-DeTY8aN2.mjs → origin-tls-client-auth-DZHld9fA.mjs} +14 -14
- package/dist/output-BOe-3AQG.mjs +2 -0
- package/dist/{page-rules-DA552Ra4.mjs → page-rules-o1tAMMsD.mjs} +7 -7
- package/dist/pages-CmiOhjSl.mjs +54 -0
- package/dist/pay-per-crawl-BsnOxGYU.mjs +38 -0
- package/dist/pay-per-use-BXWMCSyE.mjs +33 -0
- package/dist/pipelines-DWLQC0F6.mjs +44 -0
- package/dist/precursor-B6DjBib6.mjs +4 -0
- package/dist/previews-dUKEBGSM.mjs +4 -0
- package/dist/process-2wmDCy17.mjs +2 -0
- package/dist/{progress-TLUEIYE6.mjs → progress-BtkTVcHI.mjs} +1 -1
- package/dist/prompt-RlgRrmbm.mjs +3 -0
- package/dist/queries-yLwoJRHV.mjs +9 -0
- package/dist/queues-CnJRaE1o.mjs +57 -0
- package/dist/r2-CuC6-zQX.mjs +128 -0
- package/dist/{radar-Bez6k9Dw.mjs → radar-DrQLcbkq.mjs} +150 -150
- package/dist/{raw-fetch-DNxNCoeP.mjs → raw-fetch-B4NvWuZD.mjs} +1 -1
- package/dist/realtime-CjsnzHxD.mjs +172 -0
- package/dist/registrar-BgOsxTnX.mjs +43 -0
- package/dist/registrar-sandbox-3ikBD9fB.mjs +56 -0
- package/dist/{registry-CsSLAAOE.mjs → registry-CHowrQsZ.mjs} +1 -1
- package/dist/reporting-hE127s5r.mjs +14 -0
- package/dist/request-headers-DiJeDAn1.mjs +2 -0
- package/dist/request-tracers-BCwLxmPN.mjs +4 -0
- package/dist/resolve-CaTBV-c6.mjs +2 -0
- package/dist/resolve-DCGSzUDQ.mjs +2 -0
- package/dist/resource-sharing-2qvWUuMa.mjs +40 -0
- package/dist/resource-tagging-Dwx7iL3v.mjs +4 -0
- package/dist/rules-DxVQ6jIg.mjs +18 -0
- package/dist/rulesets-Cdh8YjI9.mjs +37 -0
- package/dist/rum-a4CMq4Qu.mjs +30 -0
- package/dist/run-BvHwWWUX.mjs +2 -0
- package/dist/run-CkbrPJPx.mjs +2 -0
- package/dist/schema-elj12WOx.mjs +2 -0
- package/dist/schema-flags-BzoBGPWk.mjs +5 -0
- package/dist/scim-B8XlXl8v.mjs +18 -0
- package/dist/secrets-store-Cqhedh_i.mjs +24 -0
- package/dist/{security-insights-DVAqroY5.mjs → security-insights-le2-DteL.mjs} +20 -20
- package/dist/{security-txt-rfrrdiZV.mjs → security-txt-cCArWXur.mjs} +4 -4
- package/dist/{session-B6mFkaVZ.mjs → session-C1BhT1ZJ.mjs} +1 -1
- package/dist/shared-BPjcpXuA.mjs +2 -0
- package/dist/{smart-shield-_HA814Im.mjs → smart-shield-Csyh8hwB.mjs} +11 -11
- package/dist/{snippets-mRelEw0p.mjs → snippets-DUWx25q6.mjs} +8 -8
- package/dist/source-mXUcrTVw.mjs +6 -0
- package/dist/spawn-IysxuTNW.mjs +10 -0
- package/dist/{spectrum-BwtOiaDw.mjs → spectrum-Da3UYSOR.mjs} +11 -11
- package/dist/{speed-DmqsZtiJ.mjs → speed-NxlMnB2e.mjs} +11 -11
- package/dist/sql-CNdHAlQ8.mjs +4 -0
- package/dist/src-JfLDUxFr.mjs +125 -0
- package/dist/{ssl-DCvfveJB.mjs → ssl-BtaX2WEJ.mjs} +16 -16
- package/dist/startup-profile-B2l0ChVu.mjs +2 -0
- package/dist/startup-profile-CdJWgNjd.mjs +29 -0
- package/dist/{state-BPwdiNO_.mjs → state-BDSvdSdP.mjs} +1 -1
- package/dist/state-JB4_BU1o.mjs +2 -0
- package/dist/stream-C1Ijjzn4.mjs +102 -0
- package/dist/submit-MdkuU_Pt.mjs +4 -0
- package/dist/{tags-Djw0e-4j.mjs → tags-CA1xMM96.mjs} +2 -2
- package/dist/telemetry-BsYO3nxG.mjs +2 -0
- package/dist/{telemetry-DrFNujdx.mjs → telemetry-Cm39QJ-M.mjs} +1 -1
- package/dist/{tenant-tc1wb_ym.mjs → tenant-BB6Oszcl.mjs} +5 -5
- package/dist/{tenant-custom-nameservers-XCbXryBZ.mjs → tenant-custom-nameservers-BsbgYAEo.mjs} +4 -4
- package/dist/{theme-BIWQFmZ0.mjs → theme-CQ_TYifs.mjs} +2 -2
- package/dist/{tools-CB4NleeJ.mjs → tools-CSc5DmFi.mjs} +1 -1
- package/dist/tunnels-CRFtyHWz.mjs +29 -0
- package/dist/turnstile-DBXWo_Xe.mjs +33 -0
- package/dist/{ui-D1hhIDIs.mjs → ui-YmjF66Ct.mjs} +1 -1
- package/dist/update-check-C2oVEbXx.mjs +2 -0
- package/dist/update-check-CMXSdres.mjs +2 -0
- package/dist/update-check-worker.mjs +1 -1
- package/dist/url-info-t-XAs0Mk.mjs +4 -0
- package/dist/{url-normalization-Dbypc9wz.mjs → url-normalization-Cs4F8e0a.mjs} +4 -4
- package/dist/url-scanner-CBIoDbTx.mjs +16 -0
- package/dist/{user-3uwLMH78.mjs → user-CevdOMoa.mjs} +52 -52
- package/dist/values-CjNlkbIh.mjs +4 -0
- package/dist/vectorize-9d9tPmg5.mjs +32 -0
- package/dist/version-BdVUXLnK.mjs +2 -0
- package/dist/waiting-rooms--5WmrWb3.mjs +53 -0
- package/dist/{web-assets-BfEprX1S.mjs → web-assets-BHot_MU8.mjs} +30 -30
- package/dist/{web3-DNbp5sZw.mjs → web3-CYfWAF6b.mjs} +13 -13
- package/dist/workers-S17M0n3h.mjs +40 -0
- package/dist/workers-builds-Dw7ho3So.mjs +14 -0
- package/dist/workers-for-platforms-A3yjyLh3.mjs +40 -0
- package/dist/{workers-vpc-LVfayM2-.mjs → workers-vpc-BZ2xXtC3.mjs} +7 -7
- package/dist/workflows-BgGrVpSR.mjs +43 -0
- package/dist/{wrangler-migration-B0mKHqGd.mjs → wrangler-migration-C6FKHER1.mjs} +1 -1
- package/dist/{zaraz-BY60ZUQ4.mjs → zaraz-BsD2dMI3.mjs} +11 -11
- package/dist/zero-trust-CA3iGQbG.mjs +837 -0
- package/dist/{zone-BVDW2UGd.mjs → zone-D2M4EZD0.mjs} +2 -2
- package/dist/{zones-CcZL0YQp.mjs → zones-BoOC_JzC.mjs} +43 -43
- package/package.json +33 -35
- package/dist/abuse-reports-DX5xgeka.mjs +0 -24
- package/dist/account-tags-CiKwgOWd.mjs +0 -15
- package/dist/accounts-DfXSHrkF.mjs +0 -138
- package/dist/addressing-B70NFnrX.mjs +0 -93
- package/dist/agent-context-GRiQ4zRU.mjs +0 -2
- package/dist/agent-memory-DJRquHeq.mjs +0 -34
- package/dist/ai-CP2oIS-I.mjs +0 -29
- package/dist/ai-gateway-CrrEtzUP.mjs +0 -82
- package/dist/ai-search-C4YWVTCa.mjs +0 -79
- package/dist/ai-security-Bt_fG65f.mjs +0 -10
- package/dist/alerting-CRr88fVR.mjs +0 -56
- package/dist/analytics-XqS9OP5B.mjs +0 -20
- package/dist/analytics_engine-CzmYem4f.mjs +0 -4
- package/dist/ansi-styles-eKEZXVwN.mjs +0 -2
- package/dist/argo-wFCAsYx7.mjs +0 -10
- package/dist/artifacts-qFjlNRqb.mjs +0 -43
- package/dist/auth-BmJ946bE.mjs +0 -2
- package/dist/auth-Br-t8vL_.mjs +0 -2
- package/dist/autoconfig-D-copdZG.mjs +0 -511
- package/dist/basin-catalog-CshcpsAH.mjs +0 -46
- package/dist/billing-B-xNxxiP.mjs +0 -23
- package/dist/bot-management-DhafeA2J.mjs +0 -9
- package/dist/botnet-feed-D6uCLE_D.mjs +0 -11
- package/dist/brand-protection-c3WiHbYn.mjs +0 -27
- package/dist/browser-run-D9_cwaSD.mjs +0 -46
- package/dist/build-9ihDp-Gy.mjs +0 -2
- package/dist/build-DrG6TqMw.mjs +0 -2
- package/dist/builds-Dl8if-2k.mjs +0 -71
- package/dist/cache-CIZokBjd.mjs +0 -45
- package/dist/cf-DfQfIu3q.mjs +0 -18
- package/dist/chunk-FT2NMTJB-BFqlGcem.mjs +0 -97
- package/dist/chunk-KKDV4JPS-B_t8sDTz.mjs +0 -2
- package/dist/chunk-U6NEESU5-BhF4rnpx.mjs +0 -2
- package/dist/chunk-WMOON6TZ-B8xCqjB1.mjs +0 -2
- package/dist/cli-exit-Dqoo6Jgb.mjs +0 -2
- package/dist/cloudflared-CEfZhSQH.mjs +0 -2
- package/dist/cloudforce-one-CE7y5UkF.mjs +0 -447
- package/dist/command-BWC9CbE7.mjs +0 -2
- package/dist/command-C65Ed0o9.mjs +0 -2
- package/dist/command-DHdWKtqx.mjs +0 -2
- package/dist/connector-interrupts-CVjFhU-C.mjs +0 -6
- package/dist/connector-telemetry-events-Bu3LKP6T.mjs +0 -6
- package/dist/connector-telemetry-snapshots-BbDTIc06.mjs +0 -6
- package/dist/connectors-DGtx-rPI.mjs +0 -15
- package/dist/containers-CzNbBrYE.mjs +0 -239
- package/dist/containers-DEFrbNgO.mjs +0 -78
- package/dist/ct-alerting-CYsQZO2H.mjs +0 -5
- package/dist/d1-B2duXfH2.mjs +0 -41
- package/dist/deploy-BdWBEbLj.mjs +0 -2
- package/dist/deploy-input-LmLfj6kI.mjs +0 -2
- package/dist/diagnostics-9Wj5UWBL.mjs +0 -15
- package/dist/dialog-Dpi-UVbz.mjs +0 -2
- package/dist/discover-BYkHr5Ja.mjs +0 -2
- package/dist/discover-t6E9lpf3.mjs +0 -2
- package/dist/dist-Cpb7_h4N.mjs +0 -57
- package/dist/dist-D1iG7guo.mjs +0 -366
- package/dist/dist-zep5OXGt.mjs +0 -48
- package/dist/dls-Caya7FZc.mjs +0 -17
- package/dist/dot-prop-IITUZ2XW-BsZYdILY.mjs +0 -2
- package/dist/dotenv-CcQjGlV0.mjs +0 -4
- package/dist/dry-run-p9Q7nMZ5.mjs +0 -2
- package/dist/durable-objects-DuRbdp7N.mjs +0 -6
- package/dist/email-security-DPU6xvI9.mjs +0 -158
- package/dist/error-sanitization-BbEw--0B.mjs +0 -2
- package/dist/error-sanitization-p5rmb53x.mjs +0 -2
- package/dist/fieldExtractors-ceaXu4zD.mjs +0 -9
- package/dist/flagship-DfxbNzgx.mjs +0 -28
- package/dist/generate-9P8Q_RiO.mjs +0 -2
- package/dist/gt-KlYHH-UC.mjs +0 -2
- package/dist/iam-CV_M681j.mjs +0 -52
- package/dist/images-DaLPjskW.mjs +0 -71
- package/dist/init-CBKifk5L.mjs +0 -39
- package/dist/intel-MpftjuPB.mjs +0 -76
- package/dist/interactive-D80kbTap.mjs +0 -32
- package/dist/interactive-mJQ_IrGd.mjs +0 -2
- package/dist/k2-D0QYUFqT.mjs +0 -13
- package/dist/keys-DhX4AcqF.mjs +0 -4
- package/dist/kv-DLUfUL0_.mjs +0 -15
- package/dist/lifecycle-Cyc3fmyN.mjs +0 -2
- package/dist/local-DkYQiSQQ.mjs +0 -2
- package/dist/login-CnE2Ii_F.mjs +0 -2
- package/dist/logo-matches-DFZybI0C.mjs +0 -6
- package/dist/logos-Da2YtqSN.mjs +0 -7
- package/dist/logpush-Q7WIEHS1.mjs +0 -46
- package/dist/magic-cloud-networking-BoyDmFq3.mjs +0 -71
- package/dist/magic-network-monitoring-BkUbpMUp.mjs +0 -36
- package/dist/magic-transit-4-THD45G.mjs +0 -383
- package/dist/managed-defense-CTMqSp6z.mjs +0 -18
- package/dist/mcp-kZX4irfN.mjs +0 -32
- package/dist/mesh-Dxzvvso6.mjs +0 -26
- package/dist/metadata-C33s4rc-.mjs +0 -2
- package/dist/mtls-certificates-BSbMwIna.mjs +0 -13
- package/dist/network-interconnects-osO_vAPu.mjs +0 -73
- package/dist/network-mEnXTEiG.mjs +0 -50
- package/dist/oauth-clients-CWPHi-Yn.mjs +0 -16
- package/dist/observability-BxL2RqWZ.mjs +0 -80
- package/dist/open-PCXX3ZDZ-C7gpxSsl.mjs +0 -4
- package/dist/output-ClYel9WX.mjs +0 -2
- package/dist/pages-B0x7tidm.mjs +0 -54
- package/dist/pay-per-crawl-DoTg9VP7.mjs +0 -65
- package/dist/pay-per-use-yRO2QBfe.mjs +0 -6
- package/dist/pipelines-CQxrm9ao.mjs +0 -44
- package/dist/precursor-FiGYDRV9.mjs +0 -4
- package/dist/previews-BthBa50j.mjs +0 -4
- package/dist/prompt-Ck_1PCHm.mjs +0 -3
- package/dist/queries-C0RRdol7.mjs +0 -9
- package/dist/queues-sLgvjsRP.mjs +0 -57
- package/dist/r2-C2PllL6i.mjs +0 -125
- package/dist/realtime-D-HSXznX.mjs +0 -172
- package/dist/registrar-DwHrG9QR.mjs +0 -43
- package/dist/registrar-sandbox-jNukmzQP.mjs +0 -56
- package/dist/reporting-DolhAb10.mjs +0 -14
- package/dist/request-headers-Lhj314mk.mjs +0 -2
- package/dist/request-tracers-w72hKc33.mjs +0 -4
- package/dist/resolve-CGKqk7q8.mjs +0 -2
- package/dist/resolve-Djf2xgBx.mjs +0 -2
- package/dist/resource-sharing-DTrSkqI4.mjs +0 -40
- package/dist/resource-tagging-aURR4fIJ.mjs +0 -4
- package/dist/rules-C8a7cV-W.mjs +0 -18
- package/dist/rulesets-RJ6yBefy.mjs +0 -37
- package/dist/rum-Bk1dPW4p.mjs +0 -30
- package/dist/run-BJOAPmsz.mjs +0 -2
- package/dist/run-iFM5TxtQ.mjs +0 -2
- package/dist/schema-flags-PagOq-G2.mjs +0 -5
- package/dist/schema-v7mOxMdx.mjs +0 -2
- package/dist/scim-C0FmjkkV.mjs +0 -18
- package/dist/secrets-store-cG_5RMzK.mjs +0 -24
- package/dist/shared-BqsWoApw.mjs +0 -2
- package/dist/source-38bULAR8.mjs +0 -6
- package/dist/spawn-BzPhcLJI.mjs +0 -10
- package/dist/src--KDGqL5N.mjs +0 -109
- package/dist/startup-profile-BCe9k9sR.mjs +0 -17
- package/dist/startup-profile-WrwRyMwH.mjs +0 -2
- package/dist/state-a1tTOGjm.mjs +0 -2
- package/dist/stream-aroClJeD.mjs +0 -102
- package/dist/submit-BBKhoKT8.mjs +0 -4
- package/dist/telemetry-DoBQOGRk.mjs +0 -2
- package/dist/tunnels-C2FTswb6.mjs +0 -29
- package/dist/turnstile-BV4Mdd-j.mjs +0 -33
- package/dist/update-check-CFt6cMOi.mjs +0 -2
- package/dist/update-check-Dtj9fzNe.mjs +0 -2
- package/dist/url-info-CeegsDK7.mjs +0 -4
- package/dist/url-scanner-BFXMrpJF.mjs +0 -16
- package/dist/values-BTncDc3U.mjs +0 -4
- package/dist/vectorize-CtMAtx8r.mjs +0 -32
- package/dist/version-oN1bmOgM.mjs +0 -2
- package/dist/waiting-rooms-1xDvjF13.mjs +0 -53
- package/dist/workers-DK_JgS4Y.mjs +0 -38
- package/dist/workers-builds-CdhwmmsQ.mjs +0 -14
- package/dist/workers-for-platforms-CP6IqxrK.mjs +0 -42
- package/dist/workflows-CA5K8FFb.mjs +0 -43
- package/dist/zero-trust-CQNohO7_.mjs +0 -821
- /package/dist/{Page-DAgOEX17.mjs → Page-BShsqCXr.mjs} +0 -0
- /package/dist/{alerts-D3iKtzoN.mjs → alerts-BSON-vFh.mjs} +0 -0
- /package/dist/{args-CXgkQKK7.mjs → args-CfbYkeXd.mjs} +0 -0
- /package/dist/{autorag-pvRfDwne.mjs → autorag-kNrLiqDX.mjs} +0 -0
- /package/dist/{body-parser-NjzJZMOV.mjs → body-parser-DkHKPkJ7.mjs} +0 -0
- /package/dist/{brands-DP5Ndir1.mjs → brands-bBJgbbOH.mjs} +0 -0
- /package/dist/{browser-extension-Dee2Y1qn.mjs → browser-extension-C1_fcw7h.mjs} +0 -0
- /package/dist/{clear-qLKPlJqb.mjs → clear-BW9vLgI3.mjs} +0 -0
- /package/dist/{cli-types-_Kmwfpnp.mjs → cli-types-9oYmRTHJ.mjs} +0 -0
- /package/dist/{connector-telemetry-events-latest-_aCmWeZx.mjs → connector-telemetry-events-latest-BQdOvbWh.mjs} +0 -0
- /package/dist/{connector-telemetry-snapshots-latest-CffEplpV.mjs → connector-telemetry-snapshots-latest-CtdN_dGu.mjs} +0 -0
- /package/dist/{delegate-CCGgla7X.mjs → delegate-Tgfxa-MZ.mjs} +0 -0
- /package/dist/{domain-info-BQh9XapD.mjs → domain-info-BkcBcyfF.mjs} +0 -0
- /package/dist/{errors-cuuW88wR.mjs → errors-_sob7Ihu.mjs} +0 -0
- /package/dist/{health--10IShMi.mjs → health-CTaCeVyC.mjs} +0 -0
- /package/dist/{input-validation-0CeePPHp.mjs → input-validation-D7z60HJH.mjs} +0 -0
- /package/dist/{internal-BUs583vv.mjs → internal-BYS7hO8c.mjs} +0 -0
- /package/dist/{live-VCSxA0N9.mjs → live-BJE_YWE1.mjs} +0 -0
- /package/dist/{project-settings-Bf6rReo1.mjs → project-settings-nBMEx1f-.mjs} +0 -0
- /package/dist/{r2-data-catalog-Bg7zq1IB.mjs → r2-data-catalog-BRo-Rx2I.mjs} +0 -0
- /package/dist/{rate-limit-analytics-D3q0mGv2.mjs → rate-limit-analytics-BiRyU0Xd.mjs} +0 -0
- /package/dist/{rate-limits-BIxlBuMn.mjs → rate-limits-Cr2zpncO.mjs} +0 -0
- /package/dist/{ready-CAgelFmC.mjs → ready-B3pLxnjc.mjs} +0 -0
- /package/dist/{recent-submissions-B3TOjNmk.mjs → recent-submissions-JLOvuZq-.mjs} +0 -0
- /package/dist/{refute-BZNkFpBB.mjs → refute-Dp3VodMn.mjs} +0 -0
- /package/dist/{scan-logo-StecHiaf.mjs → scan-logo-3Zr6CDJB.mjs} +0 -0
- /package/dist/{scan-page-B4adr-vD.mjs → scan-page-CxeudOzj.mjs} +0 -0
- /package/dist/{search-Devngw4M.mjs → search-B_P5ZTQj.mjs} +0 -0
- /package/dist/{signed-url-ChR5eXXd.mjs → signed-url-D5RwvrQq.mjs} +0 -0
- /package/dist/{submission-info-BGb81HZN.mjs → submission-info-_t78q2OE.mjs} +0 -0
- /package/dist/{total-queries-_wa6KxEl.mjs → total-queries-CPrKEciQ.mjs} +0 -0
- /package/dist/{tracked-domains-BesKGqfI.mjs → tracked-domains-CTRItgFT.mjs} +0 -0
- /package/dist/{verify-CYM5GlPu.mjs → verify-5KcvRk-q.mjs} +0 -0
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{G as e}from"./dist-D1iG7guo.mjs";import{a as t}from"./banner-Xk4xBN8U.mjs";import{t as n}from"./local-rYpzEQb-.mjs";import{n as r}from"./auth-Br-t8vL_.mjs";import{a as i,n as a,t as o}from"./context-CquYYyS3.mjs";import{t as s}from"./auth-token-DeG33BMQ.mjs";import{n as c}from"./request-headers-Lhj314mk.mjs";import{t as l}from"./output-ClYel9WX.mjs";import{t as u}from"./dry-run-p9Q7nMZ5.mjs";import{t as d}from"./progress-TLUEIYE6.mjs";import{n as f,t as p}from"./run-iFM5TxtQ.mjs";import"./telemetry-DoBQOGRk.mjs";import{n as m,r as h,t as g}from"./body-parser-NjzJZMOV.mjs";import{n as _}from"./input-validation-0CeePPHp.mjs";import{a as v,i as y,n as b}from"./prompt-Ck_1PCHm.mjs";import{t as x}from"./cli-types-_Kmwfpnp.mjs";import{D as S,T as C,_ as w,d as T,f as E,g as D,l as ee,m as te,o as O,w as k,x as A,y as j}from"./dist-zep5OXGt.mjs";function M(e){return e.positional(`path`,{type:`string`,demandOption:!0,description:`Directory containing the Dockerfile to build`}).option(`tag`,{alias:`t`,type:`string`,demandOption:!0,description:`Name and optional tag for the built image`}).option(`push`,{alias:`p`,type:`boolean`,default:!1,description:`Push the built image to Cloudflare's managed registry`}).option(`path-to-docker`,{type:`string`,description:`Path to the Docker binary if it is not on PATH`})}var N=f({command:`build <path>`,describe:`Build a Container image`,builder:M,handler:async t=>{if(t.local)throw Error("--local is not supported with `cf containers build`.");let n={compliance_region:t.push?await a():`public`},r=t.push?await s():``,i=S(r);D({logger:i.logger,fetchResult:i.fetchResult,fetchPagedListResult:i.fetchPagedListResult}),t.push&&T(await o(),r,e(n)),await ee({PATH:t.path,tag:t.tag,push:t.push,pathToDocker:t[`path-to-docker`]},n)}},{command:`containers build`,classification:{safeFlags:[`push`],shortFlagAliases:{p:{canonical:`push`,type:`boolean`},t:{canonical:`tag`,type:`value`}}}});function P(e){return e.option(`tag`,{alias:`t`,type:`string`,demandOption:!0,description:`Tag of the local image to push`}).option(`path-to-docker`,{type:`string`,description:`Path to the Docker binary if it is not on PATH`})}var F=f({command:`push`,describe:`Push a local image to the Cloudflare managed registry`,builder:P,handler:async t=>{if(t.local)throw Error("--local is not supported with `cf containers push`.");let n=await s(),r=await o(),i={compliance_region:await a()},c=S(n);D({logger:c.logger,fetchResult:c.fetchResult,fetchPagedListResult:c.fetchPagedListResult}),T(r,n,e(i)),await A({TAG:t.tag,pathToDocker:t[`path-to-docker`]},r,i)}},{command:`containers push`,classification:{safeFlags:[],shortFlagAliases:{t:{canonical:`tag`,type:`value`}}}});function I(e){return e.positional(`id`,{type:`string`,demandOption:!0,description:`ID of the container instance`}).positional(`ssh-command`,{type:`string`,array:!0,description:`Command and arguments to run in the container`}).options(E).middleware(e=>{k(e)&&(e.quiet=!0)},!0).parserConfiguration({"populate--":!0,"unknown-options-as-args":!0,"parse-positional-numbers":!1})}const L={command:`ssh <id> [ssh-command..]`,describe:`SSH into a container`,builder:I,handler:async t=>{if(t.local)throw Error("--local is not supported with `cf containers ssh`.");let n=await s(),r=await o(),i={compliance_region:await a()},l=S(n);D({logger:l.logger,fetchResult:l.fetchResult}),O.HEADERS=c(),T(r,n,e(i)),await C({...t,id:t.id,command:[...t[`ssh-command`]??[],...Array.isArray(t[`--`])?t[`--`].map(String):[]]})}},R=f(L,{command:`containers ssh`,recordArgs:!1});var z={...R,handler:async e=>{if(k(e)){let{markCommandReported:t}=await import(`./telemetry-DrFNujdx.mjs`);return t(),L.handler(e)}return R.handler(e)}};function B(e){return e.usage('$0 containers applications create\n\nCreate a Containers application. Use `scheduling_policy: "default"` for a scheduler-backed application. The Containers scheduler maintains the requested instance count and manages deployment configuration, placement, scaling, versions, and rollouts. Use `scheduling_policy: "durable_object"` for a Durable Object-managed application. Each Durable Object creates and manages the lifecycle of its container instance. Supply `name`, `scheduling_policy`, and `durable_objects`, with optional `configuration` and optional top-level `observability` settings. Deployment configuration, scaling, constraints, versions, and rollouts do not apply.').option(`configuration-command`,{type:`string`,array:!0,description:`The command that runs when the container starts, passed to the entrypoint.
|
|
3
|
-
You can override this at run-time. If you override only the command,
|
|
4
|
-
it gets passed to the default entrypoint specified in the image.
|
|
5
|
-
`}).option(`configuration-entrypoint`,{type:`string`,array:!0,description:`The entry point for the container, specifying the executable to run when the container starts.
|
|
6
|
-
You can override this at run-time. If you do, the default command from the image is ignored.
|
|
7
|
-
Specify both entrypoint and command at run-time to completely replace the image defaults.
|
|
8
|
-
`}).option(`configuration-image`,{type:`string`,description:`Image url.`}).option(`configuration-instance-type`,{type:`string`,description:`The instance type configures vCPU, memory, and disk.
|
|
9
|
-
|
|
10
|
-
- "lite": 1/16 vCPU, 256 MiB memory, 2 GB disk
|
|
11
|
-
- "basic": 1/4 vCPU, 1 GiB memory, 4 GB disk
|
|
12
|
-
- "standard-1": 1/2 vCPU, 4 GiB memory, 8 GB disk
|
|
13
|
-
- "standard-2": 1 vCPU, 6 GiB memory, 12 GB disk
|
|
14
|
-
- "standard-3": 2 vCPU, 8 GiB memory, 16 GB disk
|
|
15
|
-
- "standard-4": 4 vCPU, 12 GiB memory, 20 GB disk
|
|
16
|
-
`}).option(`configuration-observability-logs-enabled`,{type:`boolean`,description:`The configuration.observability.logs.enabled field`}).option(`configuration-wrangler-ssh-enabled`,{type:`boolean`,description:`The configuration.wrangler_ssh.enabled field`}).option(`configuration-wrangler-ssh-port`,{type:`number`,description:`The configuration.wrangler_ssh.port field`}).option(`constraints-jurisdiction`,{type:`string`,description:`Restricts placement to datacenters in the selected jurisdiction. Choose "eu", "fedramp", or "us". When combined with regions, EU supports EEUR and WEUR while FedRAMP and US support ENAM and WNAM.`}).option(`constraints-regions`,{type:`string`,array:!0,description:`The constraints.regions field`}).option(`instances`,{type:`number`,description:`The initial number of deployments to create.`}).option(`max-instances`,{type:`number`,description:`Sets the maximum number of instances that the application can run.`}).option(`name`,{type:`string`,description:`The name for this application.`}).option(`observability-logs-enabled`,{type:`boolean`,description:`The observability.logs.enabled field`}).option(`rollout-active-grace-period`,{type:`number`,description:`Grace period for active instances to stay alive before becoming eligible for shutdown signal due to a rollout, in seconds.
|
|
17
|
-
Defaults to 0.
|
|
18
|
-
`}).option(`scheduling-policy`,{type:`string`,description:`Selects a scheduler-backed application. Use \`default\` when the Containers
|
|
19
|
-
scheduler should maintain the requested number of instances and manage deployment
|
|
20
|
-
configuration, placement, scaling, versions, and rollouts.
|
|
21
|
-
`,choices:[`default`,`durable_object`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"Create a Containers application. Set `scheduling_policy` to `default` for a scheduler-backed application with deployment configuration, instance counts, constraints, versions, and rollouts. Set it to `durable_object` for a Durable Object-managed application where each Durable Object creates and manages the lifecycle of its container instance. For `durable_object` requests, supply `name`, `scheduling_policy`, and `durable_objects`, with optional `configuration` and top-level `observability` settings. "}).conflicts(`configuration-command`,[`configuration-wrangler-ssh-port`]).conflicts(`configuration-entrypoint`,[`configuration-wrangler-ssh-port`]).conflicts(`configuration-image`,[`configuration-wrangler-ssh-port`]).conflicts(`configuration-instance-type`,[`configuration-wrangler-ssh-port`]).conflicts(`configuration-wrangler-ssh-port`,[`configuration-command`,`configuration-entrypoint`,`configuration-image`,`configuration-instance-type`,`constraints-jurisdiction`,`constraints-regions`,`instances`,`max-instances`,`rollout-active-grace-period`]).conflicts(`constraints-jurisdiction`,[`configuration-wrangler-ssh-port`]).conflicts(`constraints-regions`,[`configuration-wrangler-ssh-port`]).conflicts(`instances`,[`configuration-wrangler-ssh-port`]).implies(`instances`,[`max-instances`]).conflicts(`max-instances`,[`configuration-wrangler-ssh-port`]).implies(`max-instances`,[`instances`]).conflicts(`rollout-active-grace-period`,[`configuration-wrangler-ssh-port`])}const V={command:`create`,describe:`Create a new application`,builder:B,handler:async e=>p({command:`containers applications create`,classification:{safeFlags:[`configuration-observability-logs-enabled`,`configuration-wrangler-ssh-enabled`,`observability-logs-enabled`,`scheduling-policy`,`dry-run`]}},e,async()=>{if(e.dryRun){u({command:`cf containers applications create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/containers/applications`,pathParams:{},bodyKind:`json`,body:e.body===void 0?g({configuration:{command:e[`configuration-command`],entrypoint:e[`configuration-entrypoint`],image:_(e[`configuration-image`],`configuration-image`,`text`),instance_type:_(e[`configuration-instance-type`],`configuration-instance-type`,`text`),observability:{logs:{enabled:e[`configuration-observability-logs-enabled`]}},wrangler_ssh:{enabled:e[`configuration-wrangler-ssh-enabled`],port:e[`configuration-wrangler-ssh-port`]}},constraints:{jurisdiction:_(e[`constraints-jurisdiction`],`constraints-jurisdiction`,`text`),regions:e[`constraints-regions`]},instances:e.instances,max_instances:e[`max-instances`],name:_(e.name,`name`,`text`),observability:{logs:{enabled:e[`observability-logs-enabled`]}},rollout_active_grace_period:e[`rollout-active-grace-period`],scheduling_policy:_(e[`scheduling-policy`],`scheduling-policy`,`text`)}):m(e.body)});return}let t=await r(e),a=e.local?n:await o();if(e.accountId=a,e.body){let n=m(e.body);l(await d(`Creating`,async()=>t.containers.applications.create({body:n,account_id:a})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await v(`name`,`The name for this application.`)),e[`scheduling-policy`]===void 0&&(e[`scheduling-policy`]=await y(`scheduling-policy`,"Selects a scheduler-backed application. Use `default` when the Containers scheduler should maintain the requested number of instances and manage deployment configuration, placement, scaling, versions, and rollouts. ",[`default`,`durable_object`]));let s=g({configuration:{command:e[`configuration-command`],entrypoint:e[`configuration-entrypoint`],image:_(e[`configuration-image`],`configuration-image`,`text`),instance_type:_(e[`configuration-instance-type`],`configuration-instance-type`,`text`),observability:{logs:{enabled:e[`configuration-observability-logs-enabled`]}},wrangler_ssh:{enabled:e[`configuration-wrangler-ssh-enabled`],port:e[`configuration-wrangler-ssh-port`]}},constraints:{jurisdiction:_(e[`constraints-jurisdiction`],`constraints-jurisdiction`,`text`),regions:e[`constraints-regions`]},instances:e.instances,max_instances:e[`max-instances`],name:_(e.name,`name`,`text`),observability:{logs:{enabled:e[`observability-logs-enabled`]}},rollout_active_grace_period:e[`rollout-active-grace-period`],scheduling_policy:_(e[`scheduling-policy`],`scheduling-policy`,`text`)});l(await d(`Creating`,async()=>t.containers.applications.create({body:s,account_id:a})),{successLabel:`Created`})})};function H(e){return e.usage(`$0 containers applications delete <application-id>
|
|
22
|
-
|
|
23
|
-
Deletes a single application by id.`).positional(`application-id`,{type:`string`,description:`An Application ID represents an identifier of an application.`,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 U={command:`delete <application-id>`,describe:`Delete a single application by id`,builder:H,handler:async e=>p({command:`containers applications delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){u({command:`cf containers applications delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/containers/applications/${e[`application-id`]==null?`<application-id>`:encodeURIComponent(String(e[`application-id`]))}`,pathParams:{"application-id":String(e[`application-id`]??``)},bodyKind:`none`});return}let t=await r(e),a=e.local?n:await o();if(e.accountId=a,!await b({force:!!e.force,message:`This operation permanently deletes the application and stops its containers.`})){process.stderr.write(`Aborted.
|
|
24
|
-
`);return}l(await d(`Deleting`,async()=>t.containers.applications.delete({account_id:a,application_id:e[`application-id`]})),{successLabel:`Deleted`})})};function W(e){return e.usage("$0 containers applications edit <application-id>\n\nModifies a single application by id. Durable Object-managed application settings are published to runtime metadata without creating deployments or rollouts. Top-level `observability` for these applications supports only `logs.enabled`. The supported fields depend on the existing application's scheduling policy. For scheduler-backed applications, changes that replace instance deployment configuration, including the image, require a rollout.").positional(`application-id`,{type:`string`,description:`An Application ID represents an identifier of an application.`,demandOption:!0}).option(`configuration-wrangler-ssh-enabled`,{type:`boolean`,description:`The configuration.wrangler_ssh.enabled field`}).option(`configuration-wrangler-ssh-port`,{type:`number`,description:`The configuration.wrangler_ssh.port field`}).option(`constraints-jurisdiction`,{type:`string`,description:`Restricts placement to datacenters in the selected jurisdiction. Choose "eu", "fedramp", or "us". When combined with regions, EU supports EEUR and WEUR while FedRAMP and US support ENAM and WNAM.`}).option(`constraints-regions`,{type:`string`,array:!0,description:`The constraints.regions field`}).option(`max-instances`,{type:`number`,description:`Maximum number of instances that an autoscaling application can run.`}).option(`observability-logs-enabled`,{type:`boolean`,description:`The observability.logs.enabled field`}).option(`rollout-active-grace-period`,{type:`number`,description:`Grace period for active instances to stay alive before becoming eligible for shutdown signal due to a rollout, in seconds.
|
|
25
|
-
Defaults to 0.
|
|
26
|
-
`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for modifying a Containers application without replacing its instances. Durable Object-managed applications support only top-level observability.logs.enabled. The other fields apply to scheduler-backed applications, where deployment configuration changes such as image, resource allocation, command, and environment variables require an application rollout. `})}const G={command:`edit <application-id>`,describe:`Modify an application`,builder:W,handler:async e=>p({command:`containers applications edit`,classification:{safeFlags:[`configuration-wrangler-ssh-enabled`,`observability-logs-enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){u({command:`cf containers applications edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/containers/applications/${e[`application-id`]==null?`<application-id>`:encodeURIComponent(String(e[`application-id`]))}`,pathParams:{"application-id":String(e[`application-id`]??``)},bodyKind:`json`,body:e.body===void 0?g({configuration:{wrangler_ssh:{enabled:e[`configuration-wrangler-ssh-enabled`],port:e[`configuration-wrangler-ssh-port`]}},constraints:{jurisdiction:_(e[`constraints-jurisdiction`],`constraints-jurisdiction`,`text`),regions:e[`constraints-regions`]},max_instances:e[`max-instances`],observability:{logs:{enabled:e[`observability-logs-enabled`]}},rollout_active_grace_period:e[`rollout-active-grace-period`]}):m(e.body)});return}let t=await r(e),a=e.local?n:await o();if(e.accountId=a,e.body){let n=m(e.body);l(await d(`Updating`,async()=>t.containers.applications.edit({...n,account_id:a,application_id:e[`application-id`]})),{successLabel:`Updated`});return}let s=g({configuration:{wrangler_ssh:{enabled:e[`configuration-wrangler-ssh-enabled`],port:e[`configuration-wrangler-ssh-port`]}},constraints:{jurisdiction:_(e[`constraints-jurisdiction`],`constraints-jurisdiction`,`text`),regions:e[`constraints-regions`]},max_instances:e[`max-instances`],observability:{logs:{enabled:e[`observability-logs-enabled`]}},rollout_active_grace_period:e[`rollout-active-grace-period`]});l(await d(`Updating`,async()=>t.containers.applications.edit({...s,account_id:a,application_id:e[`application-id`]})),{successLabel:`Updated`})})};function K(e){return e.usage(`$0 containers applications get <application-id>
|
|
27
|
-
|
|
28
|
-
Returns a single application by id.`).positional(`application-id`,{type:`string`,description:`An Application ID represents an identifier of an application.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`get <application-id>`,describe:`Get a single application by id`,builder:K,handler:async e=>p({command:`containers applications get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){u({command:`cf containers applications get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/containers/applications/${e[`application-id`]==null?`<application-id>`:encodeURIComponent(String(e[`application-id`]))}`,pathParams:{"application-id":String(e[`application-id`]??``)},bodyKind:`none`});return}let t=await r(e),a=e.local?n:await o();e.accountId=a,l(await d(`Loading`,async()=>t.containers.applications.get({account_id:a,application_id:e[`application-id`]})),{successLabel:`Loaded`})})};function J(e){return e.usage(`$0 containers applications instances get <instance-id>
|
|
29
|
-
|
|
30
|
-
Returns a container instance belonging to an application.`).positional(`instance-id`,{type:`string`,description:`A container instance ID (64-character hex Durable Object actor ID).`,demandOption:!0}).option(`application-id`,{type:`string`,description:`An Application ID represents an identifier of an application.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`get <instance-id>`,describe:`Get a container instance`,builder:J,handler:async e=>p({command:`containers applications instances get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){u({command:`cf containers applications instances get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/containers/applications/${e[`application-id`]==null?`<application-id>`:encodeURIComponent(String(e[`application-id`]))}/instances/${e[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(e[`instance-id`]))}`,pathParams:{"application-id":String(e[`application-id`]??``),"instance-id":String(e[`instance-id`]??``)},bodyKind:`none`});return}let t=await r(e),a=e.local?n:await o();e.accountId=a,l(await d(`Loading`,async()=>t.containers.applications.instances.get({account_id:a,application_id:e[`application-id`],instance_id:e[`instance-id`]})),{successLabel:`Loaded`})})};function X(e){return e.usage(`$0 containers applications instances list
|
|
31
|
-
|
|
32
|
-
Lists container instances belonging to an application.`).option(`application-id`,{type:`string`,description:`An Application ID represents an identifier of an application.`,demandOption:!0}).option(`per-page`,{type:`number`,description:`Maximum number of instances to return per page. Defaults to 100.`}).option(`page-token`,{type:`string`,description:`Opaque token from a previous response to retrieve the next page.`}).option(`state`,{type:`string`,description:"Filters instances by lifecycle state. `active` includes provisioning, running, and stopping instances; `not-active` includes stopped and failed instances. When omitted, all instances are returned.",choices:[`active`,`not-active`]}).option(`name-prefix`,{type:`string`,description:`Filter instances by a case-sensitive name prefix, falling back to the actor ID when no name is known. Keep the same prefix when using a page token.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`list`,describe:`List container instances`,builder:x(X),handler:async e=>p({command:`containers applications instances list`,classification:{safeFlags:[`state`,`dry-run`]}},e,async()=>{let t={per_page:e[`per-page`],page_token:e[`page-token`],state:e.state,name_prefix:e[`name-prefix`]};if(e.dryRun){u({command:`cf containers applications instances list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/containers/applications/${e[`application-id`]==null?`<application-id>`:encodeURIComponent(String(e[`application-id`]))}/instances-v2`,pathParams:{"application-id":String(e[`application-id`]??``)},query:t,bodyKind:`none`});return}let a=await r(e),s=e.local?n:await o();e.accountId=s,l(await d(`Loading`,async()=>a.containers.applications.instances.list({account_id:s,application_id:e[`application-id`],...t})),{successLabel:`Loaded`})})},ne={command:`instances`,describe:`Inspect Containers instances belonging to applications`,builder:e=>e.command(Y).command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function re(e){return e.usage(`$0 containers applications list
|
|
33
|
-
|
|
34
|
-
Lists all the applications that are associated with your account.`).option(`per-page`,{type:`number`,description:"Maximum number of applications to return per page. Defaults to all, or 100 when `page_token` is set."}).option(`page-token`,{type:`string`,description:`Opaque token from a previous response to retrieve the next page.`}).option(`name`,{type:`string`,description:`Filter applications by name.`}).option(`image`,{type:`string`,description:`Filter applications by image.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`list`,describe:`List Applications associated with your account`,builder:re,handler:async e=>p({command:`containers applications list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={per_page:e[`per-page`],page_token:e[`page-token`],name:e.name,image:e.image};if(e.dryRun){u({command:`cf containers applications list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/containers/applications`,pathParams:{},query:t,bodyKind:`none`});return}let a=await r(e),s=e.local?n:await o();e.accountId=s,l(await d(`Loading`,async()=>a.containers.applications.list({account_id:s,...t})),{successLabel:`Loaded`})})};function ae(e){return e.usage('$0 containers applications rollouts create <application-id>\n\nCreates a rollout to update the application\'s configuration across instances with minimal downtime. Rollouts apply only to scheduler-backed applications with `scheduling_policy: "default"`. Versions and rollouts do not apply to applications with `scheduling_policy: "durable_object"`.').positional(`application-id`,{type:`string`,description:`An Application ID represents an identifier of an application.`,demandOption:!0}).option(`description`,{type:`string`,description:`Description of the rollout process.`}).option(`kind`,{type:`string`,description:`Kind of the rollout process. Defaults to "full_auto".
|
|
35
|
-
- "full_auto": For rolling rollouts, starts progressing steps upon rollout creation. For new_instances rollouts, advances percentage targets automatically after target-version health is observed.
|
|
36
|
-
- "full_manual": Requires manually progressing each step in the rollout using the UpdateRollout's action parameter.
|
|
37
|
-
`,choices:[`full_auto`,`full_manual`],default:`full_auto`}).option(`percentage`,{type:`number`,description:`Initial target version percentage (0-100). Version sync actively replaces instances to match.
|
|
38
|
-
Required when strategy is "new_instances" and kind is "full_manual". When strategy is "new_instances" and kind is "full_auto", omitted percentage starts at 10% or the smallest percentage that targets at least one instance. Unused for "rolling".
|
|
39
|
-
`}).option(`step-percentage`,{type:`number`,description:`Percentage of rollout to increase in each step when "steps" is absent. Applicable values: 5, 10, 20, 25, 50, 100.
|
|
40
|
-
These create rollouts with 20, 10, 5, 4, 2, 1 steps respectively.
|
|
41
|
-
Only valid for "rolling" strategy.
|
|
42
|
-
`}).option(`steps`,{type:`string`,description:`Steps defining the rollout process, used when "step_percentage" is absent.
|
|
43
|
-
Specify only one of "step_percentage" or "steps" when creating a rollout.
|
|
44
|
-
"steps" allow granular control over each step.
|
|
45
|
-
Only valid for "rolling" strategy.
|
|
46
|
-
. Provide as a JSON array of objects or @path/to/file.json.`}).option(`strategy`,{type:`string`,description:`Strategy used for the rollout.
|
|
47
|
-
- "rolling": Step-based rollout with health gates. Actively replaces instances to reach each step's target percentage.
|
|
48
|
-
- "new_instances": Percentage control over version distribution. Version sync actively replaces instances to match the configured percentage. The "full_auto" kind advances through fixed percentage targets after target-version health is observed.
|
|
49
|
-
`,choices:[`rolling`,`new_instances`]}).option(`target-configuration-command`,{type:`string`,array:!0,description:`The command that runs when the container starts, passed to the entrypoint.
|
|
50
|
-
You can override this at run-time. If you override only the command,
|
|
51
|
-
it gets passed to the default entrypoint specified in the image.
|
|
52
|
-
`}).option(`target-configuration-entrypoint`,{type:`string`,array:!0,description:`The entry point for the container, specifying the executable to run when the container starts.
|
|
53
|
-
You can override this at run-time. If you do, the default command from the image is ignored.
|
|
54
|
-
Specify both entrypoint and command at run-time to completely replace the image defaults.
|
|
55
|
-
`}).option(`target-configuration-image`,{type:`string`,description:`Image url.`}).option(`target-configuration-instance-type`,{type:`string`,description:`The instance type configures vCPU, memory, and disk.
|
|
56
|
-
|
|
57
|
-
- "lite": 1/16 vCPU, 256 MiB memory, 2 GB disk
|
|
58
|
-
- "basic": 1/4 vCPU, 1 GiB memory, 4 GB disk
|
|
59
|
-
- "standard-1": 1/2 vCPU, 4 GiB memory, 8 GB disk
|
|
60
|
-
- "standard-2": 1 vCPU, 6 GiB memory, 12 GB disk
|
|
61
|
-
- "standard-3": 2 vCPU, 8 GiB memory, 16 GB disk
|
|
62
|
-
- "standard-4": 4 vCPU, 12 GiB memory, 20 GB disk
|
|
63
|
-
`,default:`lite`}).option(`target-configuration-observability-logs-enabled`,{type:`boolean`,description:`The target_configuration.observability.logs.enabled field`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body to create a new rollout for a scheduler-backed application.`})}const oe={command:`create <application-id>`,describe:`Create a new rollout for an application`,builder:ae,handler:async e=>p({command:`containers applications rollouts create`,classification:{safeFlags:[`kind`,`strategy`,`target-configuration-observability-logs-enabled`,`dry-run`]}},e,async()=>{if(e.dryRun){u({command:`cf containers applications rollouts create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/containers/applications/${e[`application-id`]==null?`<application-id>`:encodeURIComponent(String(e[`application-id`]))}/rollouts`,pathParams:{"application-id":String(e[`application-id`]??``)},bodyKind:`json`,body:e.body===void 0?g({description:_(e.description,`description`,`text`),kind:_(e.kind,`kind`,`text`),percentage:e.percentage,step_percentage:e[`step-percentage`],steps:h(e.steps,`steps`),strategy:_(e.strategy,`strategy`,`text`),target_configuration:{command:e[`target-configuration-command`],entrypoint:e[`target-configuration-entrypoint`],image:_(e[`target-configuration-image`],`target-configuration-image`,`text`),instance_type:_(e[`target-configuration-instance-type`],`target-configuration-instance-type`,`text`),observability:{logs:{enabled:e[`target-configuration-observability-logs-enabled`]}}}}):m(e.body)});return}let t=await r(e),a=e.local?n:await o();if(e.accountId=a,e.body){let n=m(e.body);l(await d(`Creating`,async()=>t.containers.applications.rollouts.create({...n,account_id:a,application_id:e[`application-id`]})),{successLabel:`Created`});return}e.description===void 0&&(e.description=await v(`description`,`Description of the rollout process.`)),e.strategy===void 0&&(e.strategy=await y(`strategy`,`Strategy used for the rollout. - "rolling": Step-based rollout with health gates. Actively replaces instances to reach each step's target percentage. - "new_instances": Percentage control over version distribution. Version sync actively replaces instances to match the configured percentage. The "full_auto" kind advances through fixed percentage targets after target-version health is observed. `,[`rolling`,`new_instances`]));let s=g({description:_(e.description,`description`,`text`),kind:_(e.kind,`kind`,`text`),percentage:e.percentage,step_percentage:e[`step-percentage`],steps:h(e.steps,`steps`),strategy:_(e.strategy,`strategy`,`text`),target_configuration:{command:e[`target-configuration-command`],entrypoint:e[`target-configuration-entrypoint`],image:_(e[`target-configuration-image`],`target-configuration-image`,`text`),instance_type:_(e[`target-configuration-instance-type`],`target-configuration-instance-type`,`text`),observability:{logs:{enabled:e[`target-configuration-observability-logs-enabled`]}}}});l(await d(`Creating`,async()=>t.containers.applications.rollouts.create({...s,account_id:a,application_id:e[`application-id`]})),{successLabel:`Created`})})},se={command:`rollouts`,describe:`Manage rollouts for scheduler-backed applications`,builder:e=>e.command(oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ce(e){return e.usage('$0 containers applications versions list\n\nReturns all versions for a scheduler-backed application with `scheduling_policy: "default"`. Versions and rollouts do not apply to applications with `scheduling_policy: "durable_object"`.').option(`application-id`,{type:`string`,description:`An Application ID represents an identifier of an application.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const le={command:`list`,describe:`List all application versions`,builder:ce,handler:async e=>p({command:`containers applications versions list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){u({command:`cf containers applications versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/containers/applications/${e[`application-id`]==null?`<application-id>`:encodeURIComponent(String(e[`application-id`]))}/versions`,pathParams:{"application-id":String(e[`application-id`]??``)},bodyKind:`none`});return}let t=await r(e),a=e.local?n:await o();e.accountId=a,l(await d(`Loading`,async()=>t.containers.applications.versions.list({account_id:a,application_id:e[`application-id`]})),{successLabel:`Loaded`})})},ue={command:`versions`,describe:`Inspect versions of scheduler-backed applications`,builder:e=>e.command(le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},de={command:`applications`,describe:`Manage Containers applications`,builder:e=>e.command(V).command(U).command(G).command(q).command(ie).command(ne).command(se).command(ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};async function Q(){let t=await s(),n=await o(),r={compliance_region:await a()};return O.HEADERS=c(),T(n,t,e(r)),{accountId:n,complianceConfig:r}}function fe(e){return e.positional(`image`,{type:`string`,demandOption:!0,description:`Image and tag to delete, of the form IMAGE:TAG`}).option(`force`,{type:`boolean`,alias:`f`,default:!1,description:`Skip the deletion confirmation prompt`})}var pe=f({command:`delete <image>`,describe:`Delete an image tag from the Cloudflare managed registry`,builder:fe,async handler(e){if(e.local)throw Error("--local is not supported with `cf containers images delete`.");if(j(e.image),!await b({force:e.force,message:`Delete ${e.image}? This action cannot be undone.`}))return;let n=await Q(),r=await d(`Deleting`,()=>te({...n,image:e.image}));l({image:e.image,...r},{quiet:e.quiet}),r.warning&&console.warn(t(r.warning))}},{command:`containers images delete`,classification:{safeFlags:[`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}});function me(e){return e.option(`filter`,{type:`string`,description:`Regex to filter repository names`})}var he=f({command:`list`,describe:`List images in the Cloudflare managed registry`,builder:me,async handler(e){if(e.local)throw Error("--local is not supported with `cf containers images list`.");e.filter!==void 0&&new RegExp(e.filter);let t=await Q();l(await d(`Loading`,()=>w({...t,filter:e.filter})),{quiet:e.quiet})}},{command:`containers images list`,classification:{safeFlags:[]}});function ge(e){return e.usage(`$0 containers images prepare
|
|
64
|
-
|
|
65
|
-
Idempotently starts or observes preparation of the runtime artifacts required to run one digest-pinned managed container image on Cloudflare's network. Returns 202 while durable preparation continues and 200 when the image is ready or preparation has reached a terminal error.`).option(`image`,{type:`string`,description:`Image url.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A digest-pinned managed container image to prepare for the new runtime.`})}const _e={command:`prepare`,describe:`Prepare a container image`,builder:ge,handler:async e=>p({command:`containers images prepare`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){u({command:`cf containers images prepare`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/containers/image-preparations`,pathParams:{},bodyKind:`json`,body:e.body===void 0?g({image:_(e.image,`image`,`text`)}):m(e.body)});return}let t=await r(e),a=e.local?n:await o();if(e.accountId=a,e.body){let n=m(e.body);l(await d(`Creating`,async()=>t.containers.images.prepare({...n,account_id:a})),{successLabel:`Created`});return}e.image===void 0&&(e.image=await v(`image`,`Image url.`));let s=g({image:_(e.image,`image`,`text`)});l(await d(`Creating`,async()=>t.containers.images.prepare({...s,account_id:a})),{successLabel:`Created`})})},ve={command:`images`,describe:`Operations for images`,builder:e=>e.command(pe).command(he).command(_e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ye(e){return e.usage(`$0 containers registries create
|
|
66
|
-
|
|
67
|
-
Registers credentials for a supported private external image registry so Containers can pull images from it. This endpoint does not create a registry or upload an image. Public Docker Hub images and images in the Cloudflare managed registry do not require this configuration. Refer to [Image management](https://developers.cloudflare.com/containers/platform-details/image-management/) for supported registries and instructions for storing registry credentials.`).option(`auth-private-credential-secret-name`,{type:`string`,description:`Name of the secret within the store.`}).option(`auth-private-credential-store-id`,{type:`string`,description:`Identifier of the Secrets Store containing the secret.`}).option(`auth-public-credential`,{type:`string`,description:`The non-secret part of the registry credential: an AWS access key ID for ECR,
|
|
68
|
-
a username for Docker Hub, or a service account email for Google Artifact Registry.
|
|
69
|
-
`}).option(`domain`,{type:`string`,description:"Hostname of the private registry, without a scheme or image path. Supported\nhostnames are `docker.io`, AWS ECR hostnames, and Google Artifact Registry\n`*-docker.pkg.dev` hostnames.\n"}).option(`is-public`,{type:`boolean`,description:`Omit this field or set it to \`false\`. Public Docker Hub images do not require
|
|
70
|
-
registry configuration and cannot be added with this endpoint.
|
|
71
|
-
`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Configuration for connecting Containers to a supported private external image registry. See [Image management](https://developers.cloudflare.com/containers/platform-details/image-management/) for supported providers and credential setup instructions. `})}const be={command:`create`,describe:`Configure a private external image registry`,builder:ye,handler:async e=>p({command:`containers registries create`,classification:{safeFlags:[`is-public`,`dry-run`]}},e,async()=>{if(e.dryRun){u({command:`cf containers registries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/containers/registries`,pathParams:{},bodyKind:`json`,body:e.body===void 0?g({auth:{private_credential:{secret_name:_(e[`auth-private-credential-secret-name`],`auth-private-credential-secret-name`,`text`),store_id:_(e[`auth-private-credential-store-id`],`auth-private-credential-store-id`,`text`)},public_credential:_(e[`auth-public-credential`],`auth-public-credential`,`text`)},domain:_(e.domain,`domain`,`text`),is_public:e[`is-public`]}):m(e.body)});return}let t=await r(e),a=e.local?n:await o();if(e.accountId=a,e.body){let n=m(e.body);l(await d(`Creating`,async()=>t.containers.registries.create({...n,account_id:a})),{successLabel:`Created`});return}e[`auth-private-credential-secret-name`]===void 0&&(e[`auth-private-credential-secret-name`]=await v(`auth-private-credential-secret-name`,`Name of the secret within the store.`)),e[`auth-private-credential-store-id`]===void 0&&(e[`auth-private-credential-store-id`]=await v(`auth-private-credential-store-id`,`Identifier of the Secrets Store containing the secret.`)),e[`auth-public-credential`]===void 0&&(e[`auth-public-credential`]=await v(`auth-public-credential`,`The non-secret part of the registry credential: an AWS access key ID for ECR, a username for Docker Hub, or a service account email for Google Artifact Registry. `)),e.domain===void 0&&(e.domain=await v(`domain`,"Hostname of the private registry, without a scheme or image path. Supported hostnames are `docker.io`, AWS ECR hostnames, and Google Artifact Registry `*-docker.pkg.dev` hostnames. "));let s=g({auth:{private_credential:{secret_name:_(e[`auth-private-credential-secret-name`],`auth-private-credential-secret-name`,`text`),store_id:_(e[`auth-private-credential-store-id`],`auth-private-credential-store-id`,`text`)},public_credential:_(e[`auth-public-credential`],`auth-public-credential`,`text`)},domain:_(e.domain,`domain`,`text`),is_public:e[`is-public`]});l(await d(`Creating`,async()=>t.containers.registries.create({...s,account_id:a})),{successLabel:`Created`})})};function $(e){return e.usage(`$0 containers registries credentials generate <domain>
|
|
72
|
-
|
|
73
|
-
Generates credentials for accessing a configured container image registry.`).positional(`domain`,{type:`string`,description:`The domain to get credentials for.`,demandOption:!0}).option(`expiration-minutes`,{type:`number`,description:`The number of minutes Cloudflare managed registry credentials stay valid. Required for managed registries and must remain positive. Cloudflare ignores this value for external registries.`}).option(`permissions`,{type:`string`,array:!0,description:`The permissions for Cloudflare managed registry credentials. Required for managed registries. Cloudflare ignores this value for external registries.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Specifies the configuration for the image registry credential to create. Cloudflare requires both fields for managed registries. For external registries, Cloudflare ignores both fields, and the registry provider determines the returned credentials' permissions and lifetime.`})}const xe={command:`generate <domain>`,describe:`Generate a JWT to interact with the specified image registry.`,builder:$,handler:async e=>p({command:`containers registries credentials generate`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){u({command:`cf containers registries credentials generate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/containers/registries/${e.domain==null?`<domain>`:encodeURIComponent(String(e.domain))}/credentials`,pathParams:{domain:String(e.domain??``)},bodyKind:`json`,body:e.body===void 0?g({expiration_minutes:e[`expiration-minutes`],permissions:e.permissions}):m(e.body)});return}let t=await r(e),a=e.local?n:await o();if(e.accountId=a,e.body){let n=m(e.body);l(await d(`Creating`,async()=>t.containers.registries.credentials.generate({...n,account_id:a,domain:e.domain})),{successLabel:`Created`});return}let s=g({expiration_minutes:e[`expiration-minutes`],permissions:e.permissions});l(await d(`Creating`,async()=>t.containers.registries.credentials.generate({...s,account_id:a,domain:e.domain})),{successLabel:`Created`})})},Se={command:`credentials`,describe:`Generate image registry credentials`,builder:e=>e.command(xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ce(e){return e.usage(`$0 containers registries delete <domain>
|
|
74
|
-
|
|
75
|
-
Delete a registry from the account, this will prevent Containers from pulling images from the registry.`).positional(`domain`,{type:`string`,description:`The domain to delete.`,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 we={command:`delete <domain>`,describe:`Delete a registry from the account`,builder:Ce,handler:async e=>p({command:`containers registries delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){u({command:`cf containers registries delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/containers/registries/${e.domain==null?`<domain>`:encodeURIComponent(String(e.domain))}`,pathParams:{domain:String(e.domain??``)},bodyKind:`none`});return}let t=await r(e),a=e.local?n:await o();if(e.accountId=a,!await b({force:!!e.force,message:`This operation deletes the registry configuration. Containers will no longer be able to pull images from it.`})){process.stderr.write(`Aborted.
|
|
76
|
-
`);return}l(await d(`Deleting`,async()=>t.containers.registries.delete({account_id:a,domain:e.domain})),{successLabel:`Deleted`})})};function Te(e){return e.usage(`$0 containers registries list
|
|
77
|
-
|
|
78
|
-
Get the list of configured registries in the account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ee={command:`list`,describe:`Get the list of configured registries in the account`,builder:Te,handler:async e=>p({command:`containers registries list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){u({command:`cf containers registries list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/containers/registries`,pathParams:{},bodyKind:`none`});return}let t=await r(e),a=e.local?n:await o();e.accountId=a,l(await d(`Loading`,async()=>t.containers.registries.list({account_id:a})),{successLabel:`Loaded`})})},De={command:`registries`,describe:`Manage Containers image registries`,builder:e=>e.command(be).command(we).command(Ee).command(Se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Oe={command:`containers`,describe:`Deploy and manage Containers applications on Cloudflare's global network`,builder:e=>e.command(N).command(F).command(z).command(de).command(ve).command(De).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Oe as default};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{n as e}from"./auth-Br-t8vL_.mjs";import{i as t}from"./context-CquYYyS3.mjs";import{t as n}from"./output-ClYel9WX.mjs";import{t as r}from"./dry-run-p9Q7nMZ5.mjs";import{t as i}from"./progress-TLUEIYE6.mjs";import{t as a}from"./run-iFM5TxtQ.mjs";import"./telemetry-DoBQOGRk.mjs";import{n as o,t as s}from"./body-parser-NjzJZMOV.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 e(o),s=await t({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 e(c),l=await t({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};
|
package/dist/d1-B2duXfH2.mjs
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-rYpzEQb-.mjs";import{n as t}from"./auth-Br-t8vL_.mjs";import{n}from"./resolve-CGKqk7q8.mjs";import{a as r,t as i}from"./context-CquYYyS3.mjs";import{t as a}from"./output-ClYel9WX.mjs";import{t as o}from"./dry-run-p9Q7nMZ5.mjs";import{t as s}from"./progress-TLUEIYE6.mjs";import{n as c,t as l}from"./run-iFM5TxtQ.mjs";import"./telemetry-DoBQOGRk.mjs";import{n as u,r as d,t as f}from"./body-parser-NjzJZMOV.mjs";import{n as p}from"./input-validation-0CeePPHp.mjs";import{a as m,i as ee,n as h,t as g}from"./prompt-Ck_1PCHm.mjs";import{t as te}from"./cli-types-_Kmwfpnp.mjs";import _ from"node:fs";import v from"node:path";const y=(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`,re=`\0COMMA`+Math.random()+`\0`,ie=`\0PERIOD`+Math.random()+`\0`,ae=new RegExp(x,`g`),oe=new RegExp(S,`g`),se=new RegExp(C,`g`),ce=new RegExp(re,`g`),le=new RegExp(ie,`g`),ue=/\\\\/g,de=/\\{/g,fe=/\\}/g,pe=/\\,/g,me=/\\\./g;function w(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function he(e){return e.replace(ue,x).replace(de,S).replace(fe,C).replace(pe,re).replace(me,ie)}function ge(e){return e.replace(ae,`\\`).replace(oe,`{`).replace(se,`}`).replace(ce,`,`).replace(le,`.`)}function T(e){if(!e)return[``];let t=[],n=y(`{`,`}`,e);if(!n)return e.split(`,`);let{pre:r,body:i,post:a}=n,o=r.split(`,`);o[o.length-1]+=`{`+i+`}`;let s=T(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(he(e),n,!0).map(ge)}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=y(`{`,`}`,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=T(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=w(d[0]),n=w(d[1]),r=Math.max(d[0].length,d[1].length),i=d.length===3&&d[2]!==void 0?Math.max(Math.abs(w(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 ee=d.length-1,h=e.length-u;for(let e of d)e[1]=h-(m[ee--]+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=v.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:v.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=_.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:v.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`${_.readFileSync(v.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(!n(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(!_.existsSync(a.migrationsPath))throw Error(`No migrations directory at ${a.migrationsPath}.`+(r.dir===void 0?` Pass --dir to point at one.`:``));return{client:await t(r),accountId:r.local?e:await i(),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 g(`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(!_.existsSync(t.migrationsPath)){if(!await g(`No migrations folder found.\nOk to create ${t.migrationsPath}?`))throw Error(`No migrations folder present at ${t.migrationsPath}.`);_.mkdirSync(t.migrationsPath,{recursive:!0})}let s=v.join(t.migrationsPath,i);_.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 n=>l({command:`d1 create`,classification:{safeFlags:[`jurisdiction`,`primary-location-hint`,`read-replication-mode`,`dry-run`]}},n,async()=>{if(n.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:n.body===void 0?f({jurisdiction:p(n.jurisdiction,`jurisdiction`,`text`),name:p(n.name,`name`,`text`),primary_location_hint:p(n[`primary-location-hint`],`primary-location-hint`,`text`),read_replication:{mode:p(n[`read-replication-mode`],`read-replication-mode`,`text`)}}):u(n.body)});return}let c=await t(n),l=n.local?e:await i();if(n.accountId=l,n.body){let e=u(n.body);a(await s(`Creating`,async()=>c.d1.create({...e,account_id:l})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await m(`name`,`D1 database name.`));let d=f({jurisdiction:p(n.jurisdiction,`jurisdiction`,`text`),name:p(n.name,`name`,`text`),primary_location_hint:p(n[`primary-location-hint`],`primary-location-hint`,`text`),read_replication:{mode:p(n[`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 n=>l({command:`d1 delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){o({command:`cf d1 delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/d1/database/${n[`database-id`]==null?`<database-id>`:encodeURIComponent(String(n[`database-id`]))}`,pathParams:{"database-id":String(n[`database-id`]??``)},bodyKind:`none`});return}let c=await t(n),l=n.local?e:await i();if(n.accountId=l,!await h({force:!!n.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:n[`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 n=>l({command:`d1 edit`,classification:{safeFlags:[`read-replication-mode`,`dry-run`]}},n,async()=>{if(n.dryRun){o({command:`cf d1 edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/d1/database/${n[`database-id`]==null?`<database-id>`:encodeURIComponent(String(n[`database-id`]))}`,pathParams:{"database-id":String(n[`database-id`]??``)},bodyKind:`json`,body:n.body===void 0?f({read_replication:{mode:p(n[`read-replication-mode`],`read-replication-mode`,`text`)}}):u(n.body)});return}let c=await t(n),l=n.local?e:await i();if(n.accountId=l,n.body){let e=u(n.body);a(await s(`Updating`,async()=>c.d1.edit({...e,account_id:l,database_id:n[`database-id`]})),{successLabel:`Updated`});return}let d=f({read_replication:{mode:p(n[`read-replication-mode`],`read-replication-mode`,`text`)}});a(await s(`Updating`,async()=>c.d1.edit({...d,account_id:l,database_id:n[`database-id`]})),{successLabel:`Updated`})})};function jt(e){return e.usage(`$0 d1 get <database-id>
|
|
26
|
-
|
|
27
|
-
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,
|
|
28
|
-
all fields are returned.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Mt={command:`get <database-id>`,describe:`Get D1 Database`,builder:te(jt),handler:async n=>l({command:`d1 get`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let c={fields:n.fields};if(n.dryRun){o({command:`cf d1 get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/d1/database/${n[`database-id`]==null?`<database-id>`:encodeURIComponent(String(n[`database-id`]))}`,pathParams:{"database-id":String(n[`database-id`]??``)},query:c,bodyKind:`none`});return}let l=await t(n),u=n.local?e:await i();n.accountId=u,a(await s(`Loading`,async()=>l.d1.get({account_id:u,database_id:n[`database-id`],...c})),{successLabel:`Loaded`})})};function Nt(e){return e.usage(`$0 d1 list
|
|
29
|
-
|
|
30
|
-
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 Pt={command:`list`,describe:`List D1 Databases`,builder:Nt,handler:async n=>l({command:`d1 list`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let c={name:n.name,page:n.page,per_page:n[`per-page`]};if(n.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 t(n),u=n.local?e:await i();n.accountId=u,a(await s(`Loading`,async()=>l.d1.list({account_id:u,...c})),{successLabel:`Loaded`})})};function Ft(e){return e.usage(`$0 d1 query <database-id>
|
|
31
|
-
|
|
32
|
-
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 It={command:`query <database-id>`,describe:`Query D1 Database`,builder:Ft,handler:async n=>l({command:`d1 query`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){o({command:`cf d1 query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/d1/database/${n[`database-id`]==null?`<database-id>`:encodeURIComponent(String(n[`database-id`]))}/query`,pathParams:{"database-id":String(n[`database-id`]??``)},bodyKind:`json`,body:n.body===void 0?f({params:n.params,sql:p(n.sql,`sql`,`text`),batch:d(n.batch,`batch`)}):u(n.body)});return}let c=await t(n),l=n.local?e:await i();if(n.accountId=l,n.body){let e=u(n.body);a(await s(`Loading`,async()=>c.d1.query({body:e,account_id:l,database_id:n[`database-id`]})),{successLabel:`Loaded`});return}let m=f({params:n.params,sql:p(n.sql,`sql`,`text`),batch:d(n.batch,`batch`)});a(await s(`Loading`,async()=>c.d1.query({body:m,account_id:l,database_id:n[`database-id`]})),{successLabel:`Loaded`})})};function Lt(e){return e.usage(`$0 d1 raw <database-id>
|
|
33
|
-
|
|
34
|
-
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 Rt={command:`raw <database-id>`,describe:`Raw D1 Database query`,builder:Lt,handler:async n=>l({command:`d1 raw`,classification:{safeFlags:[`dry-run`]}},n,async()=>{if(n.dryRun){o({command:`cf d1 raw`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/d1/database/${n[`database-id`]==null?`<database-id>`:encodeURIComponent(String(n[`database-id`]))}/raw`,pathParams:{"database-id":String(n[`database-id`]??``)},bodyKind:`json`,body:n.body===void 0?f({params:n.params,sql:p(n.sql,`sql`,`text`),batch:d(n.batch,`batch`)}):u(n.body)});return}let c=await t(n),l=n.local?e:await i();if(n.accountId=l,n.body){let e=u(n.body);a(await s(`Loading`,async()=>c.d1.raw({body:e,account_id:l,database_id:n[`database-id`]})),{successLabel:`Loaded`});return}let m=f({params:n.params,sql:p(n.sql,`sql`,`text`),batch:d(n.batch,`batch`)});a(await s(`Loading`,async()=>c.d1.raw({body:m,account_id:l,database_id:n[`database-id`]})),{successLabel:`Loaded`})})};function zt(e){return e.usage(`$0 d1 time-travel get-bookmark <database-id>
|
|
35
|
-
|
|
36
|
-
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 Bt={command:`get-bookmark <database-id>`,describe:`Get D1 database bookmark`,builder:zt,handler:async n=>l({command:`d1 time-travel get-bookmark`,classification:{safeFlags:[`dry-run`]}},n,async()=>{let c={timestamp:n.timestamp};if(n.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/${n[`database-id`]==null?`<database-id>`:encodeURIComponent(String(n[`database-id`]))}/time_travel/bookmark`,pathParams:{"database-id":String(n[`database-id`]??``)},query:c,bodyKind:`none`});return}let l=await t(n),u=n.local?e:await i();n.accountId=u,a(await s(`Loading`,async()=>l.d1.timeTravel.getBookmark({account_id:u,database_id:n[`database-id`],...c})),{successLabel:`Loaded`})})};function Vt(e){return e.usage(`$0 d1 time-travel restore <database-id>
|
|
37
|
-
|
|
38
|
-
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 Ht={command:`restore <database-id>`,describe:`Restore D1 Database to a bookmark or point in time`,builder:Vt,handler:async n=>l({command:`d1 time-travel restore`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{let c={bookmark:n.bookmark,timestamp:n.timestamp};if(n.dryRun){o({command:`cf d1 time-travel restore`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/d1/database/${n[`database-id`]==null?`<database-id>`:encodeURIComponent(String(n[`database-id`]))}/time_travel/restore`,pathParams:{"database-id":String(n[`database-id`]??``)},query:c,bodyKind:`none`});return}let l=await t(n),u=n.local?e:await i();if(n.accountId=u,!await h({force:!!n.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.
|
|
39
|
-
`);return}a(await s(`Deleting`,async()=>l.d1.timeTravel.restore({account_id:u,database_id:n[`database-id`],...c})),{successLabel:`Deleted`})})},Ut={command:`time-travel`,describe:`use specific point-in-time backups of your D1 database`,builder:e=>e.command(Bt).command(Ht).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Wt(e){return e.usage(`$0 d1 update <database-id>
|
|
40
|
-
|
|
41
|
-
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 Gt={command:`update <database-id>`,describe:`Update D1 Database`,builder:Wt,handler:async n=>l({command:`d1 update`,classification:{safeFlags:[`read-replication-mode`,`dry-run`]}},n,async()=>{if(n.dryRun){o({command:`cf d1 update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await r()??`<account-id>`}/d1/database/${n[`database-id`]==null?`<database-id>`:encodeURIComponent(String(n[`database-id`]))}`,pathParams:{"database-id":String(n[`database-id`]??``)},bodyKind:`json`,body:n.body===void 0?f({read_replication:{mode:p(n[`read-replication-mode`],`read-replication-mode`,`text`)}}):u(n.body)});return}let c=await t(n),l=n.local?e:await i();if(n.accountId=l,n.body){let e=u(n.body);a(await s(`Updating`,async()=>c.d1.update({...e,account_id:l,database_id:n[`database-id`]})),{successLabel:`Updated`});return}n[`read-replication-mode`]===void 0&&(n[`read-replication-mode`]=await ee(`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(n[`read-replication-mode`],`read-replication-mode`,`text`)}});a(await s(`Updating`,async()=>c.d1.update({...d,account_id:l,database_id:n[`database-id`]})),{successLabel:`Updated`})})},Kt={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(Gt).command(wt).command(Ut).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Kt as default};
|
package/dist/deploy-BdWBEbLj.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{n as e,t}from"./shared-BqsWoApw.mjs";function n(t){return e(t).option(`dispatch-namespace`,{type:`string`,description:`Name of a dispatch namespace to deploy the Worker to (Workers for Platforms)`,requiresArg:!0}).option(`containers-rollout`,{description:`Rollout strategy for Container changes. Immediate rolls out to all instances in one step; none leaves deployed Containers unchanged.`,choices:[`immediate`,`gradual`,`none`]})}const r={command:`deploy`,describe:`Deploy a worker to Cloudflare`,builder:n,handler:async e=>{await t(e,{command:`Deploy`})}};export{r as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{s as e}from"./build-DrG6TqMw.mjs";import{existsSync as t,readFileSync as n,statSync as r}from"node:fs";import{dirname as i,join as a,sep as o}from"node:path";const s={esm:`esm`,cjs:`commonjs`,python:`python`,"python-requirement":`python-requirement`,wasm:`compiled-wasm`,text:`text`,data:`buffer`,json:`text`};function c(e,t,n,r,a){let o=process.cwd(),s=t.main??``;return{entry:{file:s,projectRoot:o,configPath:e.configPath,format:`modules`,moduleRoot:s?i(s):e.bundleDir??``,exports:[]},name:e.config.name,compatibilityDate:t.compatibility_date,compatibilityFlags:t.compatibility_flags??[],assetsDir:p(e,t),main:t.main??void 0,keepVars:t.keep_vars??!1,dryRun:r[`dry-run`],env:void 0,outfile:void 0,tag:r.tag,message:r.message,secretsFile:r[`secrets-file`],experimentalAutoCreate:!0,accountId:n,sendMetrics:!1,resourcesProvision:!0,skipProvisioningConfigWriteback:!0,skipLastDeployedFromApiCheck:!1,containers:a,cliVars:{},isWorkersSite:!1,useServiceEnvApiPath:!1}}function l(e,t,n,r,i){return{...c(e,t,n,r,i),command:`deploy`,containersRollout:r[`containers-rollout`],triggers:t.triggers?.crons,routes:f(t),logpush:t.logpush,dispatchNamespace:r[`dispatch-namespace`],strict:!0,legacyAssetPaths:void 0,oldAssetTtl:void 0}}function u(e,t,n,r,i){return{...c(e,t,n,r,i),command:`versions upload`,strict:!0,previewAlias:r[`preview-alias`]}}function d(e,t,n,r){return{config:t,accountId:n,scriptName:t.name??e.config.name,crons:t.triggers?.crons,routes:f(t),firstDeploy:!1,dryRun:r[`dry-run`],validated:!1}}function f(e){return e.routes?e.routes:e.route?[e.route]:[]}function p(t,n){let r=t.assetsDir;if(!r)return;let i=!!n.main,a=n.assets?.run_worker_first;if(!i&&a)throw new e(`assets.run_worker_first requires a Worker entrypoint, but no main module is configured.`);return{directory:r,binding:n.assets?.binding,directoryExists:!0}}function m(i,o){if(!o.manifest||!i.bundleDir)return{modules:[],sourceMaps:void 0,dependencies:{},resolvedEntryPointPath:``,bundleType:`esm`,content:``};let{mainModule:c,modules:l}=o.manifest;h(c,i.bundleDir);let u=a(i.bundleDir,c);if(!t(u))throw new e(`Main module not found: ${u}`);let d=l?.[c]?.type??`esm`;if(d===`sourcemap`)throw new e(`Main module "${c}" cannot be a sourcemap.`);let f=n(u,`utf8`),p=s[d],m=[],g=[],_={};if(_[u]={bytesInOutput:r(u).size},l)for(let[o,u]of Object.entries(l)){if(o===c)continue;h(o,i.bundleDir);let l=a(i.bundleDir,o);if(u.type===`sourcemap`){if(!t(l))throw new e(`Module not found: ${l}`);g.push({name:o,content:n(l,`utf8`)});continue}if(!t(l))throw new e(`Module not found: ${l}`);let d=u.type===`wasm`||u.type===`data`?n(l):n(l,`utf8`);m.push({name:`./${o}`,filePath:l,content:d,type:s[u.type]}),_[l]={bytesInOutput:r(l).size}}return{modules:m,sourceMaps:g.length>0?g:void 0,dependencies:_,resolvedEntryPointPath:u,bundleType:p,content:f}}function h(t,n){let r=a(n,t);if(r!==n&&!r.startsWith(n+o))throw new e(`Module path "${t}" escapes the bundle directory.`)}export{u as i,l as n,d as r,m as t};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-rYpzEQb-.mjs";import{n as t}from"./auth-Br-t8vL_.mjs";import{a as n,t as r}from"./context-CquYYyS3.mjs";import{t as i}from"./output-ClYel9WX.mjs";import{t as a}from"./dry-run-p9Q7nMZ5.mjs";import{t as o}from"./progress-TLUEIYE6.mjs";import{t as s}from"./run-iFM5TxtQ.mjs";import"./telemetry-DoBQOGRk.mjs";import{n as c,t as l}from"./body-parser-NjzJZMOV.mjs";import{n as u}from"./input-validation-0CeePPHp.mjs";import{a as d,i as f,n as p}from"./prompt-Ck_1PCHm.mjs";function m(e){return e.usage(`$0 diagnostics endpoint-healthchecks create
|
|
3
|
-
|
|
4
|
-
Create Endpoint Health Check.`).option(`check-type`,{type:`string`,description:`type of check to perform`,choices:[`icmp`],default:`icmp`}).option(`endpoint`,{type:`string`,description:`the IP address of the host to perform checks against`}).option(`name`,{type:`string`,description:`Optional name associated with this check`}).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:`Endpoint Health Check`,builder:m,handler:async p=>s({command:`diagnostics endpoint-healthchecks create`,classification:{safeFlags:[`check-type`,`dry-run`]}},p,async()=>{if(p.dryRun){a({command:`cf diagnostics endpoint-healthchecks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/diagnostics/endpoint-healthchecks`,pathParams:{},bodyKind:`json`,body:p.body===void 0?l({check_type:u(p[`check-type`],`check-type`,`text`),endpoint:u(p.endpoint,`endpoint`,`text`),name:u(p.name,`name`,`text`)}):c(p.body)});return}let s=await t(p),m=p.local?e:await r();if(p.accountId=m,p.body){let e=c(p.body);i(await o(`Creating`,async()=>s.diagnostics.endpointHealthchecks.create({body:e,account_id:m})),{successLabel:`Created`});return}p[`check-type`]===void 0&&(p[`check-type`]=await f(`check-type`,`type of check to perform`,[`icmp`])),p.endpoint===void 0&&(p.endpoint=await d(`endpoint`,`the IP address of the host to perform checks against`));let h=l({check_type:u(p[`check-type`],`check-type`,`text`),endpoint:u(p.endpoint,`endpoint`,`text`),name:u(p.name,`name`,`text`)});i(await o(`Creating`,async()=>s.diagnostics.endpointHealthchecks.create({body:h,account_id:m})),{successLabel:`Created`})})};function g(e){return e.usage(`$0 diagnostics endpoint-healthchecks delete <id>
|
|
5
|
-
|
|
6
|
-
Delete Endpoint Health Check.`).positional(`id`,{type:`string`,description:`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 _={command:`delete <id>`,describe:`Delete Endpoint Health Check`,builder:g,handler:async c=>s({command:`diagnostics endpoint-healthchecks delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf diagnostics endpoint-healthchecks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/diagnostics/endpoint-healthchecks/${c.id==null?`<id>`:encodeURIComponent(String(c.id))}`,pathParams:{id:String(c.id??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();if(c.accountId=l,!await p({force:!!c.force})){process.stderr.write(`Aborted.
|
|
7
|
-
`);return}i(await o(`Deleting`,async()=>s.diagnostics.endpointHealthchecks.delete({account_id:l,id:c.id})),{successLabel:`Deleted`})})};function v(e){return e.usage(`$0 diagnostics endpoint-healthchecks get <id>
|
|
8
|
-
|
|
9
|
-
Get a single Endpoint Health Check.`).positional(`id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <id>`,describe:`Get Endpoint Health Check`,builder:v,handler:async c=>s({command:`diagnostics endpoint-healthchecks get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf diagnostics endpoint-healthchecks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/diagnostics/endpoint-healthchecks/${c.id==null?`<id>`:encodeURIComponent(String(c.id))}`,pathParams:{id:String(c.id??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l,i(await o(`Loading`,async()=>s.diagnostics.endpointHealthchecks.get({account_id:l,id:c.id})),{successLabel:`Loaded`})})};function b(e){return e.usage(`$0 diagnostics endpoint-healthchecks list
|
|
10
|
-
|
|
11
|
-
List Endpoint Health Checks.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`List Endpoint Health Checks`,builder:b,handler:async c=>s({command:`diagnostics endpoint-healthchecks list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf diagnostics endpoint-healthchecks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/diagnostics/endpoint-healthchecks`,pathParams:{},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l,i(await o(`Loading`,async()=>s.diagnostics.endpointHealthchecks.list({account_id:l})),{successLabel:`Loaded`})})};function S(e){return e.usage(`$0 diagnostics endpoint-healthchecks update <id>
|
|
12
|
-
|
|
13
|
-
Update a Endpoint Health Check.`).positional(`id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`check-type`,{type:`string`,description:`type of check to perform`,choices:[`icmp`]}).option(`endpoint`,{type:`string`,description:`the IP address of the host to perform checks against`}).option(`name`,{type:`string`,description:`Optional name associated with this check`}).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:`update <id>`,describe:`Update Endpoint Health Check`,builder:S,handler:async p=>s({command:`diagnostics endpoint-healthchecks update`,classification:{safeFlags:[`check-type`,`dry-run`]}},p,async()=>{if(p.dryRun){a({command:`cf diagnostics endpoint-healthchecks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/diagnostics/endpoint-healthchecks/${p.id==null?`<id>`:encodeURIComponent(String(p.id))}`,pathParams:{id:String(p.id??``)},bodyKind:`json`,body:p.body===void 0?l({check_type:u(p[`check-type`],`check-type`,`text`),endpoint:u(p.endpoint,`endpoint`,`text`),name:u(p.name,`name`,`text`)}):c(p.body)});return}let s=await t(p),m=p.local?e:await r();if(p.accountId=m,p.body){let e=c(p.body);i(await o(`Updating`,async()=>s.diagnostics.endpointHealthchecks.update({body:e,account_id:m,id:p.id})),{successLabel:`Updated`});return}p[`check-type`]===void 0&&(p[`check-type`]=await f(`check-type`,`type of check to perform`,[`icmp`])),p.endpoint===void 0&&(p.endpoint=await d(`endpoint`,`the IP address of the host to perform checks against`));let h=l({check_type:u(p[`check-type`],`check-type`,`text`),endpoint:u(p.endpoint,`endpoint`,`text`),name:u(p.name,`name`,`text`)});i(await o(`Updating`,async()=>s.diagnostics.endpointHealthchecks.update({body:h,account_id:m,id:p.id})),{successLabel:`Updated`})})},w={command:`endpoint-healthchecks`,describe:`Monitor external endpoint availability with periodic HTTP/HTTPS health checks`,builder:e=>e.command(h).command(_).command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.usage(`$0 diagnostics traceroutes create
|
|
14
|
-
|
|
15
|
-
Run traceroutes from Cloudflare colos.`).option(`colos`,{type:`string`,array:!0,description:`If no source colo names specified, all colos will be used. China colos are unavailable for traceroutes.`}).option(`options-max-ttl`,{type:`number`,description:`Max TTL.`}).option(`options-packet-type`,{type:`string`,description:`Type of packet sent.`,choices:[`icmp`,`tcp`,`udp`,`gre`,`gre+icmp`]}).option(`options-packets-per-ttl`,{type:`number`,description:`Number of packets sent at each TTL.`}).option(`options-port`,{type:`number`,description:`For UDP and TCP, specifies the destination port. For ICMP, specifies the initial ICMP sequence value. Default value 0 will choose the best value to use for each protocol.`}).option(`options-wait-time`,{type:`number`,description:`Set the time (in seconds) to wait for a response to a probe.`}).option(`targets`,{type:`string`,array:!0,description:`The targets field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const E={command:`create`,describe:`Traceroute`,builder:T,handler:async d=>s({command:`diagnostics traceroutes create`,classification:{safeFlags:[`options-packet-type`,`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf diagnostics traceroutes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/diagnostics/traceroute`,pathParams:{},bodyKind:`json`,body:d.body===void 0?l({colos:d.colos,options:{max_ttl:d[`options-max-ttl`],packet_type:u(d[`options-packet-type`],`options-packet-type`,`text`),packets_per_ttl:d[`options-packets-per-ttl`],port:d[`options-port`],wait_time:d[`options-wait-time`]},targets:d.targets}):c(d.body)});return}let s=await t(d),f=d.local?e:await r();if(d.accountId=f,d.body){let e=c(d.body);i(await o(`Creating`,async()=>s.diagnostics.traceroutes.create({...e,account_id:f})),{successLabel:`Created`});return}if(d.targets===void 0)throw Error(`--targets is required (or pass --body with this field set).`);let p=l({colos:d.colos,options:{max_ttl:d[`options-max-ttl`],packet_type:u(d[`options-packet-type`],`options-packet-type`,`text`),packets_per_ttl:d[`options-packets-per-ttl`],port:d[`options-port`],wait_time:d[`options-wait-time`]},targets:d.targets});i(await o(`Creating`,async()=>s.diagnostics.traceroutes.create({...p,account_id:f})),{successLabel:`Created`})})},D={command:`traceroutes`,describe:`Run traceroutes from Cloudflare data centers to diagnose network path issues`,builder:e=>e.command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},O={command:`diagnostics`,describe:`Network diagnostic tools — traceroutes from Cloudflare's edge and endpoint health checks`,builder:e=>e.command(w).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{O as default};
|
package/dist/dialog-Dpi-UVbz.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./cli-exit-Dqoo6Jgb.mjs";import{M as t,n}from"./interactive-D80kbTap.mjs";import{i as r,o as i,t as a}from"./dist-Cpb7_h4N.mjs";async function o(r,i){if(n())return i.fallbackValue??!1;let o=await a({message:r,initialValue:i.defaultValue,output:i.output});if(t(o))throw new e(130,{cancelled:!0});return o}async function s(r,a={}){if(n()){if(a.fallbackValue===void 0)throw Error(a.fallbackError);return a.fallbackValue}for(;;){let n=await i({message:r,defaultValue:a.defaultValue,initialValue:a.initialValue,placeholder:a.placeholder,output:a.output});if(t(n))throw new e(130,{cancelled:!0});let o=await a.validate?.(n);if(o===void 0||o===!0)return n;console.error(o===!1?`Invalid value`:o)}}async function c(i,a){if(n()){let e=a.fallbackOption??a.defaultOption??0,t=a.choices[e]??a.choices[0];if(!t)throw Error(a.fallbackError??`select() called with no choices`);return t.value}let o=await r({message:i,options:a.choices.map(e=>({label:e.title,value:e.value,hint:e.description})),initialValue:a.choices[a.defaultOption??0]?.value,output:a.output});if(t(o))throw new e(130,{cancelled:!0});return o}export{s as n,c as r,o as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{existsSync as e,readFileSync as t}from"node:fs";import{join as n}from"node:path";import{homedir as r}from"node:os";import{execFileSync as i}from"node:child_process";function a(t){return r=>{if(!r.pkgRoot)return null;let i=n(r.pkgRoot,`bin`,t);return e(i)?i:null}}function o(){let t=n(process.env.CARGO_HOME??n(r(),`.cargo`),`bin`,`cloudflare-rs-dev-server`);return e(t)?t:null}const s=[{ecosystem:`npm`,pkg:`@cloudflare/vite-plugin`,versionConstraint:{range:`>=2.0.0-0 <3.0.0-0`,display:`@cloudflare/vite-plugin v2 beta`},description:`Vite-based dev server (recommended for JavaScript/TypeScript)`,manifest:`package.json`,binary:a(`cf-vite`),installHint:`npm install --save-dev @cloudflare/vite-plugin@beta`},{ecosystem:`npm`,pkg:`wrangler`,fallback:!0,versionConstraint:{range:`>=4.136.0`,display:`wrangler@4.136.0 or newer`},description:`Wrangler-based dev server (legacy Worker projects)`,manifest:`package.json`,binary:a(`cf-wrangler.js`),installHint:`npm install --save-dev wrangler@latest`},{ecosystem:`pypi`,pkg:`cloudflare-py-dev-server`,description:`Python dev server (Pyodide via workerd)`,manifest:`pyproject.toml`,binary:()=>null,installHint:`pip install cloudflare-py-dev-server (or: uv add --dev cloudflare-py-dev-server)`},{ecosystem:`cargo`,pkg:`cloudflare-rs-dev-server`,description:`Rust dev server (wasm-bindgen + workerd)`,manifest:`Cargo.toml`,binary:o,installHint:`cargo install cloudflare-rs-dev-server`}];function c(e){return s.find(t=>t.pkg===e)}function l(e){let t=[];t.push(...u(e)),t.push(...m(e)),t.push(...v(e));let n=t.filter(e=>!e.impl.fallback);return n.length>0?n:t}function u(r){let i=n(r,`package.json`);if(!e(i))return[];let a;try{let e=t(i,`utf-8`);a=JSON.parse(e)}catch{return[]}let o=d(a),s=[];for(let e of o){let t=c(e);if(!t||t.ecosystem!==`npm`)continue;let n=f(r,e),a=n?t.binary({cwd:r,pkgRoot:n}):null,o=n?p(n):void 0;s.push({impl:t,binary:a,installed:!!n,installedVersion:o,manifestPath:i})}return s}function d(e){let t=new Set;for(let n of[`dependencies`,`devDependencies`,`peerDependencies`,`optionalDependencies`]){let r=e[n];if(r&&typeof r==`object`)for(let e of Object.keys(r))t.add(e)}return t}function f(t,r){if(e(n(t,`node_modules`,r,`package.json`)))return n(t,`node_modules`,r)}function p(e){try{let r=JSON.parse(t(n(e,`package.json`),`utf8`));return typeof r.version==`string`?r.version:void 0}catch{return}}function m(r){let i=n(r,`pyproject.toml`);if(!e(i))return[];let a;try{a=t(i,`utf-8`)}catch{return[]}let o=[];for(let e of h()){if(!g(a,e.pkg))continue;let t=_(r,e.pkg);o.push({impl:e,binary:t,manifestPath:i})}return o}function h(){let e=[],t=new Set;for(let n of b())n.ecosystem===`pypi`&&!t.has(n.pkg)&&(e.push(n),t.add(n.pkg));return e}function g(e,t){let n=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return RegExp(`["']${n}(?=[\\s\\[<>=!~"';])`,`m`).test(e)}function _(t,r){if(e(n(t,`uv.lock`)))return`uv:${r}`;try{let n=i(`python3`,[`-c`,`import shutil, sys; p = shutil.which(${JSON.stringify(r)}); sys.stdout.write(p or "")`],{cwd:t,stdio:[`ignore`,`pipe`,`ignore`],encoding:`utf-8`}).trim();if(n&&e(n))return n}catch{}return null}function v(r){let i=n(r,`Cargo.toml`);if(!e(i))return[];let a;try{a=t(i,`utf-8`)}catch{return[]}let o=[];for(let e of b()){if(e.ecosystem!==`cargo`||!y(a,e.pkg))continue;let t=e.binary({cwd:r});o.push({impl:e,binary:t,manifestPath:i})}return o}function y(e,t){let n=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return RegExp(`(^\\s*${n}\\s*=)|(^\\s*\\[[^\\]]*\\.${n}\\s*\\])`,`m`).test(e)}function b(){return s}export{s as n,l as t};
|
package/dist/dist-Cpb7_h4N.mjs
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{N as e}from"./interactive-D80kbTap.mjs";import"node:fs";import"node:path";import t,{stdin as n,stdout as r}from"node:process";import{ReadStream as i}from"node:tty";import{styleText as a}from"node:util";import*as o from"node:readline";import s from"node:readline";const c=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let n=0;for(e.lastIndex=0;e.test(t);)n+=1;return t.length-n}})(),l=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,u=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141,d=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,f=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,p=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,m=/\t{1,1000}/y,h=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,g=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,_=/\p{M}+/gu,v={limit:1/0,ellipsis:``},y=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?y(i,v,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,b=n.emojiWidth??2,x=n.regularWidth??1,S=n.wideWidth??2,C=[[g,x],[d,0],[f,o],[m,s],[h,b],[p,S]],w=0,T=0,E=e.length,D=0,O=!1,k=E,A=Math.max(0,r-a),j=0,M=0,N=0,P=0;outer:for(;;){if(M>j||T>=E&&T>w){let t=e.slice(j,M)||e.slice(w,T);D=0;for(let e of t.replaceAll(_,``)){let t=e.codePointAt(0)||0;if(P=l(t)?2:u(t)?S:x,N+P>A&&(k=Math.min(k,Math.max(j,w)+D)),N+P>r){O=!0;break outer}D+=e.length,N+=P}j=M=0}if(T>=E)break outer;for(let t=0,n=C.length;t<n;t++){let[n,i]=C[t];if(n.lastIndex=T,n.test(e)){if(D=n===p?c(e.slice(T,n.lastIndex)):n===h?1:n.lastIndex-T,P=D*i,N+P>A&&(k=Math.min(k,T+Math.floor((A-N)/i))),N+P>r){O=!0;break outer}N+=P,j=w,M=T,T=w=n.lastIndex;continue outer}}T+=1}return{width:O?A:N,index:O?k:E,truncated:O,ellipsed:O&&r>=a}},b={limit:1/0,ellipsis:``,ellipsisWidth:0},x=(e,t={})=>y(e,b,t).width,S=`]8;;`,C=RegExp(`(?:\\[(?<code>\\d+)m|\\${S}(?<uri>.*))`,`y`),w=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},T=e=>`[${e}m`,E=e=>`${S}${e}`,D=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:x(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=x(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===``)&&(i=!0,a=t.startsWith(S,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length&&e.length>1&&(e[e.length-2]+=e.pop())},O=e=>{let t=e.split(` `),n=t.length;for(;n&&!x(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},k=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=[``],c=0;for(let e=0;e<o.length;e++){let r=o[e];if(n.trim!==!1){let e=s.at(-1)??``,t=e.trimStart();e.length!==t.length&&(s[s.length-1]=t,c=x(t))}e!==0&&(c>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),c=0),(c||n.trim===!1)&&(s[s.length-1]+=` `,c++));let i=x(r);if(n.hard&&i>t){let e=t-c,n=1+Math.floor((i-e-1)/t);Math.floor((i-1)/t)<n&&s.push(``),D(s,r,t),c=x(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){D(s,r,t),c=x(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){D(s,r,t),c=x(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>O(e)));let l=s.join(`
|
|
3
|
-
`),u=!1;for(let e=0;e<l.length;e++){let t=l[e];if(r+=t,u)u=!1;else if(u=t>=`\ud800`&&t<=`\udbff`,u)continue;if(t===`\x1B`||t===``){C.lastIndex=e+1;let t=C.exec(l)?.groups;if(t?.code!==void 0){let e=Number.parseFloat(t.code);i=e===39?void 0:e}else t?.uri!==void 0&&(a=t.uri.length===0?void 0:t.uri)}if(l[e+1]===`
|
|
4
|
-
`){a&&(r+=E(``));let e=i?w(i):void 0;i&&e&&(r+=T(e))}else t===`
|
|
5
|
-
`&&(i&&w(i)&&(r+=T(i)),a&&(r+=E(a)))}return r},A=/\r?\n/;function j(e,t,n){return String(e).normalize().split(A).map(e=>k(e,t,n)).join(`
|
|
6
|
-
`)}var M=e();function N(e,t,n){if(!n.some(e=>!e.disabled))return e;let r=e+t,i=Math.max(n.length-1,0),a=r<0?i:r>i?0:r;return n[a].disabled?N(a,t<0?-1:1,n):a}const P={actions:new Set([`up`,`down`,`left`,`right`,`space`,`enter`,`cancel`]),aliases:new Map([[`k`,`up`],[`j`,`down`],[`h`,`left`],[`l`,`right`],[``,`cancel`],[`escape`,`cancel`]]),messages:{cancel:`Canceled`,error:`Something went wrong`},withGuide:!0,date:{monthNames:[...[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]],messages:{required:`Please enter a valid date`,invalidMonth:`There are only 12 months in a year`,invalidDay:(e,t)=>`There are only ${e} days in ${t}`,afterMin:e=>`Date must be on or after ${e.toISOString().slice(0,10)}`,beforeMax:e=>`Date must be on or before ${e.toISOString().slice(0,10)}`}}};function F(e,t){if(typeof e==`string`)return P.aliases.get(e)===t;for(let n of e)if(n!==void 0&&F(n,t))return!0;return!1}function ee(e,t){if(e===t)return;let n=e.split(`
|
|
7
|
-
`),r=t.split(`
|
|
8
|
-
`),i=Math.max(n.length,r.length),a=[];for(let e=0;e<i;e++)n[e]!==r[e]&&a.push(e);return{lines:a,numLinesBefore:n.length,numLinesAfter:r.length,numLines:i}}const te=globalThis.process.platform.startsWith(`win`),ne=Symbol(`clack:cancel`);function I(e,t){let n=e;n.isTTY&&n.setRawMode(t)}function re({input:e=n,output:t=r,overwrite:a=!0,hideCursor:s=!0}={}){let c=o.createInterface({input:e,output:t,prompt:``,tabSize:1});o.emitKeypressEvents(e,c),e instanceof i&&e.isTTY&&e.setRawMode(!0);let l=(n,{name:r,sequence:i})=>{if(F([String(n),r,i],`cancel`)){s&&t.write(M.cursor.show),process.exit(0);return}if(!a)return;let c=r===`return`?0:-1,u=r===`return`?-1:0;o.moveCursor(t,c,u,()=>{o.clearLine(t,1,()=>{e.once(`keypress`,l)})})};return s&&t.write(M.cursor.hide),e.once(`keypress`,l),()=>{e.off(`keypress`,l),s&&t.write(M.cursor.show),e instanceof i&&e.isTTY&&!te&&e.setRawMode(!1),c.terminal=!1,c.close()}}const L=e=>`columns`in e&&typeof e.columns==`number`?e.columns:80,R=e=>`rows`in e&&typeof e.rows==`number`?e.rows:20;function z(e,t,n,i=n,a=n,o){return j(t,L(e??r)-n.length,{hard:!0,trim:!1}).split(`
|
|
9
|
-
`).map((e,t,r)=>{let s=o?o(e,t):e;return t===0?`${i}${s}`:t===r.length-1?`${a}${s}`:`${n}${s}`}).join(`
|
|
10
|
-
`)}function ie(e,t){if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw TypeError("Schema validation must be synchronous. Update `validate()` and remove any asynchronous logic.");return n.issues?.at(0)?.message}return e(t)}var B=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame=``;_subscribers=new Map;_cursor=0;state=`initial`;error=``;value;userInput=``;constructor(e,t=!0){let{input:i=n,output:a=r,render:o,signal:s,...c}=e;this.opts=c,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=o.bind(this),this._track=t,this._abortSignal=s,this.input=i,this.output=a}unsubscribe(){this._subscribers.clear()}setSubscriber(e,t){let n=this._subscribers.get(e)??[];n.push(t),this._subscribers.set(e,n)}on(e,t){this.setSubscriber(e,{cb:t})}once(e,t){this.setSubscriber(e,{cb:t,once:!0})}emit(e,...t){let n=this._subscribers.get(e)??[],r=[];for(let e of n)e.cb(...t),e.once&&r.push(()=>n.splice(n.indexOf(e),1));for(let e of r)e()}prompt(){return new Promise(e=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state=`cancel`,this.close(),e(ne);this._abortSignal.addEventListener(`abort`,()=>{this.state=`cancel`,this.close()},{once:!0})}this.rl=s.createInterface({input:this.input,tabSize:2,prompt:``,escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on(`keypress`,this.onKeypress),I(this.input,!0),this.output.on(`resize`,this.render),this.render(),this.once(`submit`,()=>{this.output.write(M.cursor.show),this.output.off(`resize`,this.render),I(this.input,!1),e(this.value)}),this.once(`cancel`,()=>{this.output.write(M.cursor.show),this.output.off(`resize`,this.render),I(this.input,!1),e(ne)})})}_isActionKey(e,t){return e===` `}_shouldSubmit(e,t){return!0}_setValue(e){this.value=e,this.emit(`value`,this.value)}_setUserInput(e,t){this.userInput=e??``,this.emit(`userInput`,this.userInput),t&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:`u`}),this._setUserInput(``)}onKeypress(e,t){if(this._track&&t.name!==`return`&&(t.name&&this._isActionKey(e,t)&&this.rl?.write(null,{ctrl:!0,name:`h`}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state===`error`&&(this.state=`active`),t?.name&&(!this._track&&P.aliases.has(t.name)&&this.emit(`cursor`,P.aliases.get(t.name)),P.actions.has(t.name)&&this.emit(`cursor`,t.name)),e&&(e.toLowerCase()===`y`||e.toLowerCase()===`n`)&&this.emit(`confirm`,e.toLowerCase()===`y`),this.emit(`key`,e,t),t?.name===`return`&&this._shouldSubmit(e,t)){if(this.opts.validate){let e=ie(this.opts.validate,this.value);e&&(this.error=e instanceof Error?e.message:e,this.state=`error`,this.rl?.write(this.userInput))}this.state!==`error`&&(this.state=`submit`)}F([e,t?.name,t?.sequence],`cancel`)&&(this.state=`cancel`),(this.state===`submit`||this.state===`cancel`)&&this.emit(`finalize`),this.render(),(this.state===`submit`||this.state===`cancel`)&&this.close()}close(){this.input.unpipe(),this.input.removeListener(`keypress`,this.onKeypress),this.output.write(`
|
|
11
|
-
`),I(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=j(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
|
|
12
|
-
`).length-1;this.output.write(M.cursor.move(-999,e*-1))}render(){let e=j(this._render(this)??``,process.stdout.columns,{hard:!0,trim:!1});if(e!==this._prevFrame){if(this.state===`initial`)this.output.write(M.cursor.hide);else{let t=ee(this._prevFrame,e),n=R(this.output);if(this.restoreCursor(),t){let r=Math.max(0,t.numLinesAfter-n),i=Math.max(0,t.numLinesBefore-n),a=t.lines.find(e=>e>=r);if(a===void 0){this._prevFrame=e;return}if(t.lines.length===1){this.output.write(M.cursor.move(0,a-i)),this.output.write(M.erase.lines(1));let t=e.split(`
|
|
13
|
-
`);this.output.write(t[a]),this._prevFrame=e,this.output.write(M.cursor.move(0,t.length-a-1));return}else if(t.lines.length>1){if(r<i)a=r;else{let e=a-i;e>0&&this.output.write(M.cursor.move(0,e))}this.output.write(M.erase.down());let t=e.split(`
|
|
14
|
-
`).slice(a);this.output.write(t.join(`
|
|
15
|
-
`)),this._prevFrame=e;return}}this.output.write(M.erase.down())}this.output.write(e),this.state===`initial`&&(this.state=`active`),this._prevFrame=e}}},ae=class extends B{get cursor(){return+!this.value}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on(`userInput`,()=>{this.value=this._value}),this.on(`confirm`,e=>{this.output.write(M.cursor.move(0,-1)),this.value=e,this.state=`submit`,this.close()}),this.on(`cursor`,()=>{this.value=!this.value})}},oe=class extends B{_mask=`•`;get cursor(){return this._cursor}get masked(){return this.userInput.replaceAll(/./g,this._mask)}get userInputWithCursor(){if(this.state===`submit`||this.state===`cancel`)return this.masked;let e=this.userInput;if(this.cursor>=e.length)return`${this.masked}${a([`inverse`,`hidden`],`_`)}`;let t=this.masked,n=t.slice(0,this.cursor),r=t.slice(this.cursor);return`${n}${a(`inverse`,r[0])}${r.slice(1)}`}clear(){this._clearUserInput()}constructor({mask:e,...t}){super(t),this._mask=e??`•`,this.on(`userInput`,e=>{this._setValue(e)})}},se=class extends B{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(e){super(e,!1),this.options=e.options;let t=this.options.findIndex(({value:t})=>t===e.initialValue),n=t===-1?0:t;this.cursor=this.options[n].disabled?N(n,1,this.options):n,this.changeValue(),this.on(`cursor`,e=>{switch(e){case`left`:case`up`:this.cursor=N(this.cursor,-1,this.options);break;case`down`:case`right`:this.cursor=N(this.cursor,1,this.options);break}this.changeValue()})}},ce=class extends B{get userInputWithCursor(){if(this.state===`submit`)return this.userInput;let e=this.userInput;if(this.cursor>=e.length)return`${this.userInput}\u2588`;let t=e.slice(0,this.cursor),[n,...r]=e.slice(this.cursor);return`${t}${a(`inverse`,n)}${r.join(``)}`}get cursor(){return this._cursor}constructor(e){super({...e,initialUserInput:e.initialUserInput??e.initialValue}),this.on(`userInput`,e=>{this._setValue(e)}),this.on(`finalize`,()=>{this.value||=e.defaultValue,this.value===void 0&&(this.value=``)})}};function le(){return t.platform===`win32`?!!t.env.CI||!!t.env.WT_SESSION||!!t.env.TERMINUS_SUBLIME||t.env.ConEmuTask===`{cmd::Cmder}`||t.env.TERM_PROGRAM===`Terminus-Sublime`||t.env.TERM_PROGRAM===`vscode`||t.env.TERM===`xterm-256color`||t.env.TERM===`alacritty`||t.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:t.env.TERM!==`linux`}const V=le(),ue=()=>process.env.CI===`true`,H=(e,t)=>V?e:t,de=H(`◆`,`*`),U=H(`■`,`x`),W=H(`▲`,`x`),G=H(`◇`,`o`),K=H(`│`,`|`),q=H(`└`,`—`),J=H(`●`,`>`),Y=H(`○`,` `),fe=H(`▪`,`•`),pe=H(`●`,`•`),me=H(`◆`,`*`),he=H(`▲`,`!`),ge=H(`■`,`x`),X=e=>{switch(e){case`initial`:case`active`:return a(`cyan`,de);case`cancel`:return a(`red`,U);case`error`:return a(`yellow`,W);case`submit`:return a(`green`,G)}},_e=e=>{switch(e){case`initial`:case`active`:return a(`cyan`,K);case`cancel`:return a(`red`,K);case`error`:return a(`yellow`,K);case`submit`:return a(`green`,K)}},Z=(e,t,n,r,i,a=!1)=>{let o=t,s=0;if(a)for(let t=r-1;t>=n&&(o-=e[t].length,s++,!(o<=i));t--);else for(let t=n;t<r&&(o-=e[t].length,s++,!(o<=i));t++);return{lineCount:o,removals:s}},ve=({cursor:e,options:t,style:n,output:r=process.stdout,maxItems:i=1/0,columnPadding:o=0,rowPadding:s=4})=>{let c=L(r)-o,l=R(r),u=a(`dim`,`...`),d=Math.max(l-s,0),f=Math.max(Math.min(i,d),5),p=0;e>=f-3&&(p=Math.max(Math.min(e-f+3,t.length-f),0));let m=f<t.length&&p>0,h=f<t.length&&p+f<t.length,g=Math.min(p+f,t.length),_=[],v=0;m&&v++,h&&v++;let y=p+ +!!m,b=g-+!!h;for(let r=y;r<b;r++){let i=j(n(t[r],r===e),c,{hard:!0,trim:!1}).split(`
|
|
16
|
-
`);_.push(i),v+=i.length}if(v>d){let t=0,n=0,r=v,i=e-y,a=d,o=()=>Z(_,r,0,i,a),s=()=>Z(_,r,i+1,_.length,a,!0);m?({lineCount:r,removals:t}=o(),r>a&&(h||--a,{lineCount:r,removals:n}=s())):(h||--a,{lineCount:r,removals:n}=s(),r>a&&(--a,{lineCount:r,removals:t}=o())),t>0&&(m=!0,_.splice(0,t)),n>0&&(h=!0,_.splice(_.length-n,n))}let x=[];m&&x.push(u);for(let e of _)for(let t of e)x.push(t);return h&&x.push(u),x},ye=e=>{let t=e.active??`Yes`,n=e.inactive??`No`;return new ae({active:t,inactive:n,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue??!0,render(){let r=e.withGuide??P.withGuide,i=`${X(this.state)} `,o=r?`${a(`gray`,K)} `:``,s=z(e.output,e.message,o,i),c=`${r?`${a(`gray`,K)}
|
|
17
|
-
`:``}${s}
|
|
18
|
-
`,l=this.value?t:n;switch(this.state){case`submit`:return`${c}${r?`${a(`gray`,K)} `:``}${a(`dim`,l)}`;case`cancel`:return`${c}${r?`${a(`gray`,K)} `:``}${a([`strikethrough`,`dim`],l)}${r?`
|
|
19
|
-
${a(`gray`,K)}`:``}`;default:{let i=r?`${a(`cyan`,K)} `:``,o=r?a(`cyan`,q):``;return`${c}${i}${this.value?`${a(`green`,J)} ${t}`:`${a(`dim`,Y)} ${a(`dim`,t)}`}${e.vertical?r?`
|
|
20
|
-
${a(`cyan`,K)} `:`
|
|
21
|
-
`:` ${a(`dim`,`/`)} `}${this.value?`${a(`dim`,Y)} ${a(`dim`,n)}`:`${a(`green`,J)} ${n}`}
|
|
22
|
-
${o}
|
|
23
|
-
`}}}}).prompt()},Q={message:(e=[],{symbol:t=a(`gray`,K),secondarySymbol:n=a(`gray`,K),output:r=process.stdout,spacing:i=1,withGuide:o}={})=>{let s=[],c=o??P.withGuide,l=c?n:``,u=c?`${t} `:``,d=c?`${n} `:``;for(let e=0;e<i;e++)s.push(l);let f=Array.isArray(e)?e:e.split(`
|
|
24
|
-
`);if(f.length>0){let[e,...r]=f;e.length>0?s.push(`${u}${e}`):s.push(c?t:``);for(let e of r)e.length>0?s.push(`${d}${e}`):s.push(c?n:``)}r.write(`${s.join(`
|
|
25
|
-
`)}
|
|
26
|
-
`)},info:(e,t)=>{Q.message(e,{...t,symbol:a(`blue`,pe)})},success:(e,t)=>{Q.message(e,{...t,symbol:a(`green`,me)})},step:(e,t)=>{Q.message(e,{...t,symbol:a(`green`,G)})},warn:(e,t)=>{Q.message(e,{...t,symbol:a(`yellow`,he)})},warning:(e,t)=>{Q.warn(e,t)},error:(e,t)=>{Q.message(e,{...t,symbol:a(`red`,ge)})}},be=e=>new oe({validate:e.validate,mask:e.mask??fe,signal:e.signal,input:e.input,output:e.output,render(){let t=e.withGuide??P.withGuide,n=`${t?`${a(`gray`,K)}
|
|
27
|
-
`:``}${X(this.state)} ${e.message}
|
|
28
|
-
`,r=this.userInputWithCursor,i=this.masked;switch(this.state){case`error`:{let r=t?`${a(`yellow`,K)} `:``,o=t?`${a(`yellow`,q)} `:``,s=i??``;return e.clearOnError&&this.clear(),`${n.trim()}
|
|
29
|
-
${r}${s}
|
|
30
|
-
${o}${a(`yellow`,this.error)}
|
|
31
|
-
`}case`submit`:return`${n}${t?`${a(`gray`,K)} `:``}${i?a(`dim`,i):``}`;case`cancel`:return`${n}${t?`${a(`gray`,K)} `:``}${i?a([`strikethrough`,`dim`],i):``}${i&&t?`
|
|
32
|
-
${a(`gray`,K)}`:``}`;default:return`${n}${t?`${a(`cyan`,K)} `:``}${r}
|
|
33
|
-
${t?a(`cyan`,q):``}
|
|
34
|
-
`}}}).prompt(),xe=e=>a(`magenta`,e),Se=({indicator:e=`dots`,onCancel:t,output:n=process.stdout,cancelMessage:r,errorMessage:i,frames:o=V?[`◒`,`◐`,`◓`,`◑`]:[`•`,`o`,`O`,`0`],delay:s=V?80:120,signal:c,...l}={})=>{let u=ue(),d,f,p=!1,m=!1,h=``,g,_=performance.now(),v=L(n),y=l?.styleFrame??xe,b=e=>{let n=e>1?i??P.messages.error:r??P.messages.cancel;m=e===1,p&&(A(n,e),m&&typeof t==`function`&&t())},x=()=>b(2),S=()=>b(1),C=()=>{process.on(`uncaughtExceptionMonitor`,x),process.on(`unhandledRejection`,x),process.on(`SIGINT`,S),process.on(`SIGTERM`,S),process.on(`exit`,b),c&&c.addEventListener(`abort`,S)},w=()=>{process.removeListener(`uncaughtExceptionMonitor`,x),process.removeListener(`unhandledRejection`,x),process.removeListener(`SIGINT`,S),process.removeListener(`SIGTERM`,S),process.removeListener(`exit`,b),c&&c.removeEventListener(`abort`,S)},T=()=>{if(g===void 0)return;u&&n.write(`
|
|
35
|
-
`);let e=j(g,v,{hard:!0,trim:!1}).split(`
|
|
36
|
-
`);e.length>1&&n.write(M.cursor.up(e.length-1)),n.write(M.cursor.to(0)),n.write(M.erase.down())},E=e=>e.replace(/\.+$/,``),D=e=>{let t=(performance.now()-e)/1e3,n=Math.floor(t/60),r=Math.floor(t%60);return n>0?`[${n}m ${r}s]`:`[${r}s]`},O=l.withGuide??P.withGuide,k=(t=``)=>{p=!0,d=re({output:n}),h=E(t),_=performance.now(),O&&n.write(`${a(`gray`,K)}
|
|
37
|
-
`);let r=0,i=0;C(),f=setInterval(()=>{if(u&&h===g)return;T(),g=h;let t=y(o[r]),a;if(u)a=`${t} ${h}...`;else if(e===`timer`)a=`${t} ${h} ${D(_)}`;else{let e=`.`.repeat(Math.floor(i)).slice(0,3);a=`${t} ${h}${e}`}let s=j(a,v,{hard:!0,trim:!1});n.write(s),r=r+1<o.length?r+1:0,i=i<4?i+.125:0},s)},A=(t=``,r=0,i=!1)=>{if(!p)return;p=!1,clearInterval(f),T();let o=r===0?a(`green`,G):r===1?a(`red`,U):a(`red`,W);h=t??h,i||(e===`timer`?n.write(`${o} ${h} ${D(_)}
|
|
38
|
-
`):n.write(`${o} ${h}
|
|
39
|
-
`)),w(),d()};return{start:k,stop:(e=``)=>A(e,0),message:(e=``)=>{h=E(e??h)},cancel:(e=``)=>A(e,1),error:(e=``)=>A(e,2),clear:()=>A(``,0,!0),get isCancelled(){return m}}},$=(e,t)=>e.includes(`
|
|
40
|
-
`)?e.split(`
|
|
41
|
-
`).map(e=>t(e)).join(`
|
|
42
|
-
`):t(e),Ce=e=>{let t=(e,t)=>{let n=e.label??String(e.value);switch(t){case`disabled`:return`${a(`gray`,Y)} ${$(n,e=>a(`gray`,e))}${e.hint?` ${a(`dim`,`(${e.hint??`disabled`})`)}`:``}`;case`selected`:return`${$(n,e=>a(`dim`,e))}`;case`active`:return`${a(`green`,J)} ${n}${e.hint?` ${a(`dim`,`(${e.hint})`)}`:``}`;case`cancelled`:return`${$(n,e=>a([`strikethrough`,`dim`],e))}`;default:return`${a(`dim`,Y)} ${$(n,e=>a(`dim`,e))}`}};return new se({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,render(){let n=e.withGuide??P.withGuide,r=`${X(this.state)} `,i=`${_e(this.state)} `,o=z(e.output,e.message,i,r),s=`${n?`${a(`gray`,K)}
|
|
43
|
-
`:``}${o}
|
|
44
|
-
`;switch(this.state){case`submit`:{let r=n?`${a(`gray`,K)} `:``;return`${s}${z(e.output,t(this.options[this.cursor],`selected`),r)}`}case`cancel`:{let r=n?`${a(`gray`,K)} `:``;return`${s}${z(e.output,t(this.options[this.cursor],`cancelled`),r)}${n?`
|
|
45
|
-
${a(`gray`,K)}`:``}`}default:{let r=n?`${a(`cyan`,K)} `:``,i=n?a(`cyan`,q):``,o=s.split(`
|
|
46
|
-
`).length,c=n?2:1;return`${s}${r}${ve({output:e.output,cursor:this.cursor,options:this.options,maxItems:e.maxItems,columnPadding:r.length,rowPadding:o+c,style:(e,n)=>t(e,e.disabled?`disabled`:n?`active`:`inactive`)}).join(`
|
|
47
|
-
${r}`)}
|
|
48
|
-
${i}
|
|
49
|
-
`}}}}).prompt()};`${a(`gray`,K)}`;const we=e=>new ce({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,output:e.output,signal:e.signal,input:e.input,render(){let t=e?.withGuide??P.withGuide,n=`${`${t?`${a(`gray`,K)}
|
|
50
|
-
`:``}${X(this.state)} `}${e.message}
|
|
51
|
-
`,r=e.placeholder?a(`inverse`,e.placeholder[0])+a(`dim`,e.placeholder.slice(1)):a([`inverse`,`hidden`],`_`),i=this.userInput?this.userInputWithCursor:r,o=this.value??``;switch(this.state){case`error`:{let e=this.error?` ${a(`yellow`,this.error)}`:``,r=t?`${a(`yellow`,K)} `:``,o=t?a(`yellow`,q):``;return`${n.trim()}
|
|
52
|
-
${r}${i}
|
|
53
|
-
${o}${e}
|
|
54
|
-
`}case`submit`:{let e=o?` ${a(`dim`,o)}`:``;return`${n}${t?a(`gray`,K):``}${e}`}case`cancel`:{let e=o?` ${a([`strikethrough`,`dim`],o)}`:``,r=t?a(`gray`,K):``;return`${n}${r}${e}${o.trim()?`
|
|
55
|
-
${r}`:``}`}default:return`${n}${t?`${a(`cyan`,K)} `:``}${i}
|
|
56
|
-
${t?a(`cyan`,q):``}
|
|
57
|
-
`}}}).prompt();export{Se as a,Ce as i,Q as n,we as o,be as r,ye as t};
|