@isdk/web-searcher 0.1.4 → 0.1.6
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 +196 -7
- package/README.md +196 -7
- package/dist/index.d.mts +234 -11
- package/dist/index.d.ts +234 -11
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/docs/README.md +196 -7
- package/docs/classes/GoogleSearcher.md +289 -60
- package/docs/classes/WebSearcher.md +264 -61
- package/docs/functions/extractDate.md +42 -0
- package/docs/functions/extractMetadataFrom.md +40 -0
- package/docs/functions/fetchHeaders.md +34 -0
- package/docs/functions/fetchPartial.md +41 -0
- package/docs/functions/normalizeDate.md +29 -0
- package/docs/functions/parseHeaders.md +28 -0
- package/docs/functions/parseHtml.md +31 -0
- package/docs/functions/testUrlsByLatency.md +42 -0
- package/docs/globals.md +18 -0
- package/docs/interfaces/CustomTimeRange.md +3 -3
- package/docs/interfaces/ExtractOptions.md +54 -0
- package/docs/interfaces/FetchExtractorOptions.md +35 -0
- package/docs/interfaces/FetcherOptions.md +436 -0
- package/docs/interfaces/HtmlData.md +53 -0
- package/docs/interfaces/MetadataResult.md +27 -0
- package/docs/interfaces/PaginationConfig.md +9 -9
- package/docs/interfaces/SearchContext.md +30 -4
- package/docs/interfaces/SearchOptions.md +77 -11
- package/docs/interfaces/StandardSearchResult.md +10 -10
- package/docs/interfaces/VerifiedUrl.md +25 -0
- package/docs/type-aliases/MetadataType.md +13 -0
- package/docs/type-aliases/SafeSearchLevel.md +1 -1
- package/docs/type-aliases/SearchCategory.md +2 -2
- package/docs/type-aliases/SearchTimeRange.md +1 -1
- package/docs/type-aliases/SearchTimeRangePreset.md +1 -1
- package/docs/type-aliases/SearcherConstructor.md +2 -2
- package/package.json +3 -2
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
[**@isdk/web-searcher**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/web-searcher](../globals.md) / FetcherOptions
|
|
6
|
+
|
|
7
|
+
# Interface: FetcherOptions
|
|
8
|
+
|
|
9
|
+
Defined in: web-fetcher/dist/index.d.ts:1109
|
|
10
|
+
|
|
11
|
+
## Extends
|
|
12
|
+
|
|
13
|
+
- `BaseFetcherProperties`
|
|
14
|
+
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
### actions?
|
|
18
|
+
|
|
19
|
+
> `optional` **actions**: `_RequireAtLeastOne`\<`FetchActionProperties`, `"name"` \| `"id"` \| `"action"`\>[]
|
|
20
|
+
|
|
21
|
+
Defined in: web-fetcher/dist/index.d.ts:1110
|
|
22
|
+
|
|
23
|
+
***
|
|
24
|
+
|
|
25
|
+
### antibot?
|
|
26
|
+
|
|
27
|
+
> `optional` **antibot**: `boolean`
|
|
28
|
+
|
|
29
|
+
Defined in: web-fetcher/dist/index.d.ts:1049
|
|
30
|
+
|
|
31
|
+
#### Inherited from
|
|
32
|
+
|
|
33
|
+
`BaseFetcherProperties.antibot`
|
|
34
|
+
|
|
35
|
+
***
|
|
36
|
+
|
|
37
|
+
### blockResources?
|
|
38
|
+
|
|
39
|
+
> `optional` **blockResources**: `string`[]
|
|
40
|
+
|
|
41
|
+
Defined in: web-fetcher/dist/index.d.ts:1062
|
|
42
|
+
|
|
43
|
+
#### Inherited from
|
|
44
|
+
|
|
45
|
+
`BaseFetcherProperties.blockResources`
|
|
46
|
+
|
|
47
|
+
***
|
|
48
|
+
|
|
49
|
+
### browser?
|
|
50
|
+
|
|
51
|
+
> `optional` **browser**: `object`
|
|
52
|
+
|
|
53
|
+
Defined in: web-fetcher/dist/index.d.ts:1072
|
|
54
|
+
|
|
55
|
+
#### engine?
|
|
56
|
+
|
|
57
|
+
> `optional` **engine**: `BrowserEngine`
|
|
58
|
+
|
|
59
|
+
浏览器引擎,默认为 playwright
|
|
60
|
+
|
|
61
|
+
- `playwright`: 使用 Playwright 引擎
|
|
62
|
+
- `puppeteer`: 使用 Puppeteer 引擎
|
|
63
|
+
|
|
64
|
+
#### headless?
|
|
65
|
+
|
|
66
|
+
> `optional` **headless**: `boolean`
|
|
67
|
+
|
|
68
|
+
#### launchOptions?
|
|
69
|
+
|
|
70
|
+
> `optional` **launchOptions**: `Record`\<`string`, `any`\>
|
|
71
|
+
|
|
72
|
+
#### waitUntil?
|
|
73
|
+
|
|
74
|
+
> `optional` **waitUntil**: `"load"` \| `"domcontentloaded"` \| `"networkidle"` \| `"commit"`
|
|
75
|
+
|
|
76
|
+
#### Inherited from
|
|
77
|
+
|
|
78
|
+
`BaseFetcherProperties.browser`
|
|
79
|
+
|
|
80
|
+
***
|
|
81
|
+
|
|
82
|
+
### cache?
|
|
83
|
+
|
|
84
|
+
> `optional` **cache**: `FetchCacheOptions`
|
|
85
|
+
|
|
86
|
+
Defined in: web-fetcher/dist/index.d.ts:1070
|
|
87
|
+
|
|
88
|
+
Cache configuration for persistent HTTP caching.
|
|
89
|
+
|
|
90
|
+
#### Inherited from
|
|
91
|
+
|
|
92
|
+
`BaseFetcherProperties.cache`
|
|
93
|
+
|
|
94
|
+
***
|
|
95
|
+
|
|
96
|
+
### cookies?
|
|
97
|
+
|
|
98
|
+
> `optional` **cookies**: `Cookie`[]
|
|
99
|
+
|
|
100
|
+
Defined in: web-fetcher/dist/index.d.ts:1052
|
|
101
|
+
|
|
102
|
+
#### Inherited from
|
|
103
|
+
|
|
104
|
+
`BaseFetcherProperties.cookies`
|
|
105
|
+
|
|
106
|
+
***
|
|
107
|
+
|
|
108
|
+
### debug?
|
|
109
|
+
|
|
110
|
+
> `optional` **debug**: `string` \| `boolean` \| `string`[]
|
|
111
|
+
|
|
112
|
+
Defined in: web-fetcher/dist/index.d.ts:1050
|
|
113
|
+
|
|
114
|
+
#### Inherited from
|
|
115
|
+
|
|
116
|
+
`BaseFetcherProperties.debug`
|
|
117
|
+
|
|
118
|
+
***
|
|
119
|
+
|
|
120
|
+
### delayBetweenRequestsMs?
|
|
121
|
+
|
|
122
|
+
> `optional` **delayBetweenRequestsMs**: `number`
|
|
123
|
+
|
|
124
|
+
Defined in: web-fetcher/dist/index.d.ts:1092
|
|
125
|
+
|
|
126
|
+
#### Inherited from
|
|
127
|
+
|
|
128
|
+
`BaseFetcherProperties.delayBetweenRequestsMs`
|
|
129
|
+
|
|
130
|
+
***
|
|
131
|
+
|
|
132
|
+
### enableSmart?
|
|
133
|
+
|
|
134
|
+
> `optional` **enableSmart**: `boolean`
|
|
135
|
+
|
|
136
|
+
Defined in: web-fetcher/dist/index.d.ts:1044
|
|
137
|
+
|
|
138
|
+
#### Inherited from
|
|
139
|
+
|
|
140
|
+
`BaseFetcherProperties.enableSmart`
|
|
141
|
+
|
|
142
|
+
***
|
|
143
|
+
|
|
144
|
+
### engine?
|
|
145
|
+
|
|
146
|
+
> `optional` **engine**: `string`
|
|
147
|
+
|
|
148
|
+
Defined in: web-fetcher/dist/index.d.ts:1043
|
|
149
|
+
|
|
150
|
+
抓取模式
|
|
151
|
+
|
|
152
|
+
- `http`: 使用 HTTP 进行抓取
|
|
153
|
+
- `browser`: 使用浏览器进行抓取
|
|
154
|
+
- `auto`: auto 会走“智能探测”选择 http 或 browser, 但是如果没有启用 smart,并且在站点注册表中没有,那么则等价为 http.
|
|
155
|
+
|
|
156
|
+
#### Inherited from
|
|
157
|
+
|
|
158
|
+
`BaseFetcherProperties.engine`
|
|
159
|
+
|
|
160
|
+
***
|
|
161
|
+
|
|
162
|
+
### headers?
|
|
163
|
+
|
|
164
|
+
> `optional` **headers**: `Record`\<`string`, `string`\>
|
|
165
|
+
|
|
166
|
+
Defined in: web-fetcher/dist/index.d.ts:1051
|
|
167
|
+
|
|
168
|
+
#### Inherited from
|
|
169
|
+
|
|
170
|
+
`BaseFetcherProperties.headers`
|
|
171
|
+
|
|
172
|
+
***
|
|
173
|
+
|
|
174
|
+
### http?
|
|
175
|
+
|
|
176
|
+
> `optional` **http**: `object`
|
|
177
|
+
|
|
178
|
+
Defined in: web-fetcher/dist/index.d.ts:1084
|
|
179
|
+
|
|
180
|
+
#### body?
|
|
181
|
+
|
|
182
|
+
> `optional` **body**: `any`
|
|
183
|
+
|
|
184
|
+
#### method?
|
|
185
|
+
|
|
186
|
+
> `optional` **method**: `"GET"` \| `"POST"` \| `"PUT"` \| `"PATCH"` \| `"DELETE"`
|
|
187
|
+
|
|
188
|
+
#### Inherited from
|
|
189
|
+
|
|
190
|
+
`BaseFetcherProperties.http`
|
|
191
|
+
|
|
192
|
+
***
|
|
193
|
+
|
|
194
|
+
### ignoreSslErrors?
|
|
195
|
+
|
|
196
|
+
> `optional` **ignoreSslErrors**: `boolean`
|
|
197
|
+
|
|
198
|
+
Defined in: web-fetcher/dist/index.d.ts:1071
|
|
199
|
+
|
|
200
|
+
#### Inherited from
|
|
201
|
+
|
|
202
|
+
`BaseFetcherProperties.ignoreSslErrors`
|
|
203
|
+
|
|
204
|
+
***
|
|
205
|
+
|
|
206
|
+
### maxConcurrency?
|
|
207
|
+
|
|
208
|
+
> `optional` **maxConcurrency**: `number`
|
|
209
|
+
|
|
210
|
+
Defined in: web-fetcher/dist/index.d.ts:1090
|
|
211
|
+
|
|
212
|
+
#### Inherited from
|
|
213
|
+
|
|
214
|
+
`BaseFetcherProperties.maxConcurrency`
|
|
215
|
+
|
|
216
|
+
***
|
|
217
|
+
|
|
218
|
+
### maxRequestsPerMinute?
|
|
219
|
+
|
|
220
|
+
> `optional` **maxRequestsPerMinute**: `number`
|
|
221
|
+
|
|
222
|
+
Defined in: web-fetcher/dist/index.d.ts:1091
|
|
223
|
+
|
|
224
|
+
#### Inherited from
|
|
225
|
+
|
|
226
|
+
`BaseFetcherProperties.maxRequestsPerMinute`
|
|
227
|
+
|
|
228
|
+
***
|
|
229
|
+
|
|
230
|
+
### onPause?
|
|
231
|
+
|
|
232
|
+
> `optional` **onPause**: `OnFetchPauseCallback`
|
|
233
|
+
|
|
234
|
+
Defined in: web-fetcher/dist/index.d.ts:1111
|
|
235
|
+
|
|
236
|
+
***
|
|
237
|
+
|
|
238
|
+
### output?
|
|
239
|
+
|
|
240
|
+
> `optional` **output**: `object`
|
|
241
|
+
|
|
242
|
+
Defined in: web-fetcher/dist/index.d.ts:1057
|
|
243
|
+
|
|
244
|
+
#### cookies?
|
|
245
|
+
|
|
246
|
+
> `optional` **cookies**: `boolean`
|
|
247
|
+
|
|
248
|
+
#### sessionState?
|
|
249
|
+
|
|
250
|
+
> `optional` **sessionState**: `boolean`
|
|
251
|
+
|
|
252
|
+
#### Inherited from
|
|
253
|
+
|
|
254
|
+
`BaseFetcherProperties.output`
|
|
255
|
+
|
|
256
|
+
***
|
|
257
|
+
|
|
258
|
+
### overrideSessionState?
|
|
259
|
+
|
|
260
|
+
> `optional` **overrideSessionState**: `boolean`
|
|
261
|
+
|
|
262
|
+
Defined in: web-fetcher/dist/index.d.ts:1055
|
|
263
|
+
|
|
264
|
+
#### Inherited from
|
|
265
|
+
|
|
266
|
+
`BaseFetcherProperties.overrideSessionState`
|
|
267
|
+
|
|
268
|
+
***
|
|
269
|
+
|
|
270
|
+
### proxy?
|
|
271
|
+
|
|
272
|
+
> `optional` **proxy**: `string` \| `string`[]
|
|
273
|
+
|
|
274
|
+
Defined in: web-fetcher/dist/index.d.ts:1061
|
|
275
|
+
|
|
276
|
+
#### Inherited from
|
|
277
|
+
|
|
278
|
+
`BaseFetcherProperties.proxy`
|
|
279
|
+
|
|
280
|
+
***
|
|
281
|
+
|
|
282
|
+
### requestHandlerTimeoutSecs?
|
|
283
|
+
|
|
284
|
+
> `optional` **requestHandlerTimeoutSecs**: `number`
|
|
285
|
+
|
|
286
|
+
Defined in: web-fetcher/dist/index.d.ts:1089
|
|
287
|
+
|
|
288
|
+
#### Inherited from
|
|
289
|
+
|
|
290
|
+
`BaseFetcherProperties.requestHandlerTimeoutSecs`
|
|
291
|
+
|
|
292
|
+
***
|
|
293
|
+
|
|
294
|
+
### retries?
|
|
295
|
+
|
|
296
|
+
> `optional` **retries**: `number`
|
|
297
|
+
|
|
298
|
+
Defined in: web-fetcher/dist/index.d.ts:1093
|
|
299
|
+
|
|
300
|
+
#### Inherited from
|
|
301
|
+
|
|
302
|
+
`BaseFetcherProperties.retries`
|
|
303
|
+
|
|
304
|
+
***
|
|
305
|
+
|
|
306
|
+
### sessionPoolOptions?
|
|
307
|
+
|
|
308
|
+
> `optional` **sessionPoolOptions**: `SessionPoolOptions`
|
|
309
|
+
|
|
310
|
+
Defined in: web-fetcher/dist/index.d.ts:1054
|
|
311
|
+
|
|
312
|
+
#### Inherited from
|
|
313
|
+
|
|
314
|
+
`BaseFetcherProperties.sessionPoolOptions`
|
|
315
|
+
|
|
316
|
+
***
|
|
317
|
+
|
|
318
|
+
### sessionState?
|
|
319
|
+
|
|
320
|
+
> `optional` **sessionState**: `any`
|
|
321
|
+
|
|
322
|
+
Defined in: web-fetcher/dist/index.d.ts:1053
|
|
323
|
+
|
|
324
|
+
#### Inherited from
|
|
325
|
+
|
|
326
|
+
`BaseFetcherProperties.sessionState`
|
|
327
|
+
|
|
328
|
+
***
|
|
329
|
+
|
|
330
|
+
### sites?
|
|
331
|
+
|
|
332
|
+
> `optional` **sites**: `FetchSite`[]
|
|
333
|
+
|
|
334
|
+
Defined in: web-fetcher/dist/index.d.ts:1094
|
|
335
|
+
|
|
336
|
+
#### Inherited from
|
|
337
|
+
|
|
338
|
+
`BaseFetcherProperties.sites`
|
|
339
|
+
|
|
340
|
+
***
|
|
341
|
+
|
|
342
|
+
### storage?
|
|
343
|
+
|
|
344
|
+
> `optional` **storage**: `StorageOptions`
|
|
345
|
+
|
|
346
|
+
Defined in: web-fetcher/dist/index.d.ts:1066
|
|
347
|
+
|
|
348
|
+
Storage configuration for session isolation and persistence.
|
|
349
|
+
|
|
350
|
+
#### Inherited from
|
|
351
|
+
|
|
352
|
+
`BaseFetcherProperties.storage`
|
|
353
|
+
|
|
354
|
+
***
|
|
355
|
+
|
|
356
|
+
### syncStateOnUpgrade?
|
|
357
|
+
|
|
358
|
+
> `optional` **syncStateOnUpgrade**: `boolean`
|
|
359
|
+
|
|
360
|
+
Defined in: web-fetcher/dist/index.d.ts:1045
|
|
361
|
+
|
|
362
|
+
#### Inherited from
|
|
363
|
+
|
|
364
|
+
`BaseFetcherProperties.syncStateOnUpgrade`
|
|
365
|
+
|
|
366
|
+
***
|
|
367
|
+
|
|
368
|
+
### throwHttpErrors?
|
|
369
|
+
|
|
370
|
+
> `optional` **throwHttpErrors**: `boolean`
|
|
371
|
+
|
|
372
|
+
Defined in: web-fetcher/dist/index.d.ts:1056
|
|
373
|
+
|
|
374
|
+
#### Inherited from
|
|
375
|
+
|
|
376
|
+
`BaseFetcherProperties.throwHttpErrors`
|
|
377
|
+
|
|
378
|
+
***
|
|
379
|
+
|
|
380
|
+
### timeoutMs?
|
|
381
|
+
|
|
382
|
+
> `optional` **timeoutMs**: `number`
|
|
383
|
+
|
|
384
|
+
Defined in: web-fetcher/dist/index.d.ts:1088
|
|
385
|
+
|
|
386
|
+
#### Inherited from
|
|
387
|
+
|
|
388
|
+
`BaseFetcherProperties.timeoutMs`
|
|
389
|
+
|
|
390
|
+
***
|
|
391
|
+
|
|
392
|
+
### upgradeOnJsContent?
|
|
393
|
+
|
|
394
|
+
> `optional` **upgradeOnJsContent**: `boolean`
|
|
395
|
+
|
|
396
|
+
Defined in: web-fetcher/dist/index.d.ts:1046
|
|
397
|
+
|
|
398
|
+
#### Inherited from
|
|
399
|
+
|
|
400
|
+
`BaseFetcherProperties.upgradeOnJsContent`
|
|
401
|
+
|
|
402
|
+
***
|
|
403
|
+
|
|
404
|
+
### upgradeThresholdMs?
|
|
405
|
+
|
|
406
|
+
> `optional` **upgradeThresholdMs**: `number`
|
|
407
|
+
|
|
408
|
+
Defined in: web-fetcher/dist/index.d.ts:1047
|
|
409
|
+
|
|
410
|
+
#### Inherited from
|
|
411
|
+
|
|
412
|
+
`BaseFetcherProperties.upgradeThresholdMs`
|
|
413
|
+
|
|
414
|
+
***
|
|
415
|
+
|
|
416
|
+
### url?
|
|
417
|
+
|
|
418
|
+
> `optional` **url**: `string`
|
|
419
|
+
|
|
420
|
+
Defined in: web-fetcher/dist/index.d.ts:1095
|
|
421
|
+
|
|
422
|
+
#### Inherited from
|
|
423
|
+
|
|
424
|
+
`BaseFetcherProperties.url`
|
|
425
|
+
|
|
426
|
+
***
|
|
427
|
+
|
|
428
|
+
### useSiteRegistry?
|
|
429
|
+
|
|
430
|
+
> `optional` **useSiteRegistry**: `boolean`
|
|
431
|
+
|
|
432
|
+
Defined in: web-fetcher/dist/index.d.ts:1048
|
|
433
|
+
|
|
434
|
+
#### Inherited from
|
|
435
|
+
|
|
436
|
+
`BaseFetcherProperties.useSiteRegistry`
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
[**@isdk/web-searcher**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/web-searcher](../globals.md) / HtmlData
|
|
6
|
+
|
|
7
|
+
# Interface: HtmlData
|
|
8
|
+
|
|
9
|
+
Defined in: [web-searcher/src/utils/extractor/parser.ts:4](https://github.com/isdk/web-searcher.js/blob/0c4757eb75b3b7c5af0231806f11e7b3c3166736/src/utils/extractor/parser.ts#L4)
|
|
10
|
+
|
|
11
|
+
Represents structured data extracted from an HTML document.
|
|
12
|
+
|
|
13
|
+
## Properties
|
|
14
|
+
|
|
15
|
+
### jsonLd
|
|
16
|
+
|
|
17
|
+
> **jsonLd**: `any`[]
|
|
18
|
+
|
|
19
|
+
Defined in: [web-searcher/src/utils/extractor/parser.ts:8](https://github.com/isdk/web-searcher.js/blob/0c4757eb75b3b7c5af0231806f11e7b3c3166736/src/utils/extractor/parser.ts#L8)
|
|
20
|
+
|
|
21
|
+
Array of parsed JSON-LD objects found in the document.
|
|
22
|
+
|
|
23
|
+
***
|
|
24
|
+
|
|
25
|
+
### meta
|
|
26
|
+
|
|
27
|
+
> **meta**: `Record`\<`string`, `string`\>
|
|
28
|
+
|
|
29
|
+
Defined in: [web-searcher/src/utils/extractor/parser.ts:6](https://github.com/isdk/web-searcher.js/blob/0c4757eb75b3b7c5af0231806f11e7b3c3166736/src/utils/extractor/parser.ts#L6)
|
|
30
|
+
|
|
31
|
+
Map of meta tag names/properties to their content. Keys are lowercase.
|
|
32
|
+
|
|
33
|
+
***
|
|
34
|
+
|
|
35
|
+
### time
|
|
36
|
+
|
|
37
|
+
> **time**: `object`[]
|
|
38
|
+
|
|
39
|
+
Defined in: [web-searcher/src/utils/extractor/parser.ts:10](https://github.com/isdk/web-searcher.js/blob/0c4757eb75b3b7c5af0231806f11e7b3c3166736/src/utils/extractor/parser.ts#L10)
|
|
40
|
+
|
|
41
|
+
Array of data from HTML <time> tags.
|
|
42
|
+
|
|
43
|
+
#### datetime
|
|
44
|
+
|
|
45
|
+
> **datetime**: `string` \| `null`
|
|
46
|
+
|
|
47
|
+
The value of the 'datetime' attribute, if present.
|
|
48
|
+
|
|
49
|
+
#### text
|
|
50
|
+
|
|
51
|
+
> **text**: `string`
|
|
52
|
+
|
|
53
|
+
The text content within the <time> tag, with HTML stripped.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[**@isdk/web-searcher**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/web-searcher](../globals.md) / MetadataResult
|
|
6
|
+
|
|
7
|
+
# Interface: MetadataResult
|
|
8
|
+
|
|
9
|
+
Defined in: [web-searcher/src/utils/extractor/extractor.ts:7](https://github.com/isdk/web-searcher.js/blob/0c4757eb75b3b7c5af0231806f11e7b3c3166736/src/utils/extractor/extractor.ts#L7)
|
|
10
|
+
|
|
11
|
+
Result object for generic metadata extraction.
|
|
12
|
+
|
|
13
|
+
## Indexable
|
|
14
|
+
|
|
15
|
+
\[`key`: `string`\]: `any`
|
|
16
|
+
|
|
17
|
+
Placeholders for future metadata fields.
|
|
18
|
+
|
|
19
|
+
## Properties
|
|
20
|
+
|
|
21
|
+
### date?
|
|
22
|
+
|
|
23
|
+
> `optional` **date**: `string` \| `null`
|
|
24
|
+
|
|
25
|
+
Defined in: [web-searcher/src/utils/extractor/extractor.ts:9](https://github.com/isdk/web-searcher.js/blob/0c4757eb75b3b7c5af0231806f11e7b3c3166736/src/utils/extractor/extractor.ts#L9)
|
|
26
|
+
|
|
27
|
+
The extracted and normalized date, if any.
|
|
@@ -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/
|
|
9
|
+
Defined in: [web-searcher/src/types.ts:41](https://github.com/isdk/web-searcher.js/blob/0c4757eb75b3b7c5af0231806f11e7b3c3166736/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/
|
|
20
|
+
Defined in: [web-searcher/src/types.ts:68](https://github.com/isdk/web-searcher.js/blob/0c4757eb75b3b7c5af0231806f11e7b3c3166736/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,12 +35,12 @@ 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/
|
|
38
|
+
Defined in: [web-searcher/src/types.ts:85](https://github.com/isdk/web-searcher.js/blob/0c4757eb75b3b7c5af0231806f11e7b3c3166736/src/types.ts#L85)
|
|
39
39
|
|
|
40
|
-
The safety threshold for the maximum number of pages to fetch automatically
|
|
40
|
+
The safety threshold for the maximum number of pages to fetch automatically
|
|
41
41
|
in a single search call.
|
|
42
42
|
|
|
43
|
-
Even if the requested `limit` of results hasn't been reached, the searcher
|
|
43
|
+
Even if the requested `limit` of results hasn't been reached, the searcher
|
|
44
44
|
will stop after this many pages to prevent infinite loops or excessive API usage.
|
|
45
45
|
|
|
46
46
|
#### Default
|
|
@@ -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/
|
|
58
|
+
Defined in: [web-searcher/src/types.ts:74](https://github.com/isdk/web-searcher.js/blob/0c4757eb75b3b7c5af0231806f11e7b3c3166736/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/
|
|
69
|
+
Defined in: [web-searcher/src/types.ts:54](https://github.com/isdk/web-searcher.js/blob/0c4757eb75b3b7c5af0231806f11e7b3c3166736/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/
|
|
86
|
+
Defined in: [web-searcher/src/types.ts:60](https://github.com/isdk/web-searcher.js/blob/0c4757eb75b3b7c5af0231806f11e7b3c3166736/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/
|
|
102
|
+
Defined in: [web-searcher/src/types.ts:47](https://github.com/isdk/web-searcher.js/blob/0c4757eb75b3b7c5af0231806f11e7b3c3166736/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,17 +6,43 @@
|
|
|
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/
|
|
9
|
+
Defined in: [web-searcher/src/types.ts:91](https://github.com/isdk/web-searcher.js/blob/0c4757eb75b3b7c5af0231806f11e7b3c3166736/src/types.ts#L91)
|
|
10
10
|
|
|
11
11
|
Context object passed to the transform function.
|
|
12
12
|
|
|
13
|
+
## Indexable
|
|
14
|
+
|
|
15
|
+
\[`key`: `string`\]: `any`
|
|
16
|
+
|
|
17
|
+
Allows for custom variables passed via search options.
|
|
18
|
+
|
|
13
19
|
## Properties
|
|
14
20
|
|
|
21
|
+
### baseUrl?
|
|
22
|
+
|
|
23
|
+
> `optional` **baseUrl**: `string`
|
|
24
|
+
|
|
25
|
+
Defined in: [web-searcher/src/types.ts:105](https://github.com/isdk/web-searcher.js/blob/0c4757eb75b3b7c5af0231806f11e7b3c3166736/src/types.ts#L105)
|
|
26
|
+
|
|
27
|
+
The baseUrl used for this specific fetch (if multi-instance is enabled)
|
|
28
|
+
|
|
29
|
+
***
|
|
30
|
+
|
|
31
|
+
### engine?
|
|
32
|
+
|
|
33
|
+
> `optional` **engine**: `string`
|
|
34
|
+
|
|
35
|
+
Defined in: [web-searcher/src/types.ts:108](https://github.com/isdk/web-searcher.js/blob/0c4757eb75b3b7c5af0231806f11e7b3c3166736/src/types.ts#L108)
|
|
36
|
+
|
|
37
|
+
The name of the engine executing the search
|
|
38
|
+
|
|
39
|
+
***
|
|
40
|
+
|
|
15
41
|
### limit?
|
|
16
42
|
|
|
17
43
|
> `optional` **limit**: `number`
|
|
18
44
|
|
|
19
|
-
Defined in: [web-searcher/src/types.ts:99](https://github.com/isdk/web-searcher.js/blob/
|
|
45
|
+
Defined in: [web-searcher/src/types.ts:99](https://github.com/isdk/web-searcher.js/blob/0c4757eb75b3b7c5af0231806f11e7b3c3166736/src/types.ts#L99)
|
|
20
46
|
|
|
21
47
|
The requested limit of results.
|
|
22
48
|
|
|
@@ -26,7 +52,7 @@ The requested limit of results.
|
|
|
26
52
|
|
|
27
53
|
> **page**: `number`
|
|
28
54
|
|
|
29
|
-
Defined in: [web-searcher/src/types.ts:96](https://github.com/isdk/web-searcher.js/blob/
|
|
55
|
+
Defined in: [web-searcher/src/types.ts:96](https://github.com/isdk/web-searcher.js/blob/0c4757eb75b3b7c5af0231806f11e7b3c3166736/src/types.ts#L96)
|
|
30
56
|
|
|
31
57
|
The current page index (0-based).
|
|
32
58
|
|
|
@@ -36,6 +62,6 @@ The current page index (0-based).
|
|
|
36
62
|
|
|
37
63
|
> **query**: `string`
|
|
38
64
|
|
|
39
|
-
Defined in: [web-searcher/src/types.ts:93](https://github.com/isdk/web-searcher.js/blob/
|
|
65
|
+
Defined in: [web-searcher/src/types.ts:93](https://github.com/isdk/web-searcher.js/blob/0c4757eb75b3b7c5af0231806f11e7b3c3166736/src/types.ts#L93)
|
|
40
66
|
|
|
41
67
|
The original search query.
|