@spider-cloud/spider-client 0.1.57 → 0.1.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ChunkCallbackFunction, Collection, QueryRequest, SpiderCoreResponse, SpiderParams } from "./config";
1
+ import { ChunkCallbackFunction, Collection, QueryRequest, SpiderCoreResponse, SpiderParams, SearchRequestParams } from "./config";
2
2
  /**
3
3
  * Generic params for core request.
4
4
  */
@@ -78,7 +78,7 @@ export declare class Spider {
78
78
  * @param {GenericParams} [params={}] - Configuration parameters for the search.
79
79
  * @returns {Promise<any>} The result of the crawl, either structured data or a Response object if streaming.
80
80
  */
81
- search(q: string, params?: GenericParams): Promise<any>;
81
+ search(q: string, params?: SearchRequestParams): Promise<any>;
82
82
  /**
83
83
  * Transform HTML to Markdown or text. You can send up to 10MB of data at once.
84
84
  * @param {object} data - The data to trasnform, a list of objects with the key 'html' and optional 'url' key for readability.
package/dist/config.d.ts CHANGED
@@ -426,6 +426,33 @@ export interface SpiderParams {
426
426
  */
427
427
  remote_proxy?: string;
428
428
  }
429
+ /**
430
+ * Represents the options available for making a spider search request.
431
+ */
432
+ export interface SearchRequestParams {
433
+ /** The base request parameters shared across requests */
434
+ base?: SpiderParams;
435
+ /** The search query string (merged with other params) required */
436
+ search?: string;
437
+ /** Optional limit on the number of websites to search */
438
+ search_limit?: number;
439
+ /** Whether to fetch the actual page content (defaults to true) */
440
+ fetch_page_content?: boolean;
441
+ /** Optional search location (e.g., city or region name) */
442
+ location?: string;
443
+ /** Optional country code (e.g., "US", "DE") */
444
+ country?: string;
445
+ /** Optional language code (e.g., "en", "fr") */
446
+ language?: string;
447
+ /** Optional number of search results to retrieve */
448
+ num?: number;
449
+ /** Optional page number of search results to fetch */
450
+ page?: number;
451
+ /** Optional cap on websites if a list is provided via text or URL (comma-separated) */
452
+ website_limit?: number;
453
+ /** If true, prioritizes speed over completeness of results */
454
+ quick_search?: boolean;
455
+ }
429
456
  export type SpiderCoreResponse = {
430
457
  content?: string;
431
458
  message?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spider-cloud/spider-client",
3
- "version": "0.1.57",
3
+ "version": "0.1.59",
4
4
  "description": "Isomorphic Javascript SDK for Spider Cloud services",
5
5
  "scripts": {
6
6
  "test": "node --import tsx --test __tests__/*test.ts",