@@ -25,6 +25,7 @@ export const search = async (body: SearchRequest): Promise<SearchResponse | Serv
2525 method : "POST" ,
2626 headers : {
2727 "Content-Type" : "application/json" ,
28+ "X-Sourcebot-Client-Source" : "sourcebot-web-client" ,
2829 } ,
2930 body : JSON . stringify ( body ) ,
3031 } ) . then ( response => response . json ( ) ) ;
@@ -44,6 +45,9 @@ export const getFileSource = async (queryParams: FileSourceRequest): Promise<Fil
4445
4546 const result = await fetch ( url , {
4647 method : "GET" ,
48+ headers : {
49+ "X-Sourcebot-Client-Source" : "sourcebot-web-client" ,
50+ }
4751 } ) . then ( response => response . json ( ) ) ;
4852
4953 return result as FileSourceResponse | ServiceError ;
@@ -59,6 +63,7 @@ export const listRepos = async (queryParams: ListReposQueryParams): Promise<List
5963 method : "GET" ,
6064 headers : {
6165 "Content-Type" : "application/json" ,
66+ "X-Sourcebot-Client-Source" : "sourcebot-web-client" ,
6267 } ,
6368 } ) . then ( response => response . json ( ) ) ;
6469
@@ -70,6 +75,7 @@ export const getVersion = async (): Promise<GetVersionResponse> => {
7075 method : "GET" ,
7176 headers : {
7277 "Content-Type" : "application/json" ,
78+ "X-Sourcebot-Client-Source" : "sourcebot-web-client" ,
7379 } ,
7480 } ) . then ( response => response . json ( ) ) ;
7581 return result as GetVersionResponse ;
@@ -78,6 +84,9 @@ export const getVersion = async (): Promise<GetVersionResponse> => {
7884export const findSearchBasedSymbolReferences = async ( body : FindRelatedSymbolsRequest ) : Promise < FindRelatedSymbolsResponse | ServiceError > => {
7985 const result = await fetch ( "/api/find_references" , {
8086 method : "POST" ,
87+ headers : {
88+ "X-Sourcebot-Client-Source" : "sourcebot-web-client" ,
89+ } ,
8190 body : JSON . stringify ( body ) ,
8291 } ) . then ( response => response . json ( ) ) ;
8392 return result as FindRelatedSymbolsResponse | ServiceError ;
@@ -86,6 +95,9 @@ export const findSearchBasedSymbolReferences = async (body: FindRelatedSymbolsRe
8695export const findSearchBasedSymbolDefinitions = async ( body : FindRelatedSymbolsRequest ) : Promise < FindRelatedSymbolsResponse | ServiceError > => {
8796 const result = await fetch ( "/api/find_definitions" , {
8897 method : "POST" ,
98+ headers : {
99+ "X-Sourcebot-Client-Source" : "sourcebot-web-client" ,
100+ } ,
89101 body : JSON . stringify ( body ) ,
90102 } ) . then ( response => response . json ( ) ) ;
91103 return result as FindRelatedSymbolsResponse | ServiceError ;
@@ -94,6 +106,9 @@ export const findSearchBasedSymbolDefinitions = async (body: FindRelatedSymbolsR
94106export const getTree = async ( body : GetTreeRequest ) : Promise < GetTreeResponse | ServiceError > => {
95107 const result = await fetch ( "/api/tree" , {
96108 method : "POST" ,
109+ headers : {
110+ "X-Sourcebot-Client-Source" : "sourcebot-web-client" ,
111+ } ,
97112 body : JSON . stringify ( body ) ,
98113 } ) . then ( response => response . json ( ) ) ;
99114 return result as GetTreeResponse | ServiceError ;
@@ -102,6 +117,9 @@ export const getTree = async (body: GetTreeRequest): Promise<GetTreeResponse | S
102117export const getFiles = async ( body : GetFilesRequest ) : Promise < GetFilesResponse | ServiceError > => {
103118 const result = await fetch ( "/api/files" , {
104119 method : "POST" ,
120+ headers : {
121+ "X-Sourcebot-Client-Source" : "sourcebot-web-client" ,
122+ } ,
105123 body : JSON . stringify ( body ) ,
106124 } ) . then ( response => response . json ( ) ) ;
107125 return result as GetFilesResponse | ServiceError ;
0 commit comments