File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " bright-client" ,
3- "version" : " 0.6.6 " ,
3+ "version" : " 0.7.0 " ,
44 "description" : " TypeScript client library for Bright search database" ,
55 "main" : " dist/index.cjs" ,
66 "module" : " dist/index.mjs" ,
Original file line number Diff line number Diff line change 1- import { BrightErrorResponse , createBrightError } from './errors' ;
1+ import { BrightErrorResponse , createBrightError , NotFoundError } from './errors' ;
22import {
33 IndexConfig ,
44 SearchParams ,
@@ -150,6 +150,20 @@ export class BrightClient {
150150 } ) ;
151151 }
152152
153+ async indexExists ( id : string ) : Promise < boolean > {
154+ try {
155+ await this . request < IndexConfig > ( `/indexes/${ id } ` , {
156+ method : 'GET' ,
157+ } ) ;
158+ return true ;
159+ } catch ( error ) {
160+ if ( error instanceof NotFoundError ) {
161+ return false ;
162+ }
163+ throw error ;
164+ }
165+ }
166+
153167 // Document Operations
154168
155169 async addDocuments < T = Record < string , unknown > > (
You can’t perform that action at this time.
0 commit comments