Comparing version 1.0.1 to 1.0.2
@@ -77,4 +77,4 @@ type BaseSearchOptions = { | ||
*/ | ||
search(query: string, options: RegularSearchOptions): Promise<SearchResponse>; | ||
searchAndContents<T extends ContentsOptions>(query: string, options: RegularSearchOptions & T): Promise<SearchResponse<T>>; | ||
search(query: string, options?: RegularSearchOptions): Promise<SearchResponse>; | ||
searchAndContents<T extends ContentsOptions>(query: string, options?: RegularSearchOptions & T): Promise<SearchResponse<T>>; | ||
/** | ||
@@ -87,3 +87,3 @@ * Finds similar links to the provided URL. | ||
findSimilar(url: string, options?: FindSimilarOptions): Promise<SearchResponse>; | ||
findSimilarAndContents<T extends ContentsOptions>(url: string, options: FindSimilarOptions & T): Promise<SearchResponse<T>>; | ||
findSimilarAndContents<T extends ContentsOptions>(url: string, options?: FindSimilarOptions & T): Promise<SearchResponse<T>>; | ||
/** | ||
@@ -90,0 +90,0 @@ * Retrieves contents of documents based on a list of document IDs. |
@@ -88,3 +88,3 @@ "use strict"; | ||
async searchAndContents(query, options) { | ||
const { text, highlights, ...rest } = options; | ||
const { text, highlights, ...rest } = options || {}; | ||
return await this.request("/search", "POST", { | ||
@@ -109,3 +109,3 @@ query, | ||
async findSimilarAndContents(url, options) { | ||
const { text, highlights, ...rest } = options; | ||
const { text, highlights, ...rest } = options || {}; | ||
return await this.request("/findSimilar", "POST", { | ||
@@ -112,0 +112,0 @@ url, |
{ | ||
"name": "exa-js", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Exasearch SDK for Node.js and the browser", | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
16000