File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -185,3 +185,28 @@ import JSONT from "../json";
185185 }
186186 } ) ( ) ;
187187}
188+
189+ {
190+ type Spec = DefineApiEndpoints < {
191+ "/vectorize/indexes/:indexName" : {
192+ get : {
193+ resBody : {
194+ 200 : { prop : string } ;
195+ } ;
196+ } ;
197+ } ;
198+ } > ;
199+ ( async ( ) => {
200+ const CLOUDFLARE_API_HOST = "https://api.cloudflare.com/client/v4" ;
201+ const getCloudflareAccountEndpoint = ( accountId : string ) =>
202+ `${ CLOUDFLARE_API_HOST } /accounts/${ accountId } ` as const ;
203+ const basePath = getCloudflareAccountEndpoint ( "accountId" ) ;
204+ const f = fetch as FetchT < typeof basePath , Spec > ;
205+ {
206+ const res = await f ( `${ basePath } /vectorize/indexes/indexA` , { } ) ;
207+ if ( res . ok ) {
208+ ( await res . json ( ) ) . prop ;
209+ }
210+ }
211+ } ) ( ) ;
212+ }
You can’t perform that action at this time.
0 commit comments