@isdk/web-fetcher 0.3.0 → 0.3.1
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.action.cn.md +53 -312
- package/README.action.extract.cn.md +263 -0
- package/README.action.extract.md +263 -0
- package/README.action.md +53 -311
- package/README.cn.md +10 -2
- package/README.engine.cn.md +22 -1
- package/README.engine.md +22 -1
- package/README.md +8 -1
- package/dist/index.d.mts +147 -1
- package/dist/index.d.ts +147 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/docs/README.md +8 -1
- package/docs/_media/README.action.md +53 -311
- package/docs/_media/README.cn.md +10 -2
- package/docs/_media/README.engine.md +22 -1
- package/docs/classes/CheerioFetchEngine.md +236 -88
- package/docs/classes/ClickAction.md +23 -23
- package/docs/classes/EvaluateAction.md +23 -23
- package/docs/classes/ExtractAction.md +23 -23
- package/docs/classes/FetchAction.md +27 -23
- package/docs/classes/FetchEngine.md +218 -86
- package/docs/classes/FetchSession.md +13 -13
- package/docs/classes/FillAction.md +23 -23
- package/docs/classes/GetContentAction.md +23 -23
- package/docs/classes/GotoAction.md +23 -23
- package/docs/classes/KeyboardPressAction.md +533 -0
- package/docs/classes/KeyboardTypeAction.md +533 -0
- package/docs/classes/MouseClickAction.md +533 -0
- package/docs/classes/MouseMoveAction.md +533 -0
- package/docs/classes/PauseAction.md +23 -23
- package/docs/classes/PlaywrightFetchEngine.md +337 -87
- package/docs/classes/SubmitAction.md +23 -23
- package/docs/classes/TrimAction.md +23 -23
- package/docs/classes/WaitForAction.md +23 -23
- package/docs/classes/WebFetcher.md +5 -5
- package/docs/enumerations/FetchActionResultStatus.md +4 -4
- package/docs/functions/fetchWeb.md +2 -2
- package/docs/globals.md +8 -0
- package/docs/interfaces/BaseFetchActionProperties.md +12 -12
- package/docs/interfaces/BaseFetchCollectorActionProperties.md +16 -16
- package/docs/interfaces/BaseFetcherProperties.md +31 -27
- package/docs/interfaces/Cookie.md +14 -14
- package/docs/interfaces/DispatchedEngineAction.md +4 -4
- package/docs/interfaces/EvaluateActionOptions.md +3 -3
- package/docs/interfaces/ExtractActionProperties.md +12 -12
- package/docs/interfaces/FetchActionInContext.md +15 -15
- package/docs/interfaces/FetchActionProperties.md +13 -13
- package/docs/interfaces/FetchActionResult.md +6 -6
- package/docs/interfaces/FetchContext.md +41 -37
- package/docs/interfaces/FetchEngineContext.md +36 -32
- package/docs/interfaces/FetchMetadata.md +5 -5
- package/docs/interfaces/FetchResponse.md +14 -14
- package/docs/interfaces/FetchReturnTypeRegistry.md +7 -7
- package/docs/interfaces/FetchSite.md +34 -30
- package/docs/interfaces/FetcherOptions.md +33 -29
- package/docs/interfaces/GotoActionOptions.md +14 -6
- package/docs/interfaces/KeyboardPressParams.md +25 -0
- package/docs/interfaces/KeyboardTypeParams.md +25 -0
- package/docs/interfaces/MouseClickParams.md +49 -0
- package/docs/interfaces/MouseMoveParams.md +41 -0
- package/docs/interfaces/PendingEngineRequest.md +3 -3
- package/docs/interfaces/StorageOptions.md +5 -5
- package/docs/interfaces/SubmitActionOptions.md +2 -2
- package/docs/interfaces/TrimActionOptions.md +3 -3
- package/docs/interfaces/WaitForActionOptions.md +5 -5
- package/docs/type-aliases/BaseFetchActionOptions.md +1 -1
- package/docs/type-aliases/BaseFetchCollectorOptions.md +1 -1
- package/docs/type-aliases/BrowserEngine.md +1 -1
- package/docs/type-aliases/FetchActionCapabilities.md +1 -1
- package/docs/type-aliases/FetchActionCapabilityMode.md +1 -1
- package/docs/type-aliases/FetchActionOptions.md +1 -1
- package/docs/type-aliases/FetchEngineAction.md +2 -2
- package/docs/type-aliases/FetchEngineType.md +1 -1
- package/docs/type-aliases/FetchReturnType.md +1 -1
- package/docs/type-aliases/FetchReturnTypeFor.md +1 -1
- package/docs/type-aliases/OnFetchPauseCallback.md +1 -1
- package/docs/type-aliases/ResourceType.md +1 -1
- package/docs/type-aliases/TrimPreset.md +1 -1
- package/docs/variables/DefaultFetcherProperties.md +1 -1
- package/docs/variables/FetcherOptionKeys.md +1 -1
- package/docs/variables/TRIM_PRESETS.md +1 -1
- package/package.json +10 -10
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Abstract Class: FetchAction
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:99](https://github.com/isdk/web-fetcher.js/blob/
|
|
9
|
+
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:99](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L99)
|
|
10
10
|
|
|
11
11
|
## Extended by
|
|
12
12
|
|
|
@@ -20,6 +20,10 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:99](https://github.
|
|
|
20
20
|
- [`PauseAction`](PauseAction.md)
|
|
21
21
|
- [`TrimAction`](TrimAction.md)
|
|
22
22
|
- [`EvaluateAction`](EvaluateAction.md)
|
|
23
|
+
- [`MouseMoveAction`](MouseMoveAction.md)
|
|
24
|
+
- [`MouseClickAction`](MouseClickAction.md)
|
|
25
|
+
- [`KeyboardTypeAction`](KeyboardTypeAction.md)
|
|
26
|
+
- [`KeyboardPressAction`](KeyboardPressAction.md)
|
|
23
27
|
|
|
24
28
|
## Constructors
|
|
25
29
|
|
|
@@ -37,7 +41,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:99](https://github.
|
|
|
37
41
|
|
|
38
42
|
> `static` **capabilities**: [`FetchActionCapabilities`](../type-aliases/FetchActionCapabilities.md)
|
|
39
43
|
|
|
40
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:141](https://github.com/isdk/web-fetcher.js/blob/
|
|
44
|
+
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:141](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L141)
|
|
41
45
|
|
|
42
46
|
***
|
|
43
47
|
|
|
@@ -45,7 +49,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:141](https://github
|
|
|
45
49
|
|
|
46
50
|
> `static` **id**: `string`
|
|
47
51
|
|
|
48
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:139](https://github.com/isdk/web-fetcher.js/blob/
|
|
52
|
+
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:139](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L139)
|
|
49
53
|
|
|
50
54
|
***
|
|
51
55
|
|
|
@@ -53,7 +57,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:139](https://github
|
|
|
53
57
|
|
|
54
58
|
> `static` **returnType**: [`FetchReturnType`](../type-aliases/FetchReturnType.md) = `'any'`
|
|
55
59
|
|
|
56
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:140](https://github.com/isdk/web-fetcher.js/blob/
|
|
60
|
+
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:140](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L140)
|
|
57
61
|
|
|
58
62
|
## Accessors
|
|
59
63
|
|
|
@@ -63,7 +67,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:140](https://github
|
|
|
63
67
|
|
|
64
68
|
> **get** **capabilities**(): [`FetchActionCapabilities`](../type-aliases/FetchActionCapabilities.md)
|
|
65
69
|
|
|
66
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:163](https://github.com/isdk/web-fetcher.js/blob/
|
|
70
|
+
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:163](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L163)
|
|
67
71
|
|
|
68
72
|
##### Returns
|
|
69
73
|
|
|
@@ -77,7 +81,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:163](https://github
|
|
|
77
81
|
|
|
78
82
|
> **get** **id**(): `string`
|
|
79
83
|
|
|
80
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:155](https://github.com/isdk/web-fetcher.js/blob/
|
|
84
|
+
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:155](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L155)
|
|
81
85
|
|
|
82
86
|
##### Returns
|
|
83
87
|
|
|
@@ -91,7 +95,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:155](https://github
|
|
|
91
95
|
|
|
92
96
|
> **get** **returnType**(): [`FetchReturnType`](../type-aliases/FetchReturnType.md)
|
|
93
97
|
|
|
94
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:159](https://github.com/isdk/web-fetcher.js/blob/
|
|
98
|
+
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:159](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L159)
|
|
95
99
|
|
|
96
100
|
##### Returns
|
|
97
101
|
|
|
@@ -103,7 +107,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:159](https://github
|
|
|
103
107
|
|
|
104
108
|
> **afterExec**(`context`, `options?`, `result?`, `scope?`): `Promise`\<`void`\>
|
|
105
109
|
|
|
106
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:391](https://github.com/isdk/web-fetcher.js/blob/
|
|
110
|
+
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:391](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L391)
|
|
107
111
|
|
|
108
112
|
Action 结束生命周期
|
|
109
113
|
负责:调用钩子、赋值lastResult, 触发事件、清理 stack、恢复 currentAction
|
|
@@ -142,7 +146,7 @@ Action 结束生命周期
|
|
|
142
146
|
|
|
143
147
|
> **beforeExec**(`context`, `options?`): `Promise`\<\{ `collectors`: `CollectorsRuntime` \| `undefined`; `entry`: [`FetchActionInContext`](../interfaces/FetchActionInContext.md); \}\>
|
|
144
148
|
|
|
145
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:347](https://github.com/isdk/web-fetcher.js/blob/
|
|
149
|
+
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:347](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L347)
|
|
146
150
|
|
|
147
151
|
Action 开始生命周期
|
|
148
152
|
负责:初始化 stack、设置 currentAction、触发事件、调用钩子
|
|
@@ -167,7 +171,7 @@ Action 开始生命周期
|
|
|
167
171
|
|
|
168
172
|
> `protected` **delegateToEngine**(`context`, `method`, ...`args`): `Promise`\<`any`\>
|
|
169
173
|
|
|
170
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:184](https://github.com/isdk/web-fetcher.js/blob/
|
|
174
|
+
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:184](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L184)
|
|
171
175
|
|
|
172
176
|
#### Parameters
|
|
173
177
|
|
|
@@ -193,7 +197,7 @@ keyof [`FetchEngine`](FetchEngine.md)\<`any`, `any`, `any`\>
|
|
|
193
197
|
|
|
194
198
|
> **execute**\<`R`\>(`context`, `options?`): `Promise`\<[`FetchActionResult`](../interfaces/FetchActionResult.md)\<`R`\>\>
|
|
195
199
|
|
|
196
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:
|
|
200
|
+
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:461](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L461)
|
|
197
201
|
|
|
198
202
|
#### Type Parameters
|
|
199
203
|
|
|
@@ -221,7 +225,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:448](https://github
|
|
|
221
225
|
|
|
222
226
|
> **getCapability**(`mode?`): [`FetchActionCapabilityMode`](../type-aliases/FetchActionCapabilityMode.md)
|
|
223
227
|
|
|
224
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:150](https://github.com/isdk/web-fetcher.js/blob/
|
|
228
|
+
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:150](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L150)
|
|
225
229
|
|
|
226
230
|
#### Parameters
|
|
227
231
|
|
|
@@ -239,7 +243,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:150](https://github
|
|
|
239
243
|
|
|
240
244
|
> `protected` **installCollectors**(`context`, `options?`): `CollectorsRuntime` \| `undefined`
|
|
241
245
|
|
|
242
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:201](https://github.com/isdk/web-fetcher.js/blob/
|
|
246
|
+
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:201](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L201)
|
|
243
247
|
|
|
244
248
|
#### Parameters
|
|
245
249
|
|
|
@@ -261,7 +265,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:201](https://github
|
|
|
261
265
|
|
|
262
266
|
> `protected` `optional` **onAfterExec**(`context`, `options?`): `void` \| `Promise`\<`void`\>
|
|
263
267
|
|
|
264
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:172](https://github.com/isdk/web-fetcher.js/blob/
|
|
268
|
+
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:172](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L172)
|
|
265
269
|
|
|
266
270
|
#### Parameters
|
|
267
271
|
|
|
@@ -283,7 +287,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:172](https://github
|
|
|
283
287
|
|
|
284
288
|
> `protected` `optional` **onBeforeExec**(`context`, `options?`): `void` \| `Promise`\<`void`\>
|
|
285
289
|
|
|
286
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:168](https://github.com/isdk/web-fetcher.js/blob/
|
|
290
|
+
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:168](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L168)
|
|
287
291
|
|
|
288
292
|
#### Parameters
|
|
289
293
|
|
|
@@ -305,7 +309,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:168](https://github
|
|
|
305
309
|
|
|
306
310
|
> `abstract` **onExecute**(`context`, `options?`, `eventPayload?`): `any`
|
|
307
311
|
|
|
308
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:178](https://github.com/isdk/web-fetcher.js/blob/
|
|
312
|
+
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:178](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L178)
|
|
309
313
|
|
|
310
314
|
#### Parameters
|
|
311
315
|
|
|
@@ -333,7 +337,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:178](https://github
|
|
|
333
337
|
|
|
334
338
|
> `static` **create**(`id`): `FetchAction` \| `undefined`
|
|
335
339
|
|
|
336
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:113](https://github.com/isdk/web-fetcher.js/blob/
|
|
340
|
+
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:113](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L113)
|
|
337
341
|
|
|
338
342
|
##### Parameters
|
|
339
343
|
|
|
@@ -349,7 +353,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:113](https://github
|
|
|
349
353
|
|
|
350
354
|
> `static` **create**(`id`): `FetchAction` \| `undefined`
|
|
351
355
|
|
|
352
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:114](https://github.com/isdk/web-fetcher.js/blob/
|
|
356
|
+
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:114](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L114)
|
|
353
357
|
|
|
354
358
|
##### Parameters
|
|
355
359
|
|
|
@@ -367,7 +371,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:114](https://github
|
|
|
367
371
|
|
|
368
372
|
> `static` **get**(`id`): *typeof* `FetchAction` \| `undefined`
|
|
369
373
|
|
|
370
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:109](https://github.com/isdk/web-fetcher.js/blob/
|
|
374
|
+
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:109](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L109)
|
|
371
375
|
|
|
372
376
|
#### Parameters
|
|
373
377
|
|
|
@@ -385,7 +389,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:109](https://github
|
|
|
385
389
|
|
|
386
390
|
> `static` **getCapability**(`mode?`): [`FetchActionCapabilityMode`](../type-aliases/FetchActionCapabilityMode.md)
|
|
387
391
|
|
|
388
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:146](https://github.com/isdk/web-fetcher.js/blob/
|
|
392
|
+
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:146](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L146)
|
|
389
393
|
|
|
390
394
|
#### Parameters
|
|
391
395
|
|
|
@@ -403,7 +407,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:146](https://github
|
|
|
403
407
|
|
|
404
408
|
> `static` **has**(`name`): `boolean`
|
|
405
409
|
|
|
406
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:130](https://github.com/isdk/web-fetcher.js/blob/
|
|
410
|
+
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:130](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L130)
|
|
407
411
|
|
|
408
412
|
#### Parameters
|
|
409
413
|
|
|
@@ -421,7 +425,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:130](https://github
|
|
|
421
425
|
|
|
422
426
|
> `static` **list**(): `string`[]
|
|
423
427
|
|
|
424
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:134](https://github.com/isdk/web-fetcher.js/blob/
|
|
428
|
+
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:134](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L134)
|
|
425
429
|
|
|
426
430
|
#### Returns
|
|
427
431
|
|
|
@@ -433,7 +437,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:134](https://github
|
|
|
433
437
|
|
|
434
438
|
> `static` **register**(`actionClass`): `void`
|
|
435
439
|
|
|
436
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:103](https://github.com/isdk/web-fetcher.js/blob/
|
|
440
|
+
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:103](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L103)
|
|
437
441
|
|
|
438
442
|
#### Parameters
|
|
439
443
|
|