cf 1.0.0-beta.30 → 1.0.0-beta.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/_meta/commands.json +2404 -1420
- package/dist/_meta/schemas.json +1875 -956
- package/dist/{abuse-reports-Dzop8iDe.mjs → abuse-reports-DYm1nDLb.mjs} +1 -1
- package/dist/{access-2NeD3Gu8.mjs → access-Be_7nPz4.mjs} +1 -1
- package/dist/{accounts-CeJbhhX4.mjs → accounts-DXULGfnh.mjs} +3 -3
- package/dist/{acm-Dub0B14J.mjs → acm-Btsz5gzV.mjs} +1 -1
- package/dist/{addressing-BzWJU8m6.mjs → addressing-DBQ5dUBd.mjs} +1 -1
- package/dist/{agent-memory-2l9zyQFA.mjs → agent-memory-Df0q-68_.mjs} +1 -1
- package/dist/{ai-laLv3daG.mjs → ai-CJfI9JI2.mjs} +1 -1
- package/dist/{ai-audit-rgNePq5W.mjs → ai-audit-Dv37OLES.mjs} +1 -1
- package/dist/{ai-gateway-e9b8CcL6.mjs → ai-gateway-BRSUY1QZ.mjs} +5 -5
- package/dist/{ai-search-DZ0AqoPe.mjs → ai-search-Bxv4hDG9.mjs} +3 -3
- package/dist/{ai-security-CQuBTtmw.mjs → ai-security-ByNRXyJv.mjs} +1 -1
- package/dist/{alerting-_4ra-f_v.mjs → alerting-UkiCzqAq.mjs} +2 -4
- package/dist/{analytics-DLNn4bJ4.mjs → analytics-B4Wq2vJx.mjs} +1 -1
- package/dist/{analytics-engine-CY45yWuL.mjs → analytics-engine-BbwIXL0f.mjs} +1 -1
- package/dist/{api-security-BSvJAjJV.mjs → api-security-B6YETCDG.mjs} +1 -1
- package/dist/{argo-xzl0p--1.mjs → argo-CHSOLyFh.mjs} +1 -1
- package/dist/{artifacts-DAS14gcM.mjs → artifacts-1xMBpJLr.mjs} +1 -1
- package/dist/{audit-logs-3nYyCGQA.mjs → audit-logs-Cz__6-PH.mjs} +1 -1
- package/dist/auth-Byb5Y3o4.mjs +2 -0
- package/dist/{auth-cj71dGxS.mjs → auth-CRq9OQKr.mjs} +1 -1
- package/dist/{auth-B0mFB6nU.mjs → auth-CrBQca61.mjs} +1 -1
- package/dist/{auth-token-D9MnaZ-L.mjs → auth-token-BEkR6ulS.mjs} +1 -1
- package/dist/{autoconfig-DoLQ5ct8.mjs → autoconfig-BDEt9orA.mjs} +386 -120
- package/dist/{basin-catalog-BbCsAKyZ.mjs → basin-catalog-DRVVY1Ff.mjs} +1 -1
- package/dist/{billing-BsiLsjWJ.mjs → billing-CInp7pBa.mjs} +1 -1
- package/dist/{blocks-DK5qAzLe.mjs → blocks-DGXsHh9X.mjs} +1 -1
- package/dist/{bot-management-DkErOsIO.mjs → bot-management--NcaqMij.mjs} +1 -1
- package/dist/{botnet-feed-CK4_PKrf.mjs → botnet-feed-DbPZ3Wzl.mjs} +1 -1
- package/dist/{brand-protection-Czt-2Ei5.mjs → brand-protection-B3s-8soV.mjs} +2 -2
- package/dist/{browser-run-DLMdEaSJ.mjs → browser-run-B9hyiK7P.mjs} +1 -1
- package/dist/build-Bd56lS7c.mjs +2 -0
- package/dist/{build-DiEXOgHH.mjs → build-I3m3uZn6.mjs} +1 -1
- package/dist/{builds-D--zUbR2.mjs → builds-D0mRyKe3.mjs} +1 -1
- package/dist/{cache-C8PQmkjD.mjs → cache-eKHZG4U7.mjs} +1 -1
- package/dist/{cf-QIG83e0V.mjs → cf-MAiSK--E.mjs} +1 -1
- package/dist/{chunk-DSGVRFIS-CeCM3XGQ.mjs → chunk-DSGVRFIS-L76IWWlr.mjs} +1 -1
- package/dist/{chunk-Q5KVZMHK-Bjvrcihk.mjs → chunk-Q5KVZMHK-CYhKv3kZ.mjs} +1 -1
- package/dist/{cli-BBv5YMan.mjs → cli-hFt2ZEED.mjs} +1 -1
- package/dist/{client-side-security-CFxePUL9.mjs → client-side-security-BvIdcAtV.mjs} +1 -1
- package/dist/{cloud-connector-BitfLQ3s.mjs → cloud-connector-B-04mm0j.mjs} +1 -1
- package/dist/{cloudflared-DKh4JK7j.mjs → cloudflared-DynBXmdP.mjs} +1 -1
- package/dist/{cloudforce-one-D2dzA7VD.mjs → cloudforce-one-BAGybQNM.mjs} +139 -143
- package/dist/command-5bkZXAlq.mjs +2 -0
- package/dist/{command-BORazCDG.mjs → command-BCECG198.mjs} +1 -1
- package/dist/{command-BC_nezLE.mjs → command-BaFQsuac.mjs} +1 -1
- package/dist/{command-C2HYwGn_.mjs → command-BdnTjDyg.mjs} +1 -1
- package/dist/{command-n7QausoH.mjs → command-BkCc_9UI.mjs} +1 -1
- package/dist/{command-B6ustzcW.mjs → command-CQU92hcH.mjs} +1 -1
- package/dist/{command-D5FrTb2N.mjs → command-CdB1DQZl.mjs} +1 -1
- package/dist/{command-DoXuskBZ.mjs → command-CoR-c8lP.mjs} +1 -1
- package/dist/{command-iwrZ2Sb1.mjs → command-D-a4KxcW.mjs} +1 -1
- package/dist/{command-aeKPI1bt.mjs → command-D6wod_eb.mjs} +1 -1
- package/dist/{command-Xqidhyr_.mjs → command-DSPEpZHp.mjs} +1 -1
- package/dist/{command-BwcAuPBr.mjs → command-EG23K_k6.mjs} +1 -1
- package/dist/{command-s15KaL-x.mjs → command-Ux0DLWdC.mjs} +1 -1
- package/dist/{command-CQhD3Q1t.mjs → command-oko8tT2c.mjs} +1 -1
- package/dist/{completions-BAUSggys.mjs → completions-CdlqoV7q.mjs} +1 -1
- package/dist/{connector-interrupts-D9tI84Fk.mjs → connector-interrupts-D9iiu7ZU.mjs} +1 -1
- package/dist/{connector-telemetry-events-Bs9wLYwc.mjs → connector-telemetry-events-C8ouyC4A.mjs} +1 -1
- package/dist/{connector-telemetry-snapshots-CbwE4lrE.mjs → connector-telemetry-snapshots-Ck9btYy7.mjs} +1 -1
- package/dist/{connectors-LyJN1htu.mjs → connectors-kGPYvin5.mjs} +1 -1
- package/dist/{containers-CKs7ZyZq.mjs → containers-DIf9nmcC.mjs} +2 -2
- package/dist/{content-scan-BQRz7C7Z.mjs → content-scan-Cr0i9wJK.mjs} +1 -1
- package/dist/{context-DlFhI9cN.mjs → context-DsVjrTbe.mjs} +1 -1
- package/dist/{cps-DYlXx89C.mjs → cps-BHmMKg5Q.mjs} +1 -1
- package/dist/{csam-scanner-BFANxGD-.mjs → csam-scanner-DGTOi2EL.mjs} +1 -1
- package/dist/{custom-csrs-BX4aCeof.mjs → custom-csrs-DpLkO9_M.mjs} +1 -1
- package/dist/{custom-hostnames-BRYABKN3.mjs → custom-hostnames-beJnRWcQ.mjs} +1 -1
- package/dist/{custom-nameservers-CP1Vf1TD.mjs → custom-nameservers-B1WtaEDH.mjs} +1 -1
- package/dist/{custom-pages-BNL69ToU.mjs → custom-pages-BVXmc-u6.mjs} +1 -1
- package/dist/{d1-D4AZsUKn.mjs → d1-DYQBKGMz.mjs} +1 -1
- package/dist/{delegate-BKlomUk6.mjs → delegate-4bIHEQ8-.mjs} +1 -1
- package/dist/delegate.mjs +1 -1
- package/dist/{deploy-LbXgSfAd.mjs → deploy-DEq6UKzb.mjs} +1 -1
- package/dist/{deploy-context-BYw6gbl-.mjs → deploy-context-DJNsb7w-.mjs} +1 -1
- package/dist/deploy-input-Bkll8tDW.mjs +2 -0
- package/dist/{dev-DaFSd8WC.mjs → dev-DIguZvJE.mjs} +1 -1
- package/dist/{diagnostics-Dk3pyWx_.mjs → diagnostics-DyCPKwXL.mjs} +1 -1
- package/dist/{discover-DGsMj9ZN.mjs → discover-DtcZCeSh.mjs} +1 -1
- package/dist/discover-Dxb5yh9L.mjs +2 -0
- package/dist/{disk-cache-nbuwH1Dh.mjs → disk-cache-BVfJigfC.mjs} +1 -1
- package/dist/{dist-DwxlJ9Ms.mjs → dist-BoDdDWjK.mjs} +33 -33
- package/dist/{dls-DU6EdhQK.mjs → dls-BXGJug7c.mjs} +1 -1
- package/dist/{dns-3QDtCu6f.mjs → dns-Ev7l7p2X.mjs} +25 -25
- package/dist/{dns-firewall-Bbrr_0_a.mjs → dns-firewall-CrkTqlYI.mjs} +1 -1
- package/dist/{docs-lLLKcLr_.mjs → docs-Dx9n33S3.mjs} +1 -1
- package/dist/{durable-objects-DPf1DMeq.mjs → durable-objects-ChKP2Y6u.mjs} +1 -1
- package/dist/{email-auth-DOlEoi8q.mjs → email-auth-B-n1rKim.mjs} +1 -1
- package/dist/{email-routing-D56SPGty.mjs → email-routing-Dfs1g7hk.mjs} +1 -1
- package/dist/{email-security-CSawx0kD.mjs → email-security-B9wpMLHr.mjs} +1 -1
- package/dist/{email-sending-CgFi0cLA.mjs → email-sending-DUyDi24R.mjs} +3 -3
- package/dist/{errors-CilNjDVk.mjs → errors-CUuKkONZ.mjs} +1 -1
- package/dist/{field-extractors-FvIgySB4.mjs → field-extractors-B_R4gU51.mjs} +1 -1
- package/dist/{firewall-BrTvywhW.mjs → firewall-B5_DMZ5c.mjs} +1 -1
- package/dist/{flagship-BGFN1Epo.mjs → flagship-D_jWMrT9.mjs} +1 -1
- package/dist/{fraud-DzK6OIO3.mjs → fraud-BPywqzR5.mjs} +1 -1
- package/dist/{google-tag-gateway-Cd9v8A7Z.mjs → google-tag-gateway-B8SGqWxf.mjs} +1 -1
- package/dist/{healthchecks-Cm7EHaBA.mjs → healthchecks-C1NL0A-K.mjs} +1 -1
- package/dist/{hyperdrive-CVaSt0qX.mjs → hyperdrive-C1C_n591.mjs} +1 -1
- package/dist/{iam-CWN62Mi4.mjs → iam-BWm6OeLJ.mjs} +1 -1
- package/dist/{images-Bo_pdvQC.mjs → images-CU9B4ml9.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{init-Dwmpc_S-.mjs → init-DJGas0DL.mjs} +1 -1
- package/dist/{intel-CQFYeGEA.mjs → intel-COtK2F9g.mjs} +1 -1
- package/dist/{interactive-DCbIwYxy.mjs → interactive-CQ29h7qo.mjs} +1 -1
- package/dist/{ips-jTSzoqMU.mjs → ips-Dv5eyxgM.mjs} +1 -1
- package/dist/{k2-utE2lCYd.mjs → k2-CdhxgeiI.mjs} +1 -1
- package/dist/{kv-Cdh5hHte.mjs → kv-gNSTaGhd.mjs} +1 -1
- package/dist/{lazy-command-QoHlmXHW.mjs → lazy-command-CJcN1Ze6.mjs} +1 -1
- package/dist/{leaked-credential-checks-CqApscD3.mjs → leaked-credential-checks-B222QFHE.mjs} +1 -1
- package/dist/{load-balancers-w_4Uz9Gi.mjs → load-balancers-CM-4BY5q.mjs} +1 -1
- package/dist/{login-CS3KxVbk.mjs → login-Csb8Ld0x.mjs} +1 -1
- package/dist/login-bHCEjxRS.mjs +2 -0
- package/dist/{logpush-C76I5dgN.mjs → logpush-CmothcrK.mjs} +1 -1
- package/dist/{logs-B5aCYVCv.mjs → logs-CnKqBsDl.mjs} +1 -1
- package/dist/{magic-network-monitoring-CGf7cVQ9.mjs → magic-network-monitoring-BEdRTgMa.mjs} +1 -1
- package/dist/{magic-transit-CN5noqOR.mjs → magic-transit-CXjc5Yo4.mjs} +1 -1
- package/dist/{managed-defense-DAGr0UGm.mjs → managed-defense-BuOxTHAO.mjs} +1 -1
- package/dist/{managed-transforms-_SuwzZ-5.mjs → managed-transforms-BlqW4xkh.mjs} +1 -1
- package/dist/{mcp-CzedsjOf.mjs → mcp-ubFVHsP4.mjs} +1 -1
- package/dist/{mesh-DXX1S3pX.mjs → mesh-DQS7KfDF.mjs} +1 -1
- package/dist/{migrate-CvRQ4x3_.mjs → migrate-fY24KHV_.mjs} +1 -1
- package/dist/{monetization-8nt9PYln.mjs → monetization-CagZDoKh.mjs} +1 -1
- package/dist/{network-CaiRDY2e.mjs → network-BB35dF4N.mjs} +1 -1
- package/dist/{network-interconnects-Ad6JbAVd.mjs → network-interconnects-Dy4m1jMu.mjs} +2 -2
- package/dist/{o11y-DD2Hfnzi.mjs → o11y-Dmll3yib.mjs} +4 -4
- package/dist/{oauth-CQRlNgt5.mjs → oauth-Dv7Wucj6.mjs} +1 -1
- package/dist/{oauth-BUcV_xbm.mjs → oauth-NljTb7u9.mjs} +1 -1
- package/dist/observability-rtMYSCht.mjs +4 -0
- package/dist/{ohttp-gateway-Sej9-GCm.mjs → ohttp-gateway-BM3nsC92.mjs} +1 -1
- package/dist/{organizations-DwYsCbYD.mjs → organizations-Xus5102w.mjs} +1 -1
- package/dist/package-BJWSNfbc.mjs +2 -0
- package/dist/{page-rules-CjufEmIt.mjs → page-rules-BKoA5eaf.mjs} +1 -1
- package/dist/{pages-Dj0Cdf3G.mjs → pages-CLhvyehs.mjs} +4 -4
- package/dist/{pay-per-crawl-DPVlluRA.mjs → pay-per-crawl-BLjKJl62.mjs} +1 -1
- package/dist/{pay-per-use-DhuLjaoo.mjs → pay-per-use-FbddmVNv.mjs} +1 -1
- package/dist/{pipelines-D2pM69oq.mjs → pipelines-BsJkvK-K.mjs} +1 -1
- package/dist/{precursor-DzuA1m8D.mjs → precursor-oLj-WPJH.mjs} +1 -1
- package/dist/{previews-CHHd5Rx7.mjs → previews-BRPPf7UU.mjs} +3 -3
- package/dist/{progress-AML-AVs4.mjs → progress-DItBn6ZV.mjs} +1 -1
- package/dist/{prompt-Bnon9lfK.mjs → prompt-BGz3DNLz.mjs} +1 -1
- package/dist/{queues-GDwznw0o.mjs → queues-DAnbmO-t.mjs} +3 -3
- package/dist/{r2-B3Xkb0S4.mjs → r2-DNN91rtN.mjs} +2 -2
- package/dist/{radar-fBT7VIO2.mjs → radar-YWsfV39d.mjs} +150 -150
- package/dist/{raw-fetch-0T1SwPa1.mjs → raw-fetch-CmI3Ol3q.mjs} +1 -1
- package/dist/{realtime-B7mR3XtY.mjs → realtime-CfsgoOsd.mjs} +1 -1
- package/dist/{registrar-DOoxlZc7.mjs → registrar-N1c89kFV.mjs} +1 -1
- package/dist/{registrar-sandbox-DC7xAqqc.mjs → registrar-sandbox-D5lsoy-x.mjs} +1 -1
- package/dist/{reporting-DlD7J6Pq.mjs → reporting-CI5TLvj4.mjs} +1 -1
- package/dist/{request-headers-BEYXy4JN.mjs → request-headers-CUwBDAwI.mjs} +1 -1
- package/dist/{request-tracers-DYCGkszp.mjs → request-tracers-DO63p3ou.mjs} +1 -1
- package/dist/{resource-sharing-D_bUv7E8.mjs → resource-sharing-CxdcY5n1.mjs} +1 -1
- package/dist/{rules-C4cu3_jr.mjs → rules-DuuULmp2.mjs} +1 -1
- package/dist/{rulesets-Bl4mLnXA.mjs → rulesets-3_8IWMfL.mjs} +1 -1
- package/dist/{rum-DE_uJb09.mjs → rum-DkfsMJa7.mjs} +1 -1
- package/dist/run-C9SxROBF.mjs +2 -0
- package/dist/{run-DAg7dfIW.mjs → run-DAK_kbUa.mjs} +1 -1
- package/dist/{schema-cache-CTVUtkAl.mjs → schema-cache-BcbUfb3D.mjs} +1 -1
- package/dist/{scim-Dz4r0fnH.mjs → scim-DCR6AQp5.mjs} +1 -1
- package/dist/{secrets-store-C2GwCUKs.mjs → secrets-store-C3v0_Us9.mjs} +1 -1
- package/dist/{security-insights-DZCm5D3U.mjs → security-insights-0el4fk-S.mjs} +4 -2
- package/dist/security-txt-CcsEaOm5.mjs +8 -0
- package/dist/{session-BEsQIuwP.mjs → session-CgJ6kB79.mjs} +1 -1
- package/dist/shared-DjaJ-SCM.mjs +2 -0
- package/dist/{smart-shield-C2uSFcGN.mjs → smart-shield-BxTEZqtZ.mjs} +1 -1
- package/dist/{snippets-BoaGEAC6.mjs → snippets-CH4PcqCg.mjs} +1 -1
- package/dist/{spawn-B4y5Urjv.mjs → spawn-B681PPG2.mjs} +2 -2
- package/dist/{spectrum-Bb0KXA8R.mjs → spectrum-DconVKYG.mjs} +1 -1
- package/dist/{speed-zKYgLTHA.mjs → speed-Euqtk0Vc.mjs} +1 -1
- package/dist/{sql-pjWozuvl.mjs → sql-UNZoawTj.mjs} +1 -1
- package/dist/{src-B8i6_XGg.mjs → src-CSSFtpQM.mjs} +5 -5
- package/dist/{ssl-C5bg1X0i.mjs → ssl-CGWF2ZSz.mjs} +9 -9
- package/dist/startup-profile-ajl_yZx2.mjs +2 -0
- package/dist/{startup-profile-CyIelqtC.mjs → startup-profile-ne34QxOx.mjs} +1 -1
- package/dist/{state-BI_wSuID.mjs → state-BFClIYM_.mjs} +1 -1
- package/dist/state-V1KLVkd6.mjs +2 -0
- package/dist/{static-assets-CTv7XwIQ.mjs → static-assets-CWo7dxyW.mjs} +164 -164
- package/dist/{stream-C_FiNrLV.mjs → stream-B3tkAx82.mjs} +1 -1
- package/dist/{tags-CXlivF3y.mjs → tags-CKnt6RT6.mjs} +9 -9
- package/dist/telemetry-B3S5OfOn.mjs +2 -0
- package/dist/{telemetry-CtQWhsmy.mjs → telemetry-COJrOM3V.mjs} +1 -1
- package/dist/{tenant-custom-nameservers-DBg9Hzvn.mjs → tenant-custom-nameservers-BdVLeMsA.mjs} +1 -1
- package/dist/{tenants-89Q0u5_Q.mjs → tenants-C8Emd5Ou.mjs} +1 -1
- package/dist/{tunnels-CL2fIINH.mjs → tunnels-vUfvvRWt.mjs} +15 -13
- package/dist/{turnstile-D6GtQULo.mjs → turnstile-D-6e0ShA.mjs} +1 -1
- package/dist/ui-YBIkZLZt.mjs +2 -0
- package/dist/{update-check-0kpbTLvy.mjs → update-check-BW_N6gX4.mjs} +1 -1
- package/dist/{update-check-D3axIoUi.mjs → update-check-CvzNuZHG.mjs} +1 -1
- package/dist/update-check-worker.mjs +1 -1
- package/dist/{url-normalization--iS57OT_.mjs → url-normalization-Bfj-1zgi.mjs} +1 -1
- package/dist/{url-scanner-C6AtXGc2.mjs → url-scanner-CcZzqvrj.mjs} +1 -1
- package/dist/{user-C5vRYIta.mjs → user-CYHyVzic.mjs} +1 -1
- package/dist/{vectorize-C1Kxb1Ou.mjs → vectorize-69UvmqNI.mjs} +1 -1
- package/dist/version-5uL0ecbB.mjs +2 -0
- package/dist/{waiting-rooms-BCVZY9vI.mjs → waiting-rooms-Dj92gXpa.mjs} +1 -1
- package/dist/{web-assets-D2gXqKZS.mjs → web-assets-vbQ0MSCd.mjs} +1 -1
- package/dist/{web3-CJDZQCOk.mjs → web3-0Sz4gIto.mjs} +1 -1
- package/dist/{whoami-BEad9QUB.mjs → whoami-C4xRnPxf.mjs} +3 -3
- package/dist/whoami-wYc70ks4.mjs +2 -0
- package/dist/{workers-DzXSJMv9.mjs → workers-BQM8pUYu.mjs} +18 -18
- package/dist/{workers-for-platforms-CvazgrqD.mjs → workers-for-platforms-BfXIqCm4.mjs} +1 -1
- package/dist/{workers-vpc-DP4QC6UC.mjs → workers-vpc-CR3tfj4I.mjs} +1 -1
- package/dist/{workflows-BSOj56io.mjs → workflows-DpQgBIHz.mjs} +1 -1
- package/dist/{wrangler-migration-DZ9Oelof.mjs → wrangler-migration-ChTsuUHx.mjs} +57 -57
- package/dist/{zaraz-BnQvKXFy.mjs → zaraz-BPOBM0-W.mjs} +1 -1
- package/dist/{zero-trust-DsslXRub.mjs → zero-trust-Cridhy7G.mjs} +21 -17
- package/dist/{zones-DQ3SjGsZ.mjs → zones-BIKClc2S.mjs} +3 -3
- package/package.json +13 -13
- package/dist/auth-CXR2vsII.mjs +0 -2
- package/dist/build-ByjJ6yIB.mjs +0 -2
- package/dist/command-ycXauMSv.mjs +0 -2
- package/dist/deploy-input-BFWpjDVr.mjs +0 -2
- package/dist/discover-D9FNaCDK.mjs +0 -2
- package/dist/internal-CYrPZ9IX.mjs +0 -4
- package/dist/live-hZgMkXJf.mjs +0 -4
- package/dist/login-BBSJytOt.mjs +0 -2
- package/dist/observability-BzKBUUSf.mjs +0 -4
- package/dist/package-DXaRIx2f.mjs +0 -2
- package/dist/ready-BkXNDNTd.mjs +0 -4
- package/dist/run-Cg9utScS.mjs +0 -2
- package/dist/security-txt-Dbi9KxNc.mjs +0 -8
- package/dist/shared-DqW2vICA.mjs +0 -2
- package/dist/signed-url-BhHSAUam.mjs +0 -4
- package/dist/startup-profile-Dif7XOsU.mjs +0 -2
- package/dist/state-xUh3Z77T.mjs +0 -2
- package/dist/telemetry-DDs3zhdw.mjs +0 -2
- package/dist/ui-CY75N4Tm.mjs +0 -2
- package/dist/version-pcpa_kv3.mjs +0 -2
- package/dist/whoami-2eFTt0-Y.mjs +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-CRq9OQKr.mjs";import{r as n,t as r}from"./body-parser-HN91kAf0.mjs";import{a as i,t as a}from"./context-DsVjrTbe.mjs";import{t as o}from"./dry-run-mrA7FFLR.mjs";import{n as s}from"./input-validation-D7z60HJH.mjs";import{t as c}from"./local-B3zt9PXR.mjs";import{t as l}from"./run-DAK_kbUa.mjs";import{t as u}from"./output-PRKYaJuo.mjs";import{t as d}from"./progress-DItBn6ZV.mjs";import{a as f,n as p}from"./prompt-BGz3DNLz.mjs";import"./telemetry-B3S5OfOn.mjs";var m={method:`POST`,path:t=>e`/accounts/${t.account_id}/basin-catalog/${t.bucket_name}/credential`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,500:`InternalServerError`}};function h(e){return e.usage(`$0 basin-catalog credentials create <bucket-name>
|
|
3
3
|
|
|
4
4
|
Store authentication credentials for a catalog. These credentials are used to authenticate with R2 storage when performing catalog operations.`).positional(`bucket-name`,{type:`string`,description:`Specifies the R2 bucket name.`,demandOption:!0}).option(`token`,{type:`string`,description:`Provides the Cloudflare API token for accessing R2.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Contains request to store catalog credentials.`})}const g={command:`create <bucket-name>`,describe:`Store catalog credentials`,builder:h,handler:async e=>l({command:`basin-catalog credentials create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();o({command:`cf basin-catalog credentials create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/basin-catalog/${e[`bucket-name`]==null?`<bucket-name>`:encodeURIComponent(String(e[`bucket-name`]))}/credential`,pathParams:{"bucket-name":String(e[`bucket-name`]??``)},bodyKind:`json`,body:e.body===void 0?r({token:s(e.token,`token`,`text`)}):n(e.body),sensitiveBodyPaths:[[`token`]]});return}let l=e.body===void 0?void 0:n(e.body),p=await t(e),h=e.local?c:await a();if(e.accountId=h,e.body!==void 0){let t=l,n=await d(`Creating`,async()=>p.send(m,{body:t,account_id:h,bucket_name:e[`bucket-name`]}));u(n,{successLabel:`Created`});return}e.token===void 0&&(e.token=await f(`token`,`Provides the Cloudflare API token for accessing R2.`,{kind:`secret`}));let g=r({token:s(e.token,`token`,`text`)}),_=await d(`Creating`,async()=>p.send(m,{body:g,account_id:h,bucket_name:e[`bucket-name`]}));u(_,{successLabel:`Created`})})};var _={method:`GET`,path:t=>e`/accounts/${t.account_id}/basin-catalog/${t.bucket_name}/credential/status`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,500:`InternalServerError`}};function v(e){return e.usage(`$0 basin-catalog credentials status <bucket-name>
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{i as e,n as t}from"./auth-
|
|
2
|
+
import{i as e,n as t}from"./auth-CRq9OQKr.mjs";import{t as n}from"./path-DRw6Y-nd.mjs";import{c as r,o as i,r as a,t as o}from"./body-parser-HN91kAf0.mjs";import{t as s}from"./dry-run-mrA7FFLR.mjs";import{a as c,t as l}from"./context-DsVjrTbe.mjs";import{n as u}from"./input-validation-D7z60HJH.mjs";import{t as d}from"./output-PRKYaJuo.mjs";import{t as f}from"./progress-DItBn6ZV.mjs";import{t as p}from"./run-DAK_kbUa.mjs";import"./telemetry-B3S5OfOn.mjs";import"./api-Dnt6lRJG.mjs";import{t as m}from"./local-B3zt9PXR.mjs";import{a as h,i as g,n as _}from"./prompt-BGz3DNLz.mjs";var v={method:`POST`,path:()=>`/billing/address-validation`,body:`json`};function y(e){return e.usage(`$0 billing addresses validate
|
|
3
3
|
|
|
4
4
|
Validates a billing address and returns validated address suggestions. Authentication is not enforced to support pre-signup address validation flows, so credentials are accepted but not required.`).option(`address`,{type:`string`,description:`Address line 1.`}).option(`address2`,{type:`string`,description:`Address line 2.`}).option(`city`,{type:`string`,description:`City.`}).option(`country`,{type:`string`,description:`Country code.`}).option(`state`,{type:`string`,description:`State or province.`}).option(`zipcode`,{type:`string`,description:`Postal or zip code.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`validate`,describe:`Validate Billing Address`,builder:y,handler:async e=>p({command:`billing addresses validate`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf billing addresses validate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/billing/address-validation`,pathParams:{},bodyKind:`json`,body:e.body===void 0?o({address:u(e.address,`address`,`text`),address2:u(e.address2,`address2`,`text`),city:u(e.city,`city`,`text`),country:u(e.country,`country`,`text`),state:u(e.state,`state`,`text`),zipcode:u(e.zipcode,`zipcode`,`text`)}):a(e.body)});return}let n=e.body===void 0?void 0:a(e.body),r=await t(e);if(e.body!==void 0){let e=n,t=await f(`Validating`,async()=>r.send(v,{body:e}));d(t,{successLabel:`Validated`});return}let i=o({address:u(e.address,`address`,`text`),address2:u(e.address2,`address2`,`text`),city:u(e.city,`city`,`text`),country:u(e.country,`country`,`text`),state:u(e.state,`state`,`text`),zipcode:u(e.zipcode,`zipcode`,`text`)}),c=await f(`Validating`,async()=>r.send(v,{body:i}));d(c,{successLabel:`Validated`})})},ee={command:`addresses`,describe:`Operations for addresses`,builder:e=>e.command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var x={method:`POST`,path:e=>n`/accounts/${e.account_id}/billing/profile/payment-method`};function S(e){return e.usage(`$0 billing profiles create-payment-intent
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{n as e,r as t}from"./theme-BGHWSKCw.mjs";import"./delegate-
|
|
2
|
+
import{n as e,r as t}from"./theme-BGHWSKCw.mjs";import"./delegate-4bIHEQ8-.mjs";import{stripVTControlCharacters as n}from"node:util";function r(n){return`${t.success(e.success)} ${n}`}function i(n){return`${t.warning(e.warning)} ${n}`}function a(n){return`${t.muted(e.arrow)} ${t.muted(n)}`}function o(e,r){let a=process.env.CF_DELEGATION?` ${t.muted(`·`)} ${t.muted(`local version`)}`:``,o=r?` ${t.muted(`·`)} ${t.warning(`update available: v${r.latestVersion}`)}`:``,s=`🍊☁️ ${t.brand(t.bold(`cf`))} ${t.muted(`·`)} ${t.muted(`v${e}`)}${a}${o}`,c=n(s).length,l=`─`.repeat(c);return`${s}\n${t.brand(l)}${r?.isMajor?`\n${i(`A new major version of cf is available. Updating is recommended.`)}`:``}`}const s={bar:`│`,top:`┌`,bottom:`└`};function c(e,n,r){let i=r?.title??`Error`,a=t.error(s.bar),o=t.error(s.top),c=t.error(s.bottom),u=Math.max(20,(process.stderr.columns||80)-2),d=[];if(d.push(``),d.push(`${o} ${t.error(t.bold(i))}`),r?.rawMessage)for(let t of e.split(`
|
|
3
3
|
`))d.push(t.length>0?`${a} ${t}`:a);else for(let n of l(e,u))d.push(n.length>0?`${a} ${t.error(t.bold(n))}`:a);if(n){d.push(a);for(let e of l(n,u))d.push(e.length>0?`${a} ${t.muted(e)}`:a)}return d.push(c),d.join(`
|
|
4
4
|
`)}function l(e,t){let n=[];for(let r of e.split(`
|
|
5
5
|
`)){if(r.length<=t){n.push(r);continue}let e=r.split(/\s+/),i=``;for(let r of e)i?i.length+1+r.length<=t?i+=` `+r:(n.push(i),i=r):i=r;i&&n.push(i)}return n}export{r as a,a as i,l as n,i as o,o as r,c as t};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-CRq9OQKr.mjs";import{i as n}from"./context-DsVjrTbe.mjs";import{i as r,r as i,t as a}from"./body-parser-HN91kAf0.mjs";import{t as o}from"./dry-run-mrA7FFLR.mjs";import{n as s}from"./input-validation-D7z60HJH.mjs";import{t as c}from"./run-DAK_kbUa.mjs";import{t as l}from"./output-PRKYaJuo.mjs";import{t as u}from"./progress-DItBn6ZV.mjs";import{a as d,i as f}from"./prompt-BGz3DNLz.mjs";import"./telemetry-B3S5OfOn.mjs";var p={method:`POST`,path:t=>e`/zones/${t.zone_id}/bot_management/feedback`,body:`json`,response:!1};function m(e){return e.usage("$0 bot-management feedback create\n\nSubmit a feedback report for the specified zone. Use `type` to indicate whether the report is a false positive (good traffic flagged as bot) or a false negative (bot traffic missed). Furthermore, you can also use `expression` as a wirefilter to identify the affected traffic sample. See more accepted API fields and expression types at https://developers.cloudflare.com/bots/concepts/feedback-loop/#api-fields and https://developers.cloudflare.com/bots/concepts/feedback-loop/#expression-fields, respectively.").option(`description`,{type:`string`,description:`The description field`}).option(`expression`,{type:`string`,description:`Wirefilter expression describing the traffic being reported.`}).option(`first-request-seen-at`,{type:`string`,description:`The first_request_seen_at field`}).option(`last-request-seen-at`,{type:`string`,description:`The last_request_seen_at field`}).option(`requests`,{type:`number`,description:`The requests field`}).option(`requests-by-attribute`,{type:`string`,description:`Top attributes contributing to the feedback sample. Keys include topASNs, topCountries, topHosts, topIPs, topJA3Hashes, topJA4s, topPaths, topUserAgents. Provide as a JSON object or @path/to/file.json. Shape: {"<key>": [{...}]}.`}).option(`requests-by-score`,{type:`string`,description:'Map of bot scores (1-99) to request counts. Sum must equal `requests`. Provide as a JSON object or @path/to/file.json. Shape: {"<key>": number}.'}).option(`requests-by-score-src`,{type:`string`,description:'Map of score source to request counts. Sum must equal `requests`. Provide as a JSON object or @path/to/file.json. Shape: {"<key>": number}.'}).option(`subtype`,{type:`string`,description:`The subtype field`}).option(`type`,{type:`string`,description:`Type of feedback report.`,choices:[`false_positive`,`false_negative`]}).coerce(`type`,e=>s(e,`type`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`create`,describe:`Submit a feedback report`,builder:m,handler:async e=>c({command:`bot-management feedback create`,classification:{safeFlags:[`type`,`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf bot-management feedback create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/bot_management/feedback`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?a({description:s(e.description,`description`,`text`),expression:s(e.expression,`expression`,`text`),first_request_seen_at:s(e[`first-request-seen-at`],`first-request-seen-at`,`text`),last_request_seen_at:s(e[`last-request-seen-at`],`last-request-seen-at`,`text`),requests:e.requests,requests_by_attribute:r(e[`requests-by-attribute`],`requests-by-attribute`,!0),requests_by_score:r(e[`requests-by-score`],`requests-by-score`,!0),requests_by_score_src:r(e[`requests-by-score-src`],`requests-by-score-src`,!0),subtype:s(e.subtype,`subtype`,`text`),type:e.type},[[`requests_by_attribute`],[`requests_by_score`],[`requests_by_score_src`]]):i(e.body,[{path:[`requests_by_attribute`],flag:`requests-by-attribute`},{path:[`requests_by_score`],flag:`requests-by-score`},{path:[`requests_by_score_src`],flag:`requests-by-score-src`}])});return}let c=e.body===void 0?void 0:i(e.body,[{path:[`requests_by_attribute`],flag:`requests-by-attribute`},{path:[`requests_by_score`],flag:`requests-by-score`},{path:[`requests_by_score_src`],flag:`requests-by-score-src`}]),m=await t(e),h=await n({zone:e.zone},m,{quiet:e.quiet});if(e.zoneId=h,e.body!==void 0){let e=c,t=await u(`Creating`,async()=>m.send(p,{body:e,zone_id:h}));l(t,{successLabel:`Created`});return}if(e.description===void 0&&(e.description=await d(`description`,`The description field`)),e.expression===void 0&&(e.expression=await d(`expression`,`Wirefilter expression describing the traffic being reported.`)),e[`first-request-seen-at`]===void 0&&(e[`first-request-seen-at`]=await d(`first-request-seen-at`,`The first_request_seen_at field`)),e[`last-request-seen-at`]===void 0&&(e[`last-request-seen-at`]=await d(`last-request-seen-at`,`The last_request_seen_at field`)),e.requests===void 0)throw Error(`--requests is required (or pass --body with this field set).`);if(e[`requests-by-attribute`]===void 0)throw Error(`--requests-by-attribute is required (or pass --body with this field set).`);if(e[`requests-by-score`]===void 0)throw Error(`--requests-by-score is required (or pass --body with this field set).`);if(e[`requests-by-score-src`]===void 0)throw Error(`--requests-by-score-src is required (or pass --body with this field set).`);e.type===void 0&&(e.type=await f(`type`,`Type of feedback report.`,[`false_positive`,`false_negative`]));let g=a({description:s(e.description,`description`,`text`),expression:s(e.expression,`expression`,`text`),first_request_seen_at:s(e[`first-request-seen-at`],`first-request-seen-at`,`text`),last_request_seen_at:s(e[`last-request-seen-at`],`last-request-seen-at`,`text`),requests:e.requests,requests_by_attribute:r(e[`requests-by-attribute`],`requests-by-attribute`,!0),requests_by_score:r(e[`requests-by-score`],`requests-by-score`,!0),requests_by_score_src:r(e[`requests-by-score-src`],`requests-by-score-src`,!0),subtype:s(e.subtype,`subtype`,`text`),type:e.type},[[`requests_by_attribute`],[`requests_by_score`],[`requests_by_score_src`]]),_=await u(`Creating`,async()=>m.send(p,{body:g,zone_id:h}));l(_,{successLabel:`Created`})})};var g={method:`GET`,path:t=>e`/zones/${t.zone_id}/bot_management/feedback`};function _(e){return e.usage(`$0 bot-management feedback list
|
|
3
3
|
|
|
4
4
|
Returns all feedback reports previously submitted for the specified zone. Feedback reports help improve detection by sharing samples of traffic that were misclassified as bots or humans.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`list`,describe:`List zone feedback reports`,builder:_,handler:async e=>c({command:`bot-management feedback list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf bot-management feedback list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/bot_management/feedback`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await t(e),i=await n({zone:e.zone},r,{quiet:e.quiet});e.zoneId=i;let a=await u(`Loading`,async()=>r.send(g,{zone_id:i}));l(a,{successLabel:`Loaded`})})},y={command:`feedback`,describe:`Operations for feedback`,builder:e=>e.command(h).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var b={method:`GET`,path:t=>e`/zones/${t.zone_id}/bot_management`};function x(e){return e.usage(`$0 bot-management get
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-CRq9OQKr.mjs";import{t as n}from"./dry-run-mrA7FFLR.mjs";import{a as r,t as i}from"./context-DsVjrTbe.mjs";import{t as a}from"./local-B3zt9PXR.mjs";import{t as o}from"./output-PRKYaJuo.mjs";import{t as s}from"./progress-DItBn6ZV.mjs";import{t as c}from"./run-DAK_kbUa.mjs";import"./telemetry-B3S5OfOn.mjs";import{n as l}from"./prompt-BGz3DNLz.mjs";var u={method:`GET`,path:t=>e`/accounts/${t.account_id}/botnet_feed/asn/${t.asn_id}/day_report`,query:[`date`]};function d(e){return e.usage(`$0 botnet-feed asn day-report <asn-id>
|
|
3
3
|
|
|
4
4
|
Gets all the data the botnet tracking database has for a given ASN registered to user account for given date. If no date is given, it will return results for the previous day.`).positional(`asn-id`,{type:`string`,description:`Asn ID`,demandOption:!0}).option(`date`,{type:`string`,description:`Date`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`day-report <asn-id>`,describe:`Get daily report`,builder:d,handler:async e=>c({command:`botnet-feed asn day-report`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={date:e.date};if(e.dryRun){let t=await r();n({command:`cf botnet-feed asn day-report`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/botnet_feed/asn/${e[`asn-id`]==null?`<asn-id>`:encodeURIComponent(String(e[`asn-id`]))}/day_report`,pathParams:{"asn-id":String(e[`asn-id`]??``)},query:c,bodyKind:`none`});return}let l=await t(e),d=e.local?a:await i();e.accountId=d;let f=await s(`Loading`,async()=>l.send(u,{account_id:d,asn_id:e[`asn-id`],...c}));o(f,{successLabel:`Loaded`})})};var p={method:`GET`,path:t=>e`/accounts/${t.account_id}/botnet_feed/asn/${t.asn_id}/full_report`};function m(e){return e.usage(`$0 botnet-feed asn full-report <asn-id>
|
|
5
5
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{n as t}from"./auth-CRq9OQKr.mjs";import{t as n}from"./dry-run-mrA7FFLR.mjs";import{a as r,t as i}from"./context-DsVjrTbe.mjs";import{t as a}from"./local-B3zt9PXR.mjs";import{t as o}from"./output-PRKYaJuo.mjs";import{t as s}from"./progress-DItBn6ZV.mjs";import{t as c}from"./run-DAK_kbUa.mjs";import"./telemetry-B3S5OfOn.mjs";import{o as l,r as u,t as d}from"./body-parser-HN91kAf0.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{a as p,i as m,n as h}from"./prompt-BGz3DNLz.mjs";var g={method:`GET`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/logo/matches`,query:[`offset`,`limit`,`query_id`,`download`,`orderBy`,`order`]};function _(e){return e.usage(`$0 brand-protection logo-matches get
|
|
3
3
|
|
|
4
4
|
Lists images that matched a saved logo query, most recently matched first by default. Set \`download=true\` to include each matched image as base64 data.`).option(`offset`,{type:`string`,description:`Number of matches to skip, for pagination. Defaults to 0.`}).option(`limit`,{type:`string`,description:`Maximum number of matches to return. Defaults to 50.`}).option(`query-id`,{type:`string`,description:`ID of the logo query whose matches to list.`,demandOption:!0}).option(`download`,{type:`string`,description:"Set to `true` to include each matched image as base64 data in `image_data`, with its MIME type in `content_type`."}).option(`order-by`,{type:`string`,description:"Field to sort by: `matchedAt`, `domain`, `similarityScore`, or `registrar`. Defaults to `matchedAt`.",choices:[`matchedAt`,`domain`,`similarityScore`,`registrar`]}).option(`order`,{type:`string`,description:"Sort direction: `asc` or `desc`. Defaults to `desc`.",choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get`,describe:`List logo matches`,builder:_,handler:async e=>c({command:`brand-protection logo-matches get`,classification:{safeFlags:[`order-by`,`order`,`dry-run`]}},e,async()=>{let c={offset:e.offset,limit:e.limit,query_id:e[`query-id`],download:e.download,orderBy:e[`order-by`],order:e.order};if(e.dryRun){let e=await r();n({command:`cf brand-protection logo-matches get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cloudforce-one/v2/brand-protection/logo/matches`,pathParams:{},query:c,bodyKind:`none`});return}let l=await t(e),u=e.local?a:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(g,{account_id:u,...c}));o(d,{successLabel:`Loaded`})})},y={command:`logo-matches`,describe:`Operations for logo-matches`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var b={method:`POST`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/logo/queries`,body:`json`};function x(e){return e.usage(`$0 brand-protection logos create
|
|
5
5
|
|
|
6
6
|
Uploads a logo and creates a saved logo query that finds visually similar images on scanned websites. The tag must be unique among the account's logo queries. By default, the new query also searches previously scanned images (see \`search_lookback\`). Creation fails when the account has reached its Brand Protection query limit, which counts domain and logo queries together.`).option(`image-data`,{type:`string`,description:"Base64 encoded image data. Can include data URI prefix (e.g., 'data:image/png;base64,...') or just the base64 string. Supported formats: PNG, JPEG, GIF, WebP, BMP, and SVG. ICO is also accepted when the data includes a `data:image/x-icon;base64,` prefix."}).option(`search-lookback`,{type:`boolean`,description:"If true, also search previously scanned images for matches above the similarity threshold. Defaults to `true`.",default:!0}).option(`similarity-threshold`,{type:`number`,description:`Minimum similarity score (0-1) required for visual matches`}).option(`tag`,{type:`string`,description:`Name of the logo query. Must be unique among the account's logo queries.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ee={command:`create`,describe:`Create logo query`,builder:x,handler:async e=>c({command:`brand-protection logos create`,classification:{safeFlags:[`search-lookback`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf brand-protection logos create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cloudforce-one/v2/brand-protection/logo/queries`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({image_data:f(e[`image-data`],`image-data`,`text`),search_lookback:e[`search-lookback`],similarity_threshold:e[`similarity-threshold`],tag:f(e.tag,`tag`,`text`)}):u(e.body)});return}let c=e.body===void 0?void 0:u(e.body),l=await t(e),m=e.local?a:await i();if(e.accountId=m,e.body!==void 0){let e=c,t=await s(`Creating`,async()=>l.send(b,{body:e,account_id:m}));o(t,{successLabel:`Created`});return}if(e[`image-data`]===void 0&&(e[`image-data`]=await p(`image-data`,"Base64 encoded image data. Can include data URI prefix (e.g., 'data:image/png;base64,...') or just the base64 string. Supported formats: PNG, JPEG, GIF, WebP, BMP, and SVG. ICO is also accepted when the data includes a `data:image/x-icon;base64,` prefix.")),e[`similarity-threshold`]===void 0)throw Error(`--similarity-threshold is required (or pass --body with this field set).`);e.tag===void 0&&(e.tag=await p(`tag`,`Name of the logo query. Must be unique among the account's logo queries.`));let h=d({image_data:f(e[`image-data`],`image-data`,`text`),search_lookback:e[`search-lookback`],similarity_threshold:e[`similarity-threshold`],tag:f(e.tag,`tag`,`text`)}),g=await s(`Creating`,async()=>l.send(b,{body:h,account_id:m}));o(g,{successLabel:`Created`})})};var S={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/logo/queries/${t.query_id}`};function C(e){return e.usage(`$0 brand-protection logos delete <query-id>
|
|
7
7
|
|
|
8
|
-
Permanently deletes a saved logo query and all of its matches. If the query does not exist in this account, the request fails with error code 404.`).positional(`query-id`,{type:`string`,description:`ID of the logo query.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const w={command:`delete <query-id>`,describe:`Delete logo query`,builder:C,handler:async e=>c({command:`brand-protection logos delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf brand-protection logos delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cloudforce-one/v2/brand-protection/logo/queries/${e[`query-id`]==null?`<query-id>`:encodeURIComponent(String(e[`query-id`]))}`,pathParams:{"query-id":String(e[`query-id`]??``)},bodyKind:`none`});return}let c=await t(e),l=e.local?a:await i();if(e.accountId=l,!await h({force:!!e.force}))return;let u=await s(`Deleting`,async()=>c.send(S,{account_id:l,query_id:e[`query-id`]}));o(u,{successLabel:`Deleted`})})};var T={method:`GET`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/logo/queries`,query:[`id`,`download`]};function E(e){return e.usage("$0 brand-protection logos get\n\nLists the account's saved logo queries. Set `id` to return a single query object instead of an array. Set `download=true` to include each logo image as base64 data.").option(`id`,{type:`string`,description:"ID of a logo query. When set, `result` is that single query object instead of an array."}).option(`download`,{type:`string`,description:"Set to `true` to include each logo image as base64 data in `image_data`, with its MIME type in `content_type`."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get`,describe:`List logo queries`,builder:E,handler:async e=>c({command:`brand-protection logos get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={id:e.id,download:e.download};if(e.dryRun){let e=await r();n({command:`cf brand-protection logos get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cloudforce-one/v2/brand-protection/logo/queries`,pathParams:{},query:c,bodyKind:`none`});return}let l=await t(e),u=e.local?a:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(T,{account_id:u,...c}));o(d,{successLabel:`Loaded`})})},O={command:`logos`,describe:`Operations for logos`,builder:e=>e.command(ee).command(w).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var k={method:`POST`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/domain/matches/bulk-dismiss`,body:`json`};function A(e){return e.usage("$0 brand-protection matches bulk-dismiss\n\nDismisses or undismisses up to 100 domain matches in one request and returns a result for each item. Send `matches` as (`query_id`, `domain_id`) pairs to change each match for one query. The legacy `match_ids` format is still accepted, but it changes each match for every query that shares it; prefer `matches`.").option(`action`,{type:`string`,description:"`dismiss` to dismiss the matches, or `undismiss` to restore them.",choices:[`dismiss`,`undismiss`]}).coerce(`action`,e=>f(e,`action`,`text`)).option(`match-ids`,{type:`string`,array:!0,description:"Legacy format; prefer `matches`. Match IDs to update. Each ID changes the match for every query that shares it, not just one query. 1 to 100 items; duplicate IDs are rejected."}).option(`matches`,{type:`string`,description:'Matches to update, as (`query_id`, `domain_id`) pairs. Each pair changes the match for that query only. 1 to 100 items; duplicate pairs are rejected. Send only one format. If both are supplied, `match_ids` takes precedence and `matches` is ignored. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"domain_id": number, "query_id": number}].'}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const j={command:`bulk-dismiss`,describe:`Bulk dismiss or undismiss matches`,builder:A,handler:async e=>c({command:`brand-protection matches bulk-dismiss`,classification:{safeFlags:[`action`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf brand-protection matches bulk-dismiss`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cloudforce-one/v2/brand-protection/domain/matches/bulk-dismiss`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({action:e.action,match_ids:e[`match-ids`],matches:l(e.matches,`matches`)}):u(e.body)});return}let c=e.body===void 0?void 0:u(e.body),f=await t(e),p=e.local?a:await i();if(e.accountId=p,e.body!==void 0){let e=c,t=await s(`Creating`,async()=>f.send(k,{body:e,account_id:p}));o(t,{successLabel:`Created`});return}e.action===void 0&&(e.action=await m(`action`,"`dismiss` to dismiss the matches, or `undismiss` to restore them.",[`dismiss`,`undismiss`]));let h=d({action:e.action,match_ids:e[`match-ids`],matches:l(e.matches,`matches`)}),g=await s(`Creating`,async()=>f.send(k,{body:h,account_id:p}));o(g,{successLabel:`Created`})})};var M={method:`GET`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/domain/matches`,query:[`offset`,`limit`,`query_id`,`include_domain_id`,`include_dismissed`,`domain_search`,`orderBy`,`order`]};function N(e){return e.usage("$0 brand-protection matches get\n\nLists domains that matched one or more saved domain queries, most recently matched first by default. When you pass several comma-separated `query_id` values, matches are deduplicated by domain and each match includes a `match_details` array with per-query dismissed state. Set `include_domain_id=true` to get the `domain_id` needed to dismiss or undismiss a match.").option(`offset`,{type:`string`,description:`Number of matches to skip, for pagination. Defaults to 0.`}).option(`limit`,{type:`string`,description:`Maximum number of matches to return. Defaults to 50.`}).option(`query-id`,{type:`string`,array:!0,description:"ID of a domain query, or a comma-separated list of domain query IDs. When you pass several IDs, matches are deduplicated by domain and each match includes a `match_details` array with per-query metadata and dismissed state.",demandOption:!0}).option(`include-domain-id`,{type:`string`,description:"Set to `true` to include `domain_id` on each match. Required to dismiss or undismiss a match. Defaults to `false`."}).option(`include-dismissed`,{type:`string`,description:"Set to `false` to exclude dismissed matches. Dismissed matches are included when this is omitted or `true`."}).option(`domain-search`,{type:`string`,description:`Return only matches whose domain contains this text (case-insensitive).`}).option(`order-by`,{type:`string`,description:"Field to sort by: `domain`, `first_seen`, or `registrar`. Defaults to `first_seen`.",choices:[`domain`,`first_seen`,`registrar`]}).option(`order`,{type:`string`,description:"Sort direction: `asc` or `desc`. Defaults to `desc`. For single-query requests, `asc` applies only when `orderBy` is set.",choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get`,describe:`List domain matches`,builder:N,handler:async e=>c({command:`brand-protection matches get`,classification:{safeFlags:[`order-by`,`order`,`dry-run`]}},e,async()=>{let c={offset:e.offset,limit:e.limit,query_id:e[`query-id`],include_domain_id:e[`include-domain-id`],include_dismissed:e[`include-dismissed`],domain_search:e[`domain-search`],orderBy:e[`order-by`],order:e.order};if(e.dryRun){let e=await r();n({command:`cf brand-protection matches get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cloudforce-one/v2/brand-protection/domain/matches`,pathParams:{},query:c,bodyKind:`none`});return}let l=await t(e),u=e.local?a:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(M,{account_id:u,...c}));o(d,{successLabel:`Loaded`})})},F={command:`matches`,describe:`Operations for matches`,builder:e=>e.command(j).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var I={method:`POST`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/queries/${t.query_id}/matches/${t.domain_id}/dismiss`};function L(e){return e.usage("$0 brand-protection queries dismiss <domain-id>\n\nMarks a matched domain as dismissed for one domain query. Dismissals are per query: dismissing a domain in one query does not affect other queries. Get `domain_id` from List domain matches with `include_domain_id=true`. Dismissing an already dismissed match succeeds. If the query or match does not exist, the request fails with error code 404.").positional(`domain-id`,{type:`string`,description:"ID of the matched domain, as returned in `domain_id` by List domain matches with `include_domain_id=true`.",demandOption:!0}).option(`query-id`,{type:`string`,description:`ID of the domain query that the match belongs to.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`dismiss <domain-id>`,describe:`Dismiss a domain match`,builder:L,handler:async e=>c({command:`brand-protection queries dismiss`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf brand-protection queries dismiss`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cloudforce-one/v2/brand-protection/queries/${e[`query-id`]==null?`<query-id>`:encodeURIComponent(String(e[`query-id`]))}/matches/${e[`domain-id`]==null?`<domain-id>`:encodeURIComponent(String(e[`domain-id`]))}/dismiss`,pathParams:{"query-id":String(e[`query-id`]??``),"domain-id":String(e[`domain-id`]??``)},bodyKind:`none`});return}let c=await t(e),l=e.local?a:await i();e.accountId=l;let u=await s(`Creating`,async()=>c.send(I,{account_id:l,query_id:e[`query-id`],domain_id:e[`domain-id`]}));o(u,{successLabel:`Created`})})};var z={method:`GET`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/domain/queries`,query:[`id`,`page`,`per_page`]};function B(e){return e.usage("$0 brand-protection queries get\n\nLists the account's saved domain queries, most recently updated first. Set `id` to return a single query object instead of an array. Set `page` or `per_page` to paginate the list; the response then includes `result_info`. Without them, every query is returned.").option(`id`,{type:`string`,description:"ID of a domain query. When set, `result` is that single query object instead of an array, and `page` and `per_page` are ignored."}).option(`page`,{type:`number`,description:`Page number for paginated list requests. Defaults to 1 when only per_page is supplied. Omit page and per_page to return every query.`}).option(`per-page`,{type:`number`,description:`Number of queries per page for paginated list requests. Defaults to 100 when only page is supplied. Maximum 100. Omit page and per_page to return every query.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`get`,describe:`List domain queries`,builder:B,handler:async e=>c({command:`brand-protection queries get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={id:e.id,page:e.page,per_page:e[`per-page`]};if(e.dryRun){let e=await r();n({command:`cf brand-protection queries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cloudforce-one/v2/brand-protection/domain/queries`,pathParams:{},query:c,bodyKind:`none`});return}let l=await t(e),u=e.local?a:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(z,{account_id:u,...c}));o(d,{successLabel:`Loaded`})})};var te={method:`POST`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/queries/${t.query_id}/matches/${t.domain_id}/undismiss`};function H(e){return e.usage("$0 brand-protection queries undismiss <domain-id>\n\nRemoves the dismissed status from a matched domain for one domain query. Undismissing a domain in one query does not affect other queries. Get `domain_id` from List domain matches with `include_domain_id=true`. Undismissing a match that is not dismissed succeeds. If the query or match does not exist, the request fails with error code 404.").positional(`domain-id`,{type:`string`,description:"ID of the matched domain, as returned in `domain_id` by List domain matches with `include_domain_id=true`.",demandOption:!0}).option(`query-id`,{type:`string`,description:`ID of the domain query that the match belongs to.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`undismiss <domain-id>`,describe:`Undismiss a domain match`,builder:H,handler:async e=>c({command:`brand-protection queries undismiss`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf brand-protection queries undismiss`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cloudforce-one/v2/brand-protection/queries/${e[`query-id`]==null?`<query-id>`:encodeURIComponent(String(e[`query-id`]))}/matches/${e[`domain-id`]==null?`<domain-id>`:encodeURIComponent(String(e[`domain-id`]))}/undismiss`,pathParams:{"query-id":String(e[`query-id`]??``),"domain-id":String(e[`domain-id`]??``)},bodyKind:`none`});return}let c=await t(e),l=e.local?a:await i();e.accountId=l;let u=await s(`Creating`,async()=>c.send(te,{account_id:l,query_id:e[`query-id`],domain_id:e[`domain-id`]}));o(u,{successLabel:`Created`})})},W={command:`queries`,describe:`Operations for queries`,builder:e=>e.command(R).command(V).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var G={method:`POST`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/logo/search`,query:[`showHistoric`,`download`],body:`json`};function K(e){return e.usage(`$0 brand-protection submit
|
|
8
|
+
Permanently deletes a saved logo query and all of its matches. If the query does not exist in this account, the request fails with error code 404.`).positional(`query-id`,{type:`string`,description:`ID of the logo query.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const w={command:`delete <query-id>`,describe:`Delete logo query`,builder:C,handler:async e=>c({command:`brand-protection logos delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf brand-protection logos delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cloudforce-one/v2/brand-protection/logo/queries/${e[`query-id`]==null?`<query-id>`:encodeURIComponent(String(e[`query-id`]))}`,pathParams:{"query-id":String(e[`query-id`]??``)},bodyKind:`none`});return}let c=await t(e),l=e.local?a:await i();if(e.accountId=l,!await h({force:!!e.force}))return;let u=await s(`Deleting`,async()=>c.send(S,{account_id:l,query_id:e[`query-id`]}));o(u,{successLabel:`Deleted`})})};var T={method:`GET`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/logo/queries`,query:[`id`,`download`]};function E(e){return e.usage("$0 brand-protection logos get\n\nLists the account's saved logo queries. Set `id` to return a single query object instead of an array. Set `download=true` to include each logo image as base64 data.").option(`id`,{type:`string`,description:"ID of a logo query. When set, `result` is that single query object instead of an array."}).option(`download`,{type:`string`,description:"Set to `true` to include each logo image as base64 data in `image_data`, with its MIME type in `content_type`."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get`,describe:`List logo queries`,builder:E,handler:async e=>c({command:`brand-protection logos get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={id:e.id,download:e.download};if(e.dryRun){let e=await r();n({command:`cf brand-protection logos get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cloudforce-one/v2/brand-protection/logo/queries`,pathParams:{},query:c,bodyKind:`none`});return}let l=await t(e),u=e.local?a:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(T,{account_id:u,...c}));o(d,{successLabel:`Loaded`})})},O={command:`logos`,describe:`Operations for logos`,builder:e=>e.command(ee).command(w).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var k={method:`POST`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/domain/matches/bulk-dismiss`,body:`json`};function A(e){return e.usage("$0 brand-protection matches bulk-dismiss\n\nDismisses or undismisses up to 100 domain matches in one request and returns a result for each item. Send `matches` as (`query_id`, `domain_id`) pairs to change each match for one query. The legacy `match_ids` format is still accepted, but it changes each match for every query that shares it; prefer `matches`.").option(`action`,{type:`string`,description:"`dismiss` to dismiss the matches, or `undismiss` to restore them.",choices:[`dismiss`,`undismiss`]}).coerce(`action`,e=>f(e,`action`,`text`)).option(`match-ids`,{type:`string`,array:!0,description:"Legacy format; prefer `matches`. Match IDs to update. Each ID changes the match for every query that shares it, not just one query. 1 to 100 items; duplicate IDs are rejected."}).option(`matches`,{type:`string`,description:'Matches to update, as (`query_id`, `domain_id`) pairs. Each pair changes the match for that query only. 1 to 100 items; duplicate pairs are rejected. Send only one format. If both are supplied, `match_ids` takes precedence and `matches` is ignored. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"domain_id": number, "query_id": number}].'}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const j={command:`bulk-dismiss`,describe:`Bulk dismiss or undismiss matches`,builder:A,handler:async e=>c({command:`brand-protection matches bulk-dismiss`,classification:{safeFlags:[`action`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf brand-protection matches bulk-dismiss`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cloudforce-one/v2/brand-protection/domain/matches/bulk-dismiss`,pathParams:{},bodyKind:`json`,body:e.body===void 0?d({action:e.action,match_ids:e[`match-ids`],matches:l(e.matches,`matches`)}):u(e.body)});return}let c=e.body===void 0?void 0:u(e.body),f=await t(e),p=e.local?a:await i();if(e.accountId=p,e.body!==void 0){let e=c,t=await s(`Creating`,async()=>f.send(k,{body:e,account_id:p}));o(t,{successLabel:`Created`});return}e.action===void 0&&(e.action=await m(`action`,"`dismiss` to dismiss the matches, or `undismiss` to restore them.",[`dismiss`,`undismiss`]));let h=d({action:e.action,match_ids:e[`match-ids`],matches:l(e.matches,`matches`)}),g=await s(`Creating`,async()=>f.send(k,{body:h,account_id:p}));o(g,{successLabel:`Created`})})};var M={method:`GET`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/domain/matches`,query:[`offset`,`limit`,`query_id`,`include_domain_id`,`include_dismissed`,`domain_search`,`quality`,`orderBy`,`order`]};function N(e){return e.usage("$0 brand-protection matches get\n\nLists domains that matched one or more saved domain queries, most recently matched first by default. When you pass several comma-separated `query_id` values, matches are deduplicated by domain and each match includes a `match_details` array with per-query dismissed state. Set `include_domain_id=true` to get the `domain_id` needed to dismiss or undismiss a match.").option(`offset`,{type:`string`,description:`Number of matches to skip, for pagination. Defaults to 0.`}).option(`limit`,{type:`string`,description:`Maximum number of matches to return. Defaults to 50.`}).option(`query-id`,{type:`string`,array:!0,description:"ID of a domain query, or a comma-separated list of domain query IDs. When you pass several IDs, matches are deduplicated by domain and each match includes a `match_details` array with per-query metadata and dismissed state.",demandOption:!0}).option(`include-domain-id`,{type:`string`,description:"Set to `true` to include `domain_id` on each match. Required to dismiss or undismiss a match. Defaults to `false`."}).option(`include-dismissed`,{type:`string`,description:"Set to `false` to exclude dismissed matches. Dismissed matches are included when this is omitted or `true`."}).option(`domain-search`,{type:`string`,description:`Return only matches whose domain contains this text (case-insensitive).`}).option(`quality`,{type:`string`,description:`Filter matches by quality. Options: 'high' or 'low'`,choices:[`high`,`low`]}).option(`order-by`,{type:`string`,description:"Field to sort by: `domain`, `first_seen`, or `registrar`. Defaults to `first_seen`.",choices:[`domain`,`first_seen`,`registrar`]}).option(`order`,{type:`string`,description:"Sort direction: `asc` or `desc`. Defaults to `desc`. For single-query requests, `asc` applies only when `orderBy` is set.",choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get`,describe:`List domain matches`,builder:N,handler:async e=>c({command:`brand-protection matches get`,classification:{safeFlags:[`quality`,`order-by`,`order`,`dry-run`]}},e,async()=>{let c={offset:e.offset,limit:e.limit,query_id:e[`query-id`],include_domain_id:e[`include-domain-id`],include_dismissed:e[`include-dismissed`],domain_search:e[`domain-search`],quality:e.quality,orderBy:e[`order-by`],order:e.order};if(e.dryRun){let e=await r();n({command:`cf brand-protection matches get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cloudforce-one/v2/brand-protection/domain/matches`,pathParams:{},query:c,bodyKind:`none`});return}let l=await t(e),u=e.local?a:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(M,{account_id:u,...c}));o(d,{successLabel:`Loaded`})})},F={command:`matches`,describe:`Operations for matches`,builder:e=>e.command(j).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var I={method:`POST`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/queries/${t.query_id}/matches/${t.domain_id}/dismiss`};function L(e){return e.usage("$0 brand-protection queries dismiss <domain-id>\n\nMarks a matched domain as dismissed for one domain query. Dismissals are per query: dismissing a domain in one query does not affect other queries. Get `domain_id` from List domain matches with `include_domain_id=true`. Dismissing an already dismissed match succeeds. If the query or match does not exist, the request fails with error code 404.").positional(`domain-id`,{type:`string`,description:"ID of the matched domain, as returned in `domain_id` by List domain matches with `include_domain_id=true`.",demandOption:!0}).option(`query-id`,{type:`string`,description:`ID of the domain query that the match belongs to.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`dismiss <domain-id>`,describe:`Dismiss a domain match`,builder:L,handler:async e=>c({command:`brand-protection queries dismiss`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf brand-protection queries dismiss`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cloudforce-one/v2/brand-protection/queries/${e[`query-id`]==null?`<query-id>`:encodeURIComponent(String(e[`query-id`]))}/matches/${e[`domain-id`]==null?`<domain-id>`:encodeURIComponent(String(e[`domain-id`]))}/dismiss`,pathParams:{"query-id":String(e[`query-id`]??``),"domain-id":String(e[`domain-id`]??``)},bodyKind:`none`});return}let c=await t(e),l=e.local?a:await i();e.accountId=l;let u=await s(`Creating`,async()=>c.send(I,{account_id:l,query_id:e[`query-id`],domain_id:e[`domain-id`]}));o(u,{successLabel:`Created`})})};var z={method:`GET`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/domain/queries`,query:[`id`,`page`,`per_page`]};function B(e){return e.usage("$0 brand-protection queries get\n\nLists the account's saved domain queries, most recently updated first. Set `id` to return a single query object instead of an array. Set `page` or `per_page` to paginate the list; the response then includes `result_info`. Without them, every query is returned.").option(`id`,{type:`string`,description:"ID of a domain query. When set, `result` is that single query object instead of an array, and `page` and `per_page` are ignored."}).option(`page`,{type:`number`,description:`Page number for paginated list requests. Defaults to 1 when only per_page is supplied. Omit page and per_page to return every query.`}).option(`per-page`,{type:`number`,description:`Number of queries per page for paginated list requests. Defaults to 100 when only page is supplied. Maximum 100. Omit page and per_page to return every query.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`get`,describe:`List domain queries`,builder:B,handler:async e=>c({command:`brand-protection queries get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={id:e.id,page:e.page,per_page:e[`per-page`]};if(e.dryRun){let e=await r();n({command:`cf brand-protection queries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/cloudforce-one/v2/brand-protection/domain/queries`,pathParams:{},query:c,bodyKind:`none`});return}let l=await t(e),u=e.local?a:await i();e.accountId=u;let d=await s(`Loading`,async()=>l.send(z,{account_id:u,...c}));o(d,{successLabel:`Loaded`})})};var te={method:`POST`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/queries/${t.query_id}/matches/${t.domain_id}/undismiss`};function H(e){return e.usage("$0 brand-protection queries undismiss <domain-id>\n\nRemoves the dismissed status from a matched domain for one domain query. Undismissing a domain in one query does not affect other queries. Get `domain_id` from List domain matches with `include_domain_id=true`. Undismissing a match that is not dismissed succeeds. If the query or match does not exist, the request fails with error code 404.").positional(`domain-id`,{type:`string`,description:"ID of the matched domain, as returned in `domain_id` by List domain matches with `include_domain_id=true`.",demandOption:!0}).option(`query-id`,{type:`string`,description:`ID of the domain query that the match belongs to.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`undismiss <domain-id>`,describe:`Undismiss a domain match`,builder:H,handler:async e=>c({command:`brand-protection queries undismiss`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await r();n({command:`cf brand-protection queries undismiss`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cloudforce-one/v2/brand-protection/queries/${e[`query-id`]==null?`<query-id>`:encodeURIComponent(String(e[`query-id`]))}/matches/${e[`domain-id`]==null?`<domain-id>`:encodeURIComponent(String(e[`domain-id`]))}/undismiss`,pathParams:{"query-id":String(e[`query-id`]??``),"domain-id":String(e[`domain-id`]??``)},bodyKind:`none`});return}let c=await t(e),l=e.local?a:await i();e.accountId=l;let u=await s(`Creating`,async()=>c.send(te,{account_id:l,query_id:e[`query-id`],domain_id:e[`domain-id`]}));o(u,{successLabel:`Created`})})},W={command:`queries`,describe:`Operations for queries`,builder:e=>e.command(R).command(V).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var G={method:`POST`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/logo/search`,query:[`showHistoric`,`download`],body:`json`};function K(e){return e.usage(`$0 brand-protection submit
|
|
9
9
|
|
|
10
10
|
Submit an image and find the n closest matches from the scanned images index without creating any match records. Returns similarity scores and metadata for each match.`).option(`show-historic`,{type:`string`,description:`Include scanned images without domain metadata (historic data). Default: false (only show images with domain)`}).option(`download`,{type:`string`,description:`If true, include base64-encoded image data in the response`}).option(`image-data`,{type:`string`,description:`Base64 encoded image data. Can include data URI prefix (e.g., 'data:image/png;base64,...') or just the base64 string.`}).option(`score-threshold`,{type:`number`,description:`Minimum similarity score threshold for matches (0-1, default: 0)`,default:0}).option(`top-k`,{type:`number`,description:`Number of closest matches to return. Defaults to 10. Accepts 1 to 100, but values above 50 are treated as 50.`,default:10}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const q={command:`submit`,describe:`Search scanned images`,builder:K,handler:async e=>c({command:`brand-protection submit`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let c={showHistoric:e[`show-historic`],download:e.download};if(e.dryRun){let t=await r();n({command:`cf brand-protection submit`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/cloudforce-one/v2/brand-protection/logo/search`,pathParams:{},query:c,bodyKind:`json`,body:e.body===void 0?d({image_data:f(e[`image-data`],`image-data`,`text`),score_threshold:e[`score-threshold`],top_k:e[`top-k`]}):u(e.body)});return}let l=e.body===void 0?void 0:u(e.body),m=await t(e),h=e.local?a:await i();if(e.accountId=h,e.body!==void 0){let e=l;new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let t=await s(`Creating`,async()=>m.send(G,{body:e,account_id:h,...c}));o(t,{successLabel:`Created`});return}e[`image-data`]===void 0&&(e[`image-data`]=await p(`image-data`,`Base64 encoded image data. Can include data URI prefix (e.g., 'data:image/png;base64,...') or just the base64 string.`));let g=d({image_data:f(e[`image-data`],`image-data`,`text`),score_threshold:e[`score-threshold`],top_k:e[`top-k`]});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let _=await s(`Creating`,async()=>m.send(G,{body:g,account_id:h,...c}));o(_,{successLabel:`Created`})})};var J={method:`POST`,path:t=>e`/accounts/${t.account_id}/cloudforce-one/v2/brand-protection/domain/trial`,body:`json`,errors:{403:`ForbiddenError`,502:`BadGatewayError`,503:`ServiceUnavailableError`}};function Y(e){return e.usage(`$0 brand-protection trial create
|
|
11
11
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{i as t,n}from"./auth-
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{i as t,n}from"./auth-CRq9OQKr.mjs";import{c as r,i,o as a,r as o,s,t as c}from"./body-parser-HN91kAf0.mjs";import{a as l,t as u}from"./context-DsVjrTbe.mjs";import{t as d}from"./dry-run-mrA7FFLR.mjs";import{t as f}from"./local-B3zt9PXR.mjs";import{t as p}from"./output-PRKYaJuo.mjs";import{t as m}from"./run-DAK_kbUa.mjs";import{t as h}from"./progress-DItBn6ZV.mjs";import"./telemetry-B3S5OfOn.mjs";import{a as g,n as _}from"./prompt-BGz3DNLz.mjs";import{n as v}from"./input-validation-D7z60HJH.mjs";import{n as y,t as b}from"./raw-fetch-CmI3Ol3q.mjs";var x={method:`POST`,path:t=>e`/accounts/${t.account_id}/browser-rendering/crawl`,query:[`cacheTTL`],body:`json`,errors:{400:`BadRequestError`,429:`TooManyRequestsError`,500:`InternalServerError`}};function ee(e){return e.usage("$0 browser-run crawl create\n\nStarts a crawl job for the provided URL and its children. Check available options like `gotoOptions` and `waitFor*` to control page load behaviour.").option(`cache-ttl`,{type:`number`,description:`Cache TTL default is 5s. Set to 0 to disable.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`create`,describe:`Crawl websites.`,builder:ee,handler:async e=>m({command:`browser-run crawl create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let r={cacheTTL:e[`cache-ttl`]};if(e.dryRun){let t=await l();d({command:`cf browser-run crawl create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/browser-rendering/crawl`,pathParams:{},query:r,bodyKind:`json`,body:e.body===void 0?void 0:o(e.body)});return}let i=e.body===void 0?void 0:o(e.body),a=await n(e),s=e.local?f:await u();if(e.accountId=s,e.body!==void 0){let e=i;new URLSearchParams(Object.entries(r).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();let t=await h(`Creating`,async()=>a.send(x,{body:e,account_id:s,...r}));p(t,{successLabel:`Created`});return}let c=await h(`Creating`,async()=>t(a,`POST`,`/accounts/${s}/browser-rendering/crawl`,{query:r}));p(c,{successLabel:`Created`})})};var te={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/browser-rendering/crawl/${t.job_id}`,errors:{400:`BadRequestError`,404:`NotFoundError`,500:`InternalServerError`}};function ne(e){return e.usage(`$0 browser-run crawl delete <job-id>
|
|
3
3
|
|
|
4
4
|
Cancels an ongoing crawl job by setting its status to cancelled and stopping all queued URLs.`).positional(`job-id`,{type:`string`,description:`The ID of the crawl job to cancel.`,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 re={command:`delete <job-id>`,describe:`Cancel a crawl job.`,builder:ne,handler:async e=>m({command:`browser-run crawl delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await l();d({command:`cf browser-run crawl delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/browser-rendering/crawl/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}`,pathParams:{"job-id":String(e[`job-id`]??``)},bodyKind:`none`});return}let t=await n(e),r=e.local?f:await u();if(e.accountId=r,!await _({force:!!e.force}))return;let i=await h(`Deleting`,async()=>t.send(te,{account_id:r,job_id:e[`job-id`]}));p(i,{successLabel:`Deleted`})})};var ie={method:`GET`,path:t=>e`/accounts/${t.account_id}/browser-rendering/crawl/${t.job_id}`,query:[`cacheTTL`,`status`,`cursor`,`limit`],errors:{400:`BadRequestError`,500:`InternalServerError`}};function ae(e){return e.usage(`$0 browser-run crawl get <job-id>
|
|
5
5
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{i as e,r as t}from"./autoconfig-
|
|
2
|
+
import{i as e,r as t}from"./autoconfig-BDEt9orA.mjs";import{N as n}from"./dist-BoDdDWjK.mjs";import{t as r}from"./log-Brx-wjJW.mjs";import{t as i}from"./cli-exit-CstFZ1eJ.mjs";import{n as a,t as o}from"./spawn-B681PPG2.mjs";import s from"node:path";import{readBuildOutput as c}from"@cloudflare/build-output-utils";import{convertToWranglerConfig as l}from"@cloudflare/config";var u=class extends Error{constructor(e){super(e),this.name=`BuildOutputConfigError`}};function d(e,t){if(e!==void 0){if(t===void 0)throw new u(`The Build Output does not record which mode it was created with, but this command requested mode "${e}". Rebuild with "--mode ${e}" before deploying.`);if(t!==e)throw new u(`The Build Output was created with mode "${t}", but this command requested mode "${e}". To use the existing Build Output, rerun with "--mode ${t}". To deploy in ${e} mode, rebuild with "--mode ${e}" before deploying.`)}}function f(e,t){if(e!==void 0&&t)throw new u(`Temporary accounts can't be used when a specific account ID ("${e}") is set in your config file. Remove \`--temporary-account\` to use that account, or remove \`accountId\` from your config file and rebuild to use a temporary account.`)}const p={type:`string`,description:`Name of the Worker in the Build Output to use (defaults to the default Worker)`,requiresArg:!0,coerce:e=>{if(Array.isArray(e))throw Error(`--worker can only be specified once.`);return e}};function m(e,t){if(t===void 0)return e.default;let n=Object.values(e).filter(e=>e.config.name===t);if(n.length>1)throw new u(`The Build Output contains more than one Worker named "${t}".`);if(n[0]!==void 0)return n[0];let{default:r,...i}=e;throw new u(`The Build Output has no Worker named "${t}". Available Workers: ${[`${r.config.name} (default)`,...Object.values(i).map(e=>e.config.name).sort()].join(`, `)}.`)}function h(e){let t=process.env.CLOUDFLARE_CI_OVERRIDE_WORKER_NAME;return!t||t===e.config.name?{worker:e,workerNameOverridden:!1}:(r.warn(`Failed to match Worker name. Your config file is using the Worker name "${e.config.name}", but the CI system expected "${t}". Overriding using the CI provided Worker name.`),{worker:{...e,config:{...e.config,name:t}},workerNameOverridden:!0})}function g(){let e=process.env.CLOUDFLARE_CI_MATCH_WORKER_TAG;if(!e)return()=>{};let t=process.env.WRANGLER_CI_MATCH_TAG;return process.env.WRANGLER_CI_MATCH_TAG=e,()=>{t===void 0?delete process.env.WRANGLER_CI_MATCH_TAG:process.env.WRANGLER_CI_MATCH_TAG=t}}function _(e,t){let n=e.config,{buildContext:r,...i}=t,{manifest:a,...o}=n,c=l({...i,worker:o,containers:[]});n.manifest?.mainModule&&e.bundleDir&&(c.main=s.join(e.bundleDir,n.manifest.mainModule));let u=s.resolve(`cloudflare.config.ts`),{validationConfig:d,containerReferences:f}=y(c),p=v(d,e.configPath,u);b(p,f);let{containers:m,...h}=p;return{wranglerConfig:h,builtConfig:n}}function v(e,t,r){let{config:i,diagnostics:a}=n(e,t,r,{});if(a.hasErrors())throw new u(a.renderErrors());return a.hasWarnings()&&console.warn(a.renderWarnings()),i}function y(e){let{containers:t,...n}=e,r=/* @__PURE__ */ new Map;return n.exports!==void 0&&(n.exports=Object.fromEntries(Object.entries(n.exports).map(([e,t])=>{if(!(`container`in t)||typeof t.container!=`string`)return[e,t];r.set(e,t.container);let{container:n,...i}=t;return[e,i]}))),{validationConfig:n,containerReferences:r}}function b(e,t){e.exports!==void 0&&t.size!==0&&(e.exports=Object.fromEntries(Object.entries(e.exports).map(([e,n])=>{let r=t.get(e);return[e,r===void 0?n:{...n,container:r}]})))}function x(e){return e}async function S(n,{worker:s,dryRun:l=!1,...u}={},d={}){let f=u.output??`stderr`,p=process.cwd(),{details:h,configuration:g,setupNeeded:v}=await t(p,{...u,dryRun:l});if(v)return`setup-needed`;let y=g?.buildCommand??h?.buildCommand,b={...h?.env,...d.isPreview?{CLOUDFLARE_PREVIEW_BUILD:`true`}:{}};if(y&&n&&!h?.framework?.supportsMode)throw Error(`The detected command \`${y}\` does not currently support \`--mode\`.`);f!==`silent`&&r.section(`Build`);let x=n?[`--mode`,n]:[],S;if(y)S=await e(y,p,{...u,preferLocal:!0,env:b,args:x});else{let e=a(p);f!==`silent`&&r.message(`Delegating to ${C(e)}`),S=await o(e,`build`,x,{...u,env:b})}if(S.exitCode!==0||S.signal)throw new i(S.exitCode,{signal:S.signal});let{workers:w,rootConfig:T}=await c(p);return _(m(w,s),T),f!==`silent`&&r.success(`Build complete`),`built`}function C(e){switch(e.impl.pkg){case`@cloudflare/vite-plugin`:return`Vite`;case`wrangler`:return`Wrangler`;case`cloudflare-py-dev-server`:return`the Python dev server`;case`cloudflare-rs-dev-server`:return`the Rust dev server`;default:return e.impl.pkg}}const w={command:`build`,describe:`Build a project for Cloudflare`,builder:x,handler:async e=>{await S(e.mode)}};export{p as a,f as c,h as i,d as l,S as n,_ as o,g as r,m as s,w as t,u};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{i as t,n}from"./auth-
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{i as t,n}from"./auth-CRq9OQKr.mjs";import{t as r}from"./dry-run-mrA7FFLR.mjs";import{a as i,t as a}from"./context-DsVjrTbe.mjs";import{t as o}from"./local-B3zt9PXR.mjs";import{t as s}from"./output-PRKYaJuo.mjs";import{t as c}from"./progress-DItBn6ZV.mjs";import{t as l}from"./run-DAK_kbUa.mjs";import"./telemetry-B3S5OfOn.mjs";import{c as u,i as d,n as f,o as p,r as m,t as h}from"./body-parser-HN91kAf0.mjs";import{n as g}from"./input-validation-D7z60HJH.mjs";import{a as _,i as v,n as y}from"./prompt-BGz3DNLz.mjs";import{t as b}from"./body-unions-QFGGUlIr.mjs";var ee={method:`PUT`,path:t=>e`/accounts/${t.account_id}/builds/builds/${t.build_uuid}/cancel`,errors:{401:`UnauthorizedError`,404:`NotFoundError`}};function te(e){return e.usage(`$0 builds cancel <build-uuid>
|
|
3
3
|
|
|
4
4
|
Cancel a queued or running build.`).positional(`build-uuid`,{type:`string`,description:`UUID of the build, as returned by builds list.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`cancel <build-uuid>`,describe:`Cancel a Workers build`,builder:te,handler:async e=>l({command:`builds cancel`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();r({command:`cf builds cancel`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/builds/builds/${e[`build-uuid`]==null?`<build-uuid>`:encodeURIComponent(String(e[`build-uuid`]))}/cancel`,pathParams:{"build-uuid":String(e[`build-uuid`]??``)},bodyKind:`none`});return}let t=await n(e),l=e.local?o:await a();e.accountId=l;let u=await c(`Updating`,async()=>t.send(ee,{account_id:l,build_uuid:e[`build-uuid`]}));s(u,{successLabel:`Updated`})})};function re(e){return e.usage(`$0 builds create <worker>
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{i as t,n}from"./auth-cj71dGxS.mjs";import{i as r}from"./context-DlFhI9cN.mjs";import{r as i,t as a}from"./body-parser-HN91kAf0.mjs";import{t as o}from"./dry-run-mrA7FFLR.mjs";import{t as s}from"./output-PRKYaJuo.mjs";import{t as c}from"./run-DAg7dfIW.mjs";import{t as l}from"./progress-AML-AVs4.mjs";import{a as u,i as d,n as f}from"./prompt-Bnon9lfK.mjs";import"./telemetry-DDs3zhdw.mjs";import{n as p}from"./input-validation-D7z60HJH.mjs";var m={method:`POST`,path:t=>e`/zones/${t.zone_id}/environments/${t.environment_id}/invalidate_cache`,body:`json`};function h(e){return e.usage("$0 cache invalidate-environment <environment-id>\n\nMarks cached content as stale for one environment of the zone. Content cached for the zone's other environments, including production, is not affected. Otherwise this works like `POST /zones/{zone_id}/invalidate_cache`: the next request for invalidated content makes Cloudflare revalidate it with your origin, and the request body takes the same fields. Environments are part of [Version Management](https://developers.cloudflare.com/version-management/). To delete the content instead, use `POST /zones/{zone_id}/environments/{environment_id}/purge_cache`. Invalidating by URL (`files`) does not work for environments that select requests by IP address, country, ASN, or threat score, and fails with error `1136`. Use `tags`, `hosts`, `prefixes`, or `purge_everything` for those environments. ### Availability and limits Rate limits and the number of items you can send in one request depend on your plan. See [Purge cache: availability and limits](https://developers.cloudflare.com/cache/how-to/purge-cache/#availability-and-limits).").positional(`environment-id`,{type:`string`,description:`The environment ID, from Version Management.`,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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`invalidate-environment <environment-id>`,describe:`Invalidate Cached Content by Environment`,builder:h,handler:async e=>c({command:`cache invalidate-environment`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){o({command:`cf cache invalidate-environment`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/environments/${e[`environment-id`]==null?`<environment-id>`:encodeURIComponent(String(e[`environment-id`]))}/invalidate_cache`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"environment-id":String(e[`environment-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:i(e.body)});return}let a=e.body===void 0?void 0:i(e.body),c=await n(e),u=await r({zone:e.zone},c,{quiet:e.quiet});if(e.zoneId=u,!await f({force:!!e.force,message:`This operation marks the selected content in the environment's cache as stale.`}))return;if(e.body!==void 0){let t=a,n=await l(`Processing`,async()=>c.send(m,{body:t,zone_id:u,environment_id:e[`environment-id`]}));s(n,{successLabel:`Done`});return}let d=await l(`Processing`,async()=>t(c,`POST`,`/zones/${e.zoneId}/environments/${encodeURIComponent(String(e[`environment-id`]))}/invalidate_cache`));s(d,{successLabel:`Done`})})};var _={method:`POST`,path:t=>e`/zones/${t.zone_id}/invalidate_cache`,body:`json`};function ee(e){return e.usage("$0 cache invalidate\n\nMarks cached content as stale in every Cloudflare data center and cache tier, including Cache Reserve. The content stays in cache. The next request for it makes Cloudflare revalidate it with your origin, using the `ETag` and `Last-Modified` values it was cached with: - If your origin answers `304 Not Modified`, Cloudflare serves the cached copy without downloading it again, and `CF-Cache-Status` is `REVALIDATED`. - If your origin sends a full response, Cloudflare serves and caches the new content, and `CF-Cache-Status` is `EXPIRED`. With Tiered Cache, each tier revalidates with the tier above it, so a visitor can see `EXPIRED` even when your origin answered `304`. Until content is revalidated, your `stale-while-revalidate` and `stale-if-error` directives still apply, counted from the time you invalidated it. For example, if your origin fails during revalidation, Cloudflare can keep serving the stale copy for the `stale-if-error` window. ### Invalidate or purge? - **Invalidate** when content may not have changed, for example after a deploy. Unchanged content costs your origin a `304` instead of a full response. That saving needs an origin that sends `ETag` or `Last-Modified` and answers conditional requests. Otherwise, every revalidation downloads the full response. - **Purge**, with `POST /zones/{zone_id}/purge_cache`, when content must not be served again, for example content you removed for legal or security reasons. Invalidating takes the same request bodies as purging, needs the same permission, and counts against the same rate limits. After a broad invalidation, such as `purge_everything`, expect more conditional requests to your origin while visitors request the invalidated content again. ### Choose what to invalidate Send one of these fields in the request body: - `files`: specific URLs. If your cache key includes request headers, send each URL with the header values it was cached with. - `tags`: all content whose `Cache-Tag` response header contains one of the tags. - `hosts`: all content cached for the hostnames. - `prefixes`: all content whose URL starts with one of the prefixes. - `purge_everything`: all cached content in the zone. ### Check the result A `200` response with `success: true` means Cloudflare accepted the request. To check, request an invalidated URL and confirm that the `CF-Cache-Status` response header is `REVALIDATED` or `EXPIRED`. ### Availability and limits Rate limits and the number of items you can send in one request depend on your plan. See [Purge cache: availability and limits](https://developers.cloudflare.com/cache/how-to/purge-cache/#availability-and-limits).").option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const te={command:`invalidate`,describe:`Invalidate Cached Content`,builder:ee,handler:async e=>c({command:`cache invalidate`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){o({command:`cf cache invalidate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/invalidate_cache`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:i(e.body)});return}let a=e.body===void 0?void 0:i(e.body),c=await n(e),u=await r({zone:e.zone},c,{quiet:e.quiet});if(e.zoneId=u,!await f({force:!!e.force,message:`This operation marks the selected content in the zone's cache as stale.`}))return;if(e.body!==void 0){let e=a,t=await l(`Processing`,async()=>c.send(_,{body:e,zone_id:u}));s(t,{successLabel:`Done`});return}let d=await l(`Processing`,async()=>t(c,`POST`,`/zones/${e.zoneId}/invalidate_cache`));s(d,{successLabel:`Done`})})};var ne={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/origin/cloud_regions/batch`,body:`json`};function re(e){return e.usage("$0 cache origin-cloud-regions bulk delete\n\nRemoves up to 100 IP-to-cloud-region mappings in a single request. Each IP is validated independently — successfully deleted items are returned in the `succeeded` array and IPs that could not be found or are invalid are returned in the `failed` array.").option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ie={command:`delete`,describe:`Batch delete origin cloud region mappings`,builder:re,handler:async e=>c({command:`cache origin-cloud-regions bulk delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){o({command:`cf cache origin-cloud-regions bulk delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin/cloud_regions/batch`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:i(e.body,[],100)});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`);let t=e.body===void 0?void 0:i(e.body,[],100),a=await n(e),c=await r({zone:e.zone},a,{quiet:e.quiet});if(e.zoneId=c,await f({force:!!e.force,message:`Are you sure you want to delete these Origin Cloud Region configurations?`})&&e.body!==void 0){let e=t,n=await l(`Deleting`,async()=>a.send(ne,{body:e,zone_id:c}));s(n,{successLabel:`Deleted`})}})};var ae={method:`PUT`,path:t=>e`/zones/${t.zone_id}/origin/cloud_regions/batch`,body:`json`};function v(e){return e.usage("$0 cache origin-cloud-regions bulk update\n\nUpserts up to 100 IP-to-cloud-region mappings in a single request. Items in the request body are created or replaced; mappings not included in the request body are preserved unchanged (this is a merge operation, not a full collection replacement). Each item is validated independently — valid items are applied and invalid items are returned in the `failed` array. The vendor and region for every item are validated against the list from `GET /zones/{zone_id}/origin/cloud_regions/supported_regions`.").option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`update`,describe:`Batch create or replace origin cloud region mappings`,builder:v,handler:async e=>c({command:`cache origin-cloud-regions bulk update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf cache origin-cloud-regions bulk update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin/cloud_regions/batch`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:i(e.body,[],100)});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`);let t=e.body===void 0?void 0:i(e.body,[],100),a=await n(e),c=await r({zone:e.zone},a,{quiet:e.quiet});if(e.zoneId=c,e.body!==void 0){let e=t,n=await l(`Updating`,async()=>a.send(ae,{body:e,zone_id:c}));s(n,{successLabel:`Updated`})}})},b={command:`bulk`,describe:`Operations for origin-cloud-regions.bulk`,builder:e=>e.command(ie).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var x={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/origin/cloud_regions/${t.origin_ip}`};function S(e){return e.usage(`$0 cache origin-cloud-regions delete <origin-ip>
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{i as t,n}from"./auth-CRq9OQKr.mjs";import{i as r}from"./context-DsVjrTbe.mjs";import{r as i,t as a}from"./body-parser-HN91kAf0.mjs";import{t as o}from"./dry-run-mrA7FFLR.mjs";import{t as s}from"./output-PRKYaJuo.mjs";import{t as c}from"./run-DAK_kbUa.mjs";import{t as l}from"./progress-DItBn6ZV.mjs";import{a as u,i as d,n as f}from"./prompt-BGz3DNLz.mjs";import"./telemetry-B3S5OfOn.mjs";import{n as p}from"./input-validation-D7z60HJH.mjs";var m={method:`POST`,path:t=>e`/zones/${t.zone_id}/environments/${t.environment_id}/invalidate_cache`,body:`json`};function h(e){return e.usage("$0 cache invalidate-environment <environment-id>\n\nMarks cached content as stale for one environment of the zone. Content cached for the zone's other environments, including production, is not affected. Otherwise this works like `POST /zones/{zone_id}/invalidate_cache`: the next request for invalidated content makes Cloudflare revalidate it with your origin, and the request body takes the same fields. Environments are part of [Version Management](https://developers.cloudflare.com/version-management/). To delete the content instead, use `POST /zones/{zone_id}/environments/{environment_id}/purge_cache`. Invalidating by URL (`files`) does not work for environments that select requests by IP address, country, ASN, or threat score, and fails with error `1136`. Use `tags`, `hosts`, `prefixes`, or `purge_everything` for those environments. ### Availability and limits Rate limits and the number of items you can send in one request depend on your plan. See [Purge cache: availability and limits](https://developers.cloudflare.com/cache/how-to/purge-cache/#availability-and-limits).").positional(`environment-id`,{type:`string`,description:`The environment ID, from Version Management.`,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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`invalidate-environment <environment-id>`,describe:`Invalidate Cached Content by Environment`,builder:h,handler:async e=>c({command:`cache invalidate-environment`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){o({command:`cf cache invalidate-environment`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/environments/${e[`environment-id`]==null?`<environment-id>`:encodeURIComponent(String(e[`environment-id`]))}/invalidate_cache`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"environment-id":String(e[`environment-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:i(e.body)});return}let a=e.body===void 0?void 0:i(e.body),c=await n(e),u=await r({zone:e.zone},c,{quiet:e.quiet});if(e.zoneId=u,!await f({force:!!e.force,message:`This operation marks the selected content in the environment's cache as stale.`}))return;if(e.body!==void 0){let t=a,n=await l(`Processing`,async()=>c.send(m,{body:t,zone_id:u,environment_id:e[`environment-id`]}));s(n,{successLabel:`Done`});return}let d=await l(`Processing`,async()=>t(c,`POST`,`/zones/${e.zoneId}/environments/${encodeURIComponent(String(e[`environment-id`]))}/invalidate_cache`));s(d,{successLabel:`Done`})})};var _={method:`POST`,path:t=>e`/zones/${t.zone_id}/invalidate_cache`,body:`json`};function ee(e){return e.usage("$0 cache invalidate\n\nMarks cached content as stale in every Cloudflare data center and cache tier, including Cache Reserve. The content stays in cache. The next request for it makes Cloudflare revalidate it with your origin, using the `ETag` and `Last-Modified` values it was cached with: - If your origin answers `304 Not Modified`, Cloudflare serves the cached copy without downloading it again, and `CF-Cache-Status` is `REVALIDATED`. - If your origin sends a full response, Cloudflare serves and caches the new content, and `CF-Cache-Status` is `EXPIRED`. With Tiered Cache, each tier revalidates with the tier above it, so a visitor can see `EXPIRED` even when your origin answered `304`. Until content is revalidated, your `stale-while-revalidate` and `stale-if-error` directives still apply, counted from the time you invalidated it. For example, if your origin fails during revalidation, Cloudflare can keep serving the stale copy for the `stale-if-error` window. ### Invalidate or purge? - **Invalidate** when content may not have changed, for example after a deploy. Unchanged content costs your origin a `304` instead of a full response. That saving needs an origin that sends `ETag` or `Last-Modified` and answers conditional requests. Otherwise, every revalidation downloads the full response. - **Purge**, with `POST /zones/{zone_id}/purge_cache`, when content must not be served again, for example content you removed for legal or security reasons. Invalidating takes the same request bodies as purging, needs the same permission, and counts against the same rate limits. After a broad invalidation, such as `purge_everything`, expect more conditional requests to your origin while visitors request the invalidated content again. ### Choose what to invalidate Send one of these fields in the request body: - `files`: specific URLs. If your cache key includes request headers, send each URL with the header values it was cached with. - `tags`: all content whose `Cache-Tag` response header contains one of the tags. - `hosts`: all content cached for the hostnames. - `prefixes`: all content whose URL starts with one of the prefixes. - `purge_everything`: all cached content in the zone. ### Check the result A `200` response with `success: true` means Cloudflare accepted the request. To check, request an invalidated URL and confirm that the `CF-Cache-Status` response header is `REVALIDATED` or `EXPIRED`. ### Availability and limits Rate limits and the number of items you can send in one request depend on your plan. See [Purge cache: availability and limits](https://developers.cloudflare.com/cache/how-to/purge-cache/#availability-and-limits).").option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const te={command:`invalidate`,describe:`Invalidate Cached Content`,builder:ee,handler:async e=>c({command:`cache invalidate`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){o({command:`cf cache invalidate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/invalidate_cache`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:i(e.body)});return}let a=e.body===void 0?void 0:i(e.body),c=await n(e),u=await r({zone:e.zone},c,{quiet:e.quiet});if(e.zoneId=u,!await f({force:!!e.force,message:`This operation marks the selected content in the zone's cache as stale.`}))return;if(e.body!==void 0){let e=a,t=await l(`Processing`,async()=>c.send(_,{body:e,zone_id:u}));s(t,{successLabel:`Done`});return}let d=await l(`Processing`,async()=>t(c,`POST`,`/zones/${e.zoneId}/invalidate_cache`));s(d,{successLabel:`Done`})})};var ne={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/origin/cloud_regions/batch`,body:`json`};function re(e){return e.usage("$0 cache origin-cloud-regions bulk delete\n\nRemoves up to 100 IP-to-cloud-region mappings in a single request. Each IP is validated independently — successfully deleted items are returned in the `succeeded` array and IPs that could not be found or are invalid are returned in the `failed` array.").option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ie={command:`delete`,describe:`Batch delete origin cloud region mappings`,builder:re,handler:async e=>c({command:`cache origin-cloud-regions bulk delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){o({command:`cf cache origin-cloud-regions bulk delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin/cloud_regions/batch`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:i(e.body,[],100)});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`);let t=e.body===void 0?void 0:i(e.body,[],100),a=await n(e),c=await r({zone:e.zone},a,{quiet:e.quiet});if(e.zoneId=c,await f({force:!!e.force,message:`Are you sure you want to delete these Origin Cloud Region configurations?`})&&e.body!==void 0){let e=t,n=await l(`Deleting`,async()=>a.send(ne,{body:e,zone_id:c}));s(n,{successLabel:`Deleted`})}})};var ae={method:`PUT`,path:t=>e`/zones/${t.zone_id}/origin/cloud_regions/batch`,body:`json`};function v(e){return e.usage("$0 cache origin-cloud-regions bulk update\n\nUpserts up to 100 IP-to-cloud-region mappings in a single request. Items in the request body are created or replaced; mappings not included in the request body are preserved unchanged (this is a merge operation, not a full collection replacement). Each item is validated independently — valid items are applied and invalid items are returned in the `failed` array. The vendor and region for every item are validated against the list from `GET /zones/{zone_id}/origin/cloud_regions/supported_regions`.").option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`update`,describe:`Batch create or replace origin cloud region mappings`,builder:v,handler:async e=>c({command:`cache origin-cloud-regions bulk update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){o({command:`cf cache origin-cloud-regions bulk update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin/cloud_regions/batch`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:i(e.body,[],100)});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`);let t=e.body===void 0?void 0:i(e.body,[],100),a=await n(e),c=await r({zone:e.zone},a,{quiet:e.quiet});if(e.zoneId=c,e.body!==void 0){let e=t,n=await l(`Updating`,async()=>a.send(ae,{body:e,zone_id:c}));s(n,{successLabel:`Updated`})}})},b={command:`bulk`,describe:`Operations for origin-cloud-regions.bulk`,builder:e=>e.command(ie).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var x={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/origin/cloud_regions/${t.origin_ip}`};function S(e){return e.usage(`$0 cache origin-cloud-regions delete <origin-ip>
|
|
3
3
|
|
|
4
4
|
Removes the cloud region mapping for a single origin IP address. The IP path parameter is normalized before lookup. Returns the deleted IP on success. Returns 404 if no mapping exists for the specified IP. When the last mapping for the zone is removed the underlying rule record is also deleted.`).positional(`origin-ip`,{type:`string`,description:`Origin IP address whose mapping should be deleted.`,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 C={command:`delete <origin-ip>`,describe:`Delete an origin cloud region mapping`,builder:S,handler:async e=>c({command:`cache origin-cloud-regions delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){o({command:`cf cache origin-cloud-regions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin/cloud_regions/${e[`origin-ip`]==null?`<origin-ip>`:encodeURIComponent(String(e[`origin-ip`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"origin-ip":String(e[`origin-ip`]??``)},bodyKind:`none`});return}let t=await n(e),i=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=i,!await f({force:!!e.force,message:`Are you sure you want to delete this Origin Cloud Region configuration?`}))return;let a=await l(`Deleting`,async()=>t.send(x,{zone_id:i,origin_ip:e[`origin-ip`]}));s(a,{successLabel:`Deleted`})})};var w={method:`GET`,path:t=>e`/zones/${t.zone_id}/origin/cloud_regions/${t.origin_ip}`};function T(e){return e.usage(`$0 cache origin-cloud-regions get <origin-ip>
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{_ as e,a as t,c as n,f as r,g as i,h as a,i as o,m as s,o as c,p as l,r as u,s as d,t as f,u as p,v as m,y as h}from"./chunk-Q5KVZMHK-Bjvrcihk.mjs";import{N as g,O as _}from"./chunk-AAQI36FL-e6E5HW1g.mjs";import{A as v,D as ee,O as te,P as ne,R as re,X as ie,Y as y,d as ae,h as oe,nt as b,ot as x}from"./dist-DwxlJ9Ms.mjs";import{createRequire as S}from"node:module";import{chmodSync as C,existsSync as w,mkdirSync as T,readFileSync as E,readdirSync as D,rmSync as O,writeFileSync as k}from"node:fs";import A from"node:path";import{URLSearchParams as se}from"node:url";S(import.meta.url||(typeof __filename==`string`?__filename:`/`));function j(e){function t(){return A.resolve(e(),`preferences.json`)}h(t,`getUserPreferencesPath`);function n(){try{let e=E(t(),`utf8`),n=JSON.parse(e);return typeof n==`object`&&n?n:{}}catch{return{}}}h(n,`readUserPreferences`);function r(e){let r={...n(),...e},i=t();T(A.dirname(i),{recursive:!0}),k(i,JSON.stringify(r,null,` `),{encoding:`utf-8`})}return h(r,`updateUserPreferences`),{readUserPreferences:n,updateUserPreferences:r}}h(j,`createPreferences`);var M=6e4,N=525600,P=43200,F=1440,I=Symbol.for(`constructDateFrom`);function L(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&I in e?e[I](t):e instanceof Date?new e.constructor(t):new Date(t)}h(L,`constructFrom`);function R(e,t){return L(t||e,e)}h(R,`toDate`);var z={};function B(){return z}h(B,`getDefaultOptions`);function V(e){let t=R(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-n}h(V,`getTimezoneOffsetInMilliseconds`);function H(e,...t){let n=L.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}h(H,`normalizeDates`);function U(e,t){let n=+R(e)-R(t);return n<0?-1:n>0?1:n}h(U,`compareAsc`);function W(e){return L(e,Date.now())}h(W,`constructNow`);function G(e){return t=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}h(G,`getRoundingMethod`);var K={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},q=/* @__PURE__ */ h((e,t,n)=>{let r,i=K[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r},`formatDistance`);function J(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}h(J,`buildFormatLongFn`);var ce={date:J({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:J({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:J({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},Y={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},le=/* @__PURE__ */ h((e,t,n,r)=>Y[e],`formatRelative`);function X(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}h(X,`buildLocalizeFn`);var ue={ordinalNumber:/* @__PURE__ */ h((e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},`ordinalNumber`),era:X({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:X({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:/* @__PURE__ */ h(e=>e-1,`argumentCallback`)}),month:X({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:X({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:X({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function Z(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?fe(s,e=>e.test(o)):de(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}h(Z,`buildMatchFn`);function de(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}h(de,`findKey`);function fe(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}h(fe,`findIndex`);function pe(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}h(pe,`buildMatchPatternFn`);var me={code:`en-US`,formatDistance:q,formatLong:ce,formatRelative:le,localize:ue,match:{ordinalNumber:pe({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:/* @__PURE__ */ h(e=>parseInt(e,10),`valueCallback`)}),era:Z({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:Z({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:/* @__PURE__ */ h(e=>e+1,`valueCallback`)}),month:Z({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:Z({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:Z({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function he(e,t,n){let r=B(),i=n?.locale??r.locale??me,a=U(e,t);if(isNaN(a))throw RangeError(`Invalid time value`);let o=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a}),[s,c]=H(n?.in,...a>0?[t,e]:[e,t]),l=G(n?.roundingMethod??`round`),u=c.getTime()-s.getTime(),d=u/M,f=(u-(V(c)-V(s)))/M,p=n?.unit,m;if(m=p||(d<1?`second`:d<60?`minute`:d<F?`hour`:f<P?`day`:f<N?`month`:`year`),m===`second`){let e=l(u/1e3);return i.formatDistance(`xSeconds`,e,o)}if(m===`minute`){let e=l(d);return i.formatDistance(`xMinutes`,e,o)}if(m===`hour`){let e=l(d/60);return i.formatDistance(`xHours`,e,o)}if(m===`day`){let e=l(f/F);return i.formatDistance(`xDays`,e,o)}if(m===`month`){let e=l(f/P);return e===12&&p!==`month`?i.formatDistance(`xYears`,1,o):i.formatDistance(`xMonths`,e,o)}{let e=l(f/N);return i.formatDistance(`xYears`,e,o)}}h(he,`formatDistanceStrict`);function ge(e,t){return he(e,W(e),t)}h(ge,`formatDistanceToNowStrict`);function Q(e,t){return{read:/* @__PURE__ */ h(()=>{let n=t();if(!w(n))return;let r=_(n);try{return s(e,r)}catch{return}},`read`),write(n){let r=t();T(A.dirname(r),{recursive:!0}),k(r,i(e,n),{encoding:`utf-8`,mode:384}),C(r,384)},clear(){let e=t(),n=w(e);return O(e,{force:!0}),n},path:t}}h(Q,`createFileStorage`);function _e(e){let{temporaryAccountLogger:t,prompt:n}=e;return/* @__PURE__ */ h(async function(e,r){if(v())return t.log(r),!0;let i=await n(e);return typeof i==`string`&&i.trim().toLowerCase()===`yes`},`ensureTemporaryTermsAccepted`)}h(_e,`createTemporaryTermsPrompt`);var ve=[9106,1e4];function ye(e){return e?.code}h(ye,`getErrorCode`);function be(e){let t=ye(e);return t!==void 0&&ve.includes(t)}h(be,`isMembershipsInaccessible`);function xe(e){return{"no-credentials-non-interactive":`Could not authenticate because no credentials were found and the environment is non-interactive. Set a CLOUDFLARE_API_TOKEN environment variable or run \`${e}\` in an interactive terminal first.`,"no-credentials-login-failed":`No credentials were found and the login attempt was unsuccessful. Run \`${e}\` to try again.`,"token-expired-non-interactive":`Your auth token has expired and could not be refreshed, and the environment is non-interactive. Run \`${e}\` in an interactive terminal or set a CLOUDFLARE_API_TOKEN.`,"token-expired-login-failed":`Your auth token has expired and could not be refreshed, and the login attempt was unsuccessful. Run \`${e}\` to try again.`,"token-refresh-unreachable":`Your auth token has expired and could not be refreshed because the Cloudflare auth server could not be reached. This is usually a network problem (connectivity, proxy, or IPv6), not an invalid login: your stored credentials were left unchanged. Check your connection and try again.`}}h(xe,`notLoggedInErrorBodies`);function Se(e,t,n){let r=new Date(t.claim.expiresAt);e.log(c`
|
|
2
|
+
import{_ as e,a as t,c as n,f as r,g as i,h as a,i as o,m as s,o as c,p as l,r as u,s as d,t as f,u as p,v as m,y as h}from"./chunk-Q5KVZMHK-CYhKv3kZ.mjs";import{N as g,O as _}from"./chunk-AAQI36FL-e6E5HW1g.mjs";import{A as v,D as ee,O as te,P as ne,R as re,X as ie,Y as y,d as ae,h as oe,nt as b,ot as x}from"./dist-BoDdDWjK.mjs";import{createRequire as S}from"node:module";import{chmodSync as C,existsSync as w,mkdirSync as T,readFileSync as E,readdirSync as D,rmSync as O,writeFileSync as k}from"node:fs";import A from"node:path";import{URLSearchParams as se}from"node:url";S(import.meta.url||(typeof __filename==`string`?__filename:`/`));function j(e){function t(){return A.resolve(e(),`preferences.json`)}h(t,`getUserPreferencesPath`);function n(){try{let e=E(t(),`utf8`),n=JSON.parse(e);return typeof n==`object`&&n?n:{}}catch{return{}}}h(n,`readUserPreferences`);function r(e){let r={...n(),...e},i=t();T(A.dirname(i),{recursive:!0}),k(i,JSON.stringify(r,null,` `),{encoding:`utf-8`})}return h(r,`updateUserPreferences`),{readUserPreferences:n,updateUserPreferences:r}}h(j,`createPreferences`);var M=6e4,N=525600,P=43200,F=1440,I=Symbol.for(`constructDateFrom`);function L(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&I in e?e[I](t):e instanceof Date?new e.constructor(t):new Date(t)}h(L,`constructFrom`);function R(e,t){return L(t||e,e)}h(R,`toDate`);var z={};function B(){return z}h(B,`getDefaultOptions`);function V(e){let t=R(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-n}h(V,`getTimezoneOffsetInMilliseconds`);function H(e,...t){let n=L.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}h(H,`normalizeDates`);function U(e,t){let n=+R(e)-R(t);return n<0?-1:n>0?1:n}h(U,`compareAsc`);function W(e){return L(e,Date.now())}h(W,`constructNow`);function G(e){return t=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}h(G,`getRoundingMethod`);var K={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},q=/* @__PURE__ */ h((e,t,n)=>{let r,i=K[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r},`formatDistance`);function J(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}h(J,`buildFormatLongFn`);var ce={date:J({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:J({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:J({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},Y={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},le=/* @__PURE__ */ h((e,t,n,r)=>Y[e],`formatRelative`);function X(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}h(X,`buildLocalizeFn`);var ue={ordinalNumber:/* @__PURE__ */ h((e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},`ordinalNumber`),era:X({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:X({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:/* @__PURE__ */ h(e=>e-1,`argumentCallback`)}),month:X({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:X({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:X({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function Z(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?fe(s,e=>e.test(o)):de(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}h(Z,`buildMatchFn`);function de(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}h(de,`findKey`);function fe(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}h(fe,`findIndex`);function pe(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}h(pe,`buildMatchPatternFn`);var me={code:`en-US`,formatDistance:q,formatLong:ce,formatRelative:le,localize:ue,match:{ordinalNumber:pe({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:/* @__PURE__ */ h(e=>parseInt(e,10),`valueCallback`)}),era:Z({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:Z({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:/* @__PURE__ */ h(e=>e+1,`valueCallback`)}),month:Z({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:Z({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:Z({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function he(e,t,n){let r=B(),i=n?.locale??r.locale??me,a=U(e,t);if(isNaN(a))throw RangeError(`Invalid time value`);let o=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a}),[s,c]=H(n?.in,...a>0?[t,e]:[e,t]),l=G(n?.roundingMethod??`round`),u=c.getTime()-s.getTime(),d=u/M,f=(u-(V(c)-V(s)))/M,p=n?.unit,m;if(m=p||(d<1?`second`:d<60?`minute`:d<F?`hour`:f<P?`day`:f<N?`month`:`year`),m===`second`){let e=l(u/1e3);return i.formatDistance(`xSeconds`,e,o)}if(m===`minute`){let e=l(d);return i.formatDistance(`xMinutes`,e,o)}if(m===`hour`){let e=l(d/60);return i.formatDistance(`xHours`,e,o)}if(m===`day`){let e=l(f/F);return i.formatDistance(`xDays`,e,o)}if(m===`month`){let e=l(f/P);return e===12&&p!==`month`?i.formatDistance(`xYears`,1,o):i.formatDistance(`xMonths`,e,o)}{let e=l(f/N);return i.formatDistance(`xYears`,e,o)}}h(he,`formatDistanceStrict`);function ge(e,t){return he(e,W(e),t)}h(ge,`formatDistanceToNowStrict`);function Q(e,t){return{read:/* @__PURE__ */ h(()=>{let n=t();if(!w(n))return;let r=_(n);try{return s(e,r)}catch{return}},`read`),write(n){let r=t();T(A.dirname(r),{recursive:!0}),k(r,i(e,n),{encoding:`utf-8`,mode:384}),C(r,384)},clear(){let e=t(),n=w(e);return O(e,{force:!0}),n},path:t}}h(Q,`createFileStorage`);function _e(e){let{temporaryAccountLogger:t,prompt:n}=e;return/* @__PURE__ */ h(async function(e,r){if(v())return t.log(r),!0;let i=await n(e);return typeof i==`string`&&i.trim().toLowerCase()===`yes`},`ensureTemporaryTermsAccepted`)}h(_e,`createTemporaryTermsPrompt`);var ve=[9106,1e4];function ye(e){return e?.code}h(ye,`getErrorCode`);function be(e){let t=ye(e);return t!==void 0&&ve.includes(t)}h(be,`isMembershipsInaccessible`);function xe(e){return{"no-credentials-non-interactive":`Could not authenticate because no credentials were found and the environment is non-interactive. Set a CLOUDFLARE_API_TOKEN environment variable or run \`${e}\` in an interactive terminal first.`,"no-credentials-login-failed":`No credentials were found and the login attempt was unsuccessful. Run \`${e}\` to try again.`,"token-expired-non-interactive":`Your auth token has expired and could not be refreshed, and the environment is non-interactive. Run \`${e}\` in an interactive terminal or set a CLOUDFLARE_API_TOKEN.`,"token-expired-login-failed":`Your auth token has expired and could not be refreshed, and the login attempt was unsuccessful. Run \`${e}\` to try again.`,"token-refresh-unreachable":`Your auth token has expired and could not be refreshed because the Cloudflare auth server could not be reached. This is usually a network problem (connectivity, proxy, or IPv6), not an invalid login: your stored credentials were left unchanged. Check your connection and try again.`}}h(xe,`notLoggedInErrorBodies`);function Se(e,t,n){let r=new Date(t.claim.expiresAt);e.log(c`
|
|
3
3
|
Temporary account ready:
|
|
4
4
|
Account: ${t.account.name} (${n?`reused`:`created`})
|
|
5
5
|
Claim within: ${ge(r)}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{n as e,t}from"./rolldown-runtime-BNtqjh-B.mjs";import{M as n,V as r,m as i}from"./dist-DwxlJ9Ms.mjs";import{N as a,r as o}from"./chunk-AAQI36FL-e6E5HW1g.mjs";import{createRequire as s}from"node:module";import{readFileSync as c}from"node:fs";import l,{resolve as u}from"node:path";import d from"node:assert";import{spawnSync as f}from"node:child_process";const p=s(import.meta.url||(typeof __filename==`string`?__filename:`/`));var m=Object.create,h=Object.defineProperty,g=Object.getOwnPropertyDescriptor,_=Object.getOwnPropertyNames,v=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty,b=(e,t)=>h(e,`name`,{value:t,configurable:!0}),x=/* @__PURE__ */ (e=>p===void 0?typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(p===void 0?e:p)[t]}):e:p)(function(e){if(p!==void 0)return p.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),S=(e,t)=>function(){return t||(0,e[_(e)[0]])((t={exports:{}}).exports,t),t.exports},C=(e,t)=>{for(var n in t)h(e,n,{get:t[n],enumerable:!0})},w=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of _(t))!y.call(e,i)&&i!==n&&h(e,i,{get:()=>t[i],enumerable:!(r=g(t,i))||r.enumerable});return e},T=(e,t,n)=>(n=e==null?{}:m(v(e)),w(t||!e||!e.__esModule?h(n,`default`,{value:e,enumerable:!0}):n,e)),E=/* @__PURE__ */ t(((t,n)=>{var r=e(`child_process`).exec,i=e(`child_process`).execSync,a=e(`fs`),o=e(`path`),s=a.access,c=a.accessSync,l=a.constants||a,u=process.platform==`win32`,d=function(e,t){s(e,l.F_OK,function(e){t(!e)})},f=function(e){try{return c(e,l.F_OK),!1}catch{return!0}},p=function(e,t){s(e,l.F_OK|l.X_OK,function(e){t(null,!e)})},m=function(e){try{return c(e,l.F_OK|l.X_OK),!0}catch{return!1}},h=function(e,t,n){d(e,function(i){i?p(e,n):r(`command -v `+t+` 2>/dev/null && { echo >&1 `+t+`; exit 0; }`,function(e,t,r){n(null,!!t)})})},g=function(e,t,n){/^(?!(?:.*\s|.*\.|\W+)$)(?:[a-zA-Z]:)?(?:(?:[^<>:"\|\?\*\n])+(?:\/\/|\/|\\\\|\\)?)+$/m.test(e)?r(`where `+t,function(e){e===null?n(null,!0):n(null,!1)}):n(null,!1)},_=function(e,t){if(f(e))try{return!!i(`command -v `+t+` 2>/dev/null && { echo >&1 `+t+`; exit 0; }`)}catch{return!1}return m(e)},v=function(e,t,n){if(!/^(?!(?:.*\s|.*\.|\W+)$)(?:[a-zA-Z]:)?(?:(?:[^<>:"\|\?\*\n])+(?:\/\/|\/|\\\\|\\)?)+$/m.test(e))return!1;try{return!!i(`where `+t,{stdio:[]})}catch{return!1}},y=function(e){return/[^A-Za-z0-9_\/:=-]/.test(e)&&(e=`'`+e.replace(/'/g,`'\\''`)+`'`,e=e.replace(/^(?:'')+/g,``).replace(/\\'''/g,`\\'`)),e};u&&(y=function(e){if(/[\\]/.test(e)){var t=`"`+o.dirname(e)+`"`,n=`"`+o.basename(e)+`"`;return t+`:`+n}return`"`+e+`"`}),n.exports=function e(t,n){var r=y(t);if(!n&&typeof Promise<`u`)return new Promise(function(n,r){e(t,function(e,i){i?n(t):r(e)})});u?g(t,r,n):h(t,r,n)},n.exports.sync=function(e){var t=y(e);return u?v(e,t):_(e,t)}})),D=/* @__PURE__ */ t(((e,t)=>{t.exports=E()})),ee=r(),O=D();s(import.meta.url||(typeof __filename==`string`?__filename:`/`));function k(e){if(e.compiled_schema)return c(u(e.compiled_schema));let{base_path:t,source_schemas:n}=e,r=(n??[]).map(e=>u(t,e));if(!(0,O.sync)(`capnp`))throw new a(`The capnp compiler is required to upload capnp schemas, but is not present.`,{telemetryMessage:`capnp compiler missing`});let i=u(t??`.`),o=f(`capnp`,[`compile`,`-o-`,`--src-prefix=${i}`,...r],{maxBuffer:3145728});if(o.error)throw o.error;if(o.stderr.length)throw Error(o.stderr.toString());return o.stdout}b(k,`handleUnsafeCapnp`);var A={esm:`application/javascript+module`,commonjs:`application/javascript`,"compiled-wasm":`application/wasm`,buffer:`application/octet-stream`,text:`text/plain`,python:`text/x-python`,"python-requirement":`text/x-python-requirement`};function j(e){let t=A[e];if(t===void 0)throw TypeError(`Unsupported module: `+e);return t}b(j,`toMimeType`);function M(e){let t=Object.keys(A).find(t=>A[t]===e);if(t===void 0)throw TypeError(`Unsupported mime type: `+e);return t}b(M,`fromMimeType`);function N(e,t,r){let s=new ee.FormData,{main:u,sourceMaps:f,migrations:p,code_update_strategy:m,exports:h,compatibility_date:g,compatibility_flags:_,keepVars:v,keepSecrets:y,keepBindings:b,logpush:x,placement:S,tail_consumers:C,streaming_tail_consumers:w,limits:T,annotations:E,keep_assets:D,assets:O,observability:A,cache:M,package_dependencies:N}=e,P={html_handling:O?.assetConfig?.html_handling,not_found_handling:O?.assetConfig?.not_found_handling,base_path:O?.assetConfig?.base_path,run_worker_first:O?.run_worker_first,_redirects:O?._redirects,_headers:O?._headers};if(O&&!O.routerConfig.has_user_worker)return s.set(`metadata`,JSON.stringify({assets:{jwt:O.jwt,config:P},...E&&{annotations:E},...g&&{compatibility_date:g},..._&&{compatibility_flags:_}})),s;let{modules:F}=e,I=[],te=i(`plain_text`,t),ne=i(`json`,t),re=i(`secret_text`,t),ie=i(`kv_namespace`,t),ae=i(`send_email`,t),oe=i(`durable_object_namespace`,t),se=i(`workflow`,t),ce=i(`queue`,t),le=i(`r2_bucket`,t),ue=i(`d1`,t),de=i(`vectorize`,t),fe=i(`ai_search_namespace`,t),pe=i(`ai_search`,t),L=i(`agent_memory`,t),R=i(`hyperdrive`,t),z=i(`secrets_store_secret`,t),B=i(`artifacts`,t),me=i(`unsafe_hello_world`,t),he=i(`flagship`,t),ge=i(`ratelimit`,t),_e=i(`vpc_service`,t),ve=i(`vpc_network`,t),V=i(`service`,t),ye=i(`analytics_engine`,t),be=i(`dispatch_namespace`,t),xe=i(`mtls_certificate`,t),Se=i(`pipeline`,t),Ce=i(`k2`,t),we=i(`worker_loader`,t),Te=i(`logfwdr`,t),Ee=i(`wasm_module`,t),H=i(`browser`,t)[0],U=i(`analytics`,t)[0],W=i(`ai`,t)[0],G=i(`images`,t)[0],K=i(`stream`,t)[0],q=i(`media`,t)[0],J=i(`version_metadata`,t)[0],Y=i(`assets`,t)[0],De=i(`text_blob`,t),Oe=i(`data_blob`,t);i(`inherit`,t).forEach(({binding:e})=>{I.push({name:e,type:`inherit`})}),te.forEach(({binding:e,value:t})=>{I.push({name:e,type:`plain_text`,text:t})}),ne.forEach(({binding:e,value:t})=>{I.push({name:e,type:`json`,json:t})}),re.forEach(({binding:e,value:t})=>{I.push({name:e,type:`secret_text`,text:t})}),ie.forEach(({id:e,binding:t,raw:n})=>{if(r?.dryRun&&(e??=o),e===void 0)throw new a(`${t} bindings must have an "id" field`,{telemetryMessage:`kv namespace binding missing id`});e===o?I.push({name:t,type:`inherit`}):I.push({name:t,type:`kv_namespace`,namespace_id:e,raw:n})}),ae.forEach(e=>{let t={name:e.name,type:`send_email`,allowed_sender_addresses:e.allowed_sender_addresses};e.destination_address===void 0?e.allowed_destination_addresses===void 0?I.push(t):I.push({...t,allowed_destination_addresses:e.allowed_destination_addresses}):I.push({...t,destination_address:e.destination_address})}),oe.forEach(({name:e,class_name:t,script_name:n,environment:r})=>{I.push({name:e,type:`durable_object_namespace`,class_name:t,...n&&{script_name:n},...r&&{environment:r}})}),se.forEach(({binding:e,name:t,class_name:n,script_name:r,raw:i})=>{I.push({type:`workflow`,name:e,workflow_name:t,class_name:n,script_name:r,raw:i})}),ce.forEach(({binding:e,queue_name:t,delivery_delay:n,raw:i})=>{if(r?.dryRun&&(t??=o),t===void 0)throw new a(`${e} bindings must have a "queue" field. Add a "queue" field to the producer in your Worker configuration specifying the name of the Queue to bind to.`,{telemetryMessage:`queue binding missing name`});t===o?I.push({name:e,type:`inherit`}):I.push({type:`queue`,name:e,queue_name:t,delivery_delay:n,raw:i})}),le.forEach(({binding:e,bucket_name:t,jurisdiction:n,raw:i})=>{if(r?.dryRun&&(t??=o),t===void 0)throw new a(`${e} bindings must have a "bucket_name" field. Add a "bucket_name" field to the binding in your Worker configuration specifying the name of the R2 bucket to bind to.`,{telemetryMessage:`r2 bucket binding missing bucket_name`});t===o?I.push({name:e,type:`inherit`}):I.push({name:e,type:`r2_bucket`,bucket_name:t,jurisdiction:n,raw:i})}),ue.forEach(({binding:e,database_id:t,database_internal_env:n,raw:i})=>{if(r?.dryRun&&(t??=o),t===void 0)throw new a(`${e} bindings must have a "database_id" field. Add a "database_id" field to the binding in your Worker configuration specifying the ID of the D1 database to bind to.`,{telemetryMessage:`d1 database binding missing database_id`});t===o?I.push({name:e,type:`inherit`}):I.push({name:e,type:`d1`,id:t,internalEnv:n,raw:i})}),de.forEach(({binding:e,index_name:t,raw:n})=>{I.push({name:e,type:`vectorize`,index_name:t,raw:n})}),fe.forEach(({binding:e,namespace:t})=>{if(r?.dryRun&&(t??=o),t===void 0)throw new a(`${e} bindings must have a "namespace" field. Add a "namespace" field to the binding in your Worker configuration specifying the AI Search namespace to bind to.`,{telemetryMessage:`ai search namespace binding missing namespace`});t===o?I.push({name:e,type:`inherit`}):I.push({name:e,type:`ai_search_namespace`,namespace:t})}),pe.forEach(({binding:e,instance_name:t})=>{I.push({name:e,type:`ai_search`,instance_name:t})}),L.forEach(({binding:e,namespace:t})=>{if(r?.dryRun&&(t??=o),t===void 0)throw new a(`${e} bindings must have a "namespace" field. Add a "namespace" field to the binding in your Worker configuration specifying the namespace to bind to.`,{telemetryMessage:!1});t===o?I.push({name:e,type:`inherit`}):I.push({name:e,type:`agent_memory`,namespace:t})}),R.forEach(({binding:e,id:t})=>{I.push({name:e,type:`hyperdrive`,id:t})}),z.forEach(({binding:e,store_id:t,secret_name:n})=>{I.push({name:e,type:`secrets_store_secret`,store_id:t,secret_name:n})}),B.forEach(({binding:e,namespace:t})=>{I.push({name:e,type:`artifacts`,namespace:t})}),me.forEach(({binding:e,enable_timer:t})=>{I.push({name:e,type:`unsafe_hello_world`,enable_timer:t})}),he.forEach(({binding:e,app_id:t})=>{if(r?.dryRun&&(t??=o),t===void 0)throw new a(`${e} bindings must have an "app_id" field. Add an "app_id" field to the binding in your Worker configuration specifying the Flagship app to bind to.`,{telemetryMessage:`flagship binding missing app id`});I.push(t===o?{name:e,type:`inherit`}:{name:e,type:`flagship`,app_id:t})}),ge.forEach(({name:e,namespace_id:t,simple:n})=>{I.push({name:e,type:`ratelimit`,namespace_id:t,simple:n})}),_e.forEach(({binding:e,service_id:t})=>{I.push({name:e,type:`vpc_service`,service_id:t})}),ve.forEach(({binding:e,tunnel_id:t,network_id:n})=>{I.push({name:e,type:`vpc_network`,...t===void 0?{network_id:n}:{tunnel_id:t}})}),V.forEach(({binding:e,service:t,environment:n,entrypoint:r,props:i,cross_account_grant:a})=>{I.push({name:e,type:`service`,service:t,cross_account_grant:a,...n&&{environment:n},...r&&{entrypoint:r},...i&&{props:i}})}),ye.forEach(({binding:e,dataset:t})=>{I.push({name:e,type:`analytics_engine`,dataset:t})}),be.forEach(({binding:e,namespace:t,outbound:n})=>{if(r?.dryRun&&(t??=o),t===void 0)throw new a(`${e} bindings must have a "namespace" field. Add a "namespace" field to the binding in your Worker configuration specifying the dispatch namespace to bind to.`,{telemetryMessage:`dispatch namespace binding missing namespace`});t===o?I.push({name:e,type:`inherit`}):I.push({name:e,type:`dispatch_namespace`,namespace:t,...n&&{outbound:{worker:{service:n.service,environment:n.environment},params:n.parameters?.map(e=>({name:e}))}}})}),xe.forEach(({binding:e,certificate_id:t})=>{I.push({name:e,type:`mtls_certificate`,certificate_id:t})}),Se.forEach(({binding:e,stream:t,pipeline:n})=>{if(t)I.push({name:e,type:`pipelines`,stream:t});else if(n)I.push({name:e,type:`pipelines`,pipeline:n});else throw Error(`Pipeline binding must specify a stream or pipeline`)}),Ce.forEach(({binding:e,stream:t})=>{I.push({name:e,type:`k2`,stream:t})}),we.forEach(({binding:e})=>{I.push({name:e,type:`worker_loader`})}),Te.forEach(({name:e,destination:t})=>{I.push({name:e,type:`logfwdr`,destination:t})}),Ee.forEach(({binding:e,source:t})=>{I.push({name:e,type:`wasm_module`,part:e}),s.set(e,new File([`contents`in t?t.contents:c(t.path)],`path`in t?t.path??e:e,{type:`application/wasm`}))}),H!==void 0&&I.push({name:H.binding,type:`browser`,raw:H.raw}),U!==void 0&&I.push({name:U.binding,type:`analytics`}),W!==void 0&&I.push({name:W.binding,staging:W.staging,type:`ai`,raw:W.raw}),G!==void 0&&I.push({name:G.binding,type:`images`,raw:G.raw}),K!==void 0&&I.push({name:K.binding,type:`stream`}),q!==void 0&&I.push({name:q.binding,type:`media`}),J!==void 0&&I.push({name:J.binding,type:`version_metadata`}),Y!==void 0&&I.push({name:Y.binding,type:`assets`}),De.forEach(({binding:e,source:t})=>{I.push({name:e,type:`text_blob`,part:e}),e!==`__STATIC_CONTENT_MANIFEST`&&(`contents`in t?s.set(e,new File([t.contents],t.path??e,{type:`text/plain`})):s.set(e,new File([c(t.path)],t.path,{type:`text/plain`})))}),Oe.forEach(({binding:e,source:t})=>{I.push({name:e,type:`data_blob`,part:e}),s.set(e,new File([`contents`in t?t.contents:c(t.path)],`path`in t?t.path??e:e,{type:`application/octet-stream`}))});for(let[e,r]of Object.entries(t??{}))if(n(r.type)&&r.type!==`unsafe_hello_world`){let{type:t,...n}=r;I.push({name:e,type:t.slice(7),...n})}let X=`__STATIC_CONTENT_MANIFEST`;if(F?.some(({name:e})=>e===X)&&u.type===`esm`){d(F!==void 0);let e=new Set(F.map(e=>l.posix.dirname(e.name)));for(let t of e){if(t===`.`)continue;let e=l.posix.relative(t,X),n=l.posix.join(t,X);F.push({name:n,filePath:n,content:`export { default } from ${JSON.stringify(e)};`,type:`esm`})}}if(u.type===`commonjs`){for(let e of Object.values([...F||[]]))if(e.name===`__STATIC_CONTENT_MANIFEST`)s.set(e.name,new File([e.content],e.name,{type:`text/plain`})),F=F?.filter(t=>t!==e);else if(e.type===`compiled-wasm`||e.type===`text`||e.type===`buffer`){let t=e.name.replace(/[^a-zA-Z0-9_$]/g,`_`);I.push({name:t,type:e.type===`compiled-wasm`?`wasm_module`:e.type===`text`?`text_blob`:`data_blob`,part:t}),s.set(t,new File([e.content],e.name,{type:e.type===`compiled-wasm`?`application/wasm`:e.type===`text`?`text/plain`:`application/octet-stream`})),F=F?.filter(t=>t!==e)}}let Z;if(r?.unsafe?.capnp){let e=k(r.unsafe.capnp);Z=`./capnp-${Date.now()}.compiled`,s.set(Z,new File([e],Z,{type:`application/octet-stream`}))}let Q;v&&(Q??=[],Q.push(`plain_text`,`json`)),y&&(Q??=[],Q.push(`secret_text`,`secret_key`)),b&&(Q??=[],Q.push(...b));let $={...u.type===`commonjs`?{body_part:u.name}:{main_module:u.name},bindings:I,containers:e.containers===void 0?void 0:e.containers.map(e=>({...e.name!==void 0&&{name:e.name},...e.class_name!==void 0&&{class_name:e.class_name},...e.images!==void 0&&{images:e.images}})),...g&&{compatibility_date:g},..._&&{compatibility_flags:_},...p&&{migrations:p},...m&&{code_update_strategy:m},...h&&Object.keys(h).length>0&&{exports:h},capnp_schema:Z,...Q&&{keep_bindings:Q},...x!==void 0&&{logpush:x},...S&&{placement:S},...C&&{tail_consumers:C},...w&&{streaming_tail_consumers:w},...T&&{limits:T},...E&&{annotations:E},...D!==void 0&&{keep_assets:D},...O&&{assets:{jwt:O.jwt,config:P}},...A&&{observability:A},...M&&{cache_options:M},...N?.length&&{package_dependencies:N}};if(r?.unsafe?.metadata!==void 0)for(let e of Object.keys(r.unsafe.metadata))$[e]=r.unsafe.metadata[e];if(s.set(`metadata`,JSON.stringify($)),u.type===`commonjs`&&F&&F.length>0)throw TypeError(`More than one module can only be specified when type = 'esm'`);for(let e of[u].concat(F||[]))s.set(e.name,new File([e.content],e.name,{type:j(e.type??u.type??`esm`)}));for(let e of f||[])s.set(e.name,new File([e.content],e.name,{type:`application/source-map`}));return s}b(N,`createWorkerUploadForm`);export{C as a,T as c,S as i,M as n,b as o,A as r,x as s,N as t};
|
|
2
|
+
import{n as e,t}from"./rolldown-runtime-BNtqjh-B.mjs";import{M as n,V as r,m as i}from"./dist-BoDdDWjK.mjs";import{N as a,r as o}from"./chunk-AAQI36FL-e6E5HW1g.mjs";import{createRequire as s}from"node:module";import{readFileSync as c}from"node:fs";import l,{resolve as u}from"node:path";import d from"node:assert";import{spawnSync as f}from"node:child_process";const p=s(import.meta.url||(typeof __filename==`string`?__filename:`/`));var m=Object.create,h=Object.defineProperty,g=Object.getOwnPropertyDescriptor,_=Object.getOwnPropertyNames,v=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty,b=(e,t)=>h(e,`name`,{value:t,configurable:!0}),x=/* @__PURE__ */ (e=>p===void 0?typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(p===void 0?e:p)[t]}):e:p)(function(e){if(p!==void 0)return p.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),S=(e,t)=>function(){return t||(0,e[_(e)[0]])((t={exports:{}}).exports,t),t.exports},C=(e,t)=>{for(var n in t)h(e,n,{get:t[n],enumerable:!0})},w=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of _(t))!y.call(e,i)&&i!==n&&h(e,i,{get:()=>t[i],enumerable:!(r=g(t,i))||r.enumerable});return e},T=(e,t,n)=>(n=e==null?{}:m(v(e)),w(t||!e||!e.__esModule?h(n,`default`,{value:e,enumerable:!0}):n,e)),E=/* @__PURE__ */ t(((t,n)=>{var r=e(`child_process`).exec,i=e(`child_process`).execSync,a=e(`fs`),o=e(`path`),s=a.access,c=a.accessSync,l=a.constants||a,u=process.platform==`win32`,d=function(e,t){s(e,l.F_OK,function(e){t(!e)})},f=function(e){try{return c(e,l.F_OK),!1}catch{return!0}},p=function(e,t){s(e,l.F_OK|l.X_OK,function(e){t(null,!e)})},m=function(e){try{return c(e,l.F_OK|l.X_OK),!0}catch{return!1}},h=function(e,t,n){d(e,function(i){i?p(e,n):r(`command -v `+t+` 2>/dev/null && { echo >&1 `+t+`; exit 0; }`,function(e,t,r){n(null,!!t)})})},g=function(e,t,n){/^(?!(?:.*\s|.*\.|\W+)$)(?:[a-zA-Z]:)?(?:(?:[^<>:"\|\?\*\n])+(?:\/\/|\/|\\\\|\\)?)+$/m.test(e)?r(`where `+t,function(e){e===null?n(null,!0):n(null,!1)}):n(null,!1)},_=function(e,t){if(f(e))try{return!!i(`command -v `+t+` 2>/dev/null && { echo >&1 `+t+`; exit 0; }`)}catch{return!1}return m(e)},v=function(e,t,n){if(!/^(?!(?:.*\s|.*\.|\W+)$)(?:[a-zA-Z]:)?(?:(?:[^<>:"\|\?\*\n])+(?:\/\/|\/|\\\\|\\)?)+$/m.test(e))return!1;try{return!!i(`where `+t,{stdio:[]})}catch{return!1}},y=function(e){return/[^A-Za-z0-9_\/:=-]/.test(e)&&(e=`'`+e.replace(/'/g,`'\\''`)+`'`,e=e.replace(/^(?:'')+/g,``).replace(/\\'''/g,`\\'`)),e};u&&(y=function(e){if(/[\\]/.test(e)){var t=`"`+o.dirname(e)+`"`,n=`"`+o.basename(e)+`"`;return t+`:`+n}return`"`+e+`"`}),n.exports=function e(t,n){var r=y(t);if(!n&&typeof Promise<`u`)return new Promise(function(n,r){e(t,function(e,i){i?n(t):r(e)})});u?g(t,r,n):h(t,r,n)},n.exports.sync=function(e){var t=y(e);return u?v(e,t):_(e,t)}})),D=/* @__PURE__ */ t(((e,t)=>{t.exports=E()})),ee=r(),O=D();s(import.meta.url||(typeof __filename==`string`?__filename:`/`));function k(e){if(e.compiled_schema)return c(u(e.compiled_schema));let{base_path:t,source_schemas:n}=e,r=(n??[]).map(e=>u(t,e));if(!(0,O.sync)(`capnp`))throw new a(`The capnp compiler is required to upload capnp schemas, but is not present.`,{telemetryMessage:`capnp compiler missing`});let i=u(t??`.`),o=f(`capnp`,[`compile`,`-o-`,`--src-prefix=${i}`,...r],{maxBuffer:3145728});if(o.error)throw o.error;if(o.stderr.length)throw Error(o.stderr.toString());return o.stdout}b(k,`handleUnsafeCapnp`);var A={esm:`application/javascript+module`,commonjs:`application/javascript`,"compiled-wasm":`application/wasm`,buffer:`application/octet-stream`,text:`text/plain`,python:`text/x-python`,"python-requirement":`text/x-python-requirement`};function j(e){let t=A[e];if(t===void 0)throw TypeError(`Unsupported module: `+e);return t}b(j,`toMimeType`);function M(e){let t=Object.keys(A).find(t=>A[t]===e);if(t===void 0)throw TypeError(`Unsupported mime type: `+e);return t}b(M,`fromMimeType`);function N(e,t,r){let s=new ee.FormData,{main:u,sourceMaps:f,migrations:p,code_update_strategy:m,exports:h,compatibility_date:g,compatibility_flags:_,keepVars:v,keepSecrets:y,keepBindings:b,logpush:x,placement:S,tail_consumers:C,streaming_tail_consumers:w,limits:T,annotations:E,keep_assets:D,assets:O,observability:A,cache:M,package_dependencies:N}=e,P={html_handling:O?.assetConfig?.html_handling,not_found_handling:O?.assetConfig?.not_found_handling,base_path:O?.assetConfig?.base_path,run_worker_first:O?.run_worker_first,_redirects:O?._redirects,_headers:O?._headers};if(O&&!O.routerConfig.has_user_worker)return s.set(`metadata`,JSON.stringify({assets:{jwt:O.jwt,config:P},...E&&{annotations:E},...g&&{compatibility_date:g},..._&&{compatibility_flags:_}})),s;let{modules:F}=e,I=[],te=i(`plain_text`,t),ne=i(`json`,t),re=i(`secret_text`,t),ie=i(`kv_namespace`,t),ae=i(`send_email`,t),oe=i(`durable_object_namespace`,t),se=i(`workflow`,t),ce=i(`queue`,t),le=i(`r2_bucket`,t),ue=i(`d1`,t),de=i(`vectorize`,t),fe=i(`ai_search_namespace`,t),pe=i(`ai_search`,t),L=i(`agent_memory`,t),R=i(`hyperdrive`,t),z=i(`secrets_store_secret`,t),B=i(`artifacts`,t),me=i(`unsafe_hello_world`,t),he=i(`flagship`,t),ge=i(`ratelimit`,t),_e=i(`vpc_service`,t),ve=i(`vpc_network`,t),V=i(`service`,t),ye=i(`analytics_engine`,t),be=i(`dispatch_namespace`,t),xe=i(`mtls_certificate`,t),Se=i(`pipeline`,t),Ce=i(`k2`,t),we=i(`worker_loader`,t),Te=i(`logfwdr`,t),Ee=i(`wasm_module`,t),H=i(`browser`,t)[0],U=i(`analytics`,t)[0],W=i(`ai`,t)[0],G=i(`images`,t)[0],K=i(`stream`,t)[0],q=i(`media`,t)[0],J=i(`version_metadata`,t)[0],Y=i(`assets`,t)[0],De=i(`text_blob`,t),Oe=i(`data_blob`,t);i(`inherit`,t).forEach(({binding:e})=>{I.push({name:e,type:`inherit`})}),te.forEach(({binding:e,value:t})=>{I.push({name:e,type:`plain_text`,text:t})}),ne.forEach(({binding:e,value:t})=>{I.push({name:e,type:`json`,json:t})}),re.forEach(({binding:e,value:t})=>{I.push({name:e,type:`secret_text`,text:t})}),ie.forEach(({id:e,binding:t,raw:n})=>{if(r?.dryRun&&(e??=o),e===void 0)throw new a(`${t} bindings must have an "id" field`,{telemetryMessage:`kv namespace binding missing id`});e===o?I.push({name:t,type:`inherit`}):I.push({name:t,type:`kv_namespace`,namespace_id:e,raw:n})}),ae.forEach(e=>{let t={name:e.name,type:`send_email`,allowed_sender_addresses:e.allowed_sender_addresses};e.destination_address===void 0?e.allowed_destination_addresses===void 0?I.push(t):I.push({...t,allowed_destination_addresses:e.allowed_destination_addresses}):I.push({...t,destination_address:e.destination_address})}),oe.forEach(({name:e,class_name:t,script_name:n,environment:r})=>{I.push({name:e,type:`durable_object_namespace`,class_name:t,...n&&{script_name:n},...r&&{environment:r}})}),se.forEach(({binding:e,name:t,class_name:n,script_name:r,raw:i})=>{I.push({type:`workflow`,name:e,workflow_name:t,class_name:n,script_name:r,raw:i})}),ce.forEach(({binding:e,queue_name:t,delivery_delay:n,raw:i})=>{if(r?.dryRun&&(t??=o),t===void 0)throw new a(`${e} bindings must have a "queue" field. Add a "queue" field to the producer in your Worker configuration specifying the name of the Queue to bind to.`,{telemetryMessage:`queue binding missing name`});t===o?I.push({name:e,type:`inherit`}):I.push({type:`queue`,name:e,queue_name:t,delivery_delay:n,raw:i})}),le.forEach(({binding:e,bucket_name:t,jurisdiction:n,raw:i})=>{if(r?.dryRun&&(t??=o),t===void 0)throw new a(`${e} bindings must have a "bucket_name" field. Add a "bucket_name" field to the binding in your Worker configuration specifying the name of the R2 bucket to bind to.`,{telemetryMessage:`r2 bucket binding missing bucket_name`});t===o?I.push({name:e,type:`inherit`}):I.push({name:e,type:`r2_bucket`,bucket_name:t,jurisdiction:n,raw:i})}),ue.forEach(({binding:e,database_id:t,database_internal_env:n,raw:i})=>{if(r?.dryRun&&(t??=o),t===void 0)throw new a(`${e} bindings must have a "database_id" field. Add a "database_id" field to the binding in your Worker configuration specifying the ID of the D1 database to bind to.`,{telemetryMessage:`d1 database binding missing database_id`});t===o?I.push({name:e,type:`inherit`}):I.push({name:e,type:`d1`,id:t,internalEnv:n,raw:i})}),de.forEach(({binding:e,index_name:t,raw:n})=>{I.push({name:e,type:`vectorize`,index_name:t,raw:n})}),fe.forEach(({binding:e,namespace:t})=>{if(r?.dryRun&&(t??=o),t===void 0)throw new a(`${e} bindings must have a "namespace" field. Add a "namespace" field to the binding in your Worker configuration specifying the AI Search namespace to bind to.`,{telemetryMessage:`ai search namespace binding missing namespace`});t===o?I.push({name:e,type:`inherit`}):I.push({name:e,type:`ai_search_namespace`,namespace:t})}),pe.forEach(({binding:e,instance_name:t})=>{I.push({name:e,type:`ai_search`,instance_name:t})}),L.forEach(({binding:e,namespace:t})=>{if(r?.dryRun&&(t??=o),t===void 0)throw new a(`${e} bindings must have a "namespace" field. Add a "namespace" field to the binding in your Worker configuration specifying the namespace to bind to.`,{telemetryMessage:!1});t===o?I.push({name:e,type:`inherit`}):I.push({name:e,type:`agent_memory`,namespace:t})}),R.forEach(({binding:e,id:t})=>{I.push({name:e,type:`hyperdrive`,id:t})}),z.forEach(({binding:e,store_id:t,secret_name:n})=>{I.push({name:e,type:`secrets_store_secret`,store_id:t,secret_name:n})}),B.forEach(({binding:e,namespace:t})=>{I.push({name:e,type:`artifacts`,namespace:t})}),me.forEach(({binding:e,enable_timer:t})=>{I.push({name:e,type:`unsafe_hello_world`,enable_timer:t})}),he.forEach(({binding:e,app_id:t})=>{if(r?.dryRun&&(t??=o),t===void 0)throw new a(`${e} bindings must have an "app_id" field. Add an "app_id" field to the binding in your Worker configuration specifying the Flagship app to bind to.`,{telemetryMessage:`flagship binding missing app id`});I.push(t===o?{name:e,type:`inherit`}:{name:e,type:`flagship`,app_id:t})}),ge.forEach(({name:e,namespace_id:t,simple:n})=>{I.push({name:e,type:`ratelimit`,namespace_id:t,simple:n})}),_e.forEach(({binding:e,service_id:t})=>{I.push({name:e,type:`vpc_service`,service_id:t})}),ve.forEach(({binding:e,tunnel_id:t,network_id:n})=>{I.push({name:e,type:`vpc_network`,...t===void 0?{network_id:n}:{tunnel_id:t}})}),V.forEach(({binding:e,service:t,environment:n,entrypoint:r,props:i,cross_account_grant:a})=>{I.push({name:e,type:`service`,service:t,cross_account_grant:a,...n&&{environment:n},...r&&{entrypoint:r},...i&&{props:i}})}),ye.forEach(({binding:e,dataset:t})=>{I.push({name:e,type:`analytics_engine`,dataset:t})}),be.forEach(({binding:e,namespace:t,outbound:n})=>{if(r?.dryRun&&(t??=o),t===void 0)throw new a(`${e} bindings must have a "namespace" field. Add a "namespace" field to the binding in your Worker configuration specifying the dispatch namespace to bind to.`,{telemetryMessage:`dispatch namespace binding missing namespace`});t===o?I.push({name:e,type:`inherit`}):I.push({name:e,type:`dispatch_namespace`,namespace:t,...n&&{outbound:{worker:{service:n.service,environment:n.environment},params:n.parameters?.map(e=>({name:e}))}}})}),xe.forEach(({binding:e,certificate_id:t})=>{I.push({name:e,type:`mtls_certificate`,certificate_id:t})}),Se.forEach(({binding:e,stream:t,pipeline:n})=>{if(t)I.push({name:e,type:`pipelines`,stream:t});else if(n)I.push({name:e,type:`pipelines`,pipeline:n});else throw Error(`Pipeline binding must specify a stream or pipeline`)}),Ce.forEach(({binding:e,stream:t})=>{I.push({name:e,type:`k2`,stream:t})}),we.forEach(({binding:e})=>{I.push({name:e,type:`worker_loader`})}),Te.forEach(({name:e,destination:t})=>{I.push({name:e,type:`logfwdr`,destination:t})}),Ee.forEach(({binding:e,source:t})=>{I.push({name:e,type:`wasm_module`,part:e}),s.set(e,new File([`contents`in t?t.contents:c(t.path)],`path`in t?t.path??e:e,{type:`application/wasm`}))}),H!==void 0&&I.push({name:H.binding,type:`browser`,raw:H.raw}),U!==void 0&&I.push({name:U.binding,type:`analytics`}),W!==void 0&&I.push({name:W.binding,staging:W.staging,type:`ai`,raw:W.raw}),G!==void 0&&I.push({name:G.binding,type:`images`,raw:G.raw}),K!==void 0&&I.push({name:K.binding,type:`stream`}),q!==void 0&&I.push({name:q.binding,type:`media`}),J!==void 0&&I.push({name:J.binding,type:`version_metadata`}),Y!==void 0&&I.push({name:Y.binding,type:`assets`}),De.forEach(({binding:e,source:t})=>{I.push({name:e,type:`text_blob`,part:e}),e!==`__STATIC_CONTENT_MANIFEST`&&(`contents`in t?s.set(e,new File([t.contents],t.path??e,{type:`text/plain`})):s.set(e,new File([c(t.path)],t.path,{type:`text/plain`})))}),Oe.forEach(({binding:e,source:t})=>{I.push({name:e,type:`data_blob`,part:e}),s.set(e,new File([`contents`in t?t.contents:c(t.path)],`path`in t?t.path??e:e,{type:`application/octet-stream`}))});for(let[e,r]of Object.entries(t??{}))if(n(r.type)&&r.type!==`unsafe_hello_world`){let{type:t,...n}=r;I.push({name:e,type:t.slice(7),...n})}let X=`__STATIC_CONTENT_MANIFEST`;if(F?.some(({name:e})=>e===X)&&u.type===`esm`){d(F!==void 0);let e=new Set(F.map(e=>l.posix.dirname(e.name)));for(let t of e){if(t===`.`)continue;let e=l.posix.relative(t,X),n=l.posix.join(t,X);F.push({name:n,filePath:n,content:`export { default } from ${JSON.stringify(e)};`,type:`esm`})}}if(u.type===`commonjs`){for(let e of Object.values([...F||[]]))if(e.name===`__STATIC_CONTENT_MANIFEST`)s.set(e.name,new File([e.content],e.name,{type:`text/plain`})),F=F?.filter(t=>t!==e);else if(e.type===`compiled-wasm`||e.type===`text`||e.type===`buffer`){let t=e.name.replace(/[^a-zA-Z0-9_$]/g,`_`);I.push({name:t,type:e.type===`compiled-wasm`?`wasm_module`:e.type===`text`?`text_blob`:`data_blob`,part:t}),s.set(t,new File([e.content],e.name,{type:e.type===`compiled-wasm`?`application/wasm`:e.type===`text`?`text/plain`:`application/octet-stream`})),F=F?.filter(t=>t!==e)}}let Z;if(r?.unsafe?.capnp){let e=k(r.unsafe.capnp);Z=`./capnp-${Date.now()}.compiled`,s.set(Z,new File([e],Z,{type:`application/octet-stream`}))}let Q;v&&(Q??=[],Q.push(`plain_text`,`json`)),y&&(Q??=[],Q.push(`secret_text`,`secret_key`)),b&&(Q??=[],Q.push(...b));let $={...u.type===`commonjs`?{body_part:u.name}:{main_module:u.name},bindings:I,containers:e.containers===void 0?void 0:e.containers.map(e=>({...e.name!==void 0&&{name:e.name},...e.class_name!==void 0&&{class_name:e.class_name},...e.images!==void 0&&{images:e.images}})),...g&&{compatibility_date:g},..._&&{compatibility_flags:_},...p&&{migrations:p},...m&&{code_update_strategy:m},...h&&Object.keys(h).length>0&&{exports:h},capnp_schema:Z,...Q&&{keep_bindings:Q},...x!==void 0&&{logpush:x},...S&&{placement:S},...C&&{tail_consumers:C},...w&&{streaming_tail_consumers:w},...T&&{limits:T},...E&&{annotations:E},...D!==void 0&&{keep_assets:D},...O&&{assets:{jwt:O.jwt,config:P}},...A&&{observability:A},...M&&{cache_options:M},...N?.length&&{package_dependencies:N}};if(r?.unsafe?.metadata!==void 0)for(let e of Object.keys(r.unsafe.metadata))$[e]=r.unsafe.metadata[e];if(s.set(`metadata`,JSON.stringify($)),u.type===`commonjs`&&F&&F.length>0)throw TypeError(`More than one module can only be specified when type = 'esm'`);for(let e of[u].concat(F||[]))s.set(e.name,new File([e.content],e.name,{type:j(e.type??u.type??`esm`)}));for(let e of f||[])s.set(e.name,new File([e.content],e.name,{type:`application/source-map`}));return s}b(N,`createWorkerUploadForm`);export{C as a,T as c,S as i,M as n,b as o,A as r,x as s,N as t};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{A as e,J as t,U as n,V as r,W as i,X as a,Y as o,it as s,ot as c}from"./dist-
|
|
2
|
+
import{A as e,J as t,U as n,V as r,W as i,X as a,Y as o,it as s,ot as c}from"./dist-BoDdDWjK.mjs";import{E as l,M as u,N as d,O as f}from"./chunk-AAQI36FL-e6E5HW1g.mjs";import{createRequire as p}from"node:module";import{chmodSync as m,existsSync as h,mkdirSync as g,rmSync as _,writeFileSync as v}from"node:fs";import y from"node:path";import ee from"node:url";import b from"node:assert";import te from"node:http";import{TextEncoder as ne}from"node:util";import{createCipheriv as re,createDecipheriv as ie,createHash as x,randomBytes as ae,webcrypto as S}from"node:crypto";import{spawn as oe,spawnSync as se}from"node:child_process";p(import.meta.url||(typeof __filename==`string`?__filename:`/`));var ce=Object.defineProperty,C=(e,t)=>ce(e,`name`,{value:t,configurable:!0}),w=r();p(import.meta.url||(typeof __filename==`string`?__filename:`/`));var le=!1;function T(e){let{configOverride:t,warningLogger:n,storage:r}=e,{oauth_token:i,refresh_token:a,expiration_time:o,scopes:s,api_token:c}=t??r.read()??{};return i?{accessToken:{value:i,expiry:o??`2000-01-01:00:00:00+00:00`},refreshToken:{value:a??``},scopes:s}:c?(!le&&n&&(le=!0,n.warn(`It looks like you have used Wrangler v1's \`config\` command to login with an API token
|
|
3
3
|
from ${t===void 0?r.path():`in-memory config`}.
|
|
4
4
|
This is no longer supported in the current version of Wrangler.
|
|
5
5
|
If you wish to authenticate via an API token then please set the \`CLOUDFLARE_API_TOKEN\` environment variable.`)),{deprecatedApiToken:c}):{}}C(T,`readStoredAuthState`);var ue=c({variableName:`CLOUDFLARE_API_TOKEN`,deprecatedName:`CF_API_TOKEN`}),de=c({variableName:`CLOUDFLARE_API_KEY`,deprecatedName:`CF_API_KEY`}),fe=c({variableName:`CLOUDFLARE_EMAIL`,deprecatedName:`CF_EMAIL`});function pe(e){if(e?.allowGlobalAuthKey??!0){let e=de(),t=fe();if(e&&t)return{authKey:e,authEmail:t}}let t=ue();if(t)return{apiToken:t}}C(pe,`getAuthFromEnv`);function me(e){let t=pe(e);if(t)return t;let n=T({storage:e.storage,warningLogger:e.warningLogger});if(n.deprecatedApiToken)return{apiToken:n.deprecatedApiToken};if(n.accessToken?.value)return{apiToken:n.accessToken.value}}C(me,`getAPIToken`);function he(e){let t=me(e);if(!t)throw new d(`No API token found.`,{telemetryMessage:`user auth missing api token`});return t}C(he,`requireApiToken`);var ge=/^[A-Za-z0-9_-]+$/;function _e(e,t){if(!ge.test(e))throw new d(`Invalid account ID "${e}" ${t}. Account IDs may only contain alphanumeric characters, hyphens, and underscores.`,{telemetryMessage:`user account id invalid characters`});return e}C(_e,`validateAccountId`);var ve=c({variableName:`CLOUDFLARE_AUTH_PROFILE`}),E=c({variableName:`WRANGLER_AUTH_DOMAIN`,defaultValue:/* @__PURE__ */ C(()=>o()===`staging`?`dash.staging.cloudflare.com`:`dash.cloudflare.com`,`defaultValue`)}),ye=c({variableName:`WRANGLER_AUTH_URL`,defaultValue:/* @__PURE__ */ C(()=>`https://${E()}/oauth2/auth`,`defaultValue`)}),be=c({variableName:`WRANGLER_TOKEN_URL`,defaultValue:/* @__PURE__ */ C(()=>`https://${E()}/oauth2/token`,`defaultValue`)}),xe=c({variableName:`WRANGLER_REVOKE_URL`,defaultValue:/* @__PURE__ */ C(()=>`https://${E()}/oauth2/revoke`,`defaultValue`)}),Se=c({variableName:`CLOUDFLARE_ACCOUNT_ID`,deprecatedName:`CF_ACCOUNT_ID`});function Ce(){let e=Se();if(e)return _e(e,"set in the `CLOUDFLARE_ACCOUNT_ID` environment variable")}C(Ce,`getCloudflareAccountIdFromEnv`);var we=`/oauth2/device/auth`;function Te(){return`https://${E()}${we}`}C(Te,`getDeviceAuthUrl`);var Ee=c({variableName:`CLOUDFLARE_ACCESS_CLIENT_ID`}),De=c({variableName:`CLOUDFLARE_ACCESS_CLIENT_SECRET`}),Oe=c({variableName:`WRANGLER_CF_AUTHORIZATION_TOKEN`}),ke=s({variableName:`CLOUDFLARE_AUTH_USE_KEYRING`}),D={},O=/* @__PURE__ */ new Map;function Ae(e,t){let n=new URL(`https://${e}`);return t&&n.searchParams.set(`cf_workers_preview_token`,t),n.toString()}C(Ae,`buildProbeUrl`);function je(){for(let e of Object.keys(D))delete D[e];O.clear()}C(je,`clearAccessCaches`);async function Me(e,t,n){t.debug(`Checking if domain has Access enabled:`,e);let r=JSON.stringify([e,!!n]);if(O.has(r))return t.debug(`Using cached Access switch for:`,e,O.get(r)),O.get(r)??!1;t.debug(`Access switch not cached for:`,e);try{let i=new AbortController,a=setTimeout(()=>{i.abort()},1e3),o=await(0,w.fetch)(Ae(e,n),{redirect:`manual`,signal:i.signal});clearTimeout(a);let s=!!(o.status===302&&o.headers.get(`location`)?.includes(`cloudflareaccess.com`));return(s||!n)&&(t.debug(`Caching access switch for:`,e),O.set(r,s)),s}catch{return t.debug(`Access probe failed for:`,e),!1}}C(Me,`domainUsesAccess`);async function Ne(t,n){let r=n.logger,i=Ee(),a=De();if(i&&a)return r.debug(`Using Access Service Token headers for domain:`,t),{"CF-Access-Client-Id":i,"CF-Access-Client-Secret":a};if((i!==void 0||a!==void 0)&&r.warn(`Both CLOUDFLARE_ACCESS_CLIENT_ID and CLOUDFLARE_ACCESS_CLIENT_SECRET must be set to use Access Service Token authentication. Only ${i===void 0?`CLOUDFLARE_ACCESS_CLIENT_SECRET`:`CLOUDFLARE_ACCESS_CLIENT_ID`} was found.`),!await Me(t,r,n.previewToken))return{};if(r.debug(`Getting Access headers for domain:`,t),D[t])return r.debug(`Using cached Access headers for domain:`,t),D[t];if((n.isNonInteractiveOrCI??e)())throw new d(`The domain "${t}" is behind Cloudflare Access, but no Access Service Token credentials were found and the current environment is non-interactive.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{n as e,t}from"./output-PRKYaJuo.mjs";import{r as n}from"./theme-BGHWSKCw.mjs";import{d as r,i,l as a,p as o,t as s}from"./run-
|
|
2
|
+
import{n as e,t}from"./output-PRKYaJuo.mjs";import{r as n}from"./theme-BGHWSKCw.mjs";import{d as r,i,l as a,p as o,t as s}from"./run-DAK_kbUa.mjs";import"./ui-YBIkZLZt.mjs";import{t as c}from"./log-Brx-wjJW.mjs";import{t as l}from"./cli-exit-CstFZ1eJ.mjs";import{n as u,t as d}from"./metadata-Df5kCWJv.mjs";const f={command:`disable`,describe:`Disable cf telemetry collection`,handler:()=>{o(!1);let{enabled:t,source:i}=r();if(t){let e=`${a(i)}=true`;c.warn(`cf is collecting usage telemetry because ${n.code(e)} overrides this setting.`)}else e(`cf is no longer collecting usage telemetry.`)}},p={command:`enable`,describe:`Enable cf telemetry collection`,handler:()=>{o(!0);let{enabled:t,source:i}=r();if(t)e(`cf is now collecting anonymous usage telemetry. Thank you for helping make cf better.`);else{let e=`${a(i)}${i===`env`||i===`wrangler-env`?`=false`:``}`;c.warn(`cf is not collecting usage telemetry because ${n.code(e)} overrides this setting.`)}}};function m({enabled:e,source:t}){let r=e?n.success(`Enabled`):n.error(`Disabled`),i=a(t);return`Status: ${r}${i?` (set by ${i})`:``}\n`}const h={command:`status`,describe:`Check whether cf telemetry collection is enabled`,handler:()=>{console.log(m(r())),console.log(n.muted(`Configure on this machine: \`cf cli telemetry enable\` / \`cf cli telemetry disable\`.
|
|
3
3
|
Override per invocation with ${i}=true/false. DO_NOT_TRACK is also honored.\nLearn more: https://github.com/cloudflare/cf/blob/main/packages/cli/telemetry.md`))}},g={command:`telemetry`,describe:`Configure whether cf collects anonymous usage telemetry`,builder:e=>e.command(h).command(p).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},_=`KEYS`,v=`VALUES`;var y=class{constructor(e,t){let n=e._tree,r=Array.from(n.keys());this.set=e,this._type=t,this._path=r.length>0?[{node:n,keys:r}]:[]}next(){let e=this.dive();return this.backtrack(),e}dive(){if(this._path.length===0)return{done:!0,value:void 0};let{node:e,keys:t}=b(this._path);if(b(t)===``)return{done:!1,value:this.result()};let n=e.get(b(t));return this._path.push({node:n,keys:Array.from(n.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;let e=b(this._path).keys;e.pop(),e.length>0||(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:e})=>b(e)).filter(e=>e!==``).join(``)}value(){return b(this._path).node.get(``)}result(){switch(this._type){case v:return this.value();case _:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}};const b=e=>e[e.length-1],x=(e,t,n)=>{let r=/* @__PURE__ */ new Map;if(t===void 0)return r;let i=t.length+1,a=i+n,o=new Uint8Array(a*i).fill(n+1);for(let e=0;e<i;++e)o[e]=e;for(let e=1;e<a;++e)o[e*i]=e;return S(e,t,n,r,o,1,i,``),r},S=(e,t,n,r,i,a,o,s)=>{let c=a*o;key:for(let l of e.keys())if(l===``){let t=i[c-1];t<=n&&r.set(s,[e.get(l),t])}else{let c=a;for(let e=0;e<l.length;++e,++c){let r=l[e],a=o*c,s=a-o,u=i[a],d=Math.max(0,c-n-1),f=Math.min(o-1,c+n);for(let e=d;e<f;++e){let n=r!==t[e],o=i[s+e]+ +n,c=i[s+e+1]+1,l=i[a+e]+1,d=i[a+e+1]=Math.min(o,c,l);d<u&&(u=d)}if(u>n)continue key}S(e.get(l),t,n,r,i,c,o,s+l)}};var C=class e{constructor(e=/* @__PURE__ */ new Map,t=``){this._size=void 0,this._tree=e,this._prefix=t}atPrefix(t){if(!t.startsWith(this._prefix))throw Error(`Mismatched prefix`);let[n,r]=w(this._tree,t.slice(this._prefix.length));if(n===void 0){let[n,i]=A(r);for(let r of n.keys())if(r!==``&&r.startsWith(i)){let a=/* @__PURE__ */ new Map;return a.set(r.slice(i.length),n.get(r)),new e(a,t)}}return new e(n,t)}clear(){this._size=void 0,this._tree.clear()}delete(e){return this._size=void 0,D(this._tree,e)}entries(){return new y(this,`ENTRIES`)}forEach(e){for(let[t,n]of this)e(t,n,this)}fuzzyGet(e,t){return x(this._tree,e,t)}get(e){let t=T(this._tree,e);return t===void 0?void 0:t.get(``)}has(e){let t=T(this._tree,e);return t!==void 0&&t.has(``)}keys(){return new y(this,_)}set(e,t){if(typeof e!=`string`)throw Error(`key must be a string`);return this._size=void 0,E(this._tree,e).set(``,t),this}get size(){if(this._size)return this._size;this._size=0;let e=this.entries();for(;!e.next().done;)this._size+=1;return this._size}update(e,t){if(typeof e!=`string`)throw Error(`key must be a string`);this._size=void 0;let n=E(this._tree,e);return n.set(``,t(n.get(``))),this}fetch(e,t){if(typeof e!=`string`)throw Error(`key must be a string`);this._size=void 0;let n=E(this._tree,e),r=n.get(``);return r===void 0&&n.set(``,r=t()),r}values(){return new y(this,v)}[Symbol.iterator](){return this.entries()}static from(t){let n=new e;for(let[e,r]of t)n.set(e,r);return n}static fromObject(t){return e.from(Object.entries(t))}};const w=(e,t,n=[])=>{if(t.length===0||e==null)return[e,n];for(let r of e.keys())if(r!==``&&t.startsWith(r))return n.push([e,r]),w(e.get(r),t.slice(r.length),n);return n.push([e,t]),w(void 0,``,n)},T=(e,t)=>{if(t.length===0||e==null)return e;for(let n of e.keys())if(n!==``&&t.startsWith(n))return T(e.get(n),t.slice(n.length))},E=(e,t)=>{let n=t.length;outer:for(let r=0;e&&r<n;){for(let i of e.keys())if(i!==``&&t[r]===i[0]){let a=Math.min(n-r,i.length),o=1;for(;o<a&&t[r+o]===i[o];)++o;let s=e.get(i);if(o===i.length)e=s;else{let n=/* @__PURE__ */ new Map;n.set(i.slice(o),s),e.set(t.slice(r,r+o),n),e.delete(i),e=n}r+=o;continue outer}let i=/* @__PURE__ */ new Map;return e.set(t.slice(r),i),i}return e},D=(e,t)=>{let[n,r]=w(e,t);if(n!==void 0){if(n.delete(``),n.size===0)O(r);else if(n.size===1){let[e,t]=n.entries().next().value;k(r,e,t)}}},O=e=>{if(e.length===0)return;let[t,n]=A(e);if(t.delete(n),t.size===0)O(e.slice(0,-1));else if(t.size===1){let[n,r]=t.entries().next().value;n!==``&&k(e.slice(0,-1),n,r)}},k=(e,t,n)=>{if(e.length===0)return;let[r,i]=A(e);r.set(i+t,n),r.delete(i)},A=e=>e[e.length-1];var j=class e{constructor(e){if(e?.fields==null)throw Error(`MiniSearch: option "fields" must be provided`);let t=e.autoVacuum==null||e.autoVacuum===!0?H:e.autoVacuum;this._options={...L,...e,autoVacuum:t,searchOptions:{...R,...e.searchOptions||{}},autoSuggestOptions:{...z,...e.autoSuggestOptions||{}}},this._index=new C,this._documentCount=0,this._documentIds=/* @__PURE__ */ new Map,this._idToShortId=/* @__PURE__ */ new Map,this._fieldIds={},this._fieldLength=/* @__PURE__ */ new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=/* @__PURE__ */ new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=V,this.addFields(this._options.fields)}add(e){let{extractField:t,stringifyField:n,tokenize:r,processTerm:i,fields:a,idField:o}=this._options,s=t(e,o);if(s==null)throw Error(`MiniSearch: document does not have ID field "${o}"`);if(this._idToShortId.has(s))throw Error(`MiniSearch: duplicate ID ${s}`);let c=this.addDocumentId(s);this.saveStoredFields(c,e);for(let o of a){let a=t(e,o);if(a==null)continue;let s=r(n(a,o),o),l=this._fieldIds[o],u=new Set(s).size;this.addFieldLength(c,l,this._documentCount-1,u);for(let e of s){let t=i(e,o);if(Array.isArray(t))for(let e of t)this.addTerm(l,c,e);else t&&this.addTerm(l,c,t)}}}addAll(e){for(let t of e)this.add(t)}addAllAsync(e,t={}){let{chunkSize:n=10}=t,r={chunk:[],promise:Promise.resolve()},{chunk:i,promise:a}=e.reduce(({chunk:e,promise:t},r,i)=>(e.push(r),(i+1)%n===0?{chunk:[],promise:t.then(()=>new Promise(e=>setTimeout(e,0))).then(()=>this.addAll(e))}:{chunk:e,promise:t}),r);return a.then(()=>this.addAll(i))}remove(e){let{tokenize:t,processTerm:n,extractField:r,stringifyField:i,fields:a,idField:o}=this._options,s=r(e,o);if(s==null)throw Error(`MiniSearch: document does not have ID field "${o}"`);let c=this._idToShortId.get(s);if(c==null)throw Error(`MiniSearch: cannot remove document with ID ${s}: it is not in the index`);for(let o of a){let a=r(e,o);if(a==null)continue;let s=t(i(a,o),o),l=this._fieldIds[o],u=new Set(s).size;this.removeFieldLength(c,l,this._documentCount,u);for(let e of s){let t=n(e,o);if(Array.isArray(t))for(let e of t)this.removeTerm(l,c,e);else t&&this.removeTerm(l,c,t)}}this._storedFields.delete(c),this._documentIds.delete(c),this._idToShortId.delete(s),this._fieldLength.delete(c),--this._documentCount}removeAll(e){if(e)for(let t of e)this.remove(t);else if(arguments.length>0)throw Error(`Expected documents to be present. Omit the argument to remove all documents.`);else this._index=new C,this._documentCount=0,this._documentIds=/* @__PURE__ */ new Map,this._idToShortId=/* @__PURE__ */ new Map,this._fieldLength=/* @__PURE__ */ new Map,this._avgFieldLength=[],this._storedFields=/* @__PURE__ */ new Map,this._nextId=0}discard(e){let t=this._idToShortId.get(e);if(t==null)throw Error(`MiniSearch: cannot discard document with ID ${e}: it is not in the index`);this._idToShortId.delete(e),this._documentIds.delete(t),this._storedFields.delete(t),(this._fieldLength.get(t)||[]).forEach((e,n)=>{this.removeFieldLength(t,n,this._documentCount,e)}),this._fieldLength.delete(t),--this._documentCount,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;let{minDirtFactor:e,minDirtCount:t,batchSize:n,batchWait:r}=this._options.autoVacuum;this.conditionalVacuum({batchSize:n,batchWait:r},{minDirtCount:t,minDirtFactor:e})}discardAll(e){let t=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(let t of e)this.discard(t)}finally{this._options.autoVacuum=t}this.maybeAutoVacuum()}replace(e){let{idField:t,extractField:n}=this._options,r=n(e,t);this.discard(r),this.add(e)}vacuum(e={}){return this.conditionalVacuum(e)}conditionalVacuum(e,t){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum??=this._currentVacuum.then(()=>{let t=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=V,this.performVacuuming(e,t)}),this._enqueuedVacuum):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)}async performVacuuming(e,t){let n=this._dirtCount;if(this.vacuumConditionsMet(t)){let t=e.batchSize||B.batchSize,r=e.batchWait||B.batchWait,i=1;for(let[e,n]of this._index){for(let[e,t]of n)for(let[r]of t)this._documentIds.has(r)||(t.size<=1?n.delete(e):t.delete(r));this._index.get(e).size===0&&this._index.delete(e),i%t===0&&await new Promise(e=>setTimeout(e,r)),i+=1}this._dirtCount-=n}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(e){if(e==null)return!0;let{minDirtCount:t,minDirtFactor:n}=e;return t||=H.minDirtCount,n||=H.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=n}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(e){return this._idToShortId.has(e)}getStoredFields(e){let t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)}search(t,n={}){let{searchOptions:r}=this._options,i={...r,...n},a=this.executeQuery(t,n),o=[];for(let[e,{score:t,terms:n,match:r}]of a){let a=n.length||1,s={id:this._documentIds.get(e),score:t*a,terms:Object.keys(r),queryTerms:n,match:r};Object.assign(s,this._storedFields.get(e)),(i.filter==null||i.filter(s))&&o.push(s)}return t===e.wildcard&&i.boostDocument==null||o.sort(G),o}autoSuggest(e,t={}){t={...this._options.autoSuggestOptions,...t};let n=/* @__PURE__ */ new Map;for(let{score:r,terms:i}of this.search(e,t)){let e=i.join(` `),t=n.get(e);t==null?n.set(e,{score:r,terms:i,count:1}):(t.score+=r,t.count+=1)}let r=[];for(let[e,{score:t,terms:i,count:a}]of n)r.push({suggestion:e,terms:i,score:t/a});return r.sort(G),r}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(e,t){if(t==null)throw Error(`MiniSearch: loadJSON should be given the same options used when serializing the index`);return this.loadJS(JSON.parse(e),t)}static async loadJSONAsync(e,t){if(t==null)throw Error(`MiniSearch: loadJSON should be given the same options used when serializing the index`);return this.loadJSAsync(JSON.parse(e),t)}static getDefault(e){if(L.hasOwnProperty(e))return M(L,e);throw Error(`MiniSearch: unknown option "${e}"`)}static loadJS(e,t){let{index:n,documentIds:r,fieldLength:i,storedFields:a,serializationVersion:o}=e,s=this.instantiateMiniSearch(e,t);s._documentIds=q(r),s._fieldLength=q(i),s._storedFields=q(a);for(let[e,t]of s._documentIds)s._idToShortId.set(t,e);for(let[e,t]of n){let n=/* @__PURE__ */ new Map;for(let e of Object.keys(t)){let r=t[e];o===1&&(r=r.ds),n.set(parseInt(e,10),q(r))}s._index.set(e,n)}return s}static async loadJSAsync(e,t){let{index:n,documentIds:r,fieldLength:i,storedFields:a,serializationVersion:o}=e,s=this.instantiateMiniSearch(e,t);s._documentIds=await J(r),s._fieldLength=await J(i),s._storedFields=await J(a);for(let[e,t]of s._documentIds)s._idToShortId.set(t,e);let c=0;for(let[e,t]of n){let n=/* @__PURE__ */ new Map;for(let e of Object.keys(t)){let r=t[e];o===1&&(r=r.ds),n.set(parseInt(e,10),await J(r))}++c%1e3==0&&await Y(0),s._index.set(e,n)}return s}static instantiateMiniSearch(t,n){let{documentCount:r,nextId:i,fieldIds:a,averageFieldLength:o,dirtCount:s,serializationVersion:c}=t;if(c!==1&&c!==2)throw Error(`MiniSearch: cannot deserialize an index created with an incompatible version`);let l=new e(n);return l._documentCount=r,l._nextId=i,l._idToShortId=/* @__PURE__ */ new Map,l._fieldIds=a,l._avgFieldLength=o,l._dirtCount=s||0,l._index=new C,l}executeQuery(t,n={}){if(t===e.wildcard)return this.executeWildcardQuery(n);if(typeof t!=`string`){let e={...n,...t,queries:void 0},r=t.queries.map(t=>this.executeQuery(t,e));return this.combineResults(r,e.combineWith)}let{tokenize:r,processTerm:i,searchOptions:a}=this._options,o={tokenize:r,processTerm:i,...a,...n},{tokenize:s,processTerm:c}=o,l=s(t).flatMap(e=>c(e)).filter(e=>!!e).map(I(o)).map(e=>this.executeQuerySpec(e,o));return this.combineResults(l,o.combineWith)}executeQuerySpec(e,t){let n={...this._options.searchOptions,...t},r=(n.fields||this._options.fields).reduce((e,t)=>({...e,[t]:M(n.boost,t)||1}),{}),{boostDocument:i,weights:a,maxFuzzy:o,bm25:s}=n,{fuzzy:c,prefix:l}={...R.weights,...a},u=this._index.get(e.term),d=this.termResults(e.term,e.term,1,e.termBoost,u,r,i,s),f,p;if(e.prefix&&(f=this._index.atPrefix(e.term)),e.fuzzy){let t=e.fuzzy===!0?.2:e.fuzzy,n=t<1?Math.min(o,Math.round(e.term.length*t)):t;n&&(p=this._index.fuzzyGet(e.term,n))}if(f)for(let[t,n]of f){let a=t.length-e.term.length;if(!a)continue;p?.delete(t);let o=l*t.length/(t.length+.3*a);this.termResults(e.term,t,o,e.termBoost,n,r,i,s,d)}if(p)for(let t of p.keys()){let[n,a]=p.get(t);if(!a)continue;let o=c*t.length/(t.length+a);this.termResults(e.term,t,o,e.termBoost,n,r,i,s,d)}return d}executeWildcardQuery(e){let t=/* @__PURE__ */ new Map,n={...this._options.searchOptions,...e};for(let[e,r]of this._documentIds){let i=n.boostDocument?n.boostDocument(r,``,this._storedFields.get(e)):1;t.set(e,{score:i,terms:[],match:{}})}return t}combineResults(e,t=`or`){if(e.length===0)return/* @__PURE__ */ new Map;let n=t.toLowerCase(),r=N[n];if(!r)throw Error(`Invalid combination operator: ${t}`);return e.reduce(r)||/* @__PURE__ */ new Map}toJSON(){let e=[];for(let[t,n]of this._index){let r={};for(let[e,t]of n)r[e]=Object.fromEntries(t);e.push([t,r])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:e,serializationVersion:2}}termResults(e,t,n,r,i,a,o,s,c=/* @__PURE__ */ new Map){if(i==null)return c;for(let l of Object.keys(a)){let u=a[l],d=this._fieldIds[l],f=i.get(d);if(f==null)continue;let p=f.size,m=this._avgFieldLength[d];for(let i of f.keys()){if(!this._documentIds.has(i)){this.removeTerm(d,i,t),--p;continue}let a=o?o(this._documentIds.get(i),t,this._storedFields.get(i)):1;if(!a)continue;let h=f.get(i),g=this._fieldLength.get(i)[d],_=F(h,p,this._documentCount,g,m,s),v=n*r*u*a*_,y=c.get(i);if(y){y.score+=v,U(y.terms,e);let n=M(y.match,t);n?n.push(l):y.match[t]=[l]}else c.set(i,{score:v,terms:[e],match:{[t]:[l]}})}}return c}addTerm(e,t,n){let r=this._index.fetch(n,K),i=r.get(e);if(i==null)i=/* @__PURE__ */ new Map,i.set(t,1),r.set(e,i);else{let e=i.get(t);i.set(t,(e||0)+1)}}removeTerm(e,t,n){if(!this._index.has(n)){this.warnDocumentChanged(t,e,n);return}let r=this._index.fetch(n,K),i=r.get(e);i==null||i.get(t)==null?this.warnDocumentChanged(t,e,n):i.get(t)<=1?i.size<=1?r.delete(e):i.delete(t):i.set(t,i.get(t)-1),this._index.get(n).size===0&&this._index.delete(n)}warnDocumentChanged(e,t,n){for(let r of Object.keys(this._fieldIds))if(this._fieldIds[r]===t){this._options.logger(`warn`,`MiniSearch: document with ID ${this._documentIds.get(e)} has changed before removal: term "${n}" was not present in field "${r}". Removing a document after it has changed can corrupt the index!`,`version_conflict`);return}}addDocumentId(e){let t=this._nextId;return this._idToShortId.set(e,t),this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t}addFields(e){for(let t=0;t<e.length;t++)this._fieldIds[e[t]]=t}addFieldLength(e,t,n,r){let i=this._fieldLength.get(e);i??this._fieldLength.set(e,i=[]),i[t]=r;let a=(this._avgFieldLength[t]||0)*n+r;this._avgFieldLength[t]=a/(n+1)}removeFieldLength(e,t,n,r){if(n===1){this._avgFieldLength[t]=0;return}let i=this._avgFieldLength[t]*n-r;this._avgFieldLength[t]=i/(n-1)}saveStoredFields(e,t){let{storeFields:n,extractField:r}=this._options;if(n==null||n.length===0)return;let i=this._storedFields.get(e);i??this._storedFields.set(e,i={});for(let e of n){let n=r(t,e);n!==void 0&&(i[e]=n)}}};j.wildcard=Symbol(`*`);const M=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,N={or:(e,t)=>{for(let n of t.keys()){let r=e.get(n);if(r==null)e.set(n,t.get(n));else{let{score:e,terms:i,match:a}=t.get(n);r.score+=e,r.match=Object.assign(r.match,a),W(r.terms,i)}}return e},and:(e,t)=>{let n=/* @__PURE__ */ new Map;for(let r of t.keys()){let i=e.get(r);if(i==null)continue;let{score:a,terms:o,match:s}=t.get(r);W(i.terms,o),n.set(r,{score:i.score+a,terms:i.terms,match:Object.assign(i.match,s)})}return n},and_not:(e,t)=>{for(let n of t.keys())e.delete(n);return e}},P={k:1.2,b:.7,d:.5},F=(e,t,n,r,i,a)=>{let{k:o,b:s,d:c}=a;return Math.log(1+(n-t+.5)/(t+.5))*(c+e*(o+1)/(e+o*(1-s+s*r/i)))},I=e=>(t,n,r)=>({term:t,fuzzy:typeof e.fuzzy==`function`?e.fuzzy(t,n,r):e.fuzzy||!1,prefix:typeof e.prefix==`function`?e.prefix(t,n,r):e.prefix===!0,termBoost:typeof e.boostTerm==`function`?e.boostTerm(t,n,r):1}),L={idField:`id`,extractField:(e,t)=>e[t],stringifyField:(e,t)=>e.toString(),tokenize:e=>e.split(X),processTerm:e=>e.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(e,t)=>{typeof(console==null?void 0:console[e])==`function`&&console[e](t)},autoVacuum:!0},R={combineWith:`or`,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:P},z={combineWith:`and`,prefix:(e,t,n)=>t===n.length-1},B={batchSize:1e3,batchWait:10},V={minDirtFactor:.1,minDirtCount:20},H={...B,...V},U=(e,t)=>{e.includes(t)||e.push(t)},W=(e,t)=>{for(let n of t)e.includes(n)||e.push(n)},G=({score:e},{score:t})=>t-e,K=()=>/* @__PURE__ */ new Map,q=e=>{let t=/* @__PURE__ */ new Map;for(let n of Object.keys(e))t.set(parseInt(n,10),e[n]);return t},J=async e=>{let t=/* @__PURE__ */ new Map,n=0;for(let r of Object.keys(e))t.set(parseInt(r,10),e[r]),++n%1e3==0&&await Y(0);return t},Y=e=>new Promise(t=>setTimeout(t,e)),X=/[\n\r\p{Z}\p{P}]+/u;function Z(e){return!e.hideCommand&&!e.search?.exclude}function Q(e,t){let n=e.fullPath.slice(0,-1).map((t,n)=>e.fullPath.slice(0,n+1).join(` `));return{command:e.command,summary:e.summary||e.description.split(`
|
|
4
4
|
`)[0]||``,description:e.description,keywords:e.search?.keywords?.join(` `)??``,context:[...n.map(e=>t[e]??``),...e.arguments.map(e=>`${e.name} ${e.description}`),...e.options.map(e=>`${e.name} ${e.description}`)].join(` `)}}function $(e,t){let n=e.commands.filter(Z).map(t=>Q(t,e.descriptions??{})),r=new j({fields:[`command`,`summary`,`description`,`keywords`,`context`],storeFields:[`command`,`summary`],idField:`command`});return r.addAll(n),r.search(t,{prefix:!0,fuzzy:.2,boost:{command:8,summary:5,description:2,keywords:5,context:.5}}).slice(0,5).map(({command:e,summary:t})=>({command:e,summary:t}))}const ee={command:`search <query>`,describe:`Search all CLI commands by intent`,builder:e=>e.positional(`query`,{describe:`Search terms or a description of what you want to do`,type:`string`,demandOption:!0}),handler:e=>s({command:`cli search`,recordArgs:!1,searchQuery:e.query},e,()=>{let n=u(import.meta.url,`commands.json`,d);if(!n)throw console.error(`Error: Could not load commands.json.`),new l(1);t($(n,e.query))})},te={command:`cli`,describe:`Discover commands and configure the cf CLI`,builder:e=>e.command(ee).command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{te as default};
|