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{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,o as d,r as f,t as p}from"./body-parser-HN91kAf0.mjs";import{n as m}from"./input-validation-D7z60HJH.mjs";import{a as h,i as g}from"./prompt-BGz3DNLz.mjs";var _={method:`GET`,path:t=>e`/accounts/${t.account_id}/abuse-reports/${t.report_id}/appeals/eligibility`,errors:{401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,500:`InternalServerError`}};function v(e){return e.usage(`$0 abuse-reports appeals eligibility <report-id>
|
|
3
3
|
|
|
4
4
|
Returns whether the report is currently appealable, along with the signals behind that decision: whether it already has an open appeal, how many appeals have been submitted against it, and whether it has at least one mitigation that an appeal could reverse. Report-level appeals are currently available only for DMCA (copyright) reports. For other report types this operation returns the same \`404 Report not found\` response as a report that does not exist for the account.`).positional(`report-id`,{type:`string`,description:`Abuse Report ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`eligibility <report-id>`,describe:`Check whether a report can be appealed`,builder:v,handler:async e=>l({command:`abuse-reports appeals eligibility`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await i();r({command:`cf abuse-reports appeals eligibility`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/abuse-reports/${e[`report-id`]==null?`<report-id>`:encodeURIComponent(String(e[`report-id`]))}/appeals/eligibility`,pathParams:{"report-id":String(e[`report-id`]??``)},bodyKind:`none`});return}let t=await n(e),l=e.local?o:await a();e.accountId=l;let u=await c(`Loading`,async()=>t.send(_,{account_id:l,report_id:e[`report-id`]}));s(u,{successLabel:`Loaded`})})},b={command:`appeals`,describe:`Appeal eligibility for abuse reports`,builder:e=>e.command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(e){return e.usage("$0 abuse-reports create <report-type>\n\nSubmit an abuse report of a particular type. Requires the abuse-reports entitlement on the account (Enterprise accounts have it by default; other accounts must request access) and an API token with the `Trust and Safety Write` permission. If the account is not entitled, the request is rejected with an HTTP `401` response (see below). Delegated reports: In limited circumstances, Cloudflare delegates processing of abuse reports to select customers who have established abuse-handling programs. For these customers, Cloudflare may forward abuse reports directly and in full—including reporter contact information, comments, and supporting evidence—without redaction or preprocessing by Cloudflare. This allows the customer to investigate and respond using their own policies and processes. For delegated reports, the report—including contact information and comments—will be forwarded to the customer in full regardless of the `host_notification` and `owner_notification` values.").positional(`report-type`,{type:`string`,description:`The report type to be submitted. Example: abuse_general`,demandOption:!0}).option(`act`,{type:`string`,description:`The act field`,choices:[`abuse_dmca`,`abuse_trademark`,`abuse_general`,`abuse_phishing`,`abuse_children`,`abuse_threat`,`abuse_registrar_whois`,`abuse_ncsei`]}).coerce(`act`,e=>m(e,`act`,`text`)).option(`comments`,{type:`string`,description:`Any additional comments about the infringement not exceeding 2000 characters. With the exception of delegated reports, comments are kept internal to Cloudflare and not shared with the host or customer as part of regular processing. For the limited circumstances where we delegate reports to customers with established abuse-handling programs, comments may be shared in full.`}).option(`company`,{type:`string`,description:`Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`email`,{type:`string`,description:`A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`email2`,{type:`string`,description:"Should match the value provided in `email`"}).option(`name`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`reported-country`,{type:`string`,description:`Text containing 2 characters`}).option(`reported-user-agent`,{type:`string`,description:`Text not exceeding 255 characters`}).option(`tele`,{type:`string`,description:`Text not exceeding 20 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`title`,{type:`string`,description:`Text not exceeding 255 characters`}).option(`urls`,{type:`string`,description:`A list of valid URLs separated by ‘\\n’ (new line character). The list of the URLs should not exceed 250 URLs. All URLs should have the same hostname. Each URL should be unique. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`address1`,{type:`string`,description:`Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`agent-name`,{type:`string`,description:`The name of the copyright holder. Text not exceeding 60 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`agree`,{type:`number`,description:"Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports"}).option(`city`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`country`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).
|
|
5
5
|
`}).option(`host-notification`,{type:`string`,description:`Notification type based on the abuse type. For delegated reports, the report—including contact information and comments—will be forwarded to the customer in full regardless of this value. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./lazy-command-
|
|
2
|
+
import{t as e}from"./lazy-command-CJcN1Ze6.mjs";import{t}from"./hand-written-dry-run-B82fRl2N.mjs";var n=e(`curl <url>`,`Run curl against an Access-protected application with its JWT injected by cloudflared.`,()=>import(`./command-D-a4KxcW.mjs`),{command:`access curl`,recordArgs:!1}),r=e(`login <url>`,`Authenticate with an Access application and store its JWT through cloudflared.`,()=>import(`./command-BkCc_9UI.mjs`),{command:`access login`,recordArgs:!1}),i=e(`ssh-config`,`Print an example SSH configuration for an Access application.`,()=>import(`./command-EG23K_k6.mjs`),{command:`access ssh-config`,recordArgs:!1}),a=e(`ssh-gen`,`Generate a short-lived certificate for an Access SSH application.`,()=>import(`./command-BaFQsuac.mjs`),{command:`access ssh-gen`,recordArgs:!1}),o={...e(`tcp`,`Proxy a TCP connection through Access. The command is also available as ssh, rdp, and smb.`,()=>import(`./command-CdB1DQZl.mjs`),{command:`access tcp`,recordArgs:!1}),aliases:[`ssh`,`rdp`,`smb`]},s=e(`token <url>`,`Print a JWT for authenticating with an Access application.`,()=>import(`./command-oko8tT2c.mjs`),{command:`access token`,recordArgs:!1});const c={command:`access`,describe:`Access protected applications and services`,builder:e=>e.command(t(n,`preview`)).command(t(r,`preview`)).command(t(i,`preview`)).command(t(a,`preview`)).command(t(o,`preview`)).command(t(s,`preview`)).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{c as default};
|
|
@@ -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,s as r}from"./auth-
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{i as t,n,s as r}from"./auth-CRq9OQKr.mjs";import{c as i,o as a,r as o,t as s}from"./body-parser-HN91kAf0.mjs";import{a as c,i as l,t as u}from"./context-DsVjrTbe.mjs";import{t as d}from"./dry-run-mrA7FFLR.mjs";import{n as f}from"./input-validation-D7z60HJH.mjs";import{t as p}from"./local-B3zt9PXR.mjs";import{t as m}from"./run-DAK_kbUa.mjs";import{t as h}from"./output-PRKYaJuo.mjs";import{t as g}from"./progress-DItBn6ZV.mjs";import{a as _,i as v,n as y}from"./prompt-BGz3DNLz.mjs";import"./telemetry-B3S5OfOn.mjs";import{n as ee,t as te}from"./raw-fetch-CmI3Ol3q.mjs";var b={method:`POST`,path:t=>e`/accounts/${t.account_id}/resource-library/applications`,body:`json`,errors:{403:`ForbiddenError`,429:`TooManyRequestsError`}};function ne(e){return e.usage(`$0 accounts applications create
|
|
3
3
|
|
|
4
4
|
Create a custom application for an account from a name, category, and optional network matchers.`).option(`category-id`,{type:`number`,description:`Numeric identifier for an application category.`}).option(`hostnames`,{type:`string`,array:!0,description:`Hostnames matched by the application.`}).option(`human-id`,{type:`string`,description:`Human-readable identifier for the application.`}).option(`ip-subnets`,{type:`string`,array:!0,description:`IP subnets for this application. Custom application create and update requests accept IPv4 prefix lengths /8 through /32 and IPv6 prefix lengths /32 through /128.`}).option(`name`,{type:`string`,description:`Application name.`}).option(`port-protocols`,{type:`string`,array:!0,description:"Ports matched by the application, in `protocol/port` or inclusive `protocol/start-end` format (for example, `tcp/443` or `udp/10000-20000`). TCP and UDP ports must be between 0 and 65535."}).option(`support-domains`,{type:`string`,array:!0,description:`Support domains matched by the application.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"Defines a custom application. At least one hostname or IP subnet is required. Support domains and port/protocol pairs do not satisfy this requirement. A NUL character (U+0000) in any string value returns `400`. "})}const re={command:`create`,describe:`Create application`,builder:ne,handler:async e=>m({command:`accounts applications create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await c();d({command:`cf accounts applications create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/resource-library/applications`,pathParams:{},bodyKind:`json`,body:e.body===void 0?s({category_id:e[`category-id`],hostnames:e.hostnames,human_id:f(e[`human-id`],`human-id`,`text`),ip_subnets:e[`ip-subnets`],name:f(e.name,`name`,`text`),port_protocols:e[`port-protocols`],support_domains:e[`support-domains`]}):o(e.body)});return}let t=e.body===void 0?void 0:o(e.body),r=await n(e),i=e.local?p:await u();if(e.accountId=i,e.body!==void 0){let e=t,n=await g(`Creating`,async()=>r.send(b,{body:e,account_id:i}));h(n,{successLabel:`Created`});return}if(e[`category-id`]===void 0)throw Error(`--category-id is required (or pass --body with this field set).`);e[`human-id`]===void 0&&(e[`human-id`]=await _(`human-id`,`Human-readable identifier for the application.`)),e.name===void 0&&(e.name=await _(`name`,`Application name.`));let a=s({category_id:e[`category-id`],hostnames:e.hostnames,human_id:f(e[`human-id`],`human-id`,`text`),ip_subnets:e[`ip-subnets`],name:f(e.name,`name`,`text`),port_protocols:e[`port-protocols`],support_domains:e[`support-domains`]}),l=await g(`Creating`,async()=>r.send(b,{body:a,account_id:i}));h(l,{successLabel:`Created`})})};var ie={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/resource-library/applications/${t.id}`,errors:{403:`ForbiddenError`,409:`ConflictError`,429:`TooManyRequestsError`,502:`BadGatewayError`}};function ae(e){return e.usage(`$0 accounts applications delete <id>
|
|
5
5
|
|
|
@@ -126,8 +126,8 @@ Test whether a token works.`).option(`dry-run`,{type:`boolean`,description:`Vali
|
|
|
126
126
|
|
|
127
127
|
Returns a list of Image Resizing configurations across all zones for the account. This endpoint is useful for retrieving the transformations (image_resizing) state for all zones belonging to an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Vn={command:`list`,describe:`List Image Resizing configurations for account`,builder:Bn,handler:async e=>m({command:`accounts transformations list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await c();d({command:`cf accounts transformations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/settings/transformations`,pathParams:{},bodyKind:`none`});return}let t=await n(e),r=e.local?p:await u();e.accountId=r;let i=await g(`Loading`,async()=>t.send(zn,{account_id:r}));h(i,{successLabel:`Loaded`})})},Hn={command:`transformations`,describe:`Operations for transformations`,builder:e=>e.command(Vn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Q={method:`PUT`,path:t=>e`/accounts/${t.account_id}`,body:`json`};function Un(e){return e.usage(`$0 accounts update
|
|
128
128
|
|
|
129
|
-
Update an existing account. Account names are limited to 65 UTF-8 bytes.`).option(`id`,{type:`string`,description:`Identifier`}).option(`name`,{type:`string`,description:`Account name, limited to 65 UTF-8 bytes.`}).option(`settings-abuse-contact-email`,{type:`string`,description:`Sets an abuse contact email to notify for abuse reports.`}).option(`settings-enforce-twofactor`,{type:`boolean`,description:`Indicates whether membership in this account requires that
|
|
130
|
-
Two-Factor Authentication is enabled`}).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 Wn={command:`update`,describe:`Update Account`,builder:Un,handler:async e=>m({command:`accounts update`,classification:{safeFlags:[`settings-enforce-twofactor`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await c();d({command:`cf accounts update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}`,pathParams:{},bodyKind:`json`,body:e.body===void 0?s({id:f(e.id,`id`,`text`),name:f(e.name,`name`,`text`),settings:{abuse_contact_email:f(e[`settings-abuse-contact-email`],`settings-abuse-contact-email`,`text`),enforce_twofactor:e[`settings-enforce-twofactor`]}}):o(e.body)});return}let t=e.body===void 0?void 0:o(e.body),r=await n(e),i=e.local?p:await u();if(e.accountId=i,e.body!==void 0){let e=t,n=await g(`Updating`,async()=>r.send(Q,{body:e,account_id:i}));h(n,{successLabel:`Updated`});return}e.id===void 0&&(e.id=await _(`id`,`Identifier`)),e.name===void 0&&(e.name=await _(`name`,`Account name, limited to 65 UTF-8 bytes.`));let a=s({id:f(e.id,`id`,`text`),name:f(e.name,`name`,`text`),settings:{abuse_contact_email:f(e[`settings-abuse-contact-email`],`settings-abuse-contact-email`,`text`),enforce_twofactor:e[`settings-enforce-twofactor`]}}),l=await g(`Updating`,async()=>r.send(Q,{body:a,account_id:i}));h(l,{successLabel:`Updated`})})};var $={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/settings/ut-billing`,body:`json`,constants:{value:`on`}};function Gn(e){return e.usage(`$0 accounts ut-billing edit
|
|
129
|
+
Update an existing account. Account names are limited to 65 UTF-8 bytes.`).option(`id`,{type:`string`,description:`Identifier`}).option(`name`,{type:`string`,description:`Account name. When creating or updating an account, the name is limited to 65 UTF-8 bytes.`}).option(`settings-abuse-contact-email`,{type:`string`,description:`Sets an abuse contact email to notify for abuse reports.`}).option(`settings-enforce-twofactor`,{type:`boolean`,description:`Indicates whether membership in this account requires that
|
|
130
|
+
Two-Factor Authentication is enabled`}).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 Wn={command:`update`,describe:`Update Account`,builder:Un,handler:async e=>m({command:`accounts update`,classification:{safeFlags:[`settings-enforce-twofactor`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await c();d({command:`cf accounts update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}`,pathParams:{},bodyKind:`json`,body:e.body===void 0?s({id:f(e.id,`id`,`text`),name:f(e.name,`name`,`text`),settings:{abuse_contact_email:f(e[`settings-abuse-contact-email`],`settings-abuse-contact-email`,`text`),enforce_twofactor:e[`settings-enforce-twofactor`]}}):o(e.body)});return}let t=e.body===void 0?void 0:o(e.body),r=await n(e),i=e.local?p:await u();if(e.accountId=i,e.body!==void 0){let e=t,n=await g(`Updating`,async()=>r.send(Q,{body:e,account_id:i}));h(n,{successLabel:`Updated`});return}e.id===void 0&&(e.id=await _(`id`,`Identifier`)),e.name===void 0&&(e.name=await _(`name`,`Account name. When creating or updating an account, the name is limited to 65 UTF-8 bytes.`));let a=s({id:f(e.id,`id`,`text`),name:f(e.name,`name`,`text`),settings:{abuse_contact_email:f(e[`settings-abuse-contact-email`],`settings-abuse-contact-email`,`text`),enforce_twofactor:e[`settings-enforce-twofactor`]}}),l=await g(`Updating`,async()=>r.send(Q,{body:a,account_id:i}));h(l,{successLabel:`Updated`})})};var $={method:`PATCH`,path:t=>e`/accounts/${t.account_id}/settings/ut-billing`,body:`json`,constants:{value:`on`}};function Gn(e){return e.usage(`$0 accounts ut-billing edit
|
|
131
131
|
|
|
132
132
|
Updates the Unique Transformations billing configuration for an account. When enabled, billing data is directed to the Transformations pipeline. Note: setting the value to "off" is not permitted once enabled.`).option(`value`,{type:`string`,description:`Enables Unique Transformations billing for the account.
|
|
133
133
|
Note: once enabled, this setting cannot be set back to "off".
|
|
@@ -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{r,t as i}from"./body-parser-HN91kAf0.mjs";import{t as a}from"./dry-run-mrA7FFLR.mjs";import{n as o}from"./input-validation-D7z60HJH.mjs";import{t as s}from"./run-DAK_kbUa.mjs";import{t as c}from"./output-PRKYaJuo.mjs";import{t as l}from"./progress-DItBn6ZV.mjs";import{a as u,n as d}from"./prompt-BGz3DNLz.mjs";import"./telemetry-B3S5OfOn.mjs";var f={method:`POST`,path:t=>e`/zones/${t.zone_id}/acm/custom_trust_store`,body:`json`};function p(e){return e.usage(`$0 acm custom-trust-store create
|
|
3
3
|
|
|
4
4
|
Upload a root CA certificate to the Custom Origin Trust Store for a Zone. Only root CA certificates are accepted.`).option(`certificate`,{type:`string`,description:`The root CA certificate in PEM format. Only root CA certificates are accepted; intermediate and leaf certificates are not supported.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`create`,describe:`Upload Custom Origin Trust Store`,builder:p,handler:async e=>s({command:`acm custom-trust-store create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf acm custom-trust-store create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/acm/custom_trust_store`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?i({certificate:o(e.certificate,`certificate`,`text`)}):r(e.body)});return}let s=e.body===void 0?void 0:r(e.body),d=await t(e),p=await n({zone:e.zone},d,{quiet:e.quiet});if(e.zoneId=p,e.body!==void 0){let e=s,t=await l(`Creating`,async()=>d.send(f,{body:e,zone_id:p}));c(t,{successLabel:`Created`});return}e.certificate===void 0&&(e.certificate=await u(`certificate`,`The root CA certificate in PEM format. Only root CA certificates are accepted; intermediate and leaf certificates are not supported.`));let m=i({certificate:o(e.certificate,`certificate`,`text`)}),h=await l(`Creating`,async()=>d.send(f,{body:m,zone_id:p}));c(h,{successLabel:`Created`})})};var h={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/acm/custom_trust_store/${t.custom_origin_trust_store_id}`};function g(e){return e.usage(`$0 acm custom-trust-store delete <custom-origin-trust-store-id>
|
|
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-
|
|
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,i as a,t as o}from"./context-DsVjrTbe.mjs";import{t as s}from"./local-B3zt9PXR.mjs";import{t as c}from"./output-PRKYaJuo.mjs";import{t as l}from"./progress-DItBn6ZV.mjs";import{t as u}from"./run-DAK_kbUa.mjs";import{a as d,n as f}from"./prompt-BGz3DNLz.mjs";import"./telemetry-B3S5OfOn.mjs";import{o as p,r as m,t as h}from"./body-parser-HN91kAf0.mjs";import{n as g,t as ee}from"./input-validation-D7z60HJH.mjs";import{n as te,t as _}from"./raw-fetch-CmI3Ol3q.mjs";var v={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/addressing/address_maps/${t.address_map_id}/accounts/${t.member_account_id}`};function ne(e){return e.usage(`$0 addressing address-maps accounts delete <member-account-id>
|
|
3
3
|
|
|
4
4
|
Remove an account as a member of a particular address map.`).positional(`member-account-id`,{type:`string`,description:`Identifier of a Cloudflare account.`,demandOption:!0}).option(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,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 <member-account-id>`,describe:`Remove an account membership from an Address Map`,builder:ne,handler:async e=>u({command:`addressing address-maps accounts delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await i();r({command:`cf addressing address-maps accounts delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/addressing/address_maps/${e[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(e[`address-map-id`]))}/accounts/${e[`member-account-id`]==null?`<member-account-id>`:encodeURIComponent(String(e[`member-account-id`]))}`,pathParams:{"address-map-id":String(e[`address-map-id`]??``),"member-account-id":String(e[`member-account-id`]??``)},bodyKind:`none`});return}let t=await n(e),a=e.local?s:await o();if(e.accountId=a,!await f({force:!!e.force}))return;let u=await l(`Deleting`,async()=>t.send(v,{account_id:a,address_map_id:e[`address-map-id`],member_account_id:e[`member-account-id`]}));c(u,{successLabel:`Deleted`})})};var ie={method:`PUT`,path:t=>e`/accounts/${t.account_id}/addressing/address_maps/${t.address_map_id}/accounts/${t.member_account_id}`};function ae(e){return e.usage(`$0 addressing address-maps accounts update <member-account-id>
|
|
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{o as n,r,t as i}from"./body-parser-HN91kAf0.mjs";import{a,t as o}from"./context-DsVjrTbe.mjs";import{t as s}from"./dry-run-mrA7FFLR.mjs";import{n as c}from"./input-validation-D7z60HJH.mjs";import{t as l}from"./local-B3zt9PXR.mjs";import{t as u}from"./run-DAK_kbUa.mjs";import{t as d}from"./output-PRKYaJuo.mjs";import{t as f}from"./progress-DItBn6ZV.mjs";import{a as p,n as m}from"./prompt-BGz3DNLz.mjs";import"./telemetry-B3S5OfOn.mjs";var h={method:`POST`,path:t=>e`/accounts/${t.account_id}/agent-memory/namespaces`,body:`json`};function g(e){return e.usage(`$0 agent-memory create-namespace
|
|
3
3
|
|
|
4
4
|
Creates a new memory namespace owned by the account.`).option(`name`,{type:`string`,description:`Namespace name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`create-namespace`,describe:`Create a namespace`,builder:g,handler:async e=>u({command:`agent-memory create-namespace`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await a();s({command:`cf agent-memory create-namespace`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/agent-memory/namespaces`,pathParams:{},bodyKind:`json`,body:e.body===void 0?i({name:c(e.name,`name`,`text`)}):r(e.body)});return}let n=e.body===void 0?void 0:r(e.body),u=await t(e),m=e.local?l:await o();if(e.accountId=m,e.body!==void 0){let e=n,t=await f(`Creating`,async()=>u.send(h,{body:e,account_id:m}));d(t,{successLabel:`Created`});return}e.name===void 0&&(e.name=await p(`name`,`Namespace name.`));let g=i({name:c(e.name,`name`,`text`)}),_=await f(`Creating`,async()=>u.send(h,{body:g,account_id:m}));d(_,{successLabel:`Created`})})};var v={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/agent-memory/namespaces/${t.namespace_name}/profiles/${t.profile_name}/memories/${t.memory_id}`};function y(e){return e.usage(`$0 agent-memory delete-memory <memory-id>
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"./api-Dnt6lRJG.mjs";import{a as e,i as t,n}from"./auth-
|
|
2
|
+
import"./api-Dnt6lRJG.mjs";import{a as e,i as t,n}from"./auth-CRq9OQKr.mjs";import{t as r}from"./path-DRw6Y-nd.mjs";import{t as i}from"./dry-run-mrA7FFLR.mjs";import{n as a,t as o}from"./local-B3zt9PXR.mjs";import{a as s,t as c}from"./context-DsVjrTbe.mjs";import{t as l}from"./output-PRKYaJuo.mjs";import{t as u}from"./progress-DItBn6ZV.mjs";import"./telemetry-B3S5OfOn.mjs";import{n as d,t as f}from"./run-DAK_kbUa.mjs";import{n as p,t as m}from"./input-validation-D7z60HJH.mjs";import{r as h,t as g}from"./body-parser-HN91kAf0.mjs";import{a as _,i as ee,n as te}from"./prompt-BGz3DNLz.mjs";import{a as ne,i as re,n as v,r as ie,t as y}from"./schema-cache-BcbUfb3D.mjs";import{n as b}from"./raw-fetch-CmI3Ol3q.mjs";import{c as x,f as ae,i as oe,l as S,n as se,p as ce,r as C,s as w,t as T,u as E}from"./schema-flags-YgeJ6Bey.mjs";import{r as D}from"./theme-BGHWSKCw.mjs";var O={method:`GET`,path:e=>r`/accounts/${e.account_id}/ai/authors/search`,errors:{400:`BadRequestError`}};function k(e){return e.usage(`$0 ai authors list
|
|
3
3
|
|
|
4
4
|
Searches Workers AI models by author or organization name.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`Author Search`,builder:k,handler:async e=>f({command:`ai authors list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let e=await s();i({command:`cf ai authors list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai/authors/search`,pathParams:{},bodyKind:`none`});return}let t=await n(e),r=e.local?o:await c();e.accountId=r;let a=await u(`Loading`,async()=>t.send(O,{account_id:r}));l(a,{successLabel:`Loaded`})})},j={command:`authors`,describe:`Operations for authors`,builder:e=>e.command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.usage(`$0 ai finetunes assets create <finetune-id>
|
|
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{i as n}from"./context-DsVjrTbe.mjs";import{r}from"./body-parser-HN91kAf0.mjs";import{t as i}from"./dry-run-mrA7FFLR.mjs";import{t as a}from"./output-PRKYaJuo.mjs";import{t as o}from"./run-DAK_kbUa.mjs";import{t as s}from"./progress-DItBn6ZV.mjs";import"./telemetry-B3S5OfOn.mjs";var c={method:`POST`,path:t=>e`/zones/${t.zone_id}/ai-audit/robots/bulk`,body:`json`,errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,408:`RequestTimeoutError`,500:`InternalServerError`,503:`ServiceUnavailableError`}};function l(e){return e.usage(`$0 ai-audit robots bulk-get
|
|
3
3
|
|
|
4
4
|
Fetches and parses robots.txt files for multiple domains within a zone in a single request. Each domain must belong to the specified zone. Results are keyed by hostname.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Array of domain hostnames to fetch robots.txt for. Each domain must end with the zone name. Maximum 25 domains per request.`})}const u={command:`bulk-get`,describe:`Bulk get robots.txt rules`,builder:l,handler:async e=>o({command:`ai-audit robots bulk-get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){i({command:`cf ai-audit robots bulk-get`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/ai-audit/robots/bulk`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:r(e.body,[],25)});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`);let o=e.body===void 0?void 0:r(e.body,[],25),l=await t(e),u=await n({zone:e.zone},l,{quiet:e.quiet});if(e.zoneId=u,e.body!==void 0){let e=o,t=await s(`Loading`,async()=>l.send(c,{body:e,zone_id:u}));a(t,{successLabel:`Loaded`})}})};var d={method:`GET`,path:t=>e`/zones/${t.zone_id}/ai-audit/robots`,query:[`subdomain`],errors:{400:`BadRequestError`,401:`UnauthorizedError`,403:`ForbiddenError`,404:`NotFoundError`,500:`InternalServerError`,503:`ServiceUnavailableError`}};function f(e){return e.usage(`$0 ai-audit robots 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{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,t as s}from"./body-parser-HN91kAf0.mjs";import{a as c,t as l}from"./context-DsVjrTbe.mjs";import{t as u}from"./dry-run-mrA7FFLR.mjs";import{n as d}from"./input-validation-D7z60HJH.mjs";import{t as f}from"./local-B3zt9PXR.mjs";import{t as p}from"./run-DAK_kbUa.mjs";import{t as m}from"./output-PRKYaJuo.mjs";import{t as h}from"./progress-DItBn6ZV.mjs";import{a as g,n as _}from"./prompt-BGz3DNLz.mjs";import"./telemetry-B3S5OfOn.mjs";var v={method:`POST`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/custom-domains`,body:`json`,errors:{400:`BadRequestError`}};function y(e){return e.usage(`$0 ai-gateway custom-domains create <gateway-id>
|
|
3
3
|
|
|
4
4
|
Provisions a Cloudflare-for-SaaS custom hostname and returns the CNAME target to point DNS at.`).positional(`gateway-id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`,demandOption:!0}).option(`domain`,{type:`string`,description:"Custom hostname that you own, such as `ai.example.com`."}).option(`min-tls`,{type:`string`,description:`The minTLS field`,choices:[`1.0`,`1.1`,`1.2`,`1.3`]}).coerce(`min-tls`,e=>d(e,`min-tls`,`text`)).option(`zone-id`,{type:`string`,description:`ID of the Cloudflare zone that contains the custom hostname.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`create <gateway-id>`,describe:`Create a custom domain for a gateway`,builder:y,handler:async e=>p({command:`ai-gateway custom-domains create`,classification:{safeFlags:[`min-tls`,`dry-run`]}},e,async()=>{if(e.dryRun){let t=await c();u({command:`cf ai-gateway custom-domains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/custom-domains`,pathParams:{"gateway-id":String(e[`gateway-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({domain:d(e.domain,`domain`,`text`),minTLS:e[`min-tls`],zone_id:d(e[`zone-id`],`zone-id`,`text`)}):o(e.body)});return}let t=e.body===void 0?void 0:o(e.body),r=await n(e),i=e.local?f:await l();if(e.accountId=i,e.body!==void 0){let n=t,a=await h(`Creating`,async()=>r.send(v,{body:n,account_id:i,gateway_id:e[`gateway-id`]}));m(a,{successLabel:`Created`});return}e.domain===void 0&&(e.domain=await g(`domain`,"Custom hostname that you own, such as `ai.example.com`.")),e[`zone-id`]===void 0&&(e[`zone-id`]=await g(`zone-id`,`ID of the Cloudflare zone that contains the custom hostname.`));let a=s({domain:d(e.domain,`domain`,`text`),minTLS:e[`min-tls`],zone_id:d(e[`zone-id`],`zone-id`,`text`)}),p=await h(`Creating`,async()=>r.send(v,{body:a,account_id:i,gateway_id:e[`gateway-id`]}));m(p,{successLabel:`Created`})})};var x={method:`DELETE`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/custom-domains/${t.hostname}`,errors:{404:`NotFoundError`}};function S(e){return e.usage(`$0 ai-gateway custom-domains delete <hostname>
|
|
5
5
|
|
|
@@ -23,9 +23,9 @@ Creates a dynamic route on an AI Gateway from the specified routing elements. Cl
|
|
|
23
23
|
|
|
24
24
|
Deletes a dynamic route from an AI Gateway.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const W={command:`delete <id>`,describe:`Delete a dynamic route`,builder:U,handler:async e=>p({command:`ai-gateway dynamic-routing delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){let t=await c();u({command:`cf ai-gateway dynamic-routing delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/routes/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`none`});return}let t=await n(e),r=e.local?f:await l();if(e.accountId=r,!await _({force:!!e.force}))return;let i=await h(`Deleting`,async()=>t.send(H,{account_id:r,gateway_id:e[`gateway-id`],id:e.id}));m(i,{successLabel:`Deleted`})})};var G={method:`POST`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/routes/${t.id}/deployments`,body:`json`,errors:{400:`BadRequestError`}};function K(e){return e.usage(`$0 ai-gateway dynamic-routing deployments create <id>
|
|
25
25
|
|
|
26
|
-
Deploys the specified version of a dynamic route so that it serves traffic. Deploy an earlier version to roll back.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`version-id`,{type:`string`,description:`The version_id field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ce={command:`create <id>`,describe:`Deploy a dynamic route version`,builder:K,handler:async e=>p({command:`ai-gateway dynamic-routing deployments create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await c();u({command:`cf ai-gateway dynamic-routing deployments create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/routes/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/deployments`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`json`,body:e.body===void 0?s({version_id:d(e[`version-id`],`version-id`,`text`)}):o(e.body)});return}let t=e.body===void 0?void 0:o(e.body),r=await n(e),i=e.local?f:await l();if(e.accountId=i,e.body!==void 0){let n=t,a=await h(`Creating`,async()=>r.send(G,{body:n,account_id:i,gateway_id:e[`gateway-id`],id:e.id}));m(a,{successLabel:`Created`});return}e[`version-id`]===void 0&&(e[`version-id`]=await g(`version-id`,`The version_id field`));let a=s({version_id:d(e[`version-id`],`version-id`,`text`)}),p=await h(`Creating`,async()=>r.send(G,{body:a,account_id:i,gateway_id:e[`gateway-id`],id:e.id}));m(p,{successLabel:`Created`})})};var le={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/routes/${t.id}/deployments`,errors:{400:`BadRequestError`}};function ue(e){return e.usage(`$0 ai-gateway dynamic-routing deployments list
|
|
26
|
+
Deploys the specified version of a dynamic route so that it serves traffic. Deploy an earlier version to roll back.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`version-id`,{type:`string`,description:`The version_id field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ce={command:`create <id>`,describe:`Deploy a dynamic route version`,builder:K,handler:async e=>p({command:`ai-gateway dynamic-routing deployments create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await c();u({command:`cf ai-gateway dynamic-routing deployments create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/routes/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/deployments`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`json`,body:e.body===void 0?s({version_id:d(e[`version-id`],`version-id`,`text`)}):o(e.body)});return}let t=e.body===void 0?void 0:o(e.body),r=await n(e),i=e.local?f:await l();if(e.accountId=i,e.body!==void 0){let n=t,a=await h(`Creating`,async()=>r.send(G,{body:n,account_id:i,gateway_id:e[`gateway-id`],id:e.id}));m(a,{successLabel:`Created`});return}e[`version-id`]===void 0&&(e[`version-id`]=await g(`version-id`,`The version_id field`));let a=s({version_id:d(e[`version-id`],`version-id`,`text`)}),p=await h(`Creating`,async()=>r.send(G,{body:a,account_id:i,gateway_id:e[`gateway-id`],id:e.id}));m(p,{successLabel:`Created`})})};var le={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/routes/${t.id}/deployments`,query:[`page`,`per_page`],errors:{400:`BadRequestError`}};function ue(e){return e.usage(`$0 ai-gateway dynamic-routing deployments list
|
|
27
27
|
|
|
28
|
-
Lists the deployment history of a dynamic route.`).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`list`,describe:`List dynamic route deployments`,builder:ue,handler:async e=>p({command:`ai-gateway dynamic-routing deployments list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let
|
|
28
|
+
Lists the deployment history of a dynamic route.`).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number`}).option(`per-page`,{type:`number`,description:`Number of deployments per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`list`,describe:`List dynamic route deployments`,builder:ue,handler:async e=>p({command:`ai-gateway dynamic-routing deployments list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={page:e.page,per_page:e[`per-page`]};if(e.dryRun){let n=await c();u({command:`cf ai-gateway dynamic-routing deployments list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/routes/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/deployments`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},query:t,bodyKind:`none`});return}let r=await n(e),i=e.local?f:await l();e.accountId=i;let a=await h(`Loading`,async()=>r.send(le,{account_id:i,gateway_id:e[`gateway-id`],id:e.id,...t}));m(a,{successLabel:`Loaded`})})},fe={command:`deployments`,describe:`Deploy dynamic route versions and view deployment history`,builder:e=>e.command(ce).command(de).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var pe={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/routes/${t.id}`,errors:{400:`BadRequestError`}};function me(e){return e.usage(`$0 ai-gateway dynamic-routing get <id>
|
|
29
29
|
|
|
30
30
|
Retrieves a dynamic route with its routing elements, active version, and current deployment.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const he={command:`get <id>`,describe:`Get a dynamic route`,builder:me,handler:async e=>p({command:`ai-gateway dynamic-routing get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await c();u({command:`cf ai-gateway dynamic-routing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/routes/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`none`});return}let t=await n(e),r=e.local?f:await l();e.accountId=r;let i=await h(`Loading`,async()=>t.send(pe,{account_id:r,gateway_id:e[`gateway-id`],id:e.id}));m(i,{successLabel:`Loaded`})})};var ge={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/routes`,query:[`page`,`per_page`],errors:{400:`BadRequestError`}};function _e(e){return e.usage(`$0 ai-gateway dynamic-routing list
|
|
31
31
|
|
|
@@ -35,9 +35,9 @@ Updates the name of a dynamic route. To change routing behaviour, create and dep
|
|
|
35
35
|
|
|
36
36
|
Creates a new version of a dynamic route from the specified routing elements. The version does not serve traffic until you deploy it.`).positional(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`elements`,{type:`string`,description:`The elements field. Provide as a JSON array of objects or @path/to/file.json. Shape: [({"id": string, "outputs": {...}, "type": "start"} | {"id": string, "outputs": {...}, "properties": {...}, "type": "conditional"} | {"id": string, "outputs": {...}, "type": "percentage"} | ...more)].`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Se={command:`create <id>`,describe:`Create a dynamic route version`,builder:xe,handler:async e=>p({command:`ai-gateway dynamic-routing versions create`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await c();u({command:`cf ai-gateway dynamic-routing versions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/routes/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/versions`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},bodyKind:`json`,body:e.body===void 0?s({elements:a(e.elements,`elements`)}):o(e.body)});return}let t=e.body===void 0?void 0:o(e.body),r=await n(e),i=e.local?f:await l();if(e.accountId=i,e.body!==void 0){let n=t,a=await h(`Creating`,async()=>r.send(J,{body:n,account_id:i,gateway_id:e[`gateway-id`],id:e.id}));m(a,{successLabel:`Created`});return}if(e.elements===void 0)throw Error(`--elements is required (or pass --body with this field set).`);let d=s({elements:a(e.elements,`elements`)}),p=await h(`Creating`,async()=>r.send(J,{body:d,account_id:i,gateway_id:e[`gateway-id`],id:e.id}));m(p,{successLabel:`Created`})})};var Ce={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/routes/${t.id}/versions/${t.version_id}`,errors:{400:`BadRequestError`}};function we(e){return e.usage(`$0 ai-gateway dynamic-routing versions get <version-id>
|
|
37
37
|
|
|
38
|
-
Retrieves a saved version of a dynamic route, including its routing elements.`).positional(`version-id`,{type:`string`,description:`Version ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Te={command:`get <version-id>`,describe:`Get a dynamic route version`,builder:we,handler:async e=>p({command:`ai-gateway dynamic-routing versions get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await c();u({command:`cf ai-gateway dynamic-routing versions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/routes/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/versions/${e[`version-id`]==null?`<version-id>`:encodeURIComponent(String(e[`version-id`]))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``),"version-id":String(e[`version-id`]??``)},bodyKind:`none`});return}let t=await n(e),r=e.local?f:await l();e.accountId=r;let i=await h(`Loading`,async()=>t.send(Ce,{account_id:r,gateway_id:e[`gateway-id`],id:e.id,version_id:e[`version-id`]}));m(i,{successLabel:`Loaded`})})};var Ee={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/routes/${t.id}/versions`,errors:{400:`BadRequestError`}};function De(e){return e.usage(`$0 ai-gateway dynamic-routing versions list
|
|
38
|
+
Retrieves a saved version of a dynamic route, including its routing elements.`).positional(`version-id`,{type:`string`,description:`Version ID`,demandOption:!0}).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Te={command:`get <version-id>`,describe:`Get a dynamic route version`,builder:we,handler:async e=>p({command:`ai-gateway dynamic-routing versions get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let t=await c();u({command:`cf ai-gateway dynamic-routing versions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/routes/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/versions/${e[`version-id`]==null?`<version-id>`:encodeURIComponent(String(e[`version-id`]))}`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``),"version-id":String(e[`version-id`]??``)},bodyKind:`none`});return}let t=await n(e),r=e.local?f:await l();e.accountId=r;let i=await h(`Loading`,async()=>t.send(Ce,{account_id:r,gateway_id:e[`gateway-id`],id:e.id,version_id:e[`version-id`]}));m(i,{successLabel:`Loaded`})})};var Ee={method:`GET`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways/${t.gateway_id}/routes/${t.id}/versions`,query:[`page`,`per_page`],errors:{400:`BadRequestError`}};function De(e){return e.usage(`$0 ai-gateway dynamic-routing versions list
|
|
39
39
|
|
|
40
|
-
Lists the saved versions of a dynamic route.`).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Oe={command:`list`,describe:`List dynamic route versions`,builder:De,handler:async e=>p({command:`ai-gateway dynamic-routing versions list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){let
|
|
40
|
+
Lists the saved versions of a dynamic route.`).option(`gateway-id`,{type:`string`,description:`Gateway ID`,demandOption:!0}).option(`id`,{type:`string`,description:`ID`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number`}).option(`per-page`,{type:`number`,description:`Number of versions per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Oe={command:`list`,describe:`List dynamic route versions`,builder:De,handler:async e=>p({command:`ai-gateway dynamic-routing versions list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={page:e.page,per_page:e[`per-page`]};if(e.dryRun){let n=await c();u({command:`cf ai-gateway dynamic-routing versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${n??`<account-id>`}/ai-gateway/gateways/${e[`gateway-id`]==null?`<gateway-id>`:encodeURIComponent(String(e[`gateway-id`]))}/routes/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}/versions`,pathParams:{"gateway-id":String(e[`gateway-id`]??``),id:String(e.id??``)},query:t,bodyKind:`none`});return}let r=await n(e),i=e.local?f:await l();e.accountId=i;let a=await h(`Loading`,async()=>r.send(Ee,{account_id:i,gateway_id:e[`gateway-id`],id:e.id,...t}));m(a,{successLabel:`Loaded`})})},ke={command:`versions`,describe:`Create and inspect saved versions of a dynamic route`,builder:e=>e.command(Se).command(Te).command(Oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ae={command:`dynamic-routing`,describe:`Route requests across multiple AI providers with fallback, load-balancing, and versioned deployments`,builder:e=>e.command(V).command(W).command(he).command(ve).command(be).command(fe).command(ke).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var Y={method:`POST`,path:t=>e`/accounts/${t.account_id}/ai-gateway/gateways`,body:`json`,errors:{400:`BadRequestError`}};function je(e){return e.usage(`$0 ai-gateway gateways create
|
|
41
41
|
|
|
42
42
|
Creates an AI Gateway in the account with the specified caching, rate limiting, logging, and authentication settings. The gateway ID appears in request URLs and must be unique within the account.`).option(`authentication`,{type:`boolean`,description:`Require authentication for gateway access. New gateways must have authentication enabled. Once enabled, authentication cannot be disabled.`}).option(`byok-only`,{type:`boolean`,description:`Requires customer-provided provider credentials and prevents fallback to Unified Billing.`}).option(`cache-invalidate-on-update`,{type:`boolean`,description:`The cache_invalidate_on_update field`}).option(`cache-ttl`,{type:`number`,description:`The cache_ttl field`}).option(`collect-logs`,{type:`boolean`,description:`The collect_logs field`}).option(`guardrails-prompt-p1`,{type:`string`,description:`The guardrails.prompt.P1 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-p1`,e=>d(e,`guardrails-prompt-p1`,`text`)).option(`guardrails-prompt-s1`,{type:`string`,description:`The guardrails.prompt.S1 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s1`,e=>d(e,`guardrails-prompt-s1`,`text`)).option(`guardrails-prompt-s10`,{type:`string`,description:`The guardrails.prompt.S10 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s10`,e=>d(e,`guardrails-prompt-s10`,`text`)).option(`guardrails-prompt-s11`,{type:`string`,description:`The guardrails.prompt.S11 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s11`,e=>d(e,`guardrails-prompt-s11`,`text`)).option(`guardrails-prompt-s12`,{type:`string`,description:`The guardrails.prompt.S12 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s12`,e=>d(e,`guardrails-prompt-s12`,`text`)).option(`guardrails-prompt-s13`,{type:`string`,description:`The guardrails.prompt.S13 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s13`,e=>d(e,`guardrails-prompt-s13`,`text`)).option(`guardrails-prompt-s14`,{type:`string`,description:`The guardrails.prompt.S14 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s14`,e=>d(e,`guardrails-prompt-s14`,`text`)).option(`guardrails-prompt-s2`,{type:`string`,description:`The guardrails.prompt.S2 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s2`,e=>d(e,`guardrails-prompt-s2`,`text`)).option(`guardrails-prompt-s3`,{type:`string`,description:`The guardrails.prompt.S3 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s3`,e=>d(e,`guardrails-prompt-s3`,`text`)).option(`guardrails-prompt-s4`,{type:`string`,description:`The guardrails.prompt.S4 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s4`,e=>d(e,`guardrails-prompt-s4`,`text`)).option(`guardrails-prompt-s5`,{type:`string`,description:`The guardrails.prompt.S5 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s5`,e=>d(e,`guardrails-prompt-s5`,`text`)).option(`guardrails-prompt-s6`,{type:`string`,description:`The guardrails.prompt.S6 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s6`,e=>d(e,`guardrails-prompt-s6`,`text`)).option(`guardrails-prompt-s7`,{type:`string`,description:`The guardrails.prompt.S7 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s7`,e=>d(e,`guardrails-prompt-s7`,`text`)).option(`guardrails-prompt-s8`,{type:`string`,description:`The guardrails.prompt.S8 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s8`,e=>d(e,`guardrails-prompt-s8`,`text`)).option(`guardrails-prompt-s9`,{type:`string`,description:`The guardrails.prompt.S9 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-prompt-s9`,e=>d(e,`guardrails-prompt-s9`,`text`)).option(`guardrails-response-p1`,{type:`string`,description:`The guardrails.response.P1 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-p1`,e=>d(e,`guardrails-response-p1`,`text`)).option(`guardrails-response-s1`,{type:`string`,description:`The guardrails.response.S1 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s1`,e=>d(e,`guardrails-response-s1`,`text`)).option(`guardrails-response-s10`,{type:`string`,description:`The guardrails.response.S10 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s10`,e=>d(e,`guardrails-response-s10`,`text`)).option(`guardrails-response-s11`,{type:`string`,description:`The guardrails.response.S11 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s11`,e=>d(e,`guardrails-response-s11`,`text`)).option(`guardrails-response-s12`,{type:`string`,description:`The guardrails.response.S12 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s12`,e=>d(e,`guardrails-response-s12`,`text`)).option(`guardrails-response-s13`,{type:`string`,description:`The guardrails.response.S13 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s13`,e=>d(e,`guardrails-response-s13`,`text`)).option(`guardrails-response-s14`,{type:`string`,description:`The guardrails.response.S14 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s14`,e=>d(e,`guardrails-response-s14`,`text`)).option(`guardrails-response-s2`,{type:`string`,description:`The guardrails.response.S2 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s2`,e=>d(e,`guardrails-response-s2`,`text`)).option(`guardrails-response-s3`,{type:`string`,description:`The guardrails.response.S3 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s3`,e=>d(e,`guardrails-response-s3`,`text`)).option(`guardrails-response-s4`,{type:`string`,description:`The guardrails.response.S4 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s4`,e=>d(e,`guardrails-response-s4`,`text`)).option(`guardrails-response-s5`,{type:`string`,description:`The guardrails.response.S5 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s5`,e=>d(e,`guardrails-response-s5`,`text`)).option(`guardrails-response-s6`,{type:`string`,description:`The guardrails.response.S6 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s6`,e=>d(e,`guardrails-response-s6`,`text`)).option(`guardrails-response-s7`,{type:`string`,description:`The guardrails.response.S7 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s7`,e=>d(e,`guardrails-response-s7`,`text`)).option(`guardrails-response-s8`,{type:`string`,description:`The guardrails.response.S8 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s8`,e=>d(e,`guardrails-response-s8`,`text`)).option(`guardrails-response-s9`,{type:`string`,description:`The guardrails.response.S9 field`,choices:[`FLAG`,`BLOCK`]}).coerce(`guardrails-response-s9`,e=>d(e,`guardrails-response-s9`,`text`)).option(`id`,{type:`string`,description:`Unique identifier of the AI Gateway within the account.`}).option(`log-classification`,{type:`boolean`,description:`The log_classification field`}).option(`log-management`,{type:`number`,description:`The log_management field`}).option(`log-management-strategy`,{type:`string`,description:`The log_management_strategy field`,choices:[`STOP_INSERTING`,`DELETE_OLDEST`]}).coerce(`log-management-strategy`,e=>d(e,`log-management-strategy`,`text`)).option(`logpush`,{type:`boolean`,description:`The logpush field`}).option(`logpush-public-key`,{type:`string`,description:`The logpush_public_key field`}).option(`otel`,{type:`string`,description:`The otel field. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"headers": {...}, "url": string, "authorization"?: string, "content_type"?: "json" | "protobuf"}]. ? marks optional keys.`}).option(`rate-limiting-interval`,{type:`number`,description:`The rate_limiting_interval field`}).option(`rate-limiting-limit`,{type:`number`,description:`The rate_limiting_limit field`}).option(`rate-limiting-technique`,{type:`string`,description:`The rate_limiting_technique field`,choices:[`fixed`,`sliding`]}).coerce(`rate-limiting-technique`,e=>d(e,`rate-limiting-technique`,`text`)).option(`retry-backoff`,{type:`string`,description:`Backoff strategy for retry delays`,choices:[`constant`,`linear`,`exponential`]}).coerce(`retry-backoff`,e=>d(e,`retry-backoff`,`text`)).option(`retry-delay`,{type:`number`,description:`Delay between retry attempts in milliseconds (0-60000)`}).option(`retry-max-attempts`,{type:`number`,description:`Maximum number of retry attempts for failed requests (1-5)`}).option(`spend-limits-enabled`,{type:`boolean`,description:`The spend_limits.enabled field`}).option(`spend-limits-rules`,{type:`string`,description:`The spend_limits.rules field. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"limit": number, "limitType": "cost", "window": number, "enabled"?: boolean, "id"?: string, ...more}]. ? marks optional keys.`}).option(`store-id`,{type:`string`,description:`Secrets Store used by this gateway. Omit on update to keep the current store. Cannot be cleared while stored keys or secret references depend on it.`}).option(`stripe-authorization`,{type:`string`,description:`The stripe.authorization field`}).option(`stripe-usage-events`,{type:`string`,description:`The stripe.usage_events field. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"payload": string}].`}).option(`workers-ai-billing-mode`,{type:`string`,description:`Controls how Workers AI inference calls routed through this gateway are billed. 'postpaid' bills the account directly through Workers AI; 'unified' deducts credits via AI Gateway using neuron-based pricing and delegates billing to AI Gateway.`,choices:[`postpaid`,`unified`],default:`postpaid`}).coerce(`workers-ai-billing-mode`,e=>d(e,`workers-ai-billing-mode`,`text`)).option(`zdr`,{type:`boolean`,description:`The zdr field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{let t=[`stripe-authorization`,`stripe-usage-events`].some(t=>e[t]!==void 0);if(!e.body&&t){let t=[`stripe-authorization`,`stripe-usage-events`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --stripe-* flag is set`)}return!0})}const Me={command:`create`,describe:`Create a gateway`,builder:je,handler:async e=>p({command:`ai-gateway gateways create`,classification:{safeFlags:/* @__PURE__ */ `authentication.byok-only.cache-invalidate-on-update.collect-logs.guardrails-prompt-p1.guardrails-prompt-s1.guardrails-prompt-s10.guardrails-prompt-s11.guardrails-prompt-s12.guardrails-prompt-s13.guardrails-prompt-s14.guardrails-prompt-s2.guardrails-prompt-s3.guardrails-prompt-s4.guardrails-prompt-s5.guardrails-prompt-s6.guardrails-prompt-s7.guardrails-prompt-s8.guardrails-prompt-s9.guardrails-response-p1.guardrails-response-s1.guardrails-response-s10.guardrails-response-s11.guardrails-response-s12.guardrails-response-s13.guardrails-response-s14.guardrails-response-s2.guardrails-response-s3.guardrails-response-s4.guardrails-response-s5.guardrails-response-s6.guardrails-response-s7.guardrails-response-s8.guardrails-response-s9.log-classification.log-management-strategy.logpush.rate-limiting-technique.retry-backoff.spend-limits-enabled.workers-ai-billing-mode.zdr.dry-run`.split(`.`)}},e,async()=>{if(e.dryRun){let t=await c();u({command:`cf ai-gateway gateways create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-gateway/gateways`,pathParams:{},bodyKind:`json`,body:e.body===void 0?s({authentication:e.authentication,byok_only:e[`byok-only`],cache_invalidate_on_update:e[`cache-invalidate-on-update`],cache_ttl:e[`cache-ttl`],collect_logs:e[`collect-logs`],guardrails:{prompt:{P1:e[`guardrails-prompt-p1`],S1:e[`guardrails-prompt-s1`],S10:e[`guardrails-prompt-s10`],S11:e[`guardrails-prompt-s11`],S12:e[`guardrails-prompt-s12`],S13:e[`guardrails-prompt-s13`],S14:e[`guardrails-prompt-s14`],S2:e[`guardrails-prompt-s2`],S3:e[`guardrails-prompt-s3`],S4:e[`guardrails-prompt-s4`],S5:e[`guardrails-prompt-s5`],S6:e[`guardrails-prompt-s6`],S7:e[`guardrails-prompt-s7`],S8:e[`guardrails-prompt-s8`],S9:e[`guardrails-prompt-s9`]},response:{P1:e[`guardrails-response-p1`],S1:e[`guardrails-response-s1`],S10:e[`guardrails-response-s10`],S11:e[`guardrails-response-s11`],S12:e[`guardrails-response-s12`],S13:e[`guardrails-response-s13`],S14:e[`guardrails-response-s14`],S2:e[`guardrails-response-s2`],S3:e[`guardrails-response-s3`],S4:e[`guardrails-response-s4`],S5:e[`guardrails-response-s5`],S6:e[`guardrails-response-s6`],S7:e[`guardrails-response-s7`],S8:e[`guardrails-response-s8`],S9:e[`guardrails-response-s9`]}},id:d(e.id,`id`,`text`),log_classification:e[`log-classification`],log_management:e[`log-management`],log_management_strategy:e[`log-management-strategy`],logpush:e.logpush,logpush_public_key:d(e[`logpush-public-key`],`logpush-public-key`,`text`),otel:a(e.otel,`otel`),rate_limiting_interval:e[`rate-limiting-interval`],rate_limiting_limit:e[`rate-limiting-limit`],rate_limiting_technique:e[`rate-limiting-technique`],retry_backoff:e[`retry-backoff`],retry_delay:e[`retry-delay`],retry_max_attempts:e[`retry-max-attempts`],spend_limits:{enabled:e[`spend-limits-enabled`],rules:a(e[`spend-limits-rules`],`spend-limits-rules`)},store_id:d(e[`store-id`],`store-id`,`text`),stripe:{authorization:d(e[`stripe-authorization`],`stripe-authorization`,`text`),usage_events:a(e[`stripe-usage-events`],`stripe-usage-events`)},workers_ai_billing_mode:e[`workers-ai-billing-mode`],zdr:e.zdr}):o(e.body)});return}let t=e.body===void 0?void 0:o(e.body),r=await n(e),i=e.local?f:await l();if(e.accountId=i,e.body!==void 0){let e=t,n=await h(`Creating`,async()=>r.send(Y,{body:e,account_id:i}));m(n,{successLabel:`Created`});return}if(e[`cache-invalidate-on-update`]===void 0)throw Error(`--cache-invalidate-on-update is required (or pass --body with this field set).`);if(e[`cache-ttl`]===void 0)throw Error(`--cache-ttl is required (or pass --body with this field set).`);if(e[`collect-logs`]===void 0)throw Error(`--collect-logs is required (or pass --body with this field set).`);if(e.id===void 0&&(e.id=await g(`id`,`Unique identifier of the AI Gateway within the account.`)),e[`rate-limiting-interval`]===void 0)throw Error(`--rate-limiting-interval is required (or pass --body with this field set).`);if(e[`rate-limiting-limit`]===void 0)throw Error(`--rate-limiting-limit is required (or pass --body with this field set).`);let p=s({authentication:e.authentication,byok_only:e[`byok-only`],cache_invalidate_on_update:e[`cache-invalidate-on-update`],cache_ttl:e[`cache-ttl`],collect_logs:e[`collect-logs`],guardrails:{prompt:{P1:e[`guardrails-prompt-p1`],S1:e[`guardrails-prompt-s1`],S10:e[`guardrails-prompt-s10`],S11:e[`guardrails-prompt-s11`],S12:e[`guardrails-prompt-s12`],S13:e[`guardrails-prompt-s13`],S14:e[`guardrails-prompt-s14`],S2:e[`guardrails-prompt-s2`],S3:e[`guardrails-prompt-s3`],S4:e[`guardrails-prompt-s4`],S5:e[`guardrails-prompt-s5`],S6:e[`guardrails-prompt-s6`],S7:e[`guardrails-prompt-s7`],S8:e[`guardrails-prompt-s8`],S9:e[`guardrails-prompt-s9`]},response:{P1:e[`guardrails-response-p1`],S1:e[`guardrails-response-s1`],S10:e[`guardrails-response-s10`],S11:e[`guardrails-response-s11`],S12:e[`guardrails-response-s12`],S13:e[`guardrails-response-s13`],S14:e[`guardrails-response-s14`],S2:e[`guardrails-response-s2`],S3:e[`guardrails-response-s3`],S4:e[`guardrails-response-s4`],S5:e[`guardrails-response-s5`],S6:e[`guardrails-response-s6`],S7:e[`guardrails-response-s7`],S8:e[`guardrails-response-s8`],S9:e[`guardrails-response-s9`]}},id:d(e.id,`id`,`text`),log_classification:e[`log-classification`],log_management:e[`log-management`],log_management_strategy:e[`log-management-strategy`],logpush:e.logpush,logpush_public_key:d(e[`logpush-public-key`],`logpush-public-key`,`text`),otel:a(e.otel,`otel`),rate_limiting_interval:e[`rate-limiting-interval`],rate_limiting_limit:e[`rate-limiting-limit`],rate_limiting_technique:e[`rate-limiting-technique`],retry_backoff:e[`retry-backoff`],retry_delay:e[`retry-delay`],retry_max_attempts:e[`retry-max-attempts`],spend_limits:{enabled:e[`spend-limits-enabled`],rules:a(e[`spend-limits-rules`],`spend-limits-rules`)},store_id:d(e[`store-id`],`store-id`,`text`),stripe:{authorization:d(e[`stripe-authorization`],`stripe-authorization`,`text`),usage_events:a(e[`stripe-usage-events`],`stripe-usage-events`)},workers_ai_billing_mode:e[`workers-ai-billing-mode`],zdr:e.zdr}),_=await h(`Creating`,async()=>r.send(Y,{body:p,account_id:i}));m(_,{successLabel:`Created`})})};function Ne(e){return e.usage(`$0 ai-gateway gateways delete <gateway-id>
|
|
43
43
|
|
|
@@ -1,9 +1,9 @@
|
|
|
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,i,n as a,o,r as s,t as c}from"./body-parser-HN91kAf0.mjs";import{t as l}from"./dry-run-mrA7FFLR.mjs";import{a as u,t as d}from"./context-DsVjrTbe.mjs";import{n as f,t as p}from"./input-validation-D7z60HJH.mjs";import{t as m}from"./local-B3zt9PXR.mjs";import{t as h}from"./output-PRKYaJuo.mjs";import{t as g}from"./run-DAK_kbUa.mjs";import{t as _}from"./progress-DItBn6ZV.mjs";import"./telemetry-B3S5OfOn.mjs";import"./api-Dnt6lRJG.mjs";import{a as v,i as y,n as b}from"./prompt-BGz3DNLz.mjs";import{n as ee,t as te}from"./raw-fetch-CmI3Ol3q.mjs";function ne(e){return e.usage(`$0 ai-search chat-completions <instance-id>
|
|
3
3
|
|
|
4
4
|
Performs a chat completion request against an AI Search instance, using indexed content as context for generating responses.`).positional(`instance-id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Namespace to use for this operation.`,default:`default`}).option(`ai-search-options-cache-cache-threshold`,{type:`string`,description:`The ai_search_options.cache.cache_threshold field`,choices:[`super_strict_match`,`close_enough`,`flexible_friend`,`anything_goes`]}).coerce(`ai-search-options-cache-cache-threshold`,e=>f(e,`ai-search-options-cache-cache-threshold`,`text`)).option(`ai-search-options-cache-enabled`,{type:`boolean`,description:`The ai_search_options.cache.enabled field`}).option(`ai-search-options-custom-metadata`,{type:`string`,description:`Metadata added to AI Gateway logs for requests this operation triggers. Accepts up to 2 string, number, or boolean entries. Reserved keys: 'ai-search', 'task', 'origin', and any key beginning with 'cf.'. Provide as a JSON object or @path/to/file.json. Shape: {"<key>": (string | number | boolean)}.`}).option(`ai-search-options-query-rewrite-enabled`,{type:`boolean`,description:`The ai_search_options.query_rewrite.enabled field`}).option(`ai-search-options-query-rewrite-model`,{type:`string`,description:`A Workers AI model ID or an AI Gateway model ID compatible with the OpenAI Chat Completions API. An empty string uses the configured or default model.`}).option(`ai-search-options-query-rewrite-rewrite-prompt`,{type:`string`,description:`The ai_search_options.query_rewrite.rewrite_prompt field`}).option(`ai-search-options-reranking-enabled`,{type:`boolean`,description:`The ai_search_options.reranking.enabled field`}).option(`ai-search-options-reranking-match-threshold`,{type:`number`,description:`Minimum reranker relevance score a chunk must reach to be returned. When omitted, falls back to the instance-level score_threshold, then to 0.4.`}).option(`ai-search-options-reranking-model`,{type:`string`,description:`The ai_search_options.reranking.model field`}).option(`ai-search-options-retrieval-boost-by`,{type:`string`,description:`Metadata fields to boost search results by. Overrides the instance-level boost_by config. Direction defaults to 'asc' for numeric/datetime fields, 'exists' for text/boolean fields. Fields must match 'timestamp' or a defined custom_metadata field. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"field": string, "direction"?: "asc" | "desc" | "exists" | ...more}]. ? marks optional keys.`}).option(`ai-search-options-retrieval-context-expansion`,{type:`number`,description:`The ai_search_options.retrieval.context_expansion field`}).option(`ai-search-options-retrieval-filters`,{type:`string`,description:`The ai_search_options.retrieval.filters field. Provide as a JSON object or @path/to/file.json. Shape: {"<key>": unknown}.`}).option(`ai-search-options-retrieval-fusion-method`,{type:`string`,description:`The ai_search_options.retrieval.fusion_method field`,choices:[`max`,`rrf`]}).coerce(`ai-search-options-retrieval-fusion-method`,e=>f(e,`ai-search-options-retrieval-fusion-method`,`text`)).option(`ai-search-options-retrieval-keyword-match-mode`,{type:`string`,description:`Controls which documents become candidates for BM25 scoring. 'and' restricts candidates to documents containing all query terms; 'or' includes any document containing at least one term and ranks results according to BM25 relevance. When omitted, falls back to the instance-level retrieval_options.keyword_match_mode, then to 'and'.`,choices:[`and`,`or`]}).coerce(`ai-search-options-retrieval-keyword-match-mode`,e=>f(e,`ai-search-options-retrieval-keyword-match-mode`,`text`)).option(`ai-search-options-retrieval-match-threshold`,{type:`number`,description:`Minimum similarity score a chunk must reach to be returned. When omitted, falls back to the instance-level score_threshold, then to 0.4.`}).option(`ai-search-options-retrieval-max-num-results`,{type:`number`,description:`Maximum number of results to return. When omitted, falls back to the instance-level max_num_results, then to 10.`}).option(`ai-search-options-retrieval-retrieval-type`,{type:`string`,description:`The ai_search_options.retrieval.retrieval_type field`,choices:[`vector`,`keyword`,`hybrid`]}).coerce(`ai-search-options-retrieval-retrieval-type`,e=>f(e,`ai-search-options-retrieval-retrieval-type`,`text`)).option(`ai-search-options-retrieval-return-on-failure`,{type:`boolean`,description:`The ai_search_options.retrieval.return_on_failure field`}).option(`messages`,{type:`string`,description:`The messages field. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"content": (string | [{...}] | null), "role": "system" | "developer" | "user" | ...more, "<key>": unknown}].`}).option(`model`,{type:`string`,description:`A Workers AI model ID or an AI Gateway model ID compatible with the OpenAI Chat Completions API. An empty string uses the configured or default model.`}).option(`stream`,{type:`boolean`,description:`The stream field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const re={command:`chat-completions <instance-id>`,describe:`Chat Completions`,builder:ne,handler:async n=>g({command:`ai-search chat-completions`,classification:{safeFlags:[`ai-search-options-cache-cache-threshold`,`ai-search-options-cache-enabled`,`ai-search-options-query-rewrite-enabled`,`ai-search-options-reranking-enabled`,`ai-search-options-retrieval-fusion-method`,`ai-search-options-retrieval-keyword-match-mode`,`ai-search-options-retrieval-retrieval-type`,`ai-search-options-retrieval-return-on-failure`,`stream`,`dry-run`]}},n,async()=>{if(n.dryRun){let e=await u();l({command:`cf ai-search chat-completions`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${n.namespace==null?`<namespace>`:encodeURIComponent(String(n.namespace))}/instances/${n[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(n[`instance-id`]))}/chat/completions`,pathParams:{namespace:String(n.namespace??``),"instance-id":String(n[`instance-id`]??``)},bodyKind:`json`,body:n.body===void 0?c({ai_search_options:{cache:{cache_threshold:n[`ai-search-options-cache-cache-threshold`],enabled:n[`ai-search-options-cache-enabled`]},custom_metadata:i(n[`ai-search-options-custom-metadata`],`ai-search-options-custom-metadata`),query_rewrite:{enabled:n[`ai-search-options-query-rewrite-enabled`],model:f(n[`ai-search-options-query-rewrite-model`],`ai-search-options-query-rewrite-model`,`text`),rewrite_prompt:f(n[`ai-search-options-query-rewrite-rewrite-prompt`],`ai-search-options-query-rewrite-rewrite-prompt`,`text`)},reranking:{enabled:n[`ai-search-options-reranking-enabled`],match_threshold:n[`ai-search-options-reranking-match-threshold`],model:f(n[`ai-search-options-reranking-model`],`ai-search-options-reranking-model`,`text`)},retrieval:{boost_by:o(n[`ai-search-options-retrieval-boost-by`],`ai-search-options-retrieval-boost-by`),context_expansion:n[`ai-search-options-retrieval-context-expansion`],filters:i(n[`ai-search-options-retrieval-filters`],`ai-search-options-retrieval-filters`),fusion_method:n[`ai-search-options-retrieval-fusion-method`],keyword_match_mode:n[`ai-search-options-retrieval-keyword-match-mode`],match_threshold:n[`ai-search-options-retrieval-match-threshold`],max_num_results:n[`ai-search-options-retrieval-max-num-results`],retrieval_type:n[`ai-search-options-retrieval-retrieval-type`],return_on_failure:n[`ai-search-options-retrieval-return-on-failure`]}},messages:o(n.messages,`messages`),model:f(n.model,`model`,`text`),stream:n.stream},[[`ai_search_options`,`custom_metadata`],[`ai_search_options`,`retrieval`,`filters`]]):s(n.body)});return}let a=n.body===void 0?void 0:s(n.body),p=await t(n),g=n.local?m:await d();if(n.accountId=g,n.body!==void 0){let t=a,r=await _(`Creating`,async()=>e(p,`POST`,`/accounts/${g}/ai-search/namespaces/${encodeURIComponent(String(n.namespace))}/instances/${encodeURIComponent(String(n[`instance-id`]))}/chat/completions`,{body:t}));h(r,{successLabel:`Created`});return}if(n.messages===void 0)throw Error(`--messages is required (or pass --body with this field set).`);let v={};n[`ai-search-options-cache-cache-threshold`]!==void 0&&r(v,[`ai_search_options`,`cache`,`cache_threshold`],n[`ai-search-options-cache-cache-threshold`]),n[`ai-search-options-cache-enabled`]!==void 0&&r(v,[`ai_search_options`,`cache`,`enabled`],n[`ai-search-options-cache-enabled`]),n[`ai-search-options-custom-metadata`]!==void 0&&r(v,[`ai_search_options`,`custom_metadata`],i(n[`ai-search-options-custom-metadata`],`ai-search-options-custom-metadata`)),n[`ai-search-options-query-rewrite-enabled`]!==void 0&&r(v,[`ai_search_options`,`query_rewrite`,`enabled`],n[`ai-search-options-query-rewrite-enabled`]),n[`ai-search-options-query-rewrite-model`]!==void 0&&r(v,[`ai_search_options`,`query_rewrite`,`model`],f(n[`ai-search-options-query-rewrite-model`],`ai-search-options-query-rewrite-model`,`text`)),n[`ai-search-options-query-rewrite-rewrite-prompt`]!==void 0&&r(v,[`ai_search_options`,`query_rewrite`,`rewrite_prompt`],f(n[`ai-search-options-query-rewrite-rewrite-prompt`],`ai-search-options-query-rewrite-rewrite-prompt`,`text`)),n[`ai-search-options-reranking-enabled`]!==void 0&&r(v,[`ai_search_options`,`reranking`,`enabled`],n[`ai-search-options-reranking-enabled`]),n[`ai-search-options-reranking-match-threshold`]!==void 0&&r(v,[`ai_search_options`,`reranking`,`match_threshold`],n[`ai-search-options-reranking-match-threshold`]),n[`ai-search-options-reranking-model`]!==void 0&&r(v,[`ai_search_options`,`reranking`,`model`],f(n[`ai-search-options-reranking-model`],`ai-search-options-reranking-model`,`text`)),n[`ai-search-options-retrieval-boost-by`]!==void 0&&r(v,[`ai_search_options`,`retrieval`,`boost_by`],o(n[`ai-search-options-retrieval-boost-by`],`ai-search-options-retrieval-boost-by`)),n[`ai-search-options-retrieval-context-expansion`]!==void 0&&r(v,[`ai_search_options`,`retrieval`,`context_expansion`],n[`ai-search-options-retrieval-context-expansion`]),n[`ai-search-options-retrieval-filters`]!==void 0&&r(v,[`ai_search_options`,`retrieval`,`filters`],i(n[`ai-search-options-retrieval-filters`],`ai-search-options-retrieval-filters`)),n[`ai-search-options-retrieval-fusion-method`]!==void 0&&r(v,[`ai_search_options`,`retrieval`,`fusion_method`],n[`ai-search-options-retrieval-fusion-method`]),n[`ai-search-options-retrieval-keyword-match-mode`]!==void 0&&r(v,[`ai_search_options`,`retrieval`,`keyword_match_mode`],n[`ai-search-options-retrieval-keyword-match-mode`]),n[`ai-search-options-retrieval-match-threshold`]!==void 0&&r(v,[`ai_search_options`,`retrieval`,`match_threshold`],n[`ai-search-options-retrieval-match-threshold`]),n[`ai-search-options-retrieval-max-num-results`]!==void 0&&r(v,[`ai_search_options`,`retrieval`,`max_num_results`],n[`ai-search-options-retrieval-max-num-results`]),n[`ai-search-options-retrieval-retrieval-type`]!==void 0&&r(v,[`ai_search_options`,`retrieval`,`retrieval_type`],n[`ai-search-options-retrieval-retrieval-type`]),n[`ai-search-options-retrieval-return-on-failure`]!==void 0&&r(v,[`ai_search_options`,`retrieval`,`return_on_failure`],n[`ai-search-options-retrieval-return-on-failure`]),n.messages!==void 0&&r(v,[`messages`],o(n.messages,`messages`)),n.model!==void 0&&r(v,[`model`],f(n.model,`model`,`text`)),n.stream!==void 0&&r(v,[`stream`],n.stream);let y=await _(`Creating`,async()=>e(p,`POST`,`/accounts/${g}/ai-search/namespaces/${encodeURIComponent(String(n.namespace))}/instances/${encodeURIComponent(String(n[`instance-id`]))}/chat/completions`,{body:v}));h(y,{successLabel:`Created`})})};var x={method:`POST`,path:e=>n`/accounts/${e.account_id}/ai-search/namespaces/${e.namespace}/instances`,body:`json`,errors:{400:`BadRequestError`,403:`ForbiddenError`,409:`ConflictError`,503:`ServiceUnavailableError`}};function S(e){return e.usage(`$0 ai-search create <id>
|
|
5
5
|
|
|
6
|
-
Create a new AI Search instance with the given configuration. If type is omitted or null, a non-blank HTTP(S) source infers web-crawler and any other source infers r2; r2 sources must name an existing bucket. A missing or blank source without a type creates a managed upload-only instance.`).positional(`id`,{type:`string`,description:`Unique ID for the new AI Search instance.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Namespace to use for this operation.`,default:`default`}).option(`ai-gateway-id`,{type:`string`,description:`The ai_gateway_id field`}).option(`ai-search-model`,{type:`string`,description:`A Workers AI model ID or an AI Gateway model ID compatible with the OpenAI Chat Completions API. An empty string uses the configured or default model.`}).option(`cache`,{type:`boolean`,description:`The cache field`,default:!0}).option(`cache-threshold`,{type:`string`,description:`The cache_threshold field`,choices:[`super_strict_match`,`close_enough`,`flexible_friend`,`anything_goes`],default:`close_enough`}).coerce(`cache-threshold`,e=>f(e,`cache-threshold`,`text`)).option(`cache-ttl`,{type:`number`,description:`Cache entry TTL in seconds. Allowed values: 600 (10min), 1800 (30min), 3600 (1h), 7200 (2h), 21600 (6h), 43200 (12h), 86400 (24h), 172800 (48h), 259200 (72h), 518400 (6d).`,default:172800}).option(`chunk`,{type:`boolean`,description:`The chunk field`,default:!0}).option(`chunk-overlap`,{type:`number`,description:`The chunk_overlap field`,default:10}).option(`chunk-size`,{type:`number`,description:`The chunk_size field`}).option(`custom-metadata`,{type:`string`,description:`The custom_metadata field. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"data_type": "text" | "number" | "boolean" | ...more, "field_name": string}].`}).option(`embedding-model`,{type:`string`,description:`The embedding_model field`}).option(`fusion-method`,{type:`string`,description:`The fusion_method field`,choices:[`max`,`rrf`],default:`rrf`}).coerce(`fusion-method`,e=>f(e,`fusion-method`,`text`)).option(`hybrid-search-enabled`,{type:`boolean`,description:`Deprecated — use index_method instead. Defaults to true for new instances; set false to create a vector-only instance.`}).option(`index-method-keyword`,{type:`boolean`,description:`Enable keyword (BM25) storage backend.`}).option(`index-method-vector`,{type:`boolean`,description:`Enable vector (embedding) storage backend.`}).option(`indexing-options-keyword-tokenizer`,{type:`string`,description:`Tokenizer used for keyword search indexing. porter provides word-level tokenization with Porter stemming (good for natural language queries). trigram enables character-level substring matching (good for partial matches, code, identifiers). Changing this triggers a full re-index. Defaults to porter.`,choices:[`porter`,`trigram`]}).coerce(`indexing-options-keyword-tokenizer`,e=>f(e,`indexing-options-keyword-tokenizer`,`text`)).option(`indexing-options-use-ocr`,{type:`boolean`,description:`Enables OCR ingestion for PDFs and images. Changing this triggers a full re-index. Defaults to false.`}).option(`max-num-results`,{type:`number`,description:`The max_num_results field`,default:10}).option(`metadata-created-from-aisearch-wizard`,{type:`boolean`,description:`The metadata.created_from_aisearch_wizard field`}).option(`metadata-created-from-emdash-plugin-type`,{type:`string`,description:`The metadata.created_from_emdash_plugin.type field`,choices:[`native`,`rest`]}).coerce(`metadata-created-from-emdash-plugin-type`,e=>f(e,`metadata-created-from-emdash-plugin-type`,`text`)).option(`metadata-created-from-emdash-plugin-version`,{type:`string`,description:`The metadata.created_from_emdash_plugin.version field`}).option(`metadata-worker-domain`,{type:`string`,description:`The metadata.worker_domain field`}).option(`public-endpoint-params-authorized-hosts`,{type:`string`,array:!0,description:`The public_endpoint_params.authorized_hosts field`}).option(`public-endpoint-params-chat-completions-endpoint-disabled`,{type:`boolean`,description:`Disable chat completions endpoint for this public endpoint.`}).option(`public-endpoint-params-custom-domains`,{type:`string`,array:!0,description:`Custom domain hostnames that alias this public endpoint. GET and create responses return the current set; on update (PUT) this field is only echoed back when supplied in the request body, otherwise it is null (omit it to leave domains unchanged).`}).option(`public-endpoint-params-default-domain-enabled`,{type:`boolean`,description:`When false, the instance is reachable only via a registered custom domain and the default <public_endpoint_id>.search.ai.cloudflare.com host returns 404. Requires at least one custom domain. Defaults to true. public_endpoint_params is replaced wholesale on update, so resend default_domain_enabled on every update to keep the default host off — omitting it resets to true.`}).option(`public-endpoint-params-enabled`,{type:`boolean`,description:`The public_endpoint_params.enabled field`}).option(`public-endpoint-params-mcp-description`,{type:`string`,description:`The public_endpoint_params.mcp.description field`}).option(`public-endpoint-params-mcp-disabled`,{type:`boolean`,description:`Disable MCP endpoint for this public endpoint.`}).option(`public-endpoint-params-rate-limit-period-ms`,{type:`number`,description:`The public_endpoint_params.rate_limit.period_ms field`}).option(`public-endpoint-params-rate-limit-requests`,{type:`number`,description:`The public_endpoint_params.rate_limit.requests field`}).option(`public-endpoint-params-rate-limit-technique`,{type:`string`,description:`The public_endpoint_params.rate_limit.technique field`,choices:[`fixed`,`sliding`]}).coerce(`public-endpoint-params-rate-limit-technique`,e=>f(e,`public-endpoint-params-rate-limit-technique`,`text`)).option(`public-endpoint-params-search-endpoint-disabled`,{type:`boolean`,description:`Disable search endpoint for this public endpoint.`}).option(`reranking`,{type:`boolean`,description:`The reranking field`,default:!1}).option(`reranking-model`,{type:`string`,description:`The reranking_model field`}).option(`retrieval-options-boost-by`,{type:`string`,description:`Metadata fields to boost search results by. Each entry specifies a metadata field and an optional direction. Direction defaults to 'asc' for numeric/datetime fields and 'exists' for text/boolean fields. Fields must match 'timestamp' or a defined custom_metadata field. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"field": string, "direction"?: "asc" | "desc" | "exists" | ...more}]. ? marks optional keys.`}).option(`retrieval-options-keyword-match-mode`,{type:`string`,description:`Controls which documents become candidates for BM25 scoring. 'and' restricts candidates to documents containing all query terms; 'or' includes any document containing at least one term and ranks results according to BM25 relevance. When omitted on an update, the existing stored value stays unchanged; when never set, search falls back to 'and'.`,choices:[`and`,`or`]}).coerce(`retrieval-options-keyword-match-mode`,e=>f(e,`retrieval-options-keyword-match-mode`,`text`)).option(`rewrite-model`,{type:`string`,description:`A Workers AI model ID or an AI Gateway model ID compatible with the OpenAI Chat Completions API. An empty string uses the configured or default model.`}).option(`rewrite-query`,{type:`boolean`,description:`The rewrite_query field`,default:!1}).option(`score-threshold`,{type:`number`,description:`Minimum similarity score a chunk must reach to be returned. Defaults to 0.4.`}).option(`source`,{type:`string`,description:`R2 bucket name or HTTP(S) root website URL to index. When type is omitted, the source determines it.`}).option(`source-params-exclude-items`,{type:`string`,array:!0,description:`List of path patterns to exclude. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /admin/** matches /admin/users and /admin/settings/advanced). Most accounts have a limit of 10 rules; contact support to raise it.`}).option(`source-params-include-items`,{type:`string`,array:!0,description:`List of path patterns to include. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /blog/** matches /blog/post and /blog/2024/post). Most accounts have a limit of 10 rules; contact support to raise it.`}).option(`source-params-prefix`,{type:`string`,description:`The source_params.prefix field`}).option(`source-params-r2-jurisdiction`,{type:`string`,description:`The source_params.r2_jurisdiction field`}).option(`source-params-web-crawler-discover-options-depth`,{type:`number`,description:`Maximum link-follow depth from the seed URL.`}).option(`source-params-web-crawler-discover-options-include-external-links`,{type:`boolean`,description:"Follow links that point outside the source domain. Must stay `false` because discover crawls only cover the zone you own."}).option(`source-params-web-crawler-discover-options-include-subdomains`,{type:`boolean`,description:`Follow links to subdomains of the source host.`}).option(`source-params-web-crawler-discover-options-limit`,{type:`number`,description:`Maximum number of pages to crawl (1-100000).`}).option(`source-params-web-crawler-discover-options-max-age`,{type:`number`,description:`Maximum content age in seconds to accept (0–604800).`}).option(`source-params-web-crawler-discover-options-source`,{type:`string`,description:`Where the crawler looks for URLs: 'sitemaps' reads sitemap XML only, 'links' follows page links only, 'all' does both.`,choices:[`all`,`sitemaps`,`links`]}).coerce(`source-params-web-crawler-discover-options-source`,e=>f(e,`source-params-web-crawler-discover-options-source`,`text`)).option(`source-params-web-crawler-parse-options-content-selector`,{type:`string`,description:`List of path-to-selector mappings for extracting specific content from crawled pages. Each entry pairs a URL glob pattern with a CSS selector. The first matching path wins. The crawler stores and indexes only the matched HTML fragment. Omit the field to disable content selection; the API rejects empty arrays. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"path": string, "selector": string}].`}).option(`source-params-web-crawler-parse-options-include-headers`,{type:`string`,description:`Up to 5 custom HTTP headers sent with each crawl request. Names must use RFC-7230 token characters, excluding spaces, colons, and control characters. Values must use HTAB and printable ASCII only, excluding CR and LF. Provide as a JSON object or @path/to/file.json. Shape: {"<key>": string}.`}).option(`source-params-web-crawler-parse-options-include-images`,{type:`boolean`,description:`The source_params.web_crawler.parse_options.include_images field`}).option(`source-params-web-crawler-parse-options-specific-sitemaps`,{type:`string`,array:!0,description:`List of specific sitemap URLs to use for crawling. Only valid when parse_type is 'sitemap'.`}).option(`source-params-web-crawler-parse-options-use-browser-rendering`,{type:`boolean`,description:`The source_params.web_crawler.parse_options.use_browser_rendering field`}).option(`source-params-web-crawler-parse-type`,{type:`string`,description:`How the crawler finds URLs. 'sitemap' reads XML sitemaps; 'discover' follows links recursively and requires the source to belong to a Verified zone on this account.`,choices:[`sitemap`,`discover`]}).coerce(`source-params-web-crawler-parse-type`,e=>f(e,`source-params-web-crawler-parse-type`,`text`)).option(`sync-interval`,{type:`number`,description:`Interval between automatic syncs, in seconds. Allowed values: 900 (15min), 1800 (30min), 3600 (1h), 7200 (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h). Defaults to 86400 (24h).`}).option(`token-id`,{type:`string`,description:`The token_id field`}).option(`type`,{type:`string`,description:`Data source type: r2 or web-crawler.`,choices:[`r2`,`web-crawler`]}).coerce(`type`,e=>f(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)`}).check(e=>{let t=[`index-method-keyword`,`index-method-vector`].some(t=>e[t]!==void 0);if(!e.body&&t){let t=[`index-method-keyword`,`index-method-vector`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --index-method-* flag is set`)}return!0}).check(e=>{let t=[`metadata-created-from-emdash-plugin-type`,`metadata-created-from-emdash-plugin-version`].some(t=>e[t]!==void 0);if(!e.body&&t){let t=[`metadata-created-from-emdash-plugin-type`,`metadata-created-from-emdash-plugin-version`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --metadata-created-from-emdash-plugin-* flag is set`)}return!0})}const C={command:`create <id>`,describe:`Create an AI Search instance.`,builder:S,handler:async e=>g({command:`ai-search create`,classification:{safeFlags:/* @__PURE__ */ `cache.cache-threshold.chunk.fusion-method.hybrid-search-enabled.index-method-keyword.index-method-vector.indexing-options-keyword-tokenizer.indexing-options-use-ocr.metadata-created-from-aisearch-wizard.metadata-created-from-emdash-plugin-type.public-endpoint-params-chat-completions-endpoint-disabled.public-endpoint-params-default-domain-enabled.public-endpoint-params-enabled.public-endpoint-params-mcp-disabled.public-endpoint-params-rate-limit-technique.public-endpoint-params-search-endpoint-disabled.reranking.retrieval-options-keyword-match-mode.rewrite-query.source-params-web-crawler-discover-options-include-external-links.source-params-web-crawler-discover-options-include-subdomains.source-params-web-crawler-discover-options-source.source-params-web-crawler-parse-options-include-images.source-params-web-crawler-parse-options-use-browser-rendering.source-params-web-crawler-parse-type.type.dry-run`.split(`.`)}},e,async()=>{if(e.dryRun){let t=await u();l({command:`cf ai-search create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}/instances`,pathParams:{namespace:String(e.namespace??``)},bodyKind:`json`,body:e.body===void 0?c({ai_gateway_id:f(e[`ai-gateway-id`],`ai-gateway-id`,`text`),ai_search_model:f(e[`ai-search-model`],`ai-search-model`,`text`),cache:e.cache,cache_threshold:e[`cache-threshold`],cache_ttl:e[`cache-ttl`],chunk:e.chunk,chunk_overlap:e[`chunk-overlap`],chunk_size:e[`chunk-size`],custom_metadata:o(e[`custom-metadata`],`custom-metadata`),embedding_model:f(e[`embedding-model`],`embedding-model`,`text`),fusion_method:e[`fusion-method`],hybrid_search_enabled:e[`hybrid-search-enabled`],index_method:{keyword:e[`index-method-keyword`],vector:e[`index-method-vector`]},indexing_options:{keyword_tokenizer:e[`indexing-options-keyword-tokenizer`],use_ocr:e[`indexing-options-use-ocr`]},max_num_results:e[`max-num-results`],metadata:{created_from_aisearch_wizard:e[`metadata-created-from-aisearch-wizard`],created_from_emdash_plugin:{type:e[`metadata-created-from-emdash-plugin-type`],version:f(e[`metadata-created-from-emdash-plugin-version`],`metadata-created-from-emdash-plugin-version`,`text`)},worker_domain:f(e[`metadata-worker-domain`],`metadata-worker-domain`,`text`)},public_endpoint_params:{authorized_hosts:e[`public-endpoint-params-authorized-hosts`],chat_completions_endpoint:{disabled:e[`public-endpoint-params-chat-completions-endpoint-disabled`]},custom_domains:e[`public-endpoint-params-custom-domains`],default_domain_enabled:e[`public-endpoint-params-default-domain-enabled`],enabled:e[`public-endpoint-params-enabled`],mcp:{description:f(e[`public-endpoint-params-mcp-description`],`public-endpoint-params-mcp-description`,`text`),disabled:e[`public-endpoint-params-mcp-disabled`]},rate_limit:{period_ms:e[`public-endpoint-params-rate-limit-period-ms`],requests:e[`public-endpoint-params-rate-limit-requests`],technique:e[`public-endpoint-params-rate-limit-technique`]},search_endpoint:{disabled:e[`public-endpoint-params-search-endpoint-disabled`]}},reranking:e.reranking,reranking_model:f(e[`reranking-model`],`reranking-model`,`text`),retrieval_options:{boost_by:o(e[`retrieval-options-boost-by`],`retrieval-options-boost-by`),keyword_match_mode:e[`retrieval-options-keyword-match-mode`]},rewrite_model:f(e[`rewrite-model`],`rewrite-model`,`text`),rewrite_query:e[`rewrite-query`],score_threshold:e[`score-threshold`],source:f(e.source,`source`,`text`),source_params:{exclude_items:e[`source-params-exclude-items`],include_items:e[`source-params-include-items`],prefix:f(e[`source-params-prefix`],`source-params-prefix`,`text`),r2_jurisdiction:f(e[`source-params-r2-jurisdiction`],`source-params-r2-jurisdiction`,`text`),web_crawler:{discover_options:{depth:e[`source-params-web-crawler-discover-options-depth`],include_external_links:e[`source-params-web-crawler-discover-options-include-external-links`],include_subdomains:e[`source-params-web-crawler-discover-options-include-subdomains`],limit:e[`source-params-web-crawler-discover-options-limit`],max_age:e[`source-params-web-crawler-discover-options-max-age`],source:e[`source-params-web-crawler-discover-options-source`]},parse_options:{content_selector:o(e[`source-params-web-crawler-parse-options-content-selector`],`source-params-web-crawler-parse-options-content-selector`),include_headers:i(e[`source-params-web-crawler-parse-options-include-headers`],`source-params-web-crawler-parse-options-include-headers`),include_images:e[`source-params-web-crawler-parse-options-include-images`],specific_sitemaps:e[`source-params-web-crawler-parse-options-specific-sitemaps`],use_browser_rendering:e[`source-params-web-crawler-parse-options-use-browser-rendering`]},parse_type:e[`source-params-web-crawler-parse-type`]}},sync_interval:e[`sync-interval`],token_id:f(e[`token-id`],`token-id`,`text`),type:e.type,id:e.id},[[`source_params`,`web_crawler`,`parse_options`,`include_headers`]]):a(s(e.body),[{name:`id`,field:`id`,value:e.id}])});return}let n=e.body===void 0?void 0:a(s(e.body),[{name:`id`,field:`id`,value:e.id}]),r=await t(e),p=e.local?m:await d();if(e.accountId=p,e.body!==void 0){let t=n,i=await _(`Creating`,async()=>r.send(x,{body:t,account_id:p,namespace:e.namespace}));h(i,{successLabel:`Created`});return}let g=c({ai_gateway_id:f(e[`ai-gateway-id`],`ai-gateway-id`,`text`),ai_search_model:f(e[`ai-search-model`],`ai-search-model`,`text`),cache:e.cache,cache_threshold:e[`cache-threshold`],cache_ttl:e[`cache-ttl`],chunk:e.chunk,chunk_overlap:e[`chunk-overlap`],chunk_size:e[`chunk-size`],custom_metadata:o(e[`custom-metadata`],`custom-metadata`),embedding_model:f(e[`embedding-model`],`embedding-model`,`text`),fusion_method:e[`fusion-method`],hybrid_search_enabled:e[`hybrid-search-enabled`],index_method:{keyword:e[`index-method-keyword`],vector:e[`index-method-vector`]},indexing_options:{keyword_tokenizer:e[`indexing-options-keyword-tokenizer`],use_ocr:e[`indexing-options-use-ocr`]},max_num_results:e[`max-num-results`],metadata:{created_from_aisearch_wizard:e[`metadata-created-from-aisearch-wizard`],created_from_emdash_plugin:{type:e[`metadata-created-from-emdash-plugin-type`],version:f(e[`metadata-created-from-emdash-plugin-version`],`metadata-created-from-emdash-plugin-version`,`text`)},worker_domain:f(e[`metadata-worker-domain`],`metadata-worker-domain`,`text`)},public_endpoint_params:{authorized_hosts:e[`public-endpoint-params-authorized-hosts`],chat_completions_endpoint:{disabled:e[`public-endpoint-params-chat-completions-endpoint-disabled`]},custom_domains:e[`public-endpoint-params-custom-domains`],default_domain_enabled:e[`public-endpoint-params-default-domain-enabled`],enabled:e[`public-endpoint-params-enabled`],mcp:{description:f(e[`public-endpoint-params-mcp-description`],`public-endpoint-params-mcp-description`,`text`),disabled:e[`public-endpoint-params-mcp-disabled`]},rate_limit:{period_ms:e[`public-endpoint-params-rate-limit-period-ms`],requests:e[`public-endpoint-params-rate-limit-requests`],technique:e[`public-endpoint-params-rate-limit-technique`]},search_endpoint:{disabled:e[`public-endpoint-params-search-endpoint-disabled`]}},reranking:e.reranking,reranking_model:f(e[`reranking-model`],`reranking-model`,`text`),retrieval_options:{boost_by:o(e[`retrieval-options-boost-by`],`retrieval-options-boost-by`),keyword_match_mode:e[`retrieval-options-keyword-match-mode`]},rewrite_model:f(e[`rewrite-model`],`rewrite-model`,`text`),rewrite_query:e[`rewrite-query`],score_threshold:e[`score-threshold`],source:f(e.source,`source`,`text`),source_params:{exclude_items:e[`source-params-exclude-items`],include_items:e[`source-params-include-items`],prefix:f(e[`source-params-prefix`],`source-params-prefix`,`text`),r2_jurisdiction:f(e[`source-params-r2-jurisdiction`],`source-params-r2-jurisdiction`,`text`),web_crawler:{discover_options:{depth:e[`source-params-web-crawler-discover-options-depth`],include_external_links:e[`source-params-web-crawler-discover-options-include-external-links`],include_subdomains:e[`source-params-web-crawler-discover-options-include-subdomains`],limit:e[`source-params-web-crawler-discover-options-limit`],max_age:e[`source-params-web-crawler-discover-options-max-age`],source:e[`source-params-web-crawler-discover-options-source`]},parse_options:{content_selector:o(e[`source-params-web-crawler-parse-options-content-selector`],`source-params-web-crawler-parse-options-content-selector`),include_headers:i(e[`source-params-web-crawler-parse-options-include-headers`],`source-params-web-crawler-parse-options-include-headers`),include_images:e[`source-params-web-crawler-parse-options-include-images`],specific_sitemaps:e[`source-params-web-crawler-parse-options-specific-sitemaps`],use_browser_rendering:e[`source-params-web-crawler-parse-options-use-browser-rendering`]},parse_type:e[`source-params-web-crawler-parse-type`]}},sync_interval:e[`sync-interval`],token_id:f(e[`token-id`],`token-id`,`text`),type:e.type,id:e.id},[[`source_params`,`web_crawler`,`parse_options`,`include_headers`]]),v=await _(`Creating`,async()=>r.send(x,{body:g,account_id:p,namespace:e.namespace}));h(v,{successLabel:`Created`})})};function w(e){return e.usage(`$0 ai-search delete <instance-id>
|
|
6
|
+
Create a new AI Search instance with the given configuration. If type is omitted or null, a non-blank HTTP(S) source infers web-crawler and any other source infers r2; r2 sources must name an existing bucket. A missing or blank source without a type creates a managed upload-only instance.`).positional(`id`,{type:`string`,description:`Unique ID for the new AI Search instance.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Namespace to use for this operation.`,default:`default`}).option(`ai-gateway-id`,{type:`string`,description:`The ai_gateway_id field`}).option(`ai-search-model`,{type:`string`,description:`A Workers AI model ID or an AI Gateway model ID compatible with the OpenAI Chat Completions API. An empty string uses the configured or default model.`}).option(`cache`,{type:`boolean`,description:`The cache field`,default:!0}).option(`cache-threshold`,{type:`string`,description:`The cache_threshold field`,choices:[`super_strict_match`,`close_enough`,`flexible_friend`,`anything_goes`],default:`close_enough`}).coerce(`cache-threshold`,e=>f(e,`cache-threshold`,`text`)).option(`cache-ttl`,{type:`number`,description:`Cache entry TTL in seconds. Allowed values: 600 (10min), 1800 (30min), 3600 (1h), 7200 (2h), 21600 (6h), 43200 (12h), 86400 (24h), 172800 (48h), 259200 (72h), 518400 (6d).`,default:172800}).option(`chunk`,{type:`boolean`,description:`The chunk field`,default:!0}).option(`chunk-overlap`,{type:`number`,description:`The chunk_overlap field`,default:10}).option(`chunk-size`,{type:`number`,description:`The chunk_size field`}).option(`custom-metadata`,{type:`string`,description:`The custom_metadata field. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"data_type": "text" | "number" | "boolean" | ...more, "field_name": string}].`}).option(`embedding-model`,{type:`string`,description:`The embedding_model field`}).option(`fusion-method`,{type:`string`,description:`The fusion_method field`,choices:[`max`,`rrf`],default:`rrf`}).coerce(`fusion-method`,e=>f(e,`fusion-method`,`text`)).option(`hybrid-search-enabled`,{type:`boolean`,description:`Deprecated — use index_method instead. Defaults to true for new instances; set false to create a vector-only instance.`}).option(`index-method-keyword`,{type:`boolean`,description:`Enable keyword (BM25) storage backend.`}).option(`index-method-vector`,{type:`boolean`,description:`Enable vector (embedding) storage backend.`}).option(`indexing-options-keyword-tokenizer`,{type:`string`,description:`Tokenizer used for keyword search indexing. porter provides word-level tokenization with Porter stemming (good for natural language queries). trigram enables character-level substring matching (good for partial matches, code, identifiers). Changing this triggers a full re-index. Defaults to porter.`,choices:[`porter`,`trigram`]}).coerce(`indexing-options-keyword-tokenizer`,e=>f(e,`indexing-options-keyword-tokenizer`,`text`)).option(`indexing-options-use-ocr`,{type:`boolean`,description:`Enables OCR ingestion for PDFs and images. Changing this triggers a full re-index. Defaults to false.`}).option(`max-num-results`,{type:`number`,description:`The max_num_results field`,default:10}).option(`metadata-created-from-aisearch-wizard`,{type:`boolean`,description:`The metadata.created_from_aisearch_wizard field`}).option(`metadata-created-from-emdash-plugin-type`,{type:`string`,description:`The metadata.created_from_emdash_plugin.type field`,choices:[`native`,`rest`]}).coerce(`metadata-created-from-emdash-plugin-type`,e=>f(e,`metadata-created-from-emdash-plugin-type`,`text`)).option(`metadata-created-from-emdash-plugin-version`,{type:`string`,description:`The metadata.created_from_emdash_plugin.version field`}).option(`metadata-worker-domain`,{type:`string`,description:`The metadata.worker_domain field`}).option(`public-endpoint-params-authorized-hosts`,{type:`string`,array:!0,description:`The public_endpoint_params.authorized_hosts field`}).option(`public-endpoint-params-chat-completions-endpoint-disabled`,{type:`boolean`,description:`Disable chat completions endpoint for this public endpoint.`}).option(`public-endpoint-params-custom-domains`,{type:`string`,array:!0,description:`Custom domain hostnames that alias this public endpoint. GET and create responses return the current set; on update (PUT) this field is only echoed back when supplied in the request body, otherwise it is null (omit it to leave domains unchanged).`}).option(`public-endpoint-params-default-domain-enabled`,{type:`boolean`,description:`When false, the instance is reachable only via a registered custom domain and the default <public_endpoint_id>.search.ai.cloudflare.com host returns 404. Requires at least one custom domain. Defaults to true. public_endpoint_params is replaced wholesale on update, so resend default_domain_enabled on every update to keep the default host off — omitting it resets to true.`}).option(`public-endpoint-params-enabled`,{type:`boolean`,description:`The public_endpoint_params.enabled field`}).option(`public-endpoint-params-mcp-description`,{type:`string`,description:`The public_endpoint_params.mcp.description field`}).option(`public-endpoint-params-mcp-disabled`,{type:`boolean`,description:`Disable MCP endpoint for this public endpoint.`}).option(`public-endpoint-params-rate-limit-period-ms`,{type:`number`,description:`The public_endpoint_params.rate_limit.period_ms field`}).option(`public-endpoint-params-rate-limit-requests`,{type:`number`,description:`The public_endpoint_params.rate_limit.requests field`}).option(`public-endpoint-params-rate-limit-technique`,{type:`string`,description:`The public_endpoint_params.rate_limit.technique field`,choices:[`fixed`,`sliding`]}).coerce(`public-endpoint-params-rate-limit-technique`,e=>f(e,`public-endpoint-params-rate-limit-technique`,`text`)).option(`public-endpoint-params-search-endpoint-disabled`,{type:`boolean`,description:`Disable search endpoint for this public endpoint.`}).option(`reranking`,{type:`boolean`,description:`The reranking field`,default:!1}).option(`reranking-model`,{type:`string`,description:`The reranking_model field`}).option(`retrieval-options-boost-by`,{type:`string`,description:`Metadata fields to boost search results by. Each entry specifies a metadata field and an optional direction. Direction defaults to 'asc' for numeric/datetime fields and 'exists' for text/boolean fields. Fields must match 'timestamp' or a defined custom_metadata field. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"field": string, "direction"?: "asc" | "desc" | "exists" | ...more}]. ? marks optional keys.`}).option(`retrieval-options-keyword-match-mode`,{type:`string`,description:`Controls which documents become candidates for BM25 scoring. 'and' restricts candidates to documents containing all query terms; 'or' includes any document containing at least one term and ranks results according to BM25 relevance. When omitted on an update, the existing stored value stays unchanged; when never set, search falls back to 'and'.`,choices:[`and`,`or`]}).coerce(`retrieval-options-keyword-match-mode`,e=>f(e,`retrieval-options-keyword-match-mode`,`text`)).option(`rewrite-model`,{type:`string`,description:`A Workers AI model ID or an AI Gateway model ID compatible with the OpenAI Chat Completions API. An empty string uses the configured or default model.`}).option(`rewrite-query`,{type:`boolean`,description:`The rewrite_query field`,default:!1}).option(`score-threshold`,{type:`number`,description:`Minimum similarity score a chunk must reach to be returned. Defaults to 0.4.`}).option(`source`,{type:`string`,description:`R2 bucket name or HTTP(S) root website URL to index. When type is omitted, the source determines it.`}).option(`source-params-d1-query`,{type:`string`,description:"Read-only SELECT query run against the D1 database. It must return an `id` column that uniquely identifies each row. Columns named `title` and `content` set the document title and body, and up to 5 `meta_*` columns become filterable custom metadata; any other column is indexed as a labelled field. Every sync reads the full result, up to 100,000 rows, with the instance's token, and those reads count against your D1 usage. Leading and trailing whitespace is trimmed before the query is stored."}).option(`source-params-d1-template`,{type:`string`,description:`How each row is rendered into the indexed document: labelled renders the title, the labelled fields, then the content; content_only renders the title and content (labelled fields only when there is no content); key_value renders every column as name: value; json renders every column as a JSON object.`,choices:[`labelled`,`content_only`,`key_value`,`json`]}).coerce(`source-params-d1-template`,e=>f(e,`source-params-d1-template`,`text`)).option(`source-params-exclude-items`,{type:`string`,array:!0,description:`List of path patterns to exclude. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /admin/** matches /admin/users and /admin/settings/advanced). Most accounts have a limit of 10 rules; contact support to raise it.`}).option(`source-params-include-items`,{type:`string`,array:!0,description:`List of path patterns to include. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /blog/** matches /blog/post and /blog/2024/post). Most accounts have a limit of 10 rules; contact support to raise it.`}).option(`source-params-prefix`,{type:`string`,description:`The source_params.prefix field`}).option(`source-params-r2-jurisdiction`,{type:`string`,description:`The source_params.r2_jurisdiction field`}).option(`source-params-web-crawler-discover-options-depth`,{type:`number`,description:`Maximum link-follow depth from the seed URL.`}).option(`source-params-web-crawler-discover-options-include-external-links`,{type:`boolean`,description:"Follow links that point outside the source domain. Must stay `false` because discover crawls only cover the zone you own."}).option(`source-params-web-crawler-discover-options-include-subdomains`,{type:`boolean`,description:`Follow links to subdomains of the source host.`}).option(`source-params-web-crawler-discover-options-limit`,{type:`number`,description:`Maximum number of pages to crawl (1-100000).`}).option(`source-params-web-crawler-discover-options-max-age`,{type:`number`,description:`Maximum content age in seconds to accept (0–604800).`}).option(`source-params-web-crawler-discover-options-source`,{type:`string`,description:`Where the crawler looks for URLs: 'sitemaps' reads sitemap XML only, 'links' follows page links only, 'all' does both.`,choices:[`all`,`sitemaps`,`links`]}).coerce(`source-params-web-crawler-discover-options-source`,e=>f(e,`source-params-web-crawler-discover-options-source`,`text`)).option(`source-params-web-crawler-parse-options-content-selector`,{type:`string`,description:`List of path-to-selector mappings for extracting specific content from crawled pages. Each entry pairs a URL glob pattern with a CSS selector. The first matching path wins. The crawler stores and indexes only the matched HTML fragment. Omit the field to disable content selection; the API rejects empty arrays. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"path": string, "selector": string}].`}).option(`source-params-web-crawler-parse-options-include-headers`,{type:`string`,description:`Up to 5 custom HTTP headers sent with each crawl request. Names must use RFC-7230 token characters, excluding spaces, colons, and control characters. Values must use HTAB and printable ASCII only, excluding CR and LF. Provide as a JSON object or @path/to/file.json. Shape: {"<key>": string}.`}).option(`source-params-web-crawler-parse-options-include-images`,{type:`boolean`,description:`The source_params.web_crawler.parse_options.include_images field`}).option(`source-params-web-crawler-parse-options-specific-sitemaps`,{type:`string`,array:!0,description:`List of specific sitemap URLs to use for crawling. Only valid when parse_type is 'sitemap'.`}).option(`source-params-web-crawler-parse-options-use-browser-rendering`,{type:`boolean`,description:`The source_params.web_crawler.parse_options.use_browser_rendering field`}).option(`source-params-web-crawler-parse-type`,{type:`string`,description:`How the crawler finds URLs. 'sitemap' reads XML sitemaps; 'discover' follows links recursively and requires the source to belong to a Verified zone on this account.`,choices:[`sitemap`,`discover`]}).coerce(`source-params-web-crawler-parse-type`,e=>f(e,`source-params-web-crawler-parse-type`,`text`)).option(`sync-interval`,{type:`number`,description:`Interval between automatic syncs, in seconds. Allowed values: 900 (15min), 1800 (30min), 3600 (1h), 7200 (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h). Defaults to 86400 (24h).`}).option(`token-id`,{type:`string`,description:`The token_id field`}).option(`type`,{type:`string`,description:`Data source type: r2 or web-crawler.`,choices:[`r2`,`web-crawler`,`d1`]}).coerce(`type`,e=>f(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)`}).check(e=>{let t=[`index-method-keyword`,`index-method-vector`].some(t=>e[t]!==void 0);if(!e.body&&t){let t=[`index-method-keyword`,`index-method-vector`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --index-method-* flag is set`)}return!0}).check(e=>{let t=[`metadata-created-from-emdash-plugin-type`,`metadata-created-from-emdash-plugin-version`].some(t=>e[t]!==void 0);if(!e.body&&t){let t=[`metadata-created-from-emdash-plugin-type`,`metadata-created-from-emdash-plugin-version`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --metadata-created-from-emdash-plugin-* flag is set`)}return!0}).check(e=>{let t=[`source-params-d1-query`,`source-params-d1-template`].some(t=>e[t]!==void 0);if(!e.body&&t){let t=[`source-params-d1-query`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --source-params-d1-* flag is set`)}return!0})}const C={command:`create <id>`,describe:`Create an AI Search instance.`,builder:S,handler:async e=>g({command:`ai-search create`,classification:{safeFlags:/* @__PURE__ */ `cache.cache-threshold.chunk.fusion-method.hybrid-search-enabled.index-method-keyword.index-method-vector.indexing-options-keyword-tokenizer.indexing-options-use-ocr.metadata-created-from-aisearch-wizard.metadata-created-from-emdash-plugin-type.public-endpoint-params-chat-completions-endpoint-disabled.public-endpoint-params-default-domain-enabled.public-endpoint-params-enabled.public-endpoint-params-mcp-disabled.public-endpoint-params-rate-limit-technique.public-endpoint-params-search-endpoint-disabled.reranking.retrieval-options-keyword-match-mode.rewrite-query.source-params-d1-template.source-params-web-crawler-discover-options-include-external-links.source-params-web-crawler-discover-options-include-subdomains.source-params-web-crawler-discover-options-source.source-params-web-crawler-parse-options-include-images.source-params-web-crawler-parse-options-use-browser-rendering.source-params-web-crawler-parse-type.type.dry-run`.split(`.`)}},e,async()=>{if(e.dryRun){let t=await u();l({command:`cf ai-search create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t??`<account-id>`}/ai-search/namespaces/${e.namespace==null?`<namespace>`:encodeURIComponent(String(e.namespace))}/instances`,pathParams:{namespace:String(e.namespace??``)},bodyKind:`json`,body:e.body===void 0?c({ai_gateway_id:f(e[`ai-gateway-id`],`ai-gateway-id`,`text`),ai_search_model:f(e[`ai-search-model`],`ai-search-model`,`text`),cache:e.cache,cache_threshold:e[`cache-threshold`],cache_ttl:e[`cache-ttl`],chunk:e.chunk,chunk_overlap:e[`chunk-overlap`],chunk_size:e[`chunk-size`],custom_metadata:o(e[`custom-metadata`],`custom-metadata`),embedding_model:f(e[`embedding-model`],`embedding-model`,`text`),fusion_method:e[`fusion-method`],hybrid_search_enabled:e[`hybrid-search-enabled`],index_method:{keyword:e[`index-method-keyword`],vector:e[`index-method-vector`]},indexing_options:{keyword_tokenizer:e[`indexing-options-keyword-tokenizer`],use_ocr:e[`indexing-options-use-ocr`]},max_num_results:e[`max-num-results`],metadata:{created_from_aisearch_wizard:e[`metadata-created-from-aisearch-wizard`],created_from_emdash_plugin:{type:e[`metadata-created-from-emdash-plugin-type`],version:f(e[`metadata-created-from-emdash-plugin-version`],`metadata-created-from-emdash-plugin-version`,`text`)},worker_domain:f(e[`metadata-worker-domain`],`metadata-worker-domain`,`text`)},public_endpoint_params:{authorized_hosts:e[`public-endpoint-params-authorized-hosts`],chat_completions_endpoint:{disabled:e[`public-endpoint-params-chat-completions-endpoint-disabled`]},custom_domains:e[`public-endpoint-params-custom-domains`],default_domain_enabled:e[`public-endpoint-params-default-domain-enabled`],enabled:e[`public-endpoint-params-enabled`],mcp:{description:f(e[`public-endpoint-params-mcp-description`],`public-endpoint-params-mcp-description`,`text`),disabled:e[`public-endpoint-params-mcp-disabled`]},rate_limit:{period_ms:e[`public-endpoint-params-rate-limit-period-ms`],requests:e[`public-endpoint-params-rate-limit-requests`],technique:e[`public-endpoint-params-rate-limit-technique`]},search_endpoint:{disabled:e[`public-endpoint-params-search-endpoint-disabled`]}},reranking:e.reranking,reranking_model:f(e[`reranking-model`],`reranking-model`,`text`),retrieval_options:{boost_by:o(e[`retrieval-options-boost-by`],`retrieval-options-boost-by`),keyword_match_mode:e[`retrieval-options-keyword-match-mode`]},rewrite_model:f(e[`rewrite-model`],`rewrite-model`,`text`),rewrite_query:e[`rewrite-query`],score_threshold:e[`score-threshold`],source:f(e.source,`source`,`text`),source_params:{d1:{query:f(e[`source-params-d1-query`],`source-params-d1-query`,`text`),template:e[`source-params-d1-template`]},exclude_items:e[`source-params-exclude-items`],include_items:e[`source-params-include-items`],prefix:f(e[`source-params-prefix`],`source-params-prefix`,`text`),r2_jurisdiction:f(e[`source-params-r2-jurisdiction`],`source-params-r2-jurisdiction`,`text`),web_crawler:{discover_options:{depth:e[`source-params-web-crawler-discover-options-depth`],include_external_links:e[`source-params-web-crawler-discover-options-include-external-links`],include_subdomains:e[`source-params-web-crawler-discover-options-include-subdomains`],limit:e[`source-params-web-crawler-discover-options-limit`],max_age:e[`source-params-web-crawler-discover-options-max-age`],source:e[`source-params-web-crawler-discover-options-source`]},parse_options:{content_selector:o(e[`source-params-web-crawler-parse-options-content-selector`],`source-params-web-crawler-parse-options-content-selector`),include_headers:i(e[`source-params-web-crawler-parse-options-include-headers`],`source-params-web-crawler-parse-options-include-headers`),include_images:e[`source-params-web-crawler-parse-options-include-images`],specific_sitemaps:e[`source-params-web-crawler-parse-options-specific-sitemaps`],use_browser_rendering:e[`source-params-web-crawler-parse-options-use-browser-rendering`]},parse_type:e[`source-params-web-crawler-parse-type`]}},sync_interval:e[`sync-interval`],token_id:f(e[`token-id`],`token-id`,`text`),type:e.type,id:e.id},[[`source_params`,`web_crawler`,`parse_options`,`include_headers`]]):a(s(e.body),[{name:`id`,field:`id`,value:e.id}])});return}let n=e.body===void 0?void 0:a(s(e.body),[{name:`id`,field:`id`,value:e.id}]),r=await t(e),p=e.local?m:await d();if(e.accountId=p,e.body!==void 0){let t=n,i=await _(`Creating`,async()=>r.send(x,{body:t,account_id:p,namespace:e.namespace}));h(i,{successLabel:`Created`});return}let g=c({ai_gateway_id:f(e[`ai-gateway-id`],`ai-gateway-id`,`text`),ai_search_model:f(e[`ai-search-model`],`ai-search-model`,`text`),cache:e.cache,cache_threshold:e[`cache-threshold`],cache_ttl:e[`cache-ttl`],chunk:e.chunk,chunk_overlap:e[`chunk-overlap`],chunk_size:e[`chunk-size`],custom_metadata:o(e[`custom-metadata`],`custom-metadata`),embedding_model:f(e[`embedding-model`],`embedding-model`,`text`),fusion_method:e[`fusion-method`],hybrid_search_enabled:e[`hybrid-search-enabled`],index_method:{keyword:e[`index-method-keyword`],vector:e[`index-method-vector`]},indexing_options:{keyword_tokenizer:e[`indexing-options-keyword-tokenizer`],use_ocr:e[`indexing-options-use-ocr`]},max_num_results:e[`max-num-results`],metadata:{created_from_aisearch_wizard:e[`metadata-created-from-aisearch-wizard`],created_from_emdash_plugin:{type:e[`metadata-created-from-emdash-plugin-type`],version:f(e[`metadata-created-from-emdash-plugin-version`],`metadata-created-from-emdash-plugin-version`,`text`)},worker_domain:f(e[`metadata-worker-domain`],`metadata-worker-domain`,`text`)},public_endpoint_params:{authorized_hosts:e[`public-endpoint-params-authorized-hosts`],chat_completions_endpoint:{disabled:e[`public-endpoint-params-chat-completions-endpoint-disabled`]},custom_domains:e[`public-endpoint-params-custom-domains`],default_domain_enabled:e[`public-endpoint-params-default-domain-enabled`],enabled:e[`public-endpoint-params-enabled`],mcp:{description:f(e[`public-endpoint-params-mcp-description`],`public-endpoint-params-mcp-description`,`text`),disabled:e[`public-endpoint-params-mcp-disabled`]},rate_limit:{period_ms:e[`public-endpoint-params-rate-limit-period-ms`],requests:e[`public-endpoint-params-rate-limit-requests`],technique:e[`public-endpoint-params-rate-limit-technique`]},search_endpoint:{disabled:e[`public-endpoint-params-search-endpoint-disabled`]}},reranking:e.reranking,reranking_model:f(e[`reranking-model`],`reranking-model`,`text`),retrieval_options:{boost_by:o(e[`retrieval-options-boost-by`],`retrieval-options-boost-by`),keyword_match_mode:e[`retrieval-options-keyword-match-mode`]},rewrite_model:f(e[`rewrite-model`],`rewrite-model`,`text`),rewrite_query:e[`rewrite-query`],score_threshold:e[`score-threshold`],source:f(e.source,`source`,`text`),source_params:{d1:{query:f(e[`source-params-d1-query`],`source-params-d1-query`,`text`),template:e[`source-params-d1-template`]},exclude_items:e[`source-params-exclude-items`],include_items:e[`source-params-include-items`],prefix:f(e[`source-params-prefix`],`source-params-prefix`,`text`),r2_jurisdiction:f(e[`source-params-r2-jurisdiction`],`source-params-r2-jurisdiction`,`text`),web_crawler:{discover_options:{depth:e[`source-params-web-crawler-discover-options-depth`],include_external_links:e[`source-params-web-crawler-discover-options-include-external-links`],include_subdomains:e[`source-params-web-crawler-discover-options-include-subdomains`],limit:e[`source-params-web-crawler-discover-options-limit`],max_age:e[`source-params-web-crawler-discover-options-max-age`],source:e[`source-params-web-crawler-discover-options-source`]},parse_options:{content_selector:o(e[`source-params-web-crawler-parse-options-content-selector`],`source-params-web-crawler-parse-options-content-selector`),include_headers:i(e[`source-params-web-crawler-parse-options-include-headers`],`source-params-web-crawler-parse-options-include-headers`),include_images:e[`source-params-web-crawler-parse-options-include-images`],specific_sitemaps:e[`source-params-web-crawler-parse-options-specific-sitemaps`],use_browser_rendering:e[`source-params-web-crawler-parse-options-use-browser-rendering`]},parse_type:e[`source-params-web-crawler-parse-type`]}},sync_interval:e[`sync-interval`],token_id:f(e[`token-id`],`token-id`,`text`),type:e.type,id:e.id},[[`source_params`,`web_crawler`,`parse_options`,`include_headers`]]),v=await _(`Creating`,async()=>r.send(x,{body:g,account_id:p,namespace:e.namespace}));h(v,{successLabel:`Created`})})};function w(e){return e.usage(`$0 ai-search delete <instance-id>
|
|
7
7
|
|
|
8
8
|
Deletes an AI Search instance and all its indexed data permanently.`).positional(`instance-id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Namespace to use for this operation.`,default:`default`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const T={command:`delete <instance-id>`,describe:`Delete an AI Search instance.`,builder:w,handler:async n=>g({command:`ai-search delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},n,async()=>{if(n.dryRun){let e=await u();l({command:`cf ai-search delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${n.namespace==null?`<namespace>`:encodeURIComponent(String(n.namespace))}/instances/${n[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(n[`instance-id`]))}`,pathParams:{namespace:String(n.namespace??``),"instance-id":String(n[`instance-id`]??``)},bodyKind:`none`});return}let r=await t(n),i=n.local?m:await d();if(n.accountId=i,!await b({force:!!n.force,message:`This operation permanently deletes the AI Search instance and all its indexed data.`}))return;let a=await _(`Deleting`,async()=>e(r,`DELETE`,`/accounts/${i}/ai-search/namespaces/${encodeURIComponent(String(n.namespace))}/instances/${encodeURIComponent(String(n[`instance-id`]))}`));h(a,{successLabel:`Deleted`})})};function E(e){return e.usage(`$0 ai-search get <instance-id>
|
|
9
9
|
|
|
@@ -71,4 +71,4 @@ Lists stored AI Search credentials in the account without exposing their secrets
|
|
|
71
71
|
|
|
72
72
|
Replace a stored AI Search credential and invalidate cached credentials for instances that use it.`).positional(`token-id`,{type:`string`,description:`Stored credential record ID.`,demandOption:!0}).option(`api-token-id`,{type:`string`,description:`Cloudflare API token ID.`}).option(`api-token`,{type:`string`,description:`Cloudflare API token value.`}).option(`legacy`,{type:`boolean`,description:`Whether the credential uses the legacy API key format.`}).option(`name`,{type:`string`,description:`Human-readable name for the credential.`}).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 qe={command:`update <token-id>`,describe:`Update a token`,builder:Ke,handler:async n=>g({command:`ai-search tokens update`,classification:{safeFlags:[`legacy`,`dry-run`]}},n,async()=>{if(n.dryRun){let e=await u();l({command:`cf ai-search tokens update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/tokens/${n[`token-id`]==null?`<token-id>`:encodeURIComponent(String(n[`token-id`]))}`,pathParams:{"token-id":String(n[`token-id`]??``)},bodyKind:`json`,body:n.body===void 0?c({cf_api_id:f(n[`api-token-id`],`api-token-id`,`text`),cf_api_key:f(n[`api-token`],`api-token`,`text`),legacy:n.legacy,name:f(n.name,`name`,`text`)}):s(n.body),sensitiveBodyPaths:[[`cf_api_key`]]});return}let i=n.body===void 0?void 0:s(n.body),a=await t(n),o=n.local?m:await d();if(n.accountId=o,n.body!==void 0){let t=i,r=await _(`Updating`,async()=>e(a,`PUT`,`/accounts/${o}/ai-search/tokens/${encodeURIComponent(String(n[`token-id`]))}`,{body:t}));h(r,{successLabel:`Updated`});return}n[`api-token-id`]===void 0&&(n[`api-token-id`]=await v(`api-token-id`,`Cloudflare API token ID.`)),n[`api-token`]===void 0&&(n[`api-token`]=await v(`api-token`,`Cloudflare API token value.`,{kind:`secret`})),n.name===void 0&&(n.name=await v(`name`,`Human-readable name for the credential.`));let p={};n[`api-token-id`]!==void 0&&r(p,[`cf_api_id`],f(n[`api-token-id`],`api-token-id`,`text`)),n[`api-token`]!==void 0&&r(p,[`cf_api_key`],f(n[`api-token`],`api-token`,`text`)),n.legacy!==void 0&&r(p,[`legacy`],n.legacy),n.name!==void 0&&r(p,[`name`],f(n.name,`name`,`text`));let g=await _(`Updating`,async()=>e(a,`PUT`,`/accounts/${o}/ai-search/tokens/${encodeURIComponent(String(n[`token-id`]))}`,{body:p}));h(g,{successLabel:`Updated`})})},Je={command:`tokens`,describe:`Credentials used by AI Search instances`,builder:e=>e.command(ze).command(Ve).command(He).command(Ge).command(qe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ye(e){return e.usage(`$0 ai-search update <instance-id>
|
|
73
73
|
|
|
74
|
-
Updates the configuration of an AI Search instance.`).positional(`instance-id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Namespace to use for this operation.`,default:`default`}).option(`ai-gateway-id`,{type:`string`,description:`The ai_gateway_id field`}).option(`ai-search-model`,{type:`string`,description:`A Workers AI model ID or an AI Gateway model ID compatible with the OpenAI Chat Completions API. An empty string uses the configured or default model.`}).option(`cache`,{type:`boolean`,description:`The cache field`}).option(`cache-threshold`,{type:`string`,description:`The cache_threshold field`,choices:[`super_strict_match`,`close_enough`,`flexible_friend`,`anything_goes`]}).coerce(`cache-threshold`,e=>f(e,`cache-threshold`,`text`)).option(`cache-ttl`,{type:`number`,description:`Cache entry TTL in seconds. Allowed values: 600 (10min), 1800 (30min), 3600 (1h), 7200 (2h), 21600 (6h), 43200 (12h), 86400 (24h), 172800 (48h), 259200 (72h), 518400 (6d).`}).option(`chunk`,{type:`boolean`,description:`The chunk field`}).option(`chunk-overlap`,{type:`number`,description:`The chunk_overlap field`}).option(`chunk-size`,{type:`number`,description:`The chunk_size field`}).option(`custom-metadata`,{type:`string`,description:`The custom_metadata field. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"data_type": "text" | "number" | "boolean" | ...more, "field_name": string}].`}).option(`embedding-model`,{type:`string`,description:`The embedding_model field`}).option(`fusion-method`,{type:`string`,description:`The fusion_method field`,choices:[`max`,`rrf`]}).coerce(`fusion-method`,e=>f(e,`fusion-method`,`text`)).option(`index-method-keyword`,{type:`boolean`,description:`Enable keyword (BM25) storage backend.`}).option(`index-method-vector`,{type:`boolean`,description:`Enable vector (embedding) storage backend.`}).option(`indexing-options-keyword-tokenizer`,{type:`string`,description:`Tokenizer used for keyword search indexing. porter provides word-level tokenization with Porter stemming (good for natural language queries). trigram enables character-level substring matching (good for partial matches, code, identifiers). Changing this triggers a full re-index. Defaults to porter.`,choices:[`porter`,`trigram`]}).coerce(`indexing-options-keyword-tokenizer`,e=>f(e,`indexing-options-keyword-tokenizer`,`text`)).option(`indexing-options-use-ocr`,{type:`boolean`,description:`Enables OCR ingestion for PDFs and images. Changing this triggers a full re-index. Defaults to false.`}).option(`max-num-results`,{type:`number`,description:`The max_num_results field`}).option(`metadata-created-from-aisearch-wizard`,{type:`boolean`,description:`The metadata.created_from_aisearch_wizard field`}).option(`metadata-created-from-emdash-plugin-type`,{type:`string`,description:`The metadata.created_from_emdash_plugin.type field`,choices:[`native`,`rest`]}).coerce(`metadata-created-from-emdash-plugin-type`,e=>f(e,`metadata-created-from-emdash-plugin-type`,`text`)).option(`metadata-created-from-emdash-plugin-version`,{type:`string`,description:`The metadata.created_from_emdash_plugin.version field`}).option(`metadata-worker-domain`,{type:`string`,description:`The metadata.worker_domain field`}).option(`paused`,{type:`boolean`,description:`The paused field`}).option(`public-endpoint-params-authorized-hosts`,{type:`string`,array:!0,description:`The public_endpoint_params.authorized_hosts field`}).option(`public-endpoint-params-chat-completions-endpoint-disabled`,{type:`boolean`,description:`Disable chat completions endpoint for this public endpoint.`}).option(`public-endpoint-params-custom-domains`,{type:`string`,array:!0,description:`Custom domain hostnames that alias this public endpoint. GET and create responses return the current set; on update (PUT) this field is only echoed back when supplied in the request body, otherwise it is null (omit it to leave domains unchanged).`}).option(`public-endpoint-params-default-domain-enabled`,{type:`boolean`,description:`When false, the instance is reachable only via a registered custom domain and the default <public_endpoint_id>.search.ai.cloudflare.com host returns 404. Requires at least one custom domain. Defaults to true. public_endpoint_params is replaced wholesale on update, so resend default_domain_enabled on every update to keep the default host off — omitting it resets to true.`}).option(`public-endpoint-params-enabled`,{type:`boolean`,description:`The public_endpoint_params.enabled field`}).option(`public-endpoint-params-mcp-description`,{type:`string`,description:`The public_endpoint_params.mcp.description field`}).option(`public-endpoint-params-mcp-disabled`,{type:`boolean`,description:`Disable MCP endpoint for this public endpoint.`}).option(`public-endpoint-params-rate-limit-period-ms`,{type:`number`,description:`The public_endpoint_params.rate_limit.period_ms field`}).option(`public-endpoint-params-rate-limit-requests`,{type:`number`,description:`The public_endpoint_params.rate_limit.requests field`}).option(`public-endpoint-params-rate-limit-technique`,{type:`string`,description:`The public_endpoint_params.rate_limit.technique field`,choices:[`fixed`,`sliding`]}).coerce(`public-endpoint-params-rate-limit-technique`,e=>f(e,`public-endpoint-params-rate-limit-technique`,`text`)).option(`public-endpoint-params-search-endpoint-disabled`,{type:`boolean`,description:`Disable search endpoint for this public endpoint.`}).option(`reranking`,{type:`boolean`,description:`The reranking field`}).option(`reranking-model`,{type:`string`,description:`The reranking_model field`}).option(`retrieval-options-boost-by`,{type:`string`,description:`Metadata fields to boost search results by. Each entry specifies a metadata field and an optional direction. Direction defaults to 'asc' for numeric/datetime fields and 'exists' for text/boolean fields. Fields must match 'timestamp' or a defined custom_metadata field. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"field": string, "direction"?: "asc" | "desc" | "exists" | ...more}]. ? marks optional keys.`}).option(`retrieval-options-keyword-match-mode`,{type:`string`,description:`Controls which documents become candidates for BM25 scoring. 'and' restricts candidates to documents containing all query terms; 'or' includes any document containing at least one term and ranks results according to BM25 relevance. When omitted on an update, the existing stored value stays unchanged; when never set, search falls back to 'and'.`,choices:[`and`,`or`]}).coerce(`retrieval-options-keyword-match-mode`,e=>f(e,`retrieval-options-keyword-match-mode`,`text`)).option(`rewrite-model`,{type:`string`,description:`A Workers AI model ID or an AI Gateway model ID compatible with the OpenAI Chat Completions API. An empty string uses the configured or default model.`}).option(`rewrite-query`,{type:`boolean`,description:`The rewrite_query field`}).option(`score-threshold`,{type:`number`,description:`Minimum similarity score a chunk must reach to be returned. Defaults to 0.4.`}).option(`source`,{type:`string`,description:`R2 bucket name or HTTP(S) root website URL to index.`}).option(`source-params-exclude-items`,{type:`string`,array:!0,description:`List of path patterns to exclude. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /admin/** matches /admin/users and /admin/settings/advanced). Most accounts have a limit of 10 rules; contact support to raise it.`}).option(`source-params-include-items`,{type:`string`,array:!0,description:`List of path patterns to include. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /blog/** matches /blog/post and /blog/2024/post). Most accounts have a limit of 10 rules; contact support to raise it.`}).option(`source-params-prefix`,{type:`string`,description:`The source_params.prefix field`}).option(`source-params-r2-jurisdiction`,{type:`string`,description:`The source_params.r2_jurisdiction field`}).option(`source-params-web-crawler-discover-options-depth`,{type:`number`,description:`Maximum link-follow depth from the seed URL.`}).option(`source-params-web-crawler-discover-options-include-external-links`,{type:`boolean`,description:"Follow links that point outside the source domain. Must stay `false` because discover crawls only cover the zone you own."}).option(`source-params-web-crawler-discover-options-include-subdomains`,{type:`boolean`,description:`Follow links to subdomains of the source host.`}).option(`source-params-web-crawler-discover-options-limit`,{type:`number`,description:`Maximum number of pages to crawl (1-100000).`}).option(`source-params-web-crawler-discover-options-max-age`,{type:`number`,description:`Maximum content age in seconds to accept (0–604800).`}).option(`source-params-web-crawler-discover-options-source`,{type:`string`,description:`Where the crawler looks for URLs: 'sitemaps' reads sitemap XML only, 'links' follows page links only, 'all' does both.`,choices:[`all`,`sitemaps`,`links`]}).coerce(`source-params-web-crawler-discover-options-source`,e=>f(e,`source-params-web-crawler-discover-options-source`,`text`)).option(`source-params-web-crawler-parse-options-content-selector`,{type:`string`,description:`List of path-to-selector mappings for extracting specific content from crawled pages. Each entry pairs a URL glob pattern with a CSS selector. The first matching path wins. The crawler stores and indexes only the matched HTML fragment. Omit the field to disable content selection; the API rejects empty arrays. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"path": string, "selector": string}].`}).option(`source-params-web-crawler-parse-options-include-headers`,{type:`string`,description:`Up to 5 custom HTTP headers sent with each crawl request. Names must use RFC-7230 token characters, excluding spaces, colons, and control characters. Values must use HTAB and printable ASCII only, excluding CR and LF. Provide as a JSON object or @path/to/file.json. Shape: {"<key>": string}.`}).option(`source-params-web-crawler-parse-options-include-images`,{type:`boolean`,description:`The source_params.web_crawler.parse_options.include_images field`}).option(`source-params-web-crawler-parse-options-specific-sitemaps`,{type:`string`,array:!0,description:`List of specific sitemap URLs to use for crawling. Only valid when parse_type is 'sitemap'.`}).option(`source-params-web-crawler-parse-options-use-browser-rendering`,{type:`boolean`,description:`The source_params.web_crawler.parse_options.use_browser_rendering field`}).option(`source-params-web-crawler-parse-type`,{type:`string`,description:`How the crawler finds URLs. 'sitemap' reads XML sitemaps; 'discover' follows links recursively and requires the source to belong to a Verified zone on this account.`,choices:[`sitemap`,`discover`]}).coerce(`source-params-web-crawler-parse-type`,e=>f(e,`source-params-web-crawler-parse-type`,`text`)).option(`summarization`,{type:`boolean`,description:`The summarization field`}).option(`summarization-model`,{type:`string`,description:`The summarization_model field`}).option(`sync-interval`,{type:`number`,description:`Interval between automatic syncs, in seconds. Allowed values: 900 (15min), 1800 (30min), 3600 (1h), 7200 (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h). Defaults to 86400 (24h).`}).option(`system-prompt-ai-search`,{type:`string`,description:`The system_prompt_ai_search field`}).option(`system-prompt-index-summarization`,{type:`string`,description:`The system_prompt_index_summarization field`}).option(`system-prompt-rewrite-query`,{type:`string`,description:`The system_prompt_rewrite_query field`}).option(`token-id`,{type:`string`,description:`The token_id field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{let t=[`index-method-keyword`,`index-method-vector`].some(t=>e[t]!==void 0);if(!e.body&&t){let t=[`index-method-keyword`,`index-method-vector`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --index-method-* flag is set`)}return!0}).check(e=>{let t=[`metadata-created-from-emdash-plugin-type`,`metadata-created-from-emdash-plugin-version`].some(t=>e[t]!==void 0);if(!e.body&&t){let t=[`metadata-created-from-emdash-plugin-type`,`metadata-created-from-emdash-plugin-version`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --metadata-created-from-emdash-plugin-* flag is set`)}return!0})}const Xe={command:`update <instance-id>`,describe:`Update an AI Search instance.`,builder:Ye,handler:async n=>g({command:`ai-search update`,classification:{safeFlags:/* @__PURE__ */ `cache.cache-threshold.chunk.fusion-method.index-method-keyword.index-method-vector.indexing-options-keyword-tokenizer.indexing-options-use-ocr.metadata-created-from-aisearch-wizard.metadata-created-from-emdash-plugin-type.paused.public-endpoint-params-chat-completions-endpoint-disabled.public-endpoint-params-default-domain-enabled.public-endpoint-params-enabled.public-endpoint-params-mcp-disabled.public-endpoint-params-rate-limit-technique.public-endpoint-params-search-endpoint-disabled.reranking.retrieval-options-keyword-match-mode.rewrite-query.source-params-web-crawler-discover-options-include-external-links.source-params-web-crawler-discover-options-include-subdomains.source-params-web-crawler-discover-options-source.source-params-web-crawler-parse-options-include-images.source-params-web-crawler-parse-options-use-browser-rendering.source-params-web-crawler-parse-type.summarization.dry-run`.split(`.`)}},n,async()=>{if(n.dryRun){let e=await u();l({command:`cf ai-search update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${n.namespace==null?`<namespace>`:encodeURIComponent(String(n.namespace))}/instances/${n[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(n[`instance-id`]))}`,pathParams:{namespace:String(n.namespace??``),"instance-id":String(n[`instance-id`]??``)},bodyKind:`json`,body:n.body===void 0?c({ai_gateway_id:f(n[`ai-gateway-id`],`ai-gateway-id`,`text`),ai_search_model:f(n[`ai-search-model`],`ai-search-model`,`text`),cache:n.cache,cache_threshold:n[`cache-threshold`],cache_ttl:n[`cache-ttl`],chunk:n.chunk,chunk_overlap:n[`chunk-overlap`],chunk_size:n[`chunk-size`],custom_metadata:o(n[`custom-metadata`],`custom-metadata`),embedding_model:f(n[`embedding-model`],`embedding-model`,`text`),fusion_method:n[`fusion-method`],index_method:{keyword:n[`index-method-keyword`],vector:n[`index-method-vector`]},indexing_options:{keyword_tokenizer:n[`indexing-options-keyword-tokenizer`],use_ocr:n[`indexing-options-use-ocr`]},max_num_results:n[`max-num-results`],metadata:{created_from_aisearch_wizard:n[`metadata-created-from-aisearch-wizard`],created_from_emdash_plugin:{type:n[`metadata-created-from-emdash-plugin-type`],version:f(n[`metadata-created-from-emdash-plugin-version`],`metadata-created-from-emdash-plugin-version`,`text`)},worker_domain:f(n[`metadata-worker-domain`],`metadata-worker-domain`,`text`)},paused:n.paused,public_endpoint_params:{authorized_hosts:n[`public-endpoint-params-authorized-hosts`],chat_completions_endpoint:{disabled:n[`public-endpoint-params-chat-completions-endpoint-disabled`]},custom_domains:n[`public-endpoint-params-custom-domains`],default_domain_enabled:n[`public-endpoint-params-default-domain-enabled`],enabled:n[`public-endpoint-params-enabled`],mcp:{description:f(n[`public-endpoint-params-mcp-description`],`public-endpoint-params-mcp-description`,`text`),disabled:n[`public-endpoint-params-mcp-disabled`]},rate_limit:{period_ms:n[`public-endpoint-params-rate-limit-period-ms`],requests:n[`public-endpoint-params-rate-limit-requests`],technique:n[`public-endpoint-params-rate-limit-technique`]},search_endpoint:{disabled:n[`public-endpoint-params-search-endpoint-disabled`]}},reranking:n.reranking,reranking_model:f(n[`reranking-model`],`reranking-model`,`text`),retrieval_options:{boost_by:o(n[`retrieval-options-boost-by`],`retrieval-options-boost-by`),keyword_match_mode:n[`retrieval-options-keyword-match-mode`]},rewrite_model:f(n[`rewrite-model`],`rewrite-model`,`text`),rewrite_query:n[`rewrite-query`],score_threshold:n[`score-threshold`],source:f(n.source,`source`,`text`),source_params:{exclude_items:n[`source-params-exclude-items`],include_items:n[`source-params-include-items`],prefix:f(n[`source-params-prefix`],`source-params-prefix`,`text`),r2_jurisdiction:f(n[`source-params-r2-jurisdiction`],`source-params-r2-jurisdiction`,`text`),web_crawler:{discover_options:{depth:n[`source-params-web-crawler-discover-options-depth`],include_external_links:n[`source-params-web-crawler-discover-options-include-external-links`],include_subdomains:n[`source-params-web-crawler-discover-options-include-subdomains`],limit:n[`source-params-web-crawler-discover-options-limit`],max_age:n[`source-params-web-crawler-discover-options-max-age`],source:n[`source-params-web-crawler-discover-options-source`]},parse_options:{content_selector:o(n[`source-params-web-crawler-parse-options-content-selector`],`source-params-web-crawler-parse-options-content-selector`),include_headers:i(n[`source-params-web-crawler-parse-options-include-headers`],`source-params-web-crawler-parse-options-include-headers`),include_images:n[`source-params-web-crawler-parse-options-include-images`],specific_sitemaps:n[`source-params-web-crawler-parse-options-specific-sitemaps`],use_browser_rendering:n[`source-params-web-crawler-parse-options-use-browser-rendering`]},parse_type:n[`source-params-web-crawler-parse-type`]}},summarization:n.summarization,summarization_model:f(n[`summarization-model`],`summarization-model`,`text`),sync_interval:n[`sync-interval`],system_prompt_ai_search:f(n[`system-prompt-ai-search`],`system-prompt-ai-search`,`text`),system_prompt_index_summarization:f(n[`system-prompt-index-summarization`],`system-prompt-index-summarization`,`text`),system_prompt_rewrite_query:f(n[`system-prompt-rewrite-query`],`system-prompt-rewrite-query`,`text`),token_id:f(n[`token-id`],`token-id`,`text`)},[[`source_params`,`web_crawler`,`parse_options`,`include_headers`]]):s(n.body)});return}let a=n.body===void 0?void 0:s(n.body),p=await t(n),g=n.local?m:await d();if(n.accountId=g,n.body!==void 0){let t=a,r=await _(`Updating`,async()=>e(p,`PUT`,`/accounts/${g}/ai-search/namespaces/${encodeURIComponent(String(n.namespace))}/instances/${encodeURIComponent(String(n[`instance-id`]))}`,{body:t}));h(r,{successLabel:`Updated`});return}let v={};n[`ai-gateway-id`]!==void 0&&r(v,[`ai_gateway_id`],f(n[`ai-gateway-id`],`ai-gateway-id`,`text`)),n[`ai-search-model`]!==void 0&&r(v,[`ai_search_model`],f(n[`ai-search-model`],`ai-search-model`,`text`)),n.cache!==void 0&&r(v,[`cache`],n.cache),n[`cache-threshold`]!==void 0&&r(v,[`cache_threshold`],n[`cache-threshold`]),n[`cache-ttl`]!==void 0&&r(v,[`cache_ttl`],n[`cache-ttl`]),n.chunk!==void 0&&r(v,[`chunk`],n.chunk),n[`chunk-overlap`]!==void 0&&r(v,[`chunk_overlap`],n[`chunk-overlap`]),n[`chunk-size`]!==void 0&&r(v,[`chunk_size`],n[`chunk-size`]),n[`custom-metadata`]!==void 0&&r(v,[`custom_metadata`],o(n[`custom-metadata`],`custom-metadata`)),n[`embedding-model`]!==void 0&&r(v,[`embedding_model`],f(n[`embedding-model`],`embedding-model`,`text`)),n[`fusion-method`]!==void 0&&r(v,[`fusion_method`],n[`fusion-method`]),n[`index-method-keyword`]!==void 0&&r(v,[`index_method`,`keyword`],n[`index-method-keyword`]),n[`index-method-vector`]!==void 0&&r(v,[`index_method`,`vector`],n[`index-method-vector`]),n[`indexing-options-keyword-tokenizer`]!==void 0&&r(v,[`indexing_options`,`keyword_tokenizer`],n[`indexing-options-keyword-tokenizer`]),n[`indexing-options-use-ocr`]!==void 0&&r(v,[`indexing_options`,`use_ocr`],n[`indexing-options-use-ocr`]),n[`max-num-results`]!==void 0&&r(v,[`max_num_results`],n[`max-num-results`]),n[`metadata-created-from-aisearch-wizard`]!==void 0&&r(v,[`metadata`,`created_from_aisearch_wizard`],n[`metadata-created-from-aisearch-wizard`]),n[`metadata-created-from-emdash-plugin-type`]!==void 0&&r(v,[`metadata`,`created_from_emdash_plugin`,`type`],n[`metadata-created-from-emdash-plugin-type`]),n[`metadata-created-from-emdash-plugin-version`]!==void 0&&r(v,[`metadata`,`created_from_emdash_plugin`,`version`],f(n[`metadata-created-from-emdash-plugin-version`],`metadata-created-from-emdash-plugin-version`,`text`)),n[`metadata-worker-domain`]!==void 0&&r(v,[`metadata`,`worker_domain`],f(n[`metadata-worker-domain`],`metadata-worker-domain`,`text`)),n.paused!==void 0&&r(v,[`paused`],n.paused),n[`public-endpoint-params-authorized-hosts`]!==void 0&&r(v,[`public_endpoint_params`,`authorized_hosts`],n[`public-endpoint-params-authorized-hosts`]),n[`public-endpoint-params-chat-completions-endpoint-disabled`]!==void 0&&r(v,[`public_endpoint_params`,`chat_completions_endpoint`,`disabled`],n[`public-endpoint-params-chat-completions-endpoint-disabled`]),n[`public-endpoint-params-custom-domains`]!==void 0&&r(v,[`public_endpoint_params`,`custom_domains`],n[`public-endpoint-params-custom-domains`]),n[`public-endpoint-params-default-domain-enabled`]!==void 0&&r(v,[`public_endpoint_params`,`default_domain_enabled`],n[`public-endpoint-params-default-domain-enabled`]),n[`public-endpoint-params-enabled`]!==void 0&&r(v,[`public_endpoint_params`,`enabled`],n[`public-endpoint-params-enabled`]),n[`public-endpoint-params-mcp-description`]!==void 0&&r(v,[`public_endpoint_params`,`mcp`,`description`],f(n[`public-endpoint-params-mcp-description`],`public-endpoint-params-mcp-description`,`text`)),n[`public-endpoint-params-mcp-disabled`]!==void 0&&r(v,[`public_endpoint_params`,`mcp`,`disabled`],n[`public-endpoint-params-mcp-disabled`]),n[`public-endpoint-params-rate-limit-period-ms`]!==void 0&&r(v,[`public_endpoint_params`,`rate_limit`,`period_ms`],n[`public-endpoint-params-rate-limit-period-ms`]),n[`public-endpoint-params-rate-limit-requests`]!==void 0&&r(v,[`public_endpoint_params`,`rate_limit`,`requests`],n[`public-endpoint-params-rate-limit-requests`]),n[`public-endpoint-params-rate-limit-technique`]!==void 0&&r(v,[`public_endpoint_params`,`rate_limit`,`technique`],n[`public-endpoint-params-rate-limit-technique`]),n[`public-endpoint-params-search-endpoint-disabled`]!==void 0&&r(v,[`public_endpoint_params`,`search_endpoint`,`disabled`],n[`public-endpoint-params-search-endpoint-disabled`]),n.reranking!==void 0&&r(v,[`reranking`],n.reranking),n[`reranking-model`]!==void 0&&r(v,[`reranking_model`],f(n[`reranking-model`],`reranking-model`,`text`)),n[`retrieval-options-boost-by`]!==void 0&&r(v,[`retrieval_options`,`boost_by`],o(n[`retrieval-options-boost-by`],`retrieval-options-boost-by`)),n[`retrieval-options-keyword-match-mode`]!==void 0&&r(v,[`retrieval_options`,`keyword_match_mode`],n[`retrieval-options-keyword-match-mode`]),n[`rewrite-model`]!==void 0&&r(v,[`rewrite_model`],f(n[`rewrite-model`],`rewrite-model`,`text`)),n[`rewrite-query`]!==void 0&&r(v,[`rewrite_query`],n[`rewrite-query`]),n[`score-threshold`]!==void 0&&r(v,[`score_threshold`],n[`score-threshold`]),n.source!==void 0&&r(v,[`source`],f(n.source,`source`,`text`)),n[`source-params-exclude-items`]!==void 0&&r(v,[`source_params`,`exclude_items`],n[`source-params-exclude-items`]),n[`source-params-include-items`]!==void 0&&r(v,[`source_params`,`include_items`],n[`source-params-include-items`]),n[`source-params-prefix`]!==void 0&&r(v,[`source_params`,`prefix`],f(n[`source-params-prefix`],`source-params-prefix`,`text`)),n[`source-params-r2-jurisdiction`]!==void 0&&r(v,[`source_params`,`r2_jurisdiction`],f(n[`source-params-r2-jurisdiction`],`source-params-r2-jurisdiction`,`text`)),n[`source-params-web-crawler-discover-options-depth`]!==void 0&&r(v,[`source_params`,`web_crawler`,`discover_options`,`depth`],n[`source-params-web-crawler-discover-options-depth`]),n[`source-params-web-crawler-discover-options-include-external-links`]!==void 0&&r(v,[`source_params`,`web_crawler`,`discover_options`,`include_external_links`],n[`source-params-web-crawler-discover-options-include-external-links`]),n[`source-params-web-crawler-discover-options-include-subdomains`]!==void 0&&r(v,[`source_params`,`web_crawler`,`discover_options`,`include_subdomains`],n[`source-params-web-crawler-discover-options-include-subdomains`]),n[`source-params-web-crawler-discover-options-limit`]!==void 0&&r(v,[`source_params`,`web_crawler`,`discover_options`,`limit`],n[`source-params-web-crawler-discover-options-limit`]),n[`source-params-web-crawler-discover-options-max-age`]!==void 0&&r(v,[`source_params`,`web_crawler`,`discover_options`,`max_age`],n[`source-params-web-crawler-discover-options-max-age`]),n[`source-params-web-crawler-discover-options-source`]!==void 0&&r(v,[`source_params`,`web_crawler`,`discover_options`,`source`],n[`source-params-web-crawler-discover-options-source`]),n[`source-params-web-crawler-parse-options-content-selector`]!==void 0&&r(v,[`source_params`,`web_crawler`,`parse_options`,`content_selector`],o(n[`source-params-web-crawler-parse-options-content-selector`],`source-params-web-crawler-parse-options-content-selector`)),n[`source-params-web-crawler-parse-options-include-headers`]!==void 0&&r(v,[`source_params`,`web_crawler`,`parse_options`,`include_headers`],i(n[`source-params-web-crawler-parse-options-include-headers`],`source-params-web-crawler-parse-options-include-headers`)),n[`source-params-web-crawler-parse-options-include-images`]!==void 0&&r(v,[`source_params`,`web_crawler`,`parse_options`,`include_images`],n[`source-params-web-crawler-parse-options-include-images`]),n[`source-params-web-crawler-parse-options-specific-sitemaps`]!==void 0&&r(v,[`source_params`,`web_crawler`,`parse_options`,`specific_sitemaps`],n[`source-params-web-crawler-parse-options-specific-sitemaps`]),n[`source-params-web-crawler-parse-options-use-browser-rendering`]!==void 0&&r(v,[`source_params`,`web_crawler`,`parse_options`,`use_browser_rendering`],n[`source-params-web-crawler-parse-options-use-browser-rendering`]),n[`source-params-web-crawler-parse-type`]!==void 0&&r(v,[`source_params`,`web_crawler`,`parse_type`],n[`source-params-web-crawler-parse-type`]),n.summarization!==void 0&&r(v,[`summarization`],n.summarization),n[`summarization-model`]!==void 0&&r(v,[`summarization_model`],f(n[`summarization-model`],`summarization-model`,`text`)),n[`sync-interval`]!==void 0&&r(v,[`sync_interval`],n[`sync-interval`]),n[`system-prompt-ai-search`]!==void 0&&r(v,[`system_prompt_ai_search`],f(n[`system-prompt-ai-search`],`system-prompt-ai-search`,`text`)),n[`system-prompt-index-summarization`]!==void 0&&r(v,[`system_prompt_index_summarization`],f(n[`system-prompt-index-summarization`],`system-prompt-index-summarization`,`text`)),n[`system-prompt-rewrite-query`]!==void 0&&r(v,[`system_prompt_rewrite_query`],f(n[`system-prompt-rewrite-query`],`system-prompt-rewrite-query`,`text`)),n[`token-id`]!==void 0&&r(v,[`token_id`],f(n[`token-id`],`token-id`,`text`));let y=await _(`Updating`,async()=>e(p,`PUT`,`/accounts/${g}/ai-search/namespaces/${encodeURIComponent(String(n.namespace))}/instances/${encodeURIComponent(String(n[`instance-id`]))}`,{body:v}));h(y,{successLabel:`Updated`})})},Ze={command:`ai-search`,describe:`Managed search-as-a-service: crawl, index, and query content with AI-powered relevance and chat completions`,builder:e=>e.command(re).command(C).command(T).command(D).command(pe).command(he).command(_e).command(ye).command(Ne).command(Fe).command(Le).command(Xe).command(K).command(ue).command(je).command(Je).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ze as default};
|
|
74
|
+
Updates the configuration of an AI Search instance.`).positional(`instance-id`,{type:`string`,description:`AI Search instance ID.`,demandOption:!0}).option(`namespace`,{type:`string`,description:`Namespace to use for this operation.`,default:`default`}).option(`ai-gateway-id`,{type:`string`,description:`The ai_gateway_id field`}).option(`ai-search-model`,{type:`string`,description:`A Workers AI model ID or an AI Gateway model ID compatible with the OpenAI Chat Completions API. An empty string uses the configured or default model.`}).option(`cache`,{type:`boolean`,description:`The cache field`}).option(`cache-threshold`,{type:`string`,description:`The cache_threshold field`,choices:[`super_strict_match`,`close_enough`,`flexible_friend`,`anything_goes`]}).coerce(`cache-threshold`,e=>f(e,`cache-threshold`,`text`)).option(`cache-ttl`,{type:`number`,description:`Cache entry TTL in seconds. Allowed values: 600 (10min), 1800 (30min), 3600 (1h), 7200 (2h), 21600 (6h), 43200 (12h), 86400 (24h), 172800 (48h), 259200 (72h), 518400 (6d).`}).option(`chunk`,{type:`boolean`,description:`The chunk field`}).option(`chunk-overlap`,{type:`number`,description:`The chunk_overlap field`}).option(`chunk-size`,{type:`number`,description:`The chunk_size field`}).option(`custom-metadata`,{type:`string`,description:`The custom_metadata field. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"data_type": "text" | "number" | "boolean" | ...more, "field_name": string}].`}).option(`embedding-model`,{type:`string`,description:`The embedding_model field`}).option(`fusion-method`,{type:`string`,description:`The fusion_method field`,choices:[`max`,`rrf`]}).coerce(`fusion-method`,e=>f(e,`fusion-method`,`text`)).option(`index-method-keyword`,{type:`boolean`,description:`Enable keyword (BM25) storage backend.`}).option(`index-method-vector`,{type:`boolean`,description:`Enable vector (embedding) storage backend.`}).option(`indexing-options-keyword-tokenizer`,{type:`string`,description:`Tokenizer used for keyword search indexing. porter provides word-level tokenization with Porter stemming (good for natural language queries). trigram enables character-level substring matching (good for partial matches, code, identifiers). Changing this triggers a full re-index. Defaults to porter.`,choices:[`porter`,`trigram`]}).coerce(`indexing-options-keyword-tokenizer`,e=>f(e,`indexing-options-keyword-tokenizer`,`text`)).option(`indexing-options-use-ocr`,{type:`boolean`,description:`Enables OCR ingestion for PDFs and images. Changing this triggers a full re-index. Defaults to false.`}).option(`max-num-results`,{type:`number`,description:`The max_num_results field`}).option(`metadata-created-from-aisearch-wizard`,{type:`boolean`,description:`The metadata.created_from_aisearch_wizard field`}).option(`metadata-created-from-emdash-plugin-type`,{type:`string`,description:`The metadata.created_from_emdash_plugin.type field`,choices:[`native`,`rest`]}).coerce(`metadata-created-from-emdash-plugin-type`,e=>f(e,`metadata-created-from-emdash-plugin-type`,`text`)).option(`metadata-created-from-emdash-plugin-version`,{type:`string`,description:`The metadata.created_from_emdash_plugin.version field`}).option(`metadata-worker-domain`,{type:`string`,description:`The metadata.worker_domain field`}).option(`paused`,{type:`boolean`,description:`The paused field`}).option(`public-endpoint-params-authorized-hosts`,{type:`string`,array:!0,description:`The public_endpoint_params.authorized_hosts field`}).option(`public-endpoint-params-chat-completions-endpoint-disabled`,{type:`boolean`,description:`Disable chat completions endpoint for this public endpoint.`}).option(`public-endpoint-params-custom-domains`,{type:`string`,array:!0,description:`Custom domain hostnames that alias this public endpoint. GET and create responses return the current set; on update (PUT) this field is only echoed back when supplied in the request body, otherwise it is null (omit it to leave domains unchanged).`}).option(`public-endpoint-params-default-domain-enabled`,{type:`boolean`,description:`When false, the instance is reachable only via a registered custom domain and the default <public_endpoint_id>.search.ai.cloudflare.com host returns 404. Requires at least one custom domain. Defaults to true. public_endpoint_params is replaced wholesale on update, so resend default_domain_enabled on every update to keep the default host off — omitting it resets to true.`}).option(`public-endpoint-params-enabled`,{type:`boolean`,description:`The public_endpoint_params.enabled field`}).option(`public-endpoint-params-mcp-description`,{type:`string`,description:`The public_endpoint_params.mcp.description field`}).option(`public-endpoint-params-mcp-disabled`,{type:`boolean`,description:`Disable MCP endpoint for this public endpoint.`}).option(`public-endpoint-params-rate-limit-period-ms`,{type:`number`,description:`The public_endpoint_params.rate_limit.period_ms field`}).option(`public-endpoint-params-rate-limit-requests`,{type:`number`,description:`The public_endpoint_params.rate_limit.requests field`}).option(`public-endpoint-params-rate-limit-technique`,{type:`string`,description:`The public_endpoint_params.rate_limit.technique field`,choices:[`fixed`,`sliding`]}).coerce(`public-endpoint-params-rate-limit-technique`,e=>f(e,`public-endpoint-params-rate-limit-technique`,`text`)).option(`public-endpoint-params-search-endpoint-disabled`,{type:`boolean`,description:`Disable search endpoint for this public endpoint.`}).option(`reranking`,{type:`boolean`,description:`The reranking field`}).option(`reranking-model`,{type:`string`,description:`The reranking_model field`}).option(`retrieval-options-boost-by`,{type:`string`,description:`Metadata fields to boost search results by. Each entry specifies a metadata field and an optional direction. Direction defaults to 'asc' for numeric/datetime fields and 'exists' for text/boolean fields. Fields must match 'timestamp' or a defined custom_metadata field. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"field": string, "direction"?: "asc" | "desc" | "exists" | ...more}]. ? marks optional keys.`}).option(`retrieval-options-keyword-match-mode`,{type:`string`,description:`Controls which documents become candidates for BM25 scoring. 'and' restricts candidates to documents containing all query terms; 'or' includes any document containing at least one term and ranks results according to BM25 relevance. When omitted on an update, the existing stored value stays unchanged; when never set, search falls back to 'and'.`,choices:[`and`,`or`]}).coerce(`retrieval-options-keyword-match-mode`,e=>f(e,`retrieval-options-keyword-match-mode`,`text`)).option(`rewrite-model`,{type:`string`,description:`A Workers AI model ID or an AI Gateway model ID compatible with the OpenAI Chat Completions API. An empty string uses the configured or default model.`}).option(`rewrite-query`,{type:`boolean`,description:`The rewrite_query field`}).option(`score-threshold`,{type:`number`,description:`Minimum similarity score a chunk must reach to be returned. Defaults to 0.4.`}).option(`source`,{type:`string`,description:`R2 bucket name or HTTP(S) root website URL to index.`}).option(`source-params-d1-query`,{type:`string`,description:"Read-only SELECT query run against the D1 database. It must return an `id` column that uniquely identifies each row. Columns named `title` and `content` set the document title and body, and up to 5 `meta_*` columns become filterable custom metadata; any other column is indexed as a labelled field. Every sync reads the full result, up to 100,000 rows, with the instance's token, and those reads count against your D1 usage. Leading and trailing whitespace is trimmed before the query is stored. Omit to keep the stored query."}).option(`source-params-d1-template`,{type:`string`,description:`How each row is rendered into the indexed document: labelled renders the title, the labelled fields, then the content; content_only renders the title and content (labelled fields only when there is no content); key_value renders every column as name: value; json renders every column as a JSON object. Omit to keep the stored template.`,choices:[`labelled`,`content_only`,`key_value`,`json`]}).coerce(`source-params-d1-template`,e=>f(e,`source-params-d1-template`,`text`)).option(`source-params-exclude-items`,{type:`string`,array:!0,description:`List of path patterns to exclude. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /admin/** matches /admin/users and /admin/settings/advanced). Most accounts have a limit of 10 rules; contact support to raise it.`}).option(`source-params-include-items`,{type:`string`,array:!0,description:`List of path patterns to include. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /blog/** matches /blog/post and /blog/2024/post). Most accounts have a limit of 10 rules; contact support to raise it.`}).option(`source-params-prefix`,{type:`string`,description:`The source_params.prefix field`}).option(`source-params-r2-jurisdiction`,{type:`string`,description:`The source_params.r2_jurisdiction field`}).option(`source-params-web-crawler-discover-options-depth`,{type:`number`,description:`Maximum link-follow depth from the seed URL.`}).option(`source-params-web-crawler-discover-options-include-external-links`,{type:`boolean`,description:"Follow links that point outside the source domain. Must stay `false` because discover crawls only cover the zone you own."}).option(`source-params-web-crawler-discover-options-include-subdomains`,{type:`boolean`,description:`Follow links to subdomains of the source host.`}).option(`source-params-web-crawler-discover-options-limit`,{type:`number`,description:`Maximum number of pages to crawl (1-100000).`}).option(`source-params-web-crawler-discover-options-max-age`,{type:`number`,description:`Maximum content age in seconds to accept (0–604800).`}).option(`source-params-web-crawler-discover-options-source`,{type:`string`,description:`Where the crawler looks for URLs: 'sitemaps' reads sitemap XML only, 'links' follows page links only, 'all' does both.`,choices:[`all`,`sitemaps`,`links`]}).coerce(`source-params-web-crawler-discover-options-source`,e=>f(e,`source-params-web-crawler-discover-options-source`,`text`)).option(`source-params-web-crawler-parse-options-content-selector`,{type:`string`,description:`List of path-to-selector mappings for extracting specific content from crawled pages. Each entry pairs a URL glob pattern with a CSS selector. The first matching path wins. The crawler stores and indexes only the matched HTML fragment. Omit the field to disable content selection; the API rejects empty arrays. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"path": string, "selector": string}].`}).option(`source-params-web-crawler-parse-options-include-headers`,{type:`string`,description:`Up to 5 custom HTTP headers sent with each crawl request. Names must use RFC-7230 token characters, excluding spaces, colons, and control characters. Values must use HTAB and printable ASCII only, excluding CR and LF. Provide as a JSON object or @path/to/file.json. Shape: {"<key>": string}.`}).option(`source-params-web-crawler-parse-options-include-images`,{type:`boolean`,description:`The source_params.web_crawler.parse_options.include_images field`}).option(`source-params-web-crawler-parse-options-specific-sitemaps`,{type:`string`,array:!0,description:`List of specific sitemap URLs to use for crawling. Only valid when parse_type is 'sitemap'.`}).option(`source-params-web-crawler-parse-options-use-browser-rendering`,{type:`boolean`,description:`The source_params.web_crawler.parse_options.use_browser_rendering field`}).option(`source-params-web-crawler-parse-type`,{type:`string`,description:`How the crawler finds URLs. 'sitemap' reads XML sitemaps; 'discover' follows links recursively and requires the source to belong to a Verified zone on this account.`,choices:[`sitemap`,`discover`]}).coerce(`source-params-web-crawler-parse-type`,e=>f(e,`source-params-web-crawler-parse-type`,`text`)).option(`summarization`,{type:`boolean`,description:`The summarization field`}).option(`summarization-model`,{type:`string`,description:`The summarization_model field`}).option(`sync-interval`,{type:`number`,description:`Interval between automatic syncs, in seconds. Allowed values: 900 (15min), 1800 (30min), 3600 (1h), 7200 (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h). Defaults to 86400 (24h).`}).option(`system-prompt-ai-search`,{type:`string`,description:`The system_prompt_ai_search field`}).option(`system-prompt-index-summarization`,{type:`string`,description:`The system_prompt_index_summarization field`}).option(`system-prompt-rewrite-query`,{type:`string`,description:`The system_prompt_rewrite_query field`}).option(`token-id`,{type:`string`,description:`The token_id field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{let t=[`index-method-keyword`,`index-method-vector`].some(t=>e[t]!==void 0);if(!e.body&&t){let t=[`index-method-keyword`,`index-method-vector`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --index-method-* flag is set`)}return!0}).check(e=>{let t=[`metadata-created-from-emdash-plugin-type`,`metadata-created-from-emdash-plugin-version`].some(t=>e[t]!==void 0);if(!e.body&&t){let t=[`metadata-created-from-emdash-plugin-type`,`metadata-created-from-emdash-plugin-version`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --metadata-created-from-emdash-plugin-* flag is set`)}return!0})}const Xe={command:`update <instance-id>`,describe:`Update an AI Search instance.`,builder:Ye,handler:async n=>g({command:`ai-search update`,classification:{safeFlags:/* @__PURE__ */ `cache.cache-threshold.chunk.fusion-method.index-method-keyword.index-method-vector.indexing-options-keyword-tokenizer.indexing-options-use-ocr.metadata-created-from-aisearch-wizard.metadata-created-from-emdash-plugin-type.paused.public-endpoint-params-chat-completions-endpoint-disabled.public-endpoint-params-default-domain-enabled.public-endpoint-params-enabled.public-endpoint-params-mcp-disabled.public-endpoint-params-rate-limit-technique.public-endpoint-params-search-endpoint-disabled.reranking.retrieval-options-keyword-match-mode.rewrite-query.source-params-d1-template.source-params-web-crawler-discover-options-include-external-links.source-params-web-crawler-discover-options-include-subdomains.source-params-web-crawler-discover-options-source.source-params-web-crawler-parse-options-include-images.source-params-web-crawler-parse-options-use-browser-rendering.source-params-web-crawler-parse-type.summarization.dry-run`.split(`.`)}},n,async()=>{if(n.dryRun){let e=await u();l({command:`cf ai-search update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/ai-search/namespaces/${n.namespace==null?`<namespace>`:encodeURIComponent(String(n.namespace))}/instances/${n[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(n[`instance-id`]))}`,pathParams:{namespace:String(n.namespace??``),"instance-id":String(n[`instance-id`]??``)},bodyKind:`json`,body:n.body===void 0?c({ai_gateway_id:f(n[`ai-gateway-id`],`ai-gateway-id`,`text`),ai_search_model:f(n[`ai-search-model`],`ai-search-model`,`text`),cache:n.cache,cache_threshold:n[`cache-threshold`],cache_ttl:n[`cache-ttl`],chunk:n.chunk,chunk_overlap:n[`chunk-overlap`],chunk_size:n[`chunk-size`],custom_metadata:o(n[`custom-metadata`],`custom-metadata`),embedding_model:f(n[`embedding-model`],`embedding-model`,`text`),fusion_method:n[`fusion-method`],index_method:{keyword:n[`index-method-keyword`],vector:n[`index-method-vector`]},indexing_options:{keyword_tokenizer:n[`indexing-options-keyword-tokenizer`],use_ocr:n[`indexing-options-use-ocr`]},max_num_results:n[`max-num-results`],metadata:{created_from_aisearch_wizard:n[`metadata-created-from-aisearch-wizard`],created_from_emdash_plugin:{type:n[`metadata-created-from-emdash-plugin-type`],version:f(n[`metadata-created-from-emdash-plugin-version`],`metadata-created-from-emdash-plugin-version`,`text`)},worker_domain:f(n[`metadata-worker-domain`],`metadata-worker-domain`,`text`)},paused:n.paused,public_endpoint_params:{authorized_hosts:n[`public-endpoint-params-authorized-hosts`],chat_completions_endpoint:{disabled:n[`public-endpoint-params-chat-completions-endpoint-disabled`]},custom_domains:n[`public-endpoint-params-custom-domains`],default_domain_enabled:n[`public-endpoint-params-default-domain-enabled`],enabled:n[`public-endpoint-params-enabled`],mcp:{description:f(n[`public-endpoint-params-mcp-description`],`public-endpoint-params-mcp-description`,`text`),disabled:n[`public-endpoint-params-mcp-disabled`]},rate_limit:{period_ms:n[`public-endpoint-params-rate-limit-period-ms`],requests:n[`public-endpoint-params-rate-limit-requests`],technique:n[`public-endpoint-params-rate-limit-technique`]},search_endpoint:{disabled:n[`public-endpoint-params-search-endpoint-disabled`]}},reranking:n.reranking,reranking_model:f(n[`reranking-model`],`reranking-model`,`text`),retrieval_options:{boost_by:o(n[`retrieval-options-boost-by`],`retrieval-options-boost-by`),keyword_match_mode:n[`retrieval-options-keyword-match-mode`]},rewrite_model:f(n[`rewrite-model`],`rewrite-model`,`text`),rewrite_query:n[`rewrite-query`],score_threshold:n[`score-threshold`],source:f(n.source,`source`,`text`),source_params:{d1:{query:f(n[`source-params-d1-query`],`source-params-d1-query`,`text`),template:n[`source-params-d1-template`]},exclude_items:n[`source-params-exclude-items`],include_items:n[`source-params-include-items`],prefix:f(n[`source-params-prefix`],`source-params-prefix`,`text`),r2_jurisdiction:f(n[`source-params-r2-jurisdiction`],`source-params-r2-jurisdiction`,`text`),web_crawler:{discover_options:{depth:n[`source-params-web-crawler-discover-options-depth`],include_external_links:n[`source-params-web-crawler-discover-options-include-external-links`],include_subdomains:n[`source-params-web-crawler-discover-options-include-subdomains`],limit:n[`source-params-web-crawler-discover-options-limit`],max_age:n[`source-params-web-crawler-discover-options-max-age`],source:n[`source-params-web-crawler-discover-options-source`]},parse_options:{content_selector:o(n[`source-params-web-crawler-parse-options-content-selector`],`source-params-web-crawler-parse-options-content-selector`),include_headers:i(n[`source-params-web-crawler-parse-options-include-headers`],`source-params-web-crawler-parse-options-include-headers`),include_images:n[`source-params-web-crawler-parse-options-include-images`],specific_sitemaps:n[`source-params-web-crawler-parse-options-specific-sitemaps`],use_browser_rendering:n[`source-params-web-crawler-parse-options-use-browser-rendering`]},parse_type:n[`source-params-web-crawler-parse-type`]}},summarization:n.summarization,summarization_model:f(n[`summarization-model`],`summarization-model`,`text`),sync_interval:n[`sync-interval`],system_prompt_ai_search:f(n[`system-prompt-ai-search`],`system-prompt-ai-search`,`text`),system_prompt_index_summarization:f(n[`system-prompt-index-summarization`],`system-prompt-index-summarization`,`text`),system_prompt_rewrite_query:f(n[`system-prompt-rewrite-query`],`system-prompt-rewrite-query`,`text`),token_id:f(n[`token-id`],`token-id`,`text`)},[[`source_params`,`web_crawler`,`parse_options`,`include_headers`]]):s(n.body)});return}let a=n.body===void 0?void 0:s(n.body),p=await t(n),g=n.local?m:await d();if(n.accountId=g,n.body!==void 0){let t=a,r=await _(`Updating`,async()=>e(p,`PUT`,`/accounts/${g}/ai-search/namespaces/${encodeURIComponent(String(n.namespace))}/instances/${encodeURIComponent(String(n[`instance-id`]))}`,{body:t}));h(r,{successLabel:`Updated`});return}let v={};n[`ai-gateway-id`]!==void 0&&r(v,[`ai_gateway_id`],f(n[`ai-gateway-id`],`ai-gateway-id`,`text`)),n[`ai-search-model`]!==void 0&&r(v,[`ai_search_model`],f(n[`ai-search-model`],`ai-search-model`,`text`)),n.cache!==void 0&&r(v,[`cache`],n.cache),n[`cache-threshold`]!==void 0&&r(v,[`cache_threshold`],n[`cache-threshold`]),n[`cache-ttl`]!==void 0&&r(v,[`cache_ttl`],n[`cache-ttl`]),n.chunk!==void 0&&r(v,[`chunk`],n.chunk),n[`chunk-overlap`]!==void 0&&r(v,[`chunk_overlap`],n[`chunk-overlap`]),n[`chunk-size`]!==void 0&&r(v,[`chunk_size`],n[`chunk-size`]),n[`custom-metadata`]!==void 0&&r(v,[`custom_metadata`],o(n[`custom-metadata`],`custom-metadata`)),n[`embedding-model`]!==void 0&&r(v,[`embedding_model`],f(n[`embedding-model`],`embedding-model`,`text`)),n[`fusion-method`]!==void 0&&r(v,[`fusion_method`],n[`fusion-method`]),n[`index-method-keyword`]!==void 0&&r(v,[`index_method`,`keyword`],n[`index-method-keyword`]),n[`index-method-vector`]!==void 0&&r(v,[`index_method`,`vector`],n[`index-method-vector`]),n[`indexing-options-keyword-tokenizer`]!==void 0&&r(v,[`indexing_options`,`keyword_tokenizer`],n[`indexing-options-keyword-tokenizer`]),n[`indexing-options-use-ocr`]!==void 0&&r(v,[`indexing_options`,`use_ocr`],n[`indexing-options-use-ocr`]),n[`max-num-results`]!==void 0&&r(v,[`max_num_results`],n[`max-num-results`]),n[`metadata-created-from-aisearch-wizard`]!==void 0&&r(v,[`metadata`,`created_from_aisearch_wizard`],n[`metadata-created-from-aisearch-wizard`]),n[`metadata-created-from-emdash-plugin-type`]!==void 0&&r(v,[`metadata`,`created_from_emdash_plugin`,`type`],n[`metadata-created-from-emdash-plugin-type`]),n[`metadata-created-from-emdash-plugin-version`]!==void 0&&r(v,[`metadata`,`created_from_emdash_plugin`,`version`],f(n[`metadata-created-from-emdash-plugin-version`],`metadata-created-from-emdash-plugin-version`,`text`)),n[`metadata-worker-domain`]!==void 0&&r(v,[`metadata`,`worker_domain`],f(n[`metadata-worker-domain`],`metadata-worker-domain`,`text`)),n.paused!==void 0&&r(v,[`paused`],n.paused),n[`public-endpoint-params-authorized-hosts`]!==void 0&&r(v,[`public_endpoint_params`,`authorized_hosts`],n[`public-endpoint-params-authorized-hosts`]),n[`public-endpoint-params-chat-completions-endpoint-disabled`]!==void 0&&r(v,[`public_endpoint_params`,`chat_completions_endpoint`,`disabled`],n[`public-endpoint-params-chat-completions-endpoint-disabled`]),n[`public-endpoint-params-custom-domains`]!==void 0&&r(v,[`public_endpoint_params`,`custom_domains`],n[`public-endpoint-params-custom-domains`]),n[`public-endpoint-params-default-domain-enabled`]!==void 0&&r(v,[`public_endpoint_params`,`default_domain_enabled`],n[`public-endpoint-params-default-domain-enabled`]),n[`public-endpoint-params-enabled`]!==void 0&&r(v,[`public_endpoint_params`,`enabled`],n[`public-endpoint-params-enabled`]),n[`public-endpoint-params-mcp-description`]!==void 0&&r(v,[`public_endpoint_params`,`mcp`,`description`],f(n[`public-endpoint-params-mcp-description`],`public-endpoint-params-mcp-description`,`text`)),n[`public-endpoint-params-mcp-disabled`]!==void 0&&r(v,[`public_endpoint_params`,`mcp`,`disabled`],n[`public-endpoint-params-mcp-disabled`]),n[`public-endpoint-params-rate-limit-period-ms`]!==void 0&&r(v,[`public_endpoint_params`,`rate_limit`,`period_ms`],n[`public-endpoint-params-rate-limit-period-ms`]),n[`public-endpoint-params-rate-limit-requests`]!==void 0&&r(v,[`public_endpoint_params`,`rate_limit`,`requests`],n[`public-endpoint-params-rate-limit-requests`]),n[`public-endpoint-params-rate-limit-technique`]!==void 0&&r(v,[`public_endpoint_params`,`rate_limit`,`technique`],n[`public-endpoint-params-rate-limit-technique`]),n[`public-endpoint-params-search-endpoint-disabled`]!==void 0&&r(v,[`public_endpoint_params`,`search_endpoint`,`disabled`],n[`public-endpoint-params-search-endpoint-disabled`]),n.reranking!==void 0&&r(v,[`reranking`],n.reranking),n[`reranking-model`]!==void 0&&r(v,[`reranking_model`],f(n[`reranking-model`],`reranking-model`,`text`)),n[`retrieval-options-boost-by`]!==void 0&&r(v,[`retrieval_options`,`boost_by`],o(n[`retrieval-options-boost-by`],`retrieval-options-boost-by`)),n[`retrieval-options-keyword-match-mode`]!==void 0&&r(v,[`retrieval_options`,`keyword_match_mode`],n[`retrieval-options-keyword-match-mode`]),n[`rewrite-model`]!==void 0&&r(v,[`rewrite_model`],f(n[`rewrite-model`],`rewrite-model`,`text`)),n[`rewrite-query`]!==void 0&&r(v,[`rewrite_query`],n[`rewrite-query`]),n[`score-threshold`]!==void 0&&r(v,[`score_threshold`],n[`score-threshold`]),n.source!==void 0&&r(v,[`source`],f(n.source,`source`,`text`)),n[`source-params-d1-query`]!==void 0&&r(v,[`source_params`,`d1`,`query`],f(n[`source-params-d1-query`],`source-params-d1-query`,`text`)),n[`source-params-d1-template`]!==void 0&&r(v,[`source_params`,`d1`,`template`],n[`source-params-d1-template`]),n[`source-params-exclude-items`]!==void 0&&r(v,[`source_params`,`exclude_items`],n[`source-params-exclude-items`]),n[`source-params-include-items`]!==void 0&&r(v,[`source_params`,`include_items`],n[`source-params-include-items`]),n[`source-params-prefix`]!==void 0&&r(v,[`source_params`,`prefix`],f(n[`source-params-prefix`],`source-params-prefix`,`text`)),n[`source-params-r2-jurisdiction`]!==void 0&&r(v,[`source_params`,`r2_jurisdiction`],f(n[`source-params-r2-jurisdiction`],`source-params-r2-jurisdiction`,`text`)),n[`source-params-web-crawler-discover-options-depth`]!==void 0&&r(v,[`source_params`,`web_crawler`,`discover_options`,`depth`],n[`source-params-web-crawler-discover-options-depth`]),n[`source-params-web-crawler-discover-options-include-external-links`]!==void 0&&r(v,[`source_params`,`web_crawler`,`discover_options`,`include_external_links`],n[`source-params-web-crawler-discover-options-include-external-links`]),n[`source-params-web-crawler-discover-options-include-subdomains`]!==void 0&&r(v,[`source_params`,`web_crawler`,`discover_options`,`include_subdomains`],n[`source-params-web-crawler-discover-options-include-subdomains`]),n[`source-params-web-crawler-discover-options-limit`]!==void 0&&r(v,[`source_params`,`web_crawler`,`discover_options`,`limit`],n[`source-params-web-crawler-discover-options-limit`]),n[`source-params-web-crawler-discover-options-max-age`]!==void 0&&r(v,[`source_params`,`web_crawler`,`discover_options`,`max_age`],n[`source-params-web-crawler-discover-options-max-age`]),n[`source-params-web-crawler-discover-options-source`]!==void 0&&r(v,[`source_params`,`web_crawler`,`discover_options`,`source`],n[`source-params-web-crawler-discover-options-source`]),n[`source-params-web-crawler-parse-options-content-selector`]!==void 0&&r(v,[`source_params`,`web_crawler`,`parse_options`,`content_selector`],o(n[`source-params-web-crawler-parse-options-content-selector`],`source-params-web-crawler-parse-options-content-selector`)),n[`source-params-web-crawler-parse-options-include-headers`]!==void 0&&r(v,[`source_params`,`web_crawler`,`parse_options`,`include_headers`],i(n[`source-params-web-crawler-parse-options-include-headers`],`source-params-web-crawler-parse-options-include-headers`)),n[`source-params-web-crawler-parse-options-include-images`]!==void 0&&r(v,[`source_params`,`web_crawler`,`parse_options`,`include_images`],n[`source-params-web-crawler-parse-options-include-images`]),n[`source-params-web-crawler-parse-options-specific-sitemaps`]!==void 0&&r(v,[`source_params`,`web_crawler`,`parse_options`,`specific_sitemaps`],n[`source-params-web-crawler-parse-options-specific-sitemaps`]),n[`source-params-web-crawler-parse-options-use-browser-rendering`]!==void 0&&r(v,[`source_params`,`web_crawler`,`parse_options`,`use_browser_rendering`],n[`source-params-web-crawler-parse-options-use-browser-rendering`]),n[`source-params-web-crawler-parse-type`]!==void 0&&r(v,[`source_params`,`web_crawler`,`parse_type`],n[`source-params-web-crawler-parse-type`]),n.summarization!==void 0&&r(v,[`summarization`],n.summarization),n[`summarization-model`]!==void 0&&r(v,[`summarization_model`],f(n[`summarization-model`],`summarization-model`,`text`)),n[`sync-interval`]!==void 0&&r(v,[`sync_interval`],n[`sync-interval`]),n[`system-prompt-ai-search`]!==void 0&&r(v,[`system_prompt_ai_search`],f(n[`system-prompt-ai-search`],`system-prompt-ai-search`,`text`)),n[`system-prompt-index-summarization`]!==void 0&&r(v,[`system_prompt_index_summarization`],f(n[`system-prompt-index-summarization`],`system-prompt-index-summarization`,`text`)),n[`system-prompt-rewrite-query`]!==void 0&&r(v,[`system_prompt_rewrite_query`],f(n[`system-prompt-rewrite-query`],`system-prompt-rewrite-query`,`text`)),n[`token-id`]!==void 0&&r(v,[`token_id`],f(n[`token-id`],`token-id`,`text`));let y=await _(`Updating`,async()=>e(p,`PUT`,`/accounts/${g}/ai-search/namespaces/${encodeURIComponent(String(n.namespace))}/instances/${encodeURIComponent(String(n[`instance-id`]))}`,{body:v}));h(y,{successLabel:`Updated`})})},Ze={command:`ai-search`,describe:`Managed search-as-a-service: crawl, index, and query content with AI-powered relevance and chat completions`,builder:e=>e.command(re).command(C).command(T).command(D).command(pe).command(he).command(_e).command(ye).command(Ne).command(Fe).command(Le).command(Xe).command(K).command(ue).command(je).command(Je).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ze as default};
|