@isdk/web-searcher 0.1.3 → 0.1.4

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/README.cn.md CHANGED
@@ -47,6 +47,7 @@ console.log(results);
47
47
  在 `WebSearcher` 子类中定义的 `template` 是权威的“蓝图”。
48
48
 
49
49
  - **模板优先级**:如果模板定义了某个属性(如 `engine: 'browser'`、特定的 `headers` 等),该值将被**锁定**,用户选项无法覆盖。这确保了抓取逻辑的稳定性。
50
+ - **Actions 不可变性**:模板中的 `actions` 数组受到严格保护。用户无法通过 `options` 追加、替换或修改执行步骤。这防止了外部逻辑破坏爬虫的执行流程。
50
51
  - **用户灵活性**:对于模板中**未**显式锁定的属性(如 `proxy`、`timeoutMs` 或自定义变量),用户可以在构造函数或 `search()` 方法中自由设置。
51
52
 
52
53
  ```typescript
@@ -56,7 +57,17 @@ const google = new GoogleSearcher({
56
57
  proxy: 'http://my-proxy:8080',
57
58
  timeoutMs: 30000 // 有效(假设 GoogleSearcher 模板未显式设置 timeoutMs)
58
59
  });
60
+ ```
61
+
62
+ ### 🧠 智能导航 (Goto)
63
+
64
+ `WebSearcher` 会自动管理前往搜索 URL 的导航。
59
65
 
66
+ 1. **自动注入**:如果你的模板**不**包含 `goto` 动作,搜索器会自动在动作列表开头插入一个指向解析后的 `url`(已注入查询变量)的 `goto` 动作。
67
+ 2. **手动控制**:如果你在模板中显式添加了一个匹配解析后 URL 的 `goto` 动作,搜索器会检测到重复并**跳过**自动注入。这让你能完全控制导航步骤(例如添加 headers、referrer 或其他特定参数)。
68
+ 3. **多步流程**:你可以在模板中定义多个 `goto` 动作(例如先访问登录页)。搜索器仍然会预置主搜索 URL 的导航,除非你的 `goto` 动作之一与之精确匹配。
69
+
70
+ ```typescript
60
71
  try {
61
72
  // 第一次查询
62
73
  // 您还可以传递运行时选项来覆盖会话默认值或注入变量
@@ -215,7 +226,7 @@ await google.search('test', {
215
226
  ```typescript
