Comparing version 1.0.15-beta.2 to 1.1.0
@@ -0,1 +1,2 @@ | ||
declare const isBeta = false; | ||
/** | ||
@@ -63,2 +64,3 @@ * Search options for performing a search query. | ||
* @property {boolean} [filterEmptyResults] - If true, filters out results with no contents. Default is true. | ||
* @property {number} [livecrawlTimeout] - The timeout for livecrawling. | ||
*/ | ||
@@ -70,4 +72,6 @@ type ContentsOptions = { | ||
livecrawl?: LivecrawlOptions; | ||
livecrawlTimeout?: number; | ||
} & (typeof isBeta extends true ? { | ||
filterEmptyResults?: boolean; | ||
}; | ||
} : {}); | ||
/** | ||
@@ -74,0 +78,0 @@ * Options for livecrawling contents |
@@ -56,3 +56,3 @@ "use strict"; | ||
"Content-Type": "application/json", | ||
"User-Agent": "exa-node 1.0.27" | ||
"User-Agent": "exa-node 1.1.0" | ||
}); | ||
@@ -97,18 +97,13 @@ } | ||
async searchAndContents(query, options) { | ||
const { | ||
text, | ||
highlights, | ||
summary, | ||
livecrawl, | ||
filterEmptyResults, | ||
...rest | ||
} = options || {}; | ||
const isBeta = process.env.NPM_CONFIG_TAG === "beta"; | ||
const { text, highlights, summary, ...rest } = options || {}; | ||
return await this.request("/search", "POST", { | ||
query, | ||
contents: !text && !highlights && !summary ? { text: true, ...isBeta ? { livecrawl, filterEmptyResults } : {} } : { | ||
contents: !text && !highlights && !summary ? { | ||
text: true, | ||
...options | ||
} : { | ||
...text ? { text } : {}, | ||
...highlights ? { highlights } : {}, | ||
...summary ? { summary } : {}, | ||
...isBeta ? { livecrawl, filterEmptyResults } : {} | ||
...options | ||
}, | ||
@@ -134,18 +129,17 @@ ...rest | ||
async findSimilarAndContents(url, options) { | ||
const { | ||
text, | ||
highlights, | ||
summary, | ||
livecrawl, | ||
filterEmptyResults, | ||
...rest | ||
} = options || {}; | ||
const isBeta = process.env.NPM_CONFIG_TAG === "beta"; | ||
const { text, highlights, summary, ...rest } = options || {}; | ||
return await this.request("/findSimilar", "POST", { | ||
url, | ||
contents: !text && !highlights && !summary ? { text: true, ...isBeta ? { livecrawl, filterEmptyResults } : {} } : { | ||
contents: !text && !highlights && !summary ? { | ||
text: true, | ||
livecrawl: options?.livecrawl, | ||
livecrawlTimeout: options?.livecrawlTimeout, | ||
...options | ||
} : { | ||
livecrawl: options?.livecrawl, | ||
livecrawlTimeout: options?.livecrawlTimeout, | ||
...text ? { text } : {}, | ||
...highlights ? { highlights } : {}, | ||
...summary ? { summary } : {}, | ||
...isBeta ? { livecrawl, filterEmptyResults } : {} | ||
...options | ||
}, | ||
@@ -162,4 +156,2 @@ ...rest | ||
async getContents(ids, options) { | ||
const { livecrawl, filterEmptyResults, ...rest } = options || {}; | ||
const isBeta = process.env.NPM_CONFIG_TAG === "beta"; | ||
if (ids.length === 0) { | ||
@@ -178,4 +170,3 @@ throw new Error("Must provide at least one ID"); | ||
ids: requestIds, | ||
...isBeta ? { livecrawl, filterEmptyResults } : {}, | ||
...rest | ||
...options | ||
}); | ||
@@ -182,0 +173,0 @@ } |
{ | ||
"name": "exa-js", | ||
"version": "1.0.15-beta.2", | ||
"version": "1.1.0", | ||
"description": "Exa SDK for Node.js and the browser", | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
0
2
60978
534