216
227
  const results = await google.search('open source', {
217
228
  limit: 20,
218
- timeRange: 'month', // 'day', 'week', 'month', 'year'
229
+ timeRange: 'month', // 'hour', 'day', 'week', 'month', 'year'
219
230
  // 或自定义范围:
220
231
  // timeRange: { from: '2023-01-01', to: '2023-12-31' },
221
232
  category: 'news', // 'all', 'images', 'videos', 'news'
package/README.md CHANGED
@@ -47,6 +47,7 @@ Since `WebSearcher` extends `FetchSession`, you can instantiate it to keep cooki
47
47
  The `template` defined in the `WebSearcher` subclass acts as the authoritative "blueprint".
48
48
 
49
49
  - **Template Priority**: If the template defines a property (e.g., `engine: 'browser'`, `headers`), that value is **locked** and cannot be overridden by user options. This ensures engine stability.
50
+ - **Immutable Actions**: The `actions` array in the template is strictly protected. Users cannot append, replace, or modify the execution steps via `options`. This prevents external logic from breaking the scraper's flow.
50
51
  - **User Flexibility**: Properties **not** explicitly defined in the template (such as `proxy`, `timeoutMs`, or custom variables) can be freely set by the user in the constructor or `search()` method.
51
52
 
52
53
  ```typescript
@@ -56,7 +57,17 @@ const google = new GoogleSearcher({
56
57
  proxy: 'http://my-proxy:8080',
57
58
  timeoutMs: 30000 // Set a global timeout (valid if template doesn't define it)
58
59
  });
60
+ ```
61
+
62
+ ### 🧠 Intelligent Navigation (Goto)
63
+
64
+ The `WebSearcher` automatically manages navigation to the search URL.
59
65
 
66
+ 1. **Auto-Injection**: If your template does **not** include a `goto` action, the searcher automatically inserts one at the beginning of the action list, pointing to the resolved `url` (with query variables injected).
67
+ 2. **Manual Control**: If you explicitly add a `goto` action in your template that matches the resolved URL, the searcher detects this duplicate and **skips** the automatic injection. This gives you full control to add headers, referrer, or other specific parameters to the navigation step if needed.
68
+ 3. **Multi-Step Flows**: You can define multiple `goto` actions in your template (e.g., visit a login page first). The searcher will still prepend the main search URL navigation unless one of your `goto` actions matches it exactly.
69
+
70
+ ```typescript
60
71
  try {
61
72
  // First query
62
73
  // You can also pass runtime options to override session defaults or inject variables
@@ -215,7 +226,7 @@ When calling `search()`, you can provide standardized options that the search en
215
226
  ```typescript
216
227
  const results = await google.search('open source', {
217
228
  limit: 20,
218
- timeRange: 'month', // 'day', 'week', 'month', 'year'
229
+ timeRange: 'month', // 'hour', 'day', 'week', 'month', 'year'
219
230
  // Or custom range:
220
231
  // timeRange: { from: '2023-01-01', to: '2023-12-31' },
221
232
  category: 'news', // 'all', 'images', 'videos', 'news'
package/dist/index.d.mts CHANGED
@@ -84,7 +84,7 @@ interface SearchContext {
84
84
  /** The requested limit of results. */
85
85
  limit?: number;
86
86
  }
87
- type SearchTimeRangePreset = 'all' | 'day' | 'week' | 'month' | 'year';
87
+ type SearchTimeRangePreset = 'all' | 'hour' | 'day' | 'week' | 'month' | 'year';
88
88
  interface CustomTimeRange {
89
89
  /** Start date (Date object or string like 'YYYY-MM-DD'). */
90
90
  from: Date | string;
package/dist/index.d.ts CHANGED
@@ -84,7 +84,7 @@ interface SearchContext {
84
84
  /** The requested limit of results. */
85
85
  limit?: number;
86
86
  }
87
- type SearchTimeRangePreset = 'all' | 'day' | 'week' | 'month' | 'year';
87
+ type SearchTimeRangePreset = 'all' | 'hour' | 'day' | 'week' | 'month' | 'year';
88
88
  interface CustomTimeRange {
89
89
  /** Start date (Date object or string like 'YYYY-MM-DD'). */
90
90
  from: Date | string;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var t,e=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,i={};((t,r)=>{for(var s in r)e(t,s,{get:r[s],enumerable:!0})})(i,{GoogleSearcher:()=>f,WebSearcher:()=>h}),module.exports=(t=i,((t,i,n,o)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let c of s(i))a.call(t,c)||c===n||e(t,c,{get:()=>i[c],enumerable:!(o=r(i,c))||o.enumerable});return t})(e({},"__esModule",{value:!0}),t));var n=require("@isdk/web-fetcher"),o=require("custom-factory"),c=require("lodash-es");function l(t,e){if("string"==typeof t)return t.replace(/\$\{(.*?)\}/g,(t,r)=>{const s=e[r.trim()];return void 0!==s?String(s):""});if(Array.isArray(t))return t.map(t=>l(t,e));if((0,c.isPlainObject)(t)){const r={};for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=l(t[s],e));return r}return t}var u=require("lodash-es"),h=class extends n.FetchSession{static async search(t,e,r={}){const s=this.createObject(t,r);if(!s)throw new Error(`Search engine not found: ${t}`);try{return await s.search(e,r)}finally{await s.dispose()}}get pagination(){}createContext(t=this.options){const e=this.template,r=(0,u.defaultsDeep)({},e,t);return e.engine&&"auto"!==e.engine||!t.engine||(r.engine=t.engine),super.createContext(r)}async search(t,e={}){const r=e.limit||10,s=[];let a=0;const i=this.pagination?.startValue??0,n=this.pagination?.increment??1,o=e.maxPages||this.pagination?.maxPages||10;for(;s.length<r;){const c=this.formatOptions(e),h=i+a*n,f={...e,...c,query:t,page:a+i,offset:h,limit:r},m=l(this.template,f),d=(0,u.defaultsDeep)({},m,e),g=[];if(0===a||"url-param"===this.pagination?.type?d.url&&g.push({id:"goto",params:{url:d.url}}):"click-next"===this.pagination?.type&&this.pagination.nextButtonSelector&&(g.push({id:"click",params:{selector:this.pagination.nextButtonSelector}}),g.push({id:"waitFor",params:{networkIdle:!0,ms:500}})),d.actions){const t=d.actions.filter(t=>!(g.length>0&&"goto"===g[0].id&&"goto"===t.id));g.push(...t)}d.engine&&this.context.engine!==d.engine&&d.engine;const{outputs:p}=await this.executeAll(g),w={query:t,page:a,limit:e.limit};let y=[];if(y=await this.transform(p,w),e.transform&&(y=await e.transform(y,w)),!y||0===y.length)break;if(s.push(...y),s.length>=r||!this.pagination)break;if(a++,a>=o)break}return s.slice(0,r)}async transform(t,e){return t.results||[]}formatOptions(t){return{...t}}};h._isFactory=!1,(0,o.addBaseFactoryAbility)(h),h.prototype.name="Searcher";var f=class extends h{get template(){return{engine:"browser",browser:{headless:!1},url:"https://www.google.com/search?q=${query}&start=${offset}&tbs=${tbs}&tbm=${tbm}&gl=${gl}&hl=${hl}&safe=${safe}",actions:[{id:"extract",storeAs:"results",params:{type:"array",selector:"#main #search",items:{url:{selector:"a:has(h3)",attribute:"href",required:!0},title:{selector:"a:has(h3) h3",required:!0,mode:"innerText"},snippet:{selector:"div[style*='-webkit-line-clamp']",type:"html"}}}}]}}get pagination(){return{type:"url-param",paramName:"start",startValue:0,increment:10}}formatOptions(t){const e={};if(t.timeRange)if("string"==typeof t.timeRange){const r={day:"qdr:d",week:"qdr:w",month:"qdr:m",year:"qdr:y"};r[t.timeRange]&&(e.tbs=r[t.timeRange])}else{const r=new Date(t.timeRange.from),s=t.timeRange.to?new Date(t.timeRange.to):new Date;if(!isNaN(r.getTime())&&!isNaN(s.getTime())){const t=t=>`${t.getMonth()+1}/${t.getDate()}/${t.getFullYear()}`;e.tbs=`cdr:1,cd_min:${t(r)},cd_max:${t(s)}`}}if(t.category){const r={images:"isch",videos:"vid",news:"nws"};r[t.category]&&(e.tbm=r[t.category])}return t.region&&(e.gl=t.region),t.language&&(e.hl=t.language),t.safeSearch&&("strict"===t.safeSearch?e.safe="active":"off"===t.safeSearch&&(e.safe="images")),e}async transform(t){const e=t.results||[];return Array.isArray(e)?e.map(t=>{if(t.url&&t.url.startsWith("/url?q="))try{const e=new URL(t.url,"https://www.google.com").searchParams.get("q");e&&(t.url=e)}catch(t){}return t}):[]}};f.alias=["google"];
1
+ "use strict";var e,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,i={};((e,r)=>{for(var s in r)t(e,s,{get:r[s],enumerable:!0})})(i,{GoogleSearcher:()=>f,WebSearcher:()=>h}),module.exports=(e=i,((e,i,n,o)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let c of s(i))a.call(e,c)||c===n||t(e,c,{get:()=>i[c],enumerable:!(o=r(i,c))||o.enumerable});return e})(t({},"__esModule",{value:!0}),e));var n=require("@isdk/web-fetcher"),o=require("custom-factory"),c=require("lodash-es");function l(e,t){if("string"==typeof e)return e.replace(/\$\{(.*?)\}/g,(e,r)=>{const s=t[r.trim()];return void 0!==s?String(s):""});if(Array.isArray(e))return e.map(e=>l(e,t));if((0,c.isPlainObject)(e)){const r={};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=l(e[s],t));return r}return e}var u=require("lodash-es"),h=class extends n.FetchSession{static async search(e,t,r={}){const s=this.createObject(e,r);if(!s)throw new Error(`Search engine not found: ${e}`);try{return await s.search(t,r)}finally{await s.dispose()}}get pagination(){}createContext(e=this.options){const t=this.template,r=(0,u.defaultsDeep)({},t,e);return t.engine&&"auto"!==t.engine||!e.engine||(r.engine=e.engine),super.createContext(r)}async search(e,t={}){const r=t.limit||10,s=[];let a=0;const i=this.pagination?.startValue??0,n=this.pagination?.increment??1,o=t.maxPages||this.pagination?.maxPages||10;for(;s.length<r;){const c=this.formatOptions(t),h=i+a*n,f={...t,...c,query:e,page:a+i,offset:h,limit:r},m=l(this.template,f),{actions:d,...g}=t,p=(0,u.defaultsDeep)({},m,g),w=[],y=p.actions||[];if(0===a||"url-param"===this.pagination?.type){if(p.url){y.some(e=>"goto"===(e.id??e.name??e.action)&&e.params?.url===p.url)||w.push({id:"goto",params:{url:p.url}})}}else"click-next"===this.pagination?.type&&this.pagination.nextButtonSelector&&(w.push({id:"click",params:{selector:this.pagination.nextButtonSelector}}),w.push({id:"waitFor",params:{networkIdle:!0,ms:500}}));w.push(...y),p.engine&&this.context.engine!==p.engine&&p.engine;const{outputs:b}=await this.executeAll(w),q={query:e,page:a,limit:t.limit};let $=[];if($=await this.transform(b,q),t.transform&&($=await t.transform($,q)),!$||0===$.length)break;if(s.push(...$),s.length>=r||!this.pagination)break;if(a++,a>=o)break}return s.slice(0,r)}async transform(e,t){return e.results||[]}formatOptions(e){return{...e}}};h._isFactory=!1,(0,o.addBaseFactoryAbility)(h),h.prototype.name="Searcher";var f=class extends h{get template(){return{engine:"browser",browser:{headless:!1},url:"https://www.google.com/search?q=${query}&start=${offset}&tbs=${tbs}&tbm=${tbm}&gl=${gl}&hl=${hl}&safe=${safe}",actions:[{id:"extract",storeAs:"results",params:{type:"array",selector:"#main #search",items:{url:{selector:"a:has(h3)",attribute:"href",required:!0},title:{selector:"a:has(h3) h3",required:!0,mode:"innerText"},snippet:{selector:"div[style*='-webkit-line-clamp']",type:"html"}}}}]}}get pagination(){return{type:"url-param",paramName:"start",startValue:0,increment:10}}formatOptions(e){const t={};if(e.timeRange)if("string"==typeof e.timeRange){const r={hour:"qdr:h",day:"qdr:d",week:"qdr:w",month:"qdr:m",year:"qdr:y"};r[e.timeRange]&&(t.tbs=r[e.timeRange])}else{const r=new Date(e.timeRange.from),s=e.timeRange.to?new Date(e.timeRange.to):new Date;if(!isNaN(r.getTime())&&!isNaN(s.getTime())){const e=e=>`${e.getMonth()+1}/${e.getDate()}/${e.getFullYear()}`;t.tbs=`cdr:1,cd_min:${e(r)},cd_max:${e(s)}`}}if(e.category){const r={images:"isch",videos:"vid",news:"nws"};r[e.category]&&(t.tbm=r[e.category])}return e.region&&(t.gl=e.region),e.language&&(t.hl=e.language),e.safeSearch&&("strict"===e.safeSearch?t.safe="active":"off"===e.safeSearch&&(t.safe="images")),t}async transform(e){const t=e.results||[];return Array.isArray(t)?t.map(e=>{if(e.url&&e.url.startsWith("/url?q="))try{const t=new URL(e.url,"https://www.google.com").searchParams.get("q");t&&(e.url=t)}catch(e){}return e}):[]}};f.alias=["google"];
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{FetchSession as t}from"@isdk/web-fetcher";import{addBaseFactoryAbility as r}from"custom-factory";import{isPlainObject as e}from"lodash-es";function s(t,r){if("string"==typeof t)return t.replace(/\$\{(.*?)\}/g,(t,e)=>{const s=r[e.trim()];return void 0!==s?String(s):""});if(Array.isArray(t))return t.map(t=>s(t,r));if(e(t)){const e={};for(const a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=s(t[a],r));return e}return t}import{defaultsDeep as a}from"lodash-es";var i=class extends t{static async search(t,r,e={}){const s=this.createObject(t,e);if(!s)throw new Error(`Search engine not found: ${t}`);try{return await s.search(r,e)}finally{await s.dispose()}}get pagination(){}createContext(t=this.options){const r=this.template,e=a({},r,t);return r.engine&&"auto"!==r.engine||!t.engine||(e.engine=t.engine),super.createContext(e)}async search(t,r={}){const e=r.limit||10,i=[];let o=0;const n=this.pagination?.startValue??0,c=this.pagination?.increment??1,h=r.maxPages||this.pagination?.maxPages||10;for(;i.length<e;){const l=this.formatOptions(r),m=n+o*c,f={...r,...l,query:t,page:o+n,offset:m,limit:e},u=s(this.template,f),p=a({},u,r),d=[];if(0===o||"url-param"===this.pagination?.type?p.url&&d.push({id:"goto",params:{url:p.url}}):"click-next"===this.pagination?.type&&this.pagination.nextButtonSelector&&(d.push({id:"click",params:{selector:this.pagination.nextButtonSelector}}),d.push({id:"waitFor",params:{networkIdle:!0,ms:500}})),p.actions){const t=p.actions.filter(t=>!(d.length>0&&"goto"===d[0].id&&"goto"===t.id));d.push(...t)}p.engine&&this.context.engine!==p.engine&&p.engine;const{outputs:w}=await this.executeAll(d),g={query:t,page:o,limit:r.limit};let y=[];if(y=await this.transform(w,g),r.transform&&(y=await r.transform(y,g)),!y||0===y.length)break;if(i.push(...y),i.length>=e||!this.pagination)break;if(o++,o>=h)break}return i.slice(0,e)}async transform(t,r){return t.results||[]}formatOptions(t){return{...t}}};i._isFactory=!1,r(i),i.prototype.name="Searcher";var o=class extends i{get template(){return{engine:"browser",browser:{headless:!1},url:"https://www.google.com/search?q=${query}&start=${offset}&tbs=${tbs}&tbm=${tbm}&gl=${gl}&hl=${hl}&safe=${safe}",actions:[{id:"extract",storeAs:"results",params:{type:"array",selector:"#main #search",items:{url:{selector:"a:has(h3)",attribute:"href",required:!0},title:{selector:"a:has(h3) h3",required:!0,mode:"innerText"},snippet:{selector:"div[style*='-webkit-line-clamp']",type:"html"}}}}]}}get pagination(){return{type:"url-param",paramName:"start",startValue:0,increment:10}}formatOptions(t){const r={};if(t.timeRange)if("string"==typeof t.timeRange){const e={day:"qdr:d",week:"qdr:w",month:"qdr:m",year:"qdr:y"};e[t.timeRange]&&(r.tbs=e[t.timeRange])}else{const e=new Date(t.timeRange.from),s=t.timeRange.to?new Date(t.timeRange.to):new Date;if(!isNaN(e.getTime())&&!isNaN(s.getTime())){const t=t=>`${t.getMonth()+1}/${t.getDate()}/${t.getFullYear()}`;r.tbs=`cdr:1,cd_min:${t(e)},cd_max:${t(s)}`}}if(t.category){const e={images:"isch",videos:"vid",news:"nws"};e[t.category]&&(r.tbm=e[t.category])}return t.region&&(r.gl=t.region),t.language&&(r.hl=t.language),t.safeSearch&&("strict"===t.safeSearch?r.safe="active":"off"===t.safeSearch&&(r.safe="images")),r}async transform(t){const r=t.results||[];return Array.isArray(r)?r.map(t=>{if(t.url&&t.url.startsWith("/url?q="))try{const r=new URL(t.url,"https://www.google.com").searchParams.get("q");r&&(t.url=r)}catch(t){}return t}):[]}};o.alias=["google"];export{o as GoogleSearcher,i as WebSearcher};
1
+ import{FetchSession as t}from"@isdk/web-fetcher";import{addBaseFactoryAbility as r}from"custom-factory";import{isPlainObject as e}from"lodash-es";function s(t,r){if("string"==typeof t)return t.replace(/\$\{(.*?)\}/g,(t,e)=>{const s=r[e.trim()];return void 0!==s?String(s):""});if(Array.isArray(t))return t.map(t=>s(t,r));if(e(t)){const e={};for(const a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=s(t[a],r));return e}return t}import{defaultsDeep as a}from"lodash-es";var i=class extends t{static async search(t,r,e={}){const s=this.createObject(t,e);if(!s)throw new Error(`Search engine not found: ${t}`);try{return await s.search(r,e)}finally{await s.dispose()}}get pagination(){}createContext(t=this.options){const r=this.template,e=a({},r,t);return r.engine&&"auto"!==r.engine||!t.engine||(e.engine=t.engine),super.createContext(e)}async search(t,r={}){const e=r.limit||10,i=[];let o=0;const n=this.pagination?.startValue??0,c=this.pagination?.increment??1,h=r.maxPages||this.pagination?.maxPages||10;for(;i.length<e;){const l=this.formatOptions(r),m=n+o*c,f={...r,...l,query:t,page:o+n,offset:m,limit:e},u=s(this.template,f),{actions:p,...d}=r,w=a({},u,d),g=[],y=w.actions||[];if(0===o||"url-param"===this.pagination?.type){if(w.url){y.some(t=>"goto"===(t.id??t.name??t.action)&&t.params?.url===w.url)||g.push({id:"goto",params:{url:w.url}})}}else"click-next"===this.pagination?.type&&this.pagination.nextButtonSelector&&(g.push({id:"click",params:{selector:this.pagination.nextButtonSelector}}),g.push({id:"waitFor",params:{networkIdle:!0,ms:500}}));g.push(...y),w.engine&&this.context.engine!==w.engine&&w.engine;const{outputs:$}=await this.executeAll(g),b={query:t,page:o,limit:r.limit};let q=[];if(q=await this.transform($,b),r.transform&&(q=await r.transform(q,b)),!q||0===q.length)break;if(i.push(...q),i.length>=e||!this.pagination)break;if(o++,o>=h)break}return i.slice(0,e)}async transform(t,r){return t.results||[]}formatOptions(t){return{...t}}};i._isFactory=!1,r(i),i.prototype.name="Searcher";var o=class extends i{get template(){return{engine:"browser",browser:{headless:!1},url:"https://www.google.com/search?q=${query}&start=${offset}&tbs=${tbs}&tbm=${tbm}&gl=${gl}&hl=${hl}&safe=${safe}",actions:[{id:"extract",storeAs:"results",params:{type:"array",selector:"#main #search",items:{url:{selector:"a:has(h3)",attribute:"href",required:!0},title:{selector:"a:has(h3) h3",required:!0,mode:"innerText"},snippet:{selector:"div[style*='-webkit-line-clamp']",type:"html"}}}}]}}get pagination(){return{type:"url-param",paramName:"start",startValue:0,increment:10}}formatOptions(t){const r={};if(t.timeRange)if("string"==typeof t.timeRange){const e={hour:"qdr:h",day:"qdr:d",week:"qdr:w",month:"qdr:m",year:"qdr:y"};e[t.timeRange]&&(r.tbs=e[t.timeRange])}else{const e=new Date(t.timeRange.from),s=t.timeRange.to?new Date(t.timeRange.to):new Date;if(!isNaN(e.getTime())&&!isNaN(s.getTime())){const t=t=>`${t.getMonth()+1}/${t.getDate()}/${t.getFullYear()}`;r.tbs=`cdr:1,cd_min:${t(e)},cd_max:${t(s)}`}}if(t.category){const e={images:"isch",videos:"vid",news:"nws"};e[t.category]&&(r.tbm=e[t.category])}return t.region&&(r.gl=t.region),t.language&&(r.hl=t.language),t.safeSearch&&("strict"===t.safeSearch?r.safe="active":"off"===t.safeSearch&&(r.safe="images")),r}async transform(t){const r=t.results||[];return Array.isArray(r)?r.map(t=>{if(t.url&&t.url.startsWith("/url?q="))try{const r=new URL(t.url,"https://www.google.com").searchParams.get("q");r&&(t.url=r)}catch(t){}return t}):[]}};o.alias=["google"];export{o as GoogleSearcher,i as WebSearcher};
package/docs/README.md CHANGED
@@ -51,6 +51,7 @@ Since `WebSearcher` extends `FetchSession`, you can instantiate it to keep cooki
51
51
  The `template` defined in the `WebSearcher` subclass acts as the authoritative "blueprint".
52
52
 
53
53
  - **Template Priority**: If the template defines a property (e.g., `engine: 'browser'`, `headers`), that value is **locked** and cannot be overridden by user options. This ensures engine stability.
54
+ - **Immutable Actions**: The `actions` array in the template is strictly protected. Users cannot append, replace, or modify the execution steps via `options`. This prevents external logic from breaking the scraper's flow.
54
55
  - **User Flexibility**: Properties **not** explicitly defined in the template (such as `proxy`, `timeoutMs`, or custom variables) can be freely set by the user in the constructor or `search()` method.
55
56
 
56
57
  ```typescript
@@ -60,7 +61,17 @@ const google = new GoogleSearcher({
60
61
  proxy: 'http://my-proxy:8080',
61
62
  timeoutMs: 30000 // Set a global timeout (valid if template doesn't define it)
62
63
  });
64
+ ```
65
+
66
+ ### 🧠 Intelligent Navigation (Goto)
67
+
68
+ The `WebSearcher` automatically manages navigation to the search URL.
63
69
 
70
+ 1. **Auto-Injection**: If your template does **not** include a `goto` action, the searcher automatically inserts one at the beginning of the action list, pointing to the resolved `url` (with query variables injected).
71
+ 2. **Manual Control**: If you explicitly add a `goto` action in your template that matches the resolved URL, the searcher detects this duplicate and **skips** the automatic injection. This gives you full control to add headers, referrer, or other specific parameters to the navigation step if needed.
72
+ 3. **Multi-Step Flows**: You can define multiple `goto` actions in your template (e.g., visit a login page first). The searcher will still prepend the main search URL navigation unless one of your `goto` actions matches it exactly.
73
+
74
+ ```typescript
64
75
  try {
65
76
  // First query
66
77
  // You can also pass runtime options to override session defaults or inject variables
@@ -219,7 +230,7 @@ When calling `search()`, you can provide standardized options that the search en
219
230
  ```typescript
220
231
  const results = await google.search('open source', {
221
232
  limit: 20,
222
- timeRange: 'month', // 'day', 'week', 'month', 'year'
233
+ timeRange: 'month', // 'hour', 'day', 'week', 'month', 'year'
223
234
  // Or custom range:
224
235
  // timeRange: { from: '2023-01-01', to: '2023-12-31' },
225
236
  category: 'news', // 'all', 'images', 'videos', 'news'
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Class: GoogleSearcher
8
8
 
9
- Defined in: [web-searcher/src/engines/google.ts:24](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/engines/google.ts#L24)
9
+ Defined in: [web-searcher/src/engines/google.ts:24](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/engines/google.ts#L24)
10
10
 
11
11
  A sample implementation of a Google Search scraper.
12
12
 
@@ -37,7 +37,7 @@ Use this class to understand:
37
37
 
38
38
  > **new GoogleSearcher**(`options?`): `GoogleSearcher`
39
39
 
40
- Defined in: web-fetcher/dist/index.d.ts:2275
40
+ Defined in: web-fetcher/dist/index.d.ts:2287
41
41
 
42
42
  Creates a new FetchSession.
43
43
 
@@ -63,7 +63,7 @@ Configuration options for the fetcher.
63
63
 
64
64
  > `protected` **closed**: `boolean`
65
65
 
66
- Defined in: web-fetcher/dist/index.d.ts:2269
66
+ Defined in: web-fetcher/dist/index.d.ts:2281
67
67
 
68
68
  #### Inherited from
69
69
 
@@ -75,7 +75,7 @@ Defined in: web-fetcher/dist/index.d.ts:2269
75
75
 
76
76
  > `readonly` **context**: `FetchContext`
77
77
 
78
- Defined in: web-fetcher/dist/index.d.ts:2268
78
+ Defined in: web-fetcher/dist/index.d.ts:2280
79
79
 
80
80
  The execution context for this session, containing configurations, event bus, and shared state.
81
81
 
@@ -89,7 +89,7 @@ The execution context for this session, containing configurations, event bus, an
89
89
 
90
90
  > `readonly` **id**: `string`
91
91
 
92
- Defined in: web-fetcher/dist/index.d.ts:2264
92
+ Defined in: web-fetcher/dist/index.d.ts:2276
93
93
 
94
94
  Unique identifier for the session.
95
95
 
@@ -103,7 +103,7 @@ Unique identifier for the session.
103
103
 
104
104
  > `protected` **options**: `FetcherOptions`
105
105
 
106
- Defined in: web-fetcher/dist/index.d.ts:2260
106
+ Defined in: web-fetcher/dist/index.d.ts:2272
107
107
 
108
108
  #### Inherited from
109
109
 
@@ -115,7 +115,7 @@ Defined in: web-fetcher/dist/index.d.ts:2260
115
115
 
116
116
  > `static` **\_isFactory**: `boolean` = `false`
117
117
 
118
- Defined in: [web-searcher/src/searcher.ts:33](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/searcher.ts#L33)
118
+ Defined in: [web-searcher/src/searcher.ts:33](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/searcher.ts#L33)
119
119
 
120
120
  #### Inherited from
121
121
 
@@ -127,7 +127,7 @@ Defined in: [web-searcher/src/searcher.ts:33](https://github.com/isdk/web-search
127
127
 
128
128
  > `static` **alias**: `string`[]
129
129
 
130
- Defined in: [web-searcher/src/engines/google.ts:25](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/engines/google.ts#L25)
130
+ Defined in: [web-searcher/src/engines/google.ts:25](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/engines/google.ts#L25)
131
131
 
132
132
  Engine alias(es). Can be a single string or an array of strings.
133
133
  Useful for registering shorthand names (e.g., 'g' for 'Google').
@@ -142,7 +142,7 @@ Useful for registering shorthand names (e.g., 'g' for 'Google').
142
142
 
143
143
  > `static` **createObject**: (`name`, ...`args`) => [`WebSearcher`](WebSearcher.md)
144
144
 
145
- Defined in: [web-searcher/src/searcher.ts:78](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/searcher.ts#L78)
145
+ Defined in: [web-searcher/src/searcher.ts:78](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/searcher.ts#L78)
146
146
 
147
147
  Creates an instance of the registered search engine.
148
148
 
@@ -176,7 +176,7 @@ An instance of the search engine.
176
176
 
177
177
  > `static` **forEach**: (`cb`) => `void`
178
178
 
179
- Defined in: [web-searcher/src/searcher.ts:85](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/searcher.ts#L85)
179
+ Defined in: [web-searcher/src/searcher.ts:85](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/searcher.ts#L85)
180
180
 
181
181
  Iterates over all registered engines.
182
182
 
@@ -202,7 +202,7 @@ Callback function to invoke for each registered engine.
202
202
 
203
203
  > `static` **get**: (`name`) => *typeof* [`WebSearcher`](WebSearcher.md)
204
204
 
205
- Defined in: [web-searcher/src/searcher.ts:69](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/searcher.ts#L69)
205
+ Defined in: [web-searcher/src/searcher.ts:69](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/searcher.ts#L69)
206
206
 
207
207
  Retrieves a registered search engine class by name.
208
208
 
@@ -230,7 +230,7 @@ The search engine class constructor.
230
230
 
231
231
  > `static` `optional` **name**: `string`
232
232
 
233
- Defined in: [web-searcher/src/searcher.ts:40](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/searcher.ts#L40)
233
+ Defined in: [web-searcher/src/searcher.ts:40](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/searcher.ts#L40)
234
234
 
235
235
  Custom engine name. If not provided, it is derived from the class name.
236
236
  For example, `GoogleSearcher` becomes `Google`.
@@ -245,7 +245,7 @@ For example, `GoogleSearcher` becomes `Google`.
245
245
 
246
246
  > `static` **register**: (`ctor`, `options?`) => `boolean`
247
247
 
248
- Defined in: [web-searcher/src/searcher.ts:54](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/searcher.ts#L54)
248
+ Defined in: [web-searcher/src/searcher.ts:54](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/searcher.ts#L54)
249
249
 
250
250
  Registers a search engine class.
251
251
 
@@ -279,7 +279,7 @@ Registration options. If a string is provided, it is used as the registered name
279
279
 
280
280
  > `static` **setAliases**: (`ctor`, ...`aliases`) => `void`
281
281
 
282
- Defined in: [web-searcher/src/searcher.ts:93](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/searcher.ts#L93)
282
+ Defined in: [web-searcher/src/searcher.ts:93](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/searcher.ts#L93)
283
283
 
284
284
  Sets aliases for a registered engine.
285
285
 
@@ -311,7 +311,7 @@ Aliases to add.
311
311
 
312
312
  > `static` **unregister**: (`name?`) => `void`
313
313
 
314
- Defined in: [web-searcher/src/searcher.ts:61](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/searcher.ts#L61)
314
+ Defined in: [web-searcher/src/searcher.ts:61](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/searcher.ts#L61)
315
315
 
316
316
  Unregisters a search engine.
317
317
 
@@ -339,7 +339,7 @@ The name or class to unregister.
339
339
 
340
340
  > **get** **pagination**(): [`PaginationConfig`](../interfaces/PaginationConfig.md)
341
341
 
342
- Defined in: [web-searcher/src/engines/google.ts:61](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/engines/google.ts#L61)
342
+ Defined in: [web-searcher/src/engines/google.ts:61](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/engines/google.ts#L61)
343
343
 
344
344
  Configures pagination for Google Search results.
345
345
  Uses the 'start' URL parameter, incrementing by 10 for each page.
@@ -360,7 +360,7 @@ Uses the 'start' URL parameter, incrementing by 10 for each page.
360
360
 
361
361
  > **get** **template**(): `FetcherOptions`
362
362
 
363
- Defined in: [web-searcher/src/engines/google.ts:32](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/engines/google.ts#L32)
363
+ Defined in: [web-searcher/src/engines/google.ts:32](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/engines/google.ts#L32)
364
364
 
365
365
  Defines the fetch template for Google Search.
366
366
 
@@ -380,7 +380,7 @@ The fetcher configuration including the URL pattern and extraction rules.
380
380
 
381
381
  > `protected` **createContext**(`options`): `FetchContext`
382
382
 
383
- Defined in: [web-searcher/src/searcher.ts:155](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/searcher.ts#L155)
383
+ Defined in: [web-searcher/src/searcher.ts:155](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/searcher.ts#L155)
384
384
 
385
385
  #### Parameters
386
386
 
@@ -402,7 +402,7 @@ Defined in: [web-searcher/src/searcher.ts:155](https://github.com/isdk/web-searc
402
402
 
403
403
  > **dispose**(): `Promise`\<`void`\>
404
404
 
405
- Defined in: web-fetcher/dist/index.d.ts:2334
405
+ Defined in: web-fetcher/dist/index.d.ts:2346
406
406
 
407
407
  Disposes of the session and its associated engine.
408
408
 
@@ -425,7 +425,7 @@ This method should be called when the session is no longer needed to free up res
425
425
 
426
426
  > **execute**\<`R`\>(`actionOptions`, `context?`): `Promise`\<`FetchActionResult`\<`R`\>\>
427
427
 
428
- Defined in: web-fetcher/dist/index.d.ts:2289
428
+ Defined in: web-fetcher/dist/index.d.ts:2301
429
429
 
430
430
  Executes a single action within the session.
431
431
 
@@ -473,7 +473,7 @@ await session.execute({ name: 'goto', params: { url: 'https://example.com' } });
473
473
 
474
474
  > **executeAll**(`actions`, `options?`): `Promise`\<\{ `outputs`: `Record`\<`string`, `any`\>; `result`: `FetchResponse` \| `undefined`; \}\>
475
475
 
476
- Defined in: web-fetcher/dist/index.d.ts:2306
476
+ Defined in: web-fetcher/dist/index.d.ts:2318
477
477
 
478
478
  Executes a sequence of actions.
479
479
 
@@ -517,7 +517,7 @@ const { result, outputs } = await session.executeAll([
517
517
 
518
518
  > `protected` **formatOptions**(`options`): `Record`\<`string`, `any`\>
519
519
 
520
- Defined in: [web-searcher/src/engines/google.ts:82](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/engines/google.ts#L82)
520
+ Defined in: [web-searcher/src/engines/google.ts:82](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/engines/google.ts#L82)
521
521
 
522
522
  Maps standard `SearchOptions` to Google's specific URL parameters.
523
523
 
@@ -551,7 +551,7 @@ A map of variables to inject into the URL template.
551
551
 
552
552
  > **getOutputs**(): `Record`\<`string`, `any`\>
553
553
 
554
- Defined in: web-fetcher/dist/index.d.ts:2317
554
+ Defined in: web-fetcher/dist/index.d.ts:2329
555
555
 
556
556
  Retrieves all outputs accumulated during the session.
557
557
 
@@ -571,7 +571,7 @@ A record of stored output data.
571
571
 
572
572
  > **getState**(): `Promise`\<\{ `cookies`: `Cookie`[]; `sessionState?`: `any`; \} \| `undefined`\>
573
573
 
574
- Defined in: web-fetcher/dist/index.d.ts:2323
574
+ Defined in: web-fetcher/dist/index.d.ts:2335
575
575
 
576
576
  Gets the current state of the session, including cookies and engine-specific state.
577
577
 
@@ -591,7 +591,7 @@ A promise resolving to the session state, or undefined if no engine is initializ
591
591
 
592
592
  > **search**(`query`, `options`): `Promise`\<[`StandardSearchResult`](../interfaces/StandardSearchResult.md)[]\>
593
593
 
594
- Defined in: [web-searcher/src/searcher.ts:182](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/searcher.ts#L182)
594
+ Defined in: [web-searcher/src/searcher.ts:182](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/searcher.ts#L182)
595
595
 
596
596
  Executes a search query.
597
597
 
@@ -628,7 +628,7 @@ A promise resolving to an array of standardized search results.
628
628
 
629
629
  > `protected` **transform**(`outputs`): `Promise`\<`any`[]\>
630
630
 
631
- Defined in: [web-searcher/src/engines/google.ts:144](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/engines/google.ts#L144)
631
+ Defined in: [web-searcher/src/engines/google.ts:145](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/engines/google.ts#L145)
632
632
 
633
633
  Cleans and normalizes the extracted results.
634
634
  Specifically, it unwraps Google's redirect URLs (starting with `/url?q=`).
@@ -657,7 +657,7 @@ An array of cleaned search results.
657
657
 
658
658
  > `static` **search**(`engineName`, `query`, `options`): `Promise`\<[`StandardSearchResult`](../interfaces/StandardSearchResult.md)[]\>
659
659
 
660
- Defined in: [web-searcher/src/searcher.ts:106](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/searcher.ts#L106)
660
+ Defined in: [web-searcher/src/searcher.ts:106](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/searcher.ts#L106)
661
661
 
662
662
  Static helper to execute a one-off search.
663
663
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Abstract Class: WebSearcher
8
8
 
9
- Defined in: [web-searcher/src/searcher.ts:31](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/searcher.ts#L31)
9
+ Defined in: [web-searcher/src/searcher.ts:31](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/searcher.ts#L31)
10
10
 
11
11
  The abstract base class for all search engines.
12
12
 
@@ -41,7 +41,7 @@ WebSearcher.register(MySearcher);
41
41
 
42
42
  > **new WebSearcher**(`options?`): `WebSearcher`
43
43
 
44
- Defined in: web-fetcher/dist/index.d.ts:2275
44
+ Defined in: web-fetcher/dist/index.d.ts:2287
45
45
 
46
46
  Creates a new FetchSession.
47
47
 
@@ -67,7 +67,7 @@ Configuration options for the fetcher.
67
67
 
68
68
  > `protected` **closed**: `boolean`
69
69
 
70
- Defined in: web-fetcher/dist/index.d.ts:2269
70
+ Defined in: web-fetcher/dist/index.d.ts:2281
71
71
 
72
72
  #### Inherited from
73
73
 
@@ -79,7 +79,7 @@ Defined in: web-fetcher/dist/index.d.ts:2269
79
79
 
80
80
  > `readonly` **context**: `FetchContext`
81
81
 
82
- Defined in: web-fetcher/dist/index.d.ts:2268
82
+ Defined in: web-fetcher/dist/index.d.ts:2280
83
83
 
84
84
  The execution context for this session, containing configurations, event bus, and shared state.
85
85
 
@@ -93,7 +93,7 @@ The execution context for this session, containing configurations, event bus, an
93
93
 
94
94
  > `readonly` **id**: `string`
95
95
 
96
- Defined in: web-fetcher/dist/index.d.ts:2264
96
+ Defined in: web-fetcher/dist/index.d.ts:2276
97
97
 
98
98
  Unique identifier for the session.
99
99
 
@@ -107,7 +107,7 @@ Unique identifier for the session.
107
107
 
108
108
  > `protected` **options**: `FetcherOptions`
109
109
 
110
- Defined in: web-fetcher/dist/index.d.ts:2260
110
+ Defined in: web-fetcher/dist/index.d.ts:2272
111
111
 
112
112
  #### Inherited from
113
113
 
@@ -119,7 +119,7 @@ Defined in: web-fetcher/dist/index.d.ts:2260
119
119
 
120
120
  > `static` **\_isFactory**: `boolean` = `false`
121
121
 
122
- Defined in: [web-searcher/src/searcher.ts:33](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/searcher.ts#L33)
122
+ Defined in: [web-searcher/src/searcher.ts:33](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/searcher.ts#L33)
123
123
 
124
124
  ***
125
125
 
@@ -127,7 +127,7 @@ Defined in: [web-searcher/src/searcher.ts:33](https://github.com/isdk/web-search
127
127
 
128
128
  > `static` `optional` **alias**: `string` \| `string`[]
129
129
 
130
- Defined in: [web-searcher/src/searcher.ts:45](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/searcher.ts#L45)
130
+ Defined in: [web-searcher/src/searcher.ts:45](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/searcher.ts#L45)
131
131
 
132
132
  Engine alias(es). Can be a single string or an array of strings.
133
133
  Useful for registering shorthand names (e.g., 'g' for 'Google').
@@ -138,7 +138,7 @@ Useful for registering shorthand names (e.g., 'g' for 'Google').
138
138
 
139
139
  > `static` **createObject**: (`name`, ...`args`) => `WebSearcher`
140
140
 
141
- Defined in: [web-searcher/src/searcher.ts:78](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/searcher.ts#L78)
141
+ Defined in: [web-searcher/src/searcher.ts:78](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/searcher.ts#L78)
142
142
 
143
143
  Creates an instance of the registered search engine.
144
144
 
@@ -168,7 +168,7 @@ An instance of the search engine.
168
168
 
169
169
  > `static` **forEach**: (`cb`) => `void`
170
170
 
171
- Defined in: [web-searcher/src/searcher.ts:85](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/searcher.ts#L85)
171
+ Defined in: [web-searcher/src/searcher.ts:85](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/searcher.ts#L85)
172
172
 
173
173
  Iterates over all registered engines.
174
174
 
@@ -190,7 +190,7 @@ Callback function to invoke for each registered engine.
190
190
 
191
191
  > `static` **get**: (`name`) => *typeof* `WebSearcher`
192
192
 
193
- Defined in: [web-searcher/src/searcher.ts:69](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/searcher.ts#L69)
193
+ Defined in: [web-searcher/src/searcher.ts:69](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/searcher.ts#L69)
194
194
 
195
195
  Retrieves a registered search engine class by name.
196
196
 
@@ -214,7 +214,7 @@ The search engine class constructor.
214
214
 
215
215
  > `static` `optional` **name**: `string`
216
216
 
217
- Defined in: [web-searcher/src/searcher.ts:40](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/searcher.ts#L40)
217
+ Defined in: [web-searcher/src/searcher.ts:40](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/searcher.ts#L40)
218
218
 
219
219
  Custom engine name. If not provided, it is derived from the class name.
220
220
  For example, `GoogleSearcher` becomes `Google`.
@@ -225,7 +225,7 @@ For example, `GoogleSearcher` becomes `Google`.
225
225
 
226
226
  > `static` **register**: (`ctor`, `options?`) => `boolean`
227
227
 
228
- Defined in: [web-searcher/src/searcher.ts:54](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/searcher.ts#L54)
228
+ Defined in: [web-searcher/src/searcher.ts:54](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/searcher.ts#L54)
229
229
 
230
230
  Registers a search engine class.
231
231
 
@@ -255,7 +255,7 @@ Registration options. If a string is provided, it is used as the registered name
255
255
 
256
256
  > `static` **setAliases**: (`ctor`, ...`aliases`) => `void`
257
257
 
258
- Defined in: [web-searcher/src/searcher.ts:93](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/searcher.ts#L93)
258
+ Defined in: [web-searcher/src/searcher.ts:93](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/searcher.ts#L93)
259
259
 
260
260
  Sets aliases for a registered engine.
261
261
 
@@ -283,7 +283,7 @@ Aliases to add.
283
283
 
284
284
  > `static` **unregister**: (`name?`) => `void`
285
285
 
286
- Defined in: [web-searcher/src/searcher.ts:61](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/searcher.ts#L61)
286
+ Defined in: [web-searcher/src/searcher.ts:61](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/searcher.ts#L61)
287
287
 
288
288
  Unregisters a search engine.
289
289
 
@@ -307,7 +307,7 @@ The name or class to unregister.
307
307
 
308
308
  > **get** **pagination**(): [`PaginationConfig`](../interfaces/PaginationConfig.md) \| `undefined`
309
309
 
310
- Defined in: [web-searcher/src/searcher.ts:151](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/searcher.ts#L151)
310
+ Defined in: [web-searcher/src/searcher.ts:151](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/searcher.ts#L151)
311
311
 
312
312
  Optional pagination configuration.
313
313
  Defines how the searcher navigates to subsequent pages.
@@ -326,7 +326,7 @@ If undefined, the searcher will only fetch the first page.
326
326
 
327
327
  > **get** `abstract` **template**(): `FetcherOptions`
328
328
 
329
- Defined in: [web-searcher/src/searcher.ts:143](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/searcher.ts#L143)
329
+ Defined in: [web-searcher/src/searcher.ts:143](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/searcher.ts#L143)
330
330
 
331
331
  The declarative template for the fetch options.
332
332
 
@@ -356,7 +356,7 @@ get template() {
356
356
 
357
357
  > `protected` **createContext**(`options`): `FetchContext`
358
358
 
359
- Defined in: [web-searcher/src/searcher.ts:155](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/searcher.ts#L155)
359
+ Defined in: [web-searcher/src/searcher.ts:155](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/searcher.ts#L155)
360
360
 
361
361
  #### Parameters
362
362
 
@@ -378,7 +378,7 @@ Defined in: [web-searcher/src/searcher.ts:155](https://github.com/isdk/web-searc
378
378
 
379
379
  > **dispose**(): `Promise`\<`void`\>
380
380
 
381
- Defined in: web-fetcher/dist/index.d.ts:2334
381
+ Defined in: web-fetcher/dist/index.d.ts:2346
382
382
 
383
383
  Disposes of the session and its associated engine.
384
384
 
@@ -401,7 +401,7 @@ This method should be called when the session is no longer needed to free up res
401
401
 
402
402
  > **execute**\<`R`\>(`actionOptions`, `context?`): `Promise`\<`FetchActionResult`\<`R`\>\>
403
403
 
404
- Defined in: web-fetcher/dist/index.d.ts:2289
404
+ Defined in: web-fetcher/dist/index.d.ts:2301
405
405
 
406
406
  Executes a single action within the session.
407
407
 
@@ -449,7 +449,7 @@ await session.execute({ name: 'goto', params: { url: 'https://example.com' } });
449
449
 
450
450
  > **executeAll**(`actions`, `options?`): `Promise`\<\{ `outputs`: `Record`\<`string`, `any`\>; `result`: `FetchResponse` \| `undefined`; \}\>
451
451
 
452
- Defined in: web-fetcher/dist/index.d.ts:2306
452
+ Defined in: web-fetcher/dist/index.d.ts:2318
453
453
 
454
454
  Executes a sequence of actions.
455
455
 
@@ -493,7 +493,7 @@ const { result, outputs } = await session.executeAll([
493
493
 
494
494
  > `protected` **formatOptions**(`options`): `Record`\<`string`, `any`\>
495
495
 
496
- Defined in: [web-searcher/src/searcher.ts:309](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/searcher.ts#L309)
496
+ Defined in: [web-searcher/src/searcher.ts:312](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/searcher.ts#L312)
497
497
 
498
498
  Transforms standard options into engine-specific template variables.
499
499
 
@@ -521,7 +521,7 @@ A dictionary of variables to be injected into the template.
521
521
 
522
522
  > **getOutputs**(): `Record`\<`string`, `any`\>
523
523
 
524
- Defined in: web-fetcher/dist/index.d.ts:2317
524
+ Defined in: web-fetcher/dist/index.d.ts:2329
525
525
 
526
526
  Retrieves all outputs accumulated during the session.
527
527
 
@@ -541,7 +541,7 @@ A record of stored output data.
541
541
 
542
542
  > **getState**(): `Promise`\<\{ `cookies`: `Cookie`[]; `sessionState?`: `any`; \} \| `undefined`\>
543
543
 
544
- Defined in: web-fetcher/dist/index.d.ts:2323
544
+ Defined in: web-fetcher/dist/index.d.ts:2335
545
545
 
546
546
  Gets the current state of the session, including cookies and engine-specific state.
547
547
 
@@ -561,7 +561,7 @@ A promise resolving to the session state, or undefined if no engine is initializ
561
561
 
562
562
  > **search**(`query`, `options`): `Promise`\<[`StandardSearchResult`](../interfaces/StandardSearchResult.md)[]\>
563
563
 
564
- Defined in: [web-searcher/src/searcher.ts:182](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/searcher.ts#L182)
564
+ Defined in: [web-searcher/src/searcher.ts:182](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/searcher.ts#L182)
565
565
 
566
566
  Executes a search query.
567
567
 
@@ -594,7 +594,7 @@ A promise resolving to an array of standardized search results.
594
594
 
595
595
  > `protected` **transform**(`outputs`, `context`): `Promise`\<[`StandardSearchResult`](../interfaces/StandardSearchResult.md)[]\>
596
596
 
597
- Defined in: [web-searcher/src/searcher.ts:291](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/searcher.ts#L291)
597
+ Defined in: [web-searcher/src/searcher.ts:294](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/searcher.ts#L294)
598
598
 
599
599
  Transform and clean the raw extracted results.
600
600
 
@@ -627,7 +627,7 @@ A promise resolving to an array of standardized search results.
627
627
 
628
628
  > `static` **search**(`engineName`, `query`, `options`): `Promise`\<[`StandardSearchResult`](../interfaces/StandardSearchResult.md)[]\>
629
629
 
630
- Defined in: [web-searcher/src/searcher.ts:106](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/searcher.ts#L106)
630
+ Defined in: [web-searcher/src/searcher.ts:106](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/searcher.ts#L106)
631
631
 
632
632
  Static helper to execute a one-off search.
633
633
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Interface: CustomTimeRange
8
8
 
9
- Defined in: [web-searcher/src/types.ts:104](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L104)
9
+ Defined in: [web-searcher/src/types.ts:104](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L104)
10
10
 
11
11
  ## Properties
12
12
 
@@ -14,7 +14,7 @@ Defined in: [web-searcher/src/types.ts:104](https://github.com/isdk/web-searcher
14
14
 
15
15
  > **from**: `string` \| `Date`
16
16
 
17
- Defined in: [web-searcher/src/types.ts:106](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L106)
17
+ Defined in: [web-searcher/src/types.ts:106](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L106)
18
18
 
19
19
  Start date (Date object or string like 'YYYY-MM-DD').
20
20
 
@@ -24,6 +24,6 @@ Start date (Date object or string like 'YYYY-MM-DD').
24
24
 
25
25
  > `optional` **to**: `string` \| `Date`
26
26
 
27
- Defined in: [web-searcher/src/types.ts:108](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L108)
27
+ Defined in: [web-searcher/src/types.ts:108](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L108)
28
28
 
29
29
  End date (Date object or string like 'YYYY-MM-DD'). Defaults to current date if omitted.
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Interface: PaginationConfig
8
8
 
9
- Defined in: [web-searcher/src/types.ts:41](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L41)
9
+ Defined in: [web-searcher/src/types.ts:41](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L41)
10
10
 
11
11
  Configuration for pagination strategies.
12
12
  Defines how the searcher should navigate to the next page of results.
@@ -17,7 +17,7 @@ Defines how the searcher should navigate to the next page of results.
17
17
 
18
18
  > `optional` **increment**: `number`
19
19
 
20
- Defined in: [web-searcher/src/types.ts:68](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L68)
20
+ Defined in: [web-searcher/src/types.ts:68](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L68)
21
21
 
22
22
  The increment step for each page.
23
23
  - If the parameter represents an item offset (like Google's 'start'), this might be 10.
@@ -35,7 +35,7 @@ The increment step for each page.
35
35
 
36
36
  > `optional` **maxPages**: `number`
37
37
 
38
- Defined in: [web-searcher/src/types.ts:85](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L85)
38
+ Defined in: [web-searcher/src/types.ts:85](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L85)
39
39
 
40
40
  The safety threshold for the maximum number of pages to fetch automatically
41
41
  in a single search call.
@@ -55,7 +55,7 @@ will stop after this many pages to prevent infinite loops or excessive API usage
55
55
 
56
56
  > `optional` **nextButtonSelector**: `string`
57
57
 
58
- Defined in: [web-searcher/src/types.ts:74](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L74)
58
+ Defined in: [web-searcher/src/types.ts:74](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L74)
59
59
 
60
60
  The CSS selector for the "Next" page button.
61
61
  Required if type is 'click-next'.
@@ -66,7 +66,7 @@ Required if type is 'click-next'.
66
66
 
67
67
  > `optional` **paramName**: `string`
68
68
 
69
- Defined in: [web-searcher/src/types.ts:54](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L54)
69
+ Defined in: [web-searcher/src/types.ts:54](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L54)
70
70
 
71
71
  The name of the URL parameter used for pagination.
72
72
  Required if type is 'url-param'.
@@ -83,7 +83,7 @@ Required if type is 'url-param'.
83
83
 
84
84
  > `optional` **startValue**: `number`
85
85
 
86
- Defined in: [web-searcher/src/types.ts:60](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L60)
86
+ Defined in: [web-searcher/src/types.ts:60](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L60)
87
87
 
88
88
  The starting value for the pagination parameter.
89
89
 
@@ -99,7 +99,7 @@ The starting value for the pagination parameter.
99
99
 
100
100
  > **type**: `"url-param"` \| `"click-next"`
101
101
 
102
- Defined in: [web-searcher/src/types.ts:47](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L47)
102
+ Defined in: [web-searcher/src/types.ts:47](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L47)
103
103
 
104
104
  The type of pagination mechanism:
105
105
  - 'url-param': Pagination is handled by modifying URL parameters (e.g., `?page=2` or `?start=10`).
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Interface: SearchContext
8
8
 
9
- Defined in: [web-searcher/src/types.ts:91](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L91)
9
+ Defined in: [web-searcher/src/types.ts:91](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L91)
10
10
 
11
11
  Context object passed to the transform function.
12
12
 
@@ -16,7 +16,7 @@ Context object passed to the transform function.
16
16
 
17
17
  > `optional` **limit**: `number`
18
18
 
19
- Defined in: [web-searcher/src/types.ts:99](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L99)
19
+ Defined in: [web-searcher/src/types.ts:99](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L99)
20
20
 
21
21
  The requested limit of results.
22
22
 
@@ -26,7 +26,7 @@ The requested limit of results.
26
26
 
27
27
  > **page**: `number`
28
28
 
29
- Defined in: [web-searcher/src/types.ts:96](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L96)
29
+ Defined in: [web-searcher/src/types.ts:96](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L96)
30
30
 
31
31
  The current page index (0-based).
32
32
 
@@ -36,6 +36,6 @@ The current page index (0-based).
36
36
 
37
37
  > **query**: `string`
38
38
 
39
- Defined in: [web-searcher/src/types.ts:93](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L93)
39
+ Defined in: [web-searcher/src/types.ts:93](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L93)
40
40
 
41
41
  The original search query.
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Interface: SearchOptions
8
8
 
9
- Defined in: [web-searcher/src/types.ts:120](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L120)
9
+ Defined in: [web-searcher/src/types.ts:120](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L120)
10
10
 
11
11
  Options provided when executing a search.
12
12
 
@@ -22,7 +22,7 @@ Any other custom variables to be injected into the template.
22
22
 
23
23
  > `optional` **category**: [`SearchCategory`](../type-aliases/SearchCategory.md)
24
24
 
25
- Defined in: [web-searcher/src/types.ts:144](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L144)
25
+ Defined in: [web-searcher/src/types.ts:144](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L144)
26
26
 
27
27
  The category of results to return.
28
28
  Default: 'all' (web search)
@@ -33,7 +33,7 @@ Default: 'all' (web search)
33
33
 
34
34
  > `optional` **language**: `string`
35
35
 
36
- Defined in: [web-searcher/src/types.ts:154](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L154)
36
+ Defined in: [web-searcher/src/types.ts:154](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L154)
37
37
 
38
38
  Language code (ISO 639-1) for the interface or results (e.g., 'en', 'zh-CN').
39
39
 
@@ -43,7 +43,7 @@ Language code (ISO 639-1) for the interface or results (e.g., 'en', 'zh-CN').
43
43
 
44
44
  > `optional` **limit**: `number`
45
45
 
46
- Defined in: [web-searcher/src/types.ts:122](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L122)
46
+ Defined in: [web-searcher/src/types.ts:122](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L122)
47
47
 
48
48
  The maximum number of results to retrieve.
49
49
 
@@ -53,7 +53,7 @@ The maximum number of results to retrieve.
53
53
 
54
54
  > `optional` **maxPages**: `number`
55
55
 
56
- Defined in: [web-searcher/src/types.ts:132](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L132)
56
+ Defined in: [web-searcher/src/types.ts:132](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L132)
57
57
 
58
58
  The maximum number of pages (fetch cycles) allowed to reach the requested `limit`.
59
59
 
@@ -68,7 +68,7 @@ If not provided, it defaults to the value in `PaginationConfig` or 10.
68
68
 
69
69
  > `optional` **region**: `string`
70
70
 
71
- Defined in: [web-searcher/src/types.ts:149](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L149)
71
+ Defined in: [web-searcher/src/types.ts:149](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L149)
72
72
 
73
73
  Region code (ISO 3166-1 alpha-2) to bias results (e.g., 'US', 'CN', 'JP').
74
74
 
@@ -78,7 +78,7 @@ Region code (ISO 3166-1 alpha-2) to bias results (e.g., 'US', 'CN', 'JP').
78
78
 
79
79
  > `optional` **safeSearch**: [`SafeSearchLevel`](../type-aliases/SafeSearchLevel.md)
80
80
 
81
- Defined in: [web-searcher/src/types.ts:160](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L160)
81
+ Defined in: [web-searcher/src/types.ts:160](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L160)
82
82
 
83
83
  Safe search filtering level.
84
84
  Default: engine dependent (usually 'moderate' or 'strict' by default).
@@ -89,7 +89,7 @@ Default: engine dependent (usually 'moderate' or 'strict' by default).
89
89
 
90
90
  > `optional` **timeRange**: [`SearchTimeRange`](../type-aliases/SearchTimeRange.md)
91
91
 
92
- Defined in: [web-searcher/src/types.ts:138](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L138)
92
+ Defined in: [web-searcher/src/types.ts:138](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L138)
93
93
 
94
94
  Date range for the search results.
95
95
  Default: 'all'
@@ -100,7 +100,7 @@ Default: 'all'
100
100
 
101
101
  > `optional` **transform**: (`results`, `context`) => [`StandardSearchResult`](StandardSearchResult.md)[] \| `Promise`\<[`StandardSearchResult`](StandardSearchResult.md)[]\>
102
102
 
103
- Defined in: [web-searcher/src/types.ts:166](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L166)
103
+ Defined in: [web-searcher/src/types.ts:166](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L166)
104
104
 
105
105
  A custom transform function to filter or modify results at runtime.
106
106
  This runs AFTER the engine-level transform.
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Interface: StandardSearchResult
8
8
 
9
- Defined in: [web-searcher/src/types.ts:5](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L5)
9
+ Defined in: [web-searcher/src/types.ts:5](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L5)
10
10
 
11
11
  Interface representing a standardized search result item.
12
12
  This ensures consistency across different search engines.
@@ -23,7 +23,7 @@ Allows for engine-specific extra fields (e.g., siteIcon, category).
23
23
 
24
24
  > `optional` **author**: `string`
25
25
 
26
- Defined in: [web-searcher/src/types.ts:22](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L22)
26
+ Defined in: [web-searcher/src/types.ts:22](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L22)
27
27
 
28
28
  The author or source name of the result.
29
29
 
@@ -33,7 +33,7 @@ The author or source name of the result.
33
33
 
34
34
  > `optional` **date**: `string` \| `Date`
35
35
 
36
- Defined in: [web-searcher/src/types.ts:19](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L19)
36
+ Defined in: [web-searcher/src/types.ts:19](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L19)
37
37
 
38
38
  The date the result was published or last updated.
39
39
 
@@ -43,7 +43,7 @@ The date the result was published or last updated.
43
43
 
44
44
  > `optional` **favicon**: `string`
45
45
 
46
- Defined in: [web-searcher/src/types.ts:25](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L25)
46
+ Defined in: [web-searcher/src/types.ts:25](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L25)
47
47
 
48
48
  The favicon URL of the source website.
49
49
 
@@ -53,7 +53,7 @@ The favicon URL of the source website.
53
53
 
54
54
  > `optional` **image**: `string`
55
55
 
56
- Defined in: [web-searcher/src/types.ts:16](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L16)
56
+ Defined in: [web-searcher/src/types.ts:16](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L16)
57
57
 
58
58
  An optional image URL associated with the result.
59
59
 
@@ -63,7 +63,7 @@ An optional image URL associated with the result.
63
63
 
64
64
  > `optional` **rank**: `number`
65
65
 
66
- Defined in: [web-searcher/src/types.ts:28](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L28)
66
+ Defined in: [web-searcher/src/types.ts:28](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L28)
67
67
 
68
68
  The rank or position of the result (usually 1-indexed).
69
69
 
@@ -73,7 +73,7 @@ The rank or position of the result (usually 1-indexed).
73
73
 
74
74
  > `optional` **snippet**: `string`
75
75
 
76
- Defined in: [web-searcher/src/types.ts:13](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L13)
76
+ Defined in: [web-searcher/src/types.ts:13](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L13)
77
77
 
78
78
  A brief snippet or description of the result.
79
79
 
@@ -83,7 +83,7 @@ A brief snippet or description of the result.
83
83
 
84
84
  > `optional` **source**: `string`
85
85
 
86
- Defined in: [web-searcher/src/types.ts:31](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L31)
86
+ Defined in: [web-searcher/src/types.ts:31](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L31)
87
87
 
88
88
  The source website name (e.g., 'GitHub', 'StackOverflow').
89
89
 
@@ -93,7 +93,7 @@ The source website name (e.g., 'GitHub', 'StackOverflow').
93
93
 
94
94
  > **title**: `string`
95
95
 
96
- Defined in: [web-searcher/src/types.ts:7](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L7)
96
+ Defined in: [web-searcher/src/types.ts:7](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L7)
97
97
 
98
98
  The title of the search result.
99
99
 
@@ -103,6 +103,6 @@ The title of the search result.
103
103
 
104
104
  > **url**: `string`
105
105
 
106
- Defined in: [web-searcher/src/types.ts:10](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L10)
106
+ Defined in: [web-searcher/src/types.ts:10](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L10)
107
107
 
108
108
  The URL of the search result.
@@ -8,4 +8,4 @@
8
8
 
9
9
  > **SafeSearchLevel** = `"off"` \| `"moderate"` \| `"strict"`
10
10
 
11
- Defined in: [web-searcher/src/types.ts:115](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L115)
11
+ Defined in: [web-searcher/src/types.ts:115](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L115)
@@ -8,4 +8,4 @@
8
8
 
9
9
  > **SearchCategory** = `"all"` \| `"images"` \| `"videos"` \| `"news"`
10
10
 
11
- Defined in: [web-searcher/src/types.ts:113](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L113)
11
+ Defined in: [web-searcher/src/types.ts:113](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L113)
@@ -8,4 +8,4 @@
8
8
 
9
9
  > **SearchTimeRange** = [`SearchTimeRangePreset`](SearchTimeRangePreset.md) \| [`CustomTimeRange`](../interfaces/CustomTimeRange.md)
10
10
 
11
- Defined in: [web-searcher/src/types.ts:111](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L111)
11
+ Defined in: [web-searcher/src/types.ts:111](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L111)
@@ -6,6 +6,6 @@
6
6
 
7
7
  # Type Alias: SearchTimeRangePreset
8
8
 
9
- > **SearchTimeRangePreset** = `"all"` \| `"day"` \| `"week"` \| `"month"` \| `"year"`
9
+ > **SearchTimeRangePreset** = `"all"` \| `"hour"` \| `"day"` \| `"week"` \| `"month"` \| `"year"`
10
10
 
11
- Defined in: [web-searcher/src/types.ts:102](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/types.ts#L102)
11
+ Defined in: [web-searcher/src/types.ts:102](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/types.ts#L102)
@@ -8,7 +8,7 @@
8
8
 
9
9
  > **SearcherConstructor** = (`options?`) => [`WebSearcher`](../classes/WebSearcher.md)
10
10
 
11
- Defined in: [web-searcher/src/searcher.ts:10](https://github.com/isdk/web-searcher.js/blob/e17f1bcb40984e389c2901da9e3b4886a969899a/src/searcher.ts#L10)
11
+ Defined in: [web-searcher/src/searcher.ts:10](https://github.com/isdk/web-searcher.js/blob/7bcd8cca4a3a7fc201a5cf3e3b4283f267eadcea/src/searcher.ts#L10)
12
12
 
13
13
  Constructor definition for Searcher subclasses.
14
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isdk/web-searcher",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "A high-level framework for building search engine scrapers, supporting multi-page navigation, session persistence, and result standardization.",
5
5
  "license": "MIT",
6
6
  "author": "Riceball LEE <snowyu.lee@gmail.com>",