@isdk/web-fetcher 0.2.0

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.
Files changed (66) hide show
  1. package/README.action.cn.md +469 -0
  2. package/README.action.md +452 -0
  3. package/README.cn.md +147 -0
  4. package/README.engine.cn.md +262 -0
  5. package/README.engine.md +262 -0
  6. package/README.md +147 -0
  7. package/dist/index.d.mts +1603 -0
  8. package/dist/index.d.ts +1603 -0
  9. package/dist/index.js +1 -0
  10. package/dist/index.mjs +1 -0
  11. package/docs/README.md +151 -0
  12. package/docs/_media/LICENSE-MIT +22 -0
  13. package/docs/_media/README.action.md +452 -0
  14. package/docs/_media/README.cn.md +147 -0
  15. package/docs/_media/README.engine.md +262 -0
  16. package/docs/classes/CheerioFetchEngine.md +1447 -0
  17. package/docs/classes/ClickAction.md +533 -0
  18. package/docs/classes/ExtractAction.md +533 -0
  19. package/docs/classes/FetchAction.md +444 -0
  20. package/docs/classes/FetchEngine.md +1230 -0
  21. package/docs/classes/FetchSession.md +111 -0
  22. package/docs/classes/FillAction.md +533 -0
  23. package/docs/classes/GetContentAction.md +533 -0
  24. package/docs/classes/GotoAction.md +537 -0
  25. package/docs/classes/PauseAction.md +533 -0
  26. package/docs/classes/PlaywrightFetchEngine.md +1437 -0
  27. package/docs/classes/SubmitAction.md +533 -0
  28. package/docs/classes/WaitForAction.md +533 -0
  29. package/docs/classes/WebFetcher.md +85 -0
  30. package/docs/enumerations/FetchActionResultStatus.md +40 -0
  31. package/docs/functions/fetchWeb.md +43 -0
  32. package/docs/globals.md +72 -0
  33. package/docs/interfaces/BaseFetchActionProperties.md +83 -0
  34. package/docs/interfaces/BaseFetchCollectorActionProperties.md +145 -0
  35. package/docs/interfaces/BaseFetcherProperties.md +206 -0
  36. package/docs/interfaces/Cookie.md +142 -0
  37. package/docs/interfaces/DispatchedEngineAction.md +60 -0
  38. package/docs/interfaces/ExtractActionProperties.md +113 -0
  39. package/docs/interfaces/FetchActionInContext.md +149 -0
  40. package/docs/interfaces/FetchActionProperties.md +125 -0
  41. package/docs/interfaces/FetchActionResult.md +55 -0
  42. package/docs/interfaces/FetchContext.md +424 -0
  43. package/docs/interfaces/FetchEngineContext.md +328 -0
  44. package/docs/interfaces/FetchMetadata.md +73 -0
  45. package/docs/interfaces/FetchResponse.md +105 -0
  46. package/docs/interfaces/FetchReturnTypeRegistry.md +57 -0
  47. package/docs/interfaces/FetchSite.md +320 -0
  48. package/docs/interfaces/FetcherOptions.md +300 -0
  49. package/docs/interfaces/GotoActionOptions.md +66 -0
  50. package/docs/interfaces/PendingEngineRequest.md +51 -0
  51. package/docs/interfaces/SubmitActionOptions.md +23 -0
  52. package/docs/interfaces/WaitForActionOptions.md +39 -0
  53. package/docs/type-aliases/BaseFetchActionOptions.md +11 -0
  54. package/docs/type-aliases/BaseFetchCollectorOptions.md +11 -0
  55. package/docs/type-aliases/BrowserEngine.md +11 -0
  56. package/docs/type-aliases/FetchActionCapabilities.md +11 -0
  57. package/docs/type-aliases/FetchActionCapabilityMode.md +11 -0
  58. package/docs/type-aliases/FetchActionOptions.md +11 -0
  59. package/docs/type-aliases/FetchEngineAction.md +18 -0
  60. package/docs/type-aliases/FetchEngineType.md +11 -0
  61. package/docs/type-aliases/FetchReturnType.md +11 -0
  62. package/docs/type-aliases/FetchReturnTypeFor.md +17 -0
  63. package/docs/type-aliases/OnFetchPauseCallback.md +23 -0
  64. package/docs/type-aliases/ResourceType.md +11 -0
  65. package/docs/variables/DefaultFetcherProperties.md +11 -0
  66. package/package.json +90 -0
@@ -0,0 +1,444 @@
1
+ [**@isdk/web-fetcher**](../README.md)
2
+
3
+ ***
4
+
5
+ [@isdk/web-fetcher](../globals.md) / FetchAction
6
+
7
+ # Abstract Class: FetchAction
8
+
9
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:84](https://github.com/isdk/web-fetcher.js/blob/ef3a4e527bf3ca75213d55b02c017b9a30a036fd/src/action/fetch-action.ts#L84)
10
+
11
+ ## Extended by
12
+
13
+ - [`ClickAction`](ClickAction.md)
14
+ - [`FillAction`](FillAction.md)
15
+ - [`GetContentAction`](GetContentAction.md)
16
+ - [`GotoAction`](GotoAction.md)
17
+ - [`SubmitAction`](SubmitAction.md)
18
+ - [`WaitForAction`](WaitForAction.md)
19
+ - [`ExtractAction`](ExtractAction.md)
20
+ - [`PauseAction`](PauseAction.md)
21
+
22
+ ## Constructors
23
+
24
+ ### Constructor
25
+
26
+ > **new FetchAction**(): `FetchAction`
27
+
28
+ #### Returns
29
+
30
+ `FetchAction`
31
+
32
+ ## Properties
33
+
34
+ ### capabilities
35
+
36
+ > `static` **capabilities**: [`FetchActionCapabilities`](../type-aliases/FetchActionCapabilities.md)
37
+
38
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:118](https://github.com/isdk/web-fetcher.js/blob/ef3a4e527bf3ca75213d55b02c017b9a30a036fd/src/action/fetch-action.ts#L118)
39
+
40
+ ***
41
+
42
+ ### id
43
+
44
+ > `static` **id**: `string`
45
+
46
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:116](https://github.com/isdk/web-fetcher.js/blob/ef3a4e527bf3ca75213d55b02c017b9a30a036fd/src/action/fetch-action.ts#L116)
47
+
48
+ ***
49
+
50
+ ### returnType
51
+
52
+ > `static` **returnType**: [`FetchReturnType`](../type-aliases/FetchReturnType.md) = `'any'`
53
+
54
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:117](https://github.com/isdk/web-fetcher.js/blob/ef3a4e527bf3ca75213d55b02c017b9a30a036fd/src/action/fetch-action.ts#L117)
55
+
56
+ ## Accessors
57
+
58
+ ### capabilities
59
+
60
+ #### Get Signature
61
+
62
+ > **get** **capabilities**(): [`FetchActionCapabilities`](../type-aliases/FetchActionCapabilities.md)
63
+
64
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:137](https://github.com/isdk/web-fetcher.js/blob/ef3a4e527bf3ca75213d55b02c017b9a30a036fd/src/action/fetch-action.ts#L137)
65
+
66
+ ##### Returns
67
+
68
+ [`FetchActionCapabilities`](../type-aliases/FetchActionCapabilities.md)
69
+
70
+ ***
71
+
72
+ ### id
73
+
74
+ #### Get Signature
75
+
76
+ > **get** **id**(): `string`
77
+
78
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:129](https://github.com/isdk/web-fetcher.js/blob/ef3a4e527bf3ca75213d55b02c017b9a30a036fd/src/action/fetch-action.ts#L129)
79
+
80
+ ##### Returns
81
+
82
+ `string`
83
+
84
+ ***
85
+
86
+ ### returnType
87
+
88
+ #### Get Signature
89
+
90
+ > **get** **returnType**(): [`FetchReturnType`](../type-aliases/FetchReturnType.md)
91
+
92
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:133](https://github.com/isdk/web-fetcher.js/blob/ef3a4e527bf3ca75213d55b02c017b9a30a036fd/src/action/fetch-action.ts#L133)
93
+
94
+ ##### Returns
95
+
96
+ [`FetchReturnType`](../type-aliases/FetchReturnType.md)
97
+
98
+ ## Methods
99
+
100
+ ### afterExec()
101
+
102
+ > **afterExec**(`context`, `options?`, `result?`, `scope?`): `Promise`\<`void`\>
103
+
104
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:311](https://github.com/isdk/web-fetcher.js/blob/ef3a4e527bf3ca75213d55b02c017b9a30a036fd/src/action/fetch-action.ts#L311)
105
+
106
+ Action 结束生命周期
107
+ 负责:调用钩子、赋值lastResult, 触发事件、清理 stack、恢复 currentAction
108
+
109
+ #### Parameters
110
+
111
+ ##### context
112
+
113
+ [`FetchContext`](../interfaces/FetchContext.md)
114
+
115
+ ##### options?
116
+
117
+ [`BaseFetchCollectorActionProperties`](../interfaces/BaseFetchCollectorActionProperties.md)
118
+
119
+ ##### result?
120
+
121
+ [`FetchActionResult`](../interfaces/FetchActionResult.md)\<[`FetchReturnType`](../type-aliases/FetchReturnType.md)\>
122
+
123
+ ##### scope?
124
+
125
+ ###### collectors?
126
+
127
+ `CollectorsRuntime`
128
+
129
+ ###### entry
130
+
131
+ [`FetchActionInContext`](../interfaces/FetchActionInContext.md)
132
+
133
+ #### Returns
134
+
135
+ `Promise`\<`void`\>
136
+
137
+ ***
138
+
139
+ ### beforeExec()
140
+
141
+ > **beforeExec**(`context`, `options?`): `Promise`\<\{ `collectors`: `undefined` \| `CollectorsRuntime`; `entry`: [`FetchActionInContext`](../interfaces/FetchActionInContext.md); \}\>
142
+
143
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:265](https://github.com/isdk/web-fetcher.js/blob/ef3a4e527bf3ca75213d55b02c017b9a30a036fd/src/action/fetch-action.ts#L265)
144
+
145
+ Action 开始生命周期
146
+ 负责:初始化 stack、设置 currentAction、触发事件、调用钩子
147
+
148
+ #### Parameters
149
+
150
+ ##### context
151
+
152
+ [`FetchContext`](../interfaces/FetchContext.md)
153
+
154
+ ##### options?
155
+
156
+ [`FetchActionProperties`](../interfaces/FetchActionProperties.md)
157
+
158
+ #### Returns
159
+
160
+ `Promise`\<\{ `collectors`: `undefined` \| `CollectorsRuntime`; `entry`: [`FetchActionInContext`](../interfaces/FetchActionInContext.md); \}\>
161
+
162
+ ***
163
+
164
+ ### delegateToEngine()
165
+
166
+ > `protected` **delegateToEngine**(`context`, `method`, ...`args`): `Promise`\<`any`\>
167
+
168
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:148](https://github.com/isdk/web-fetcher.js/blob/ef3a4e527bf3ca75213d55b02c017b9a30a036fd/src/action/fetch-action.ts#L148)
169
+
170
+ #### Parameters
171
+
172
+ ##### context
173
+
174
+ [`FetchContext`](../interfaces/FetchContext.md)
175
+
176
+ ##### method
177
+
178
+ keyof [`FetchEngine`](FetchEngine.md)\<`any`, `any`, `any`\>
179
+
180
+ ##### args
181
+
182
+ ...`any`[]
183
+
184
+ #### Returns
185
+
186
+ `Promise`\<`any`\>
187
+
188
+ ***
189
+
190
+ ### execute()
191
+
192
+ > **execute**\<`R`\>(`context`, `options?`): `Promise`\<[`FetchActionResult`](../interfaces/FetchActionResult.md)\<`R`\>\>
193
+
194
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:363](https://github.com/isdk/web-fetcher.js/blob/ef3a4e527bf3ca75213d55b02c017b9a30a036fd/src/action/fetch-action.ts#L363)
195
+
196
+ #### Type Parameters
197
+
198
+ ##### R
199
+
200
+ `R` *extends* [`FetchReturnType`](../type-aliases/FetchReturnType.md) = `"any"`
201
+
202
+ #### Parameters
203
+
204
+ ##### context
205
+
206
+ [`FetchContext`](../interfaces/FetchContext.md)
207
+
208
+ ##### options?
209
+
210
+ [`FetchActionProperties`](../interfaces/FetchActionProperties.md)
211
+
212
+ #### Returns
213
+
214
+ `Promise`\<[`FetchActionResult`](../interfaces/FetchActionResult.md)\<`R`\>\>
215
+
216
+ ***
217
+
218
+ ### getCapability()
219
+
220
+ > **getCapability**(`mode?`): [`FetchActionCapabilityMode`](../type-aliases/FetchActionCapabilityMode.md)
221
+
222
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:124](https://github.com/isdk/web-fetcher.js/blob/ef3a4e527bf3ca75213d55b02c017b9a30a036fd/src/action/fetch-action.ts#L124)
223
+
224
+ #### Parameters
225
+
226
+ ##### mode?
227
+
228
+ [`FetchEngineType`](../type-aliases/FetchEngineType.md)
229
+
230
+ #### Returns
231
+
232
+ [`FetchActionCapabilityMode`](../type-aliases/FetchActionCapabilityMode.md)
233
+
234
+ ***
235
+
236
+ ### installCollectors()
237
+
238
+ > `protected` **installCollectors**(`context`, `options?`): `undefined` \| `CollectorsRuntime`
239
+
240
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:165](https://github.com/isdk/web-fetcher.js/blob/ef3a4e527bf3ca75213d55b02c017b9a30a036fd/src/action/fetch-action.ts#L165)
241
+
242
+ #### Parameters
243
+
244
+ ##### context
245
+
246
+ [`FetchContext`](../interfaces/FetchContext.md)
247
+
248
+ ##### options?
249
+
250
+ [`FetchActionProperties`](../interfaces/FetchActionProperties.md)
251
+
252
+ #### Returns
253
+
254
+ `undefined` \| `CollectorsRuntime`
255
+
256
+ ***
257
+
258
+ ### onAfterExec()?
259
+
260
+ > `protected` `optional` **onAfterExec**(`context`, `options?`): `void` \| `Promise`\<`void`\>
261
+
262
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:143](https://github.com/isdk/web-fetcher.js/blob/ef3a4e527bf3ca75213d55b02c017b9a30a036fd/src/action/fetch-action.ts#L143)
263
+
264
+ #### Parameters
265
+
266
+ ##### context
267
+
268
+ [`FetchContext`](../interfaces/FetchContext.md)
269
+
270
+ ##### options?
271
+
272
+ [`FetchActionProperties`](../interfaces/FetchActionProperties.md)
273
+
274
+ #### Returns
275
+
276
+ `void` \| `Promise`\<`void`\>
277
+
278
+ ***
279
+
280
+ ### onBeforeExec()?
281
+
282
+ > `protected` `optional` **onBeforeExec**(`context`, `options?`): `void` \| `Promise`\<`void`\>
283
+
284
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:142](https://github.com/isdk/web-fetcher.js/blob/ef3a4e527bf3ca75213d55b02c017b9a30a036fd/src/action/fetch-action.ts#L142)
285
+
286
+ #### Parameters
287
+
288
+ ##### context
289
+
290
+ [`FetchContext`](../interfaces/FetchContext.md)
291
+
292
+ ##### options?
293
+
294
+ [`FetchActionProperties`](../interfaces/FetchActionProperties.md)
295
+
296
+ #### Returns
297
+
298
+ `void` \| `Promise`\<`void`\>
299
+
300
+ ***
301
+
302
+ ### onExecute()
303
+
304
+ > `abstract` **onExecute**(`context`, `options?`, `eventPayload?`): `any`
305
+
306
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:146](https://github.com/isdk/web-fetcher.js/blob/ef3a4e527bf3ca75213d55b02c017b9a30a036fd/src/action/fetch-action.ts#L146)
307
+
308
+ #### Parameters
309
+
310
+ ##### context
311
+
312
+ [`FetchContext`](../interfaces/FetchContext.md)
313
+
314
+ ##### options?
315
+
316
+ [`FetchActionProperties`](../interfaces/FetchActionProperties.md)
317
+
318
+ ##### eventPayload?
319
+
320
+ `any`
321
+
322
+ #### Returns
323
+
324
+ `any`
325
+
326
+ ***
327
+
328
+ ### create()
329
+
330
+ #### Call Signature
331
+
332
+ > `static` **create**(`id`): `undefined` \| `FetchAction`
333
+
334
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:98](https://github.com/isdk/web-fetcher.js/blob/ef3a4e527bf3ca75213d55b02c017b9a30a036fd/src/action/fetch-action.ts#L98)
335
+
336
+ ##### Parameters
337
+
338
+ ###### id
339
+
340
+ `_RequireAtLeastOne`
341
+
342
+ ##### Returns
343
+
344
+ `undefined` \| `FetchAction`
345
+
346
+ #### Call Signature
347
+
348
+ > `static` **create**(`id`): `undefined` \| `FetchAction`
349
+
350
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:99](https://github.com/isdk/web-fetcher.js/blob/ef3a4e527bf3ca75213d55b02c017b9a30a036fd/src/action/fetch-action.ts#L99)
351
+
352
+ ##### Parameters
353
+
354
+ ###### id
355
+
356
+ `string`
357
+
358
+ ##### Returns
359
+
360
+ `undefined` \| `FetchAction`
361
+
362
+ ***
363
+
364
+ ### get()
365
+
366
+ > `static` **get**(`id`): `undefined` \| *typeof* `FetchAction`
367
+
368
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:94](https://github.com/isdk/web-fetcher.js/blob/ef3a4e527bf3ca75213d55b02c017b9a30a036fd/src/action/fetch-action.ts#L94)
369
+
370
+ #### Parameters
371
+
372
+ ##### id
373
+
374
+ `string`
375
+
376
+ #### Returns
377
+
378
+ `undefined` \| *typeof* `FetchAction`
379
+
380
+ ***
381
+
382
+ ### getCapability()
383
+
384
+ > `static` **getCapability**(`mode?`): [`FetchActionCapabilityMode`](../type-aliases/FetchActionCapabilityMode.md)
385
+
386
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:120](https://github.com/isdk/web-fetcher.js/blob/ef3a4e527bf3ca75213d55b02c017b9a30a036fd/src/action/fetch-action.ts#L120)
387
+
388
+ #### Parameters
389
+
390
+ ##### mode?
391
+
392
+ [`FetchEngineType`](../type-aliases/FetchEngineType.md)
393
+
394
+ #### Returns
395
+
396
+ [`FetchActionCapabilityMode`](../type-aliases/FetchActionCapabilityMode.md)
397
+
398
+ ***
399
+
400
+ ### has()
401
+
402
+ > `static` **has**(`name`): `boolean`
403
+
404
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:107](https://github.com/isdk/web-fetcher.js/blob/ef3a4e527bf3ca75213d55b02c017b9a30a036fd/src/action/fetch-action.ts#L107)
405
+
406
+ #### Parameters
407
+
408
+ ##### name
409
+
410
+ `string`
411
+
412
+ #### Returns
413
+
414
+ `boolean`
415
+
416
+ ***
417
+
418
+ ### list()
419
+
420
+ > `static` **list**(): `string`[]
421
+
422
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:111](https://github.com/isdk/web-fetcher.js/blob/ef3a4e527bf3ca75213d55b02c017b9a30a036fd/src/action/fetch-action.ts#L111)
423
+
424
+ #### Returns
425
+
426
+ `string`[]
427
+
428
+ ***
429
+
430
+ ### register()
431
+
432
+ > `static` **register**(`actionClass`): `void`
433
+
434
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:88](https://github.com/isdk/web-fetcher.js/blob/ef3a4e527bf3ca75213d55b02c017b9a30a036fd/src/action/fetch-action.ts#L88)
435
+
436
+ #### Parameters
437
+
438
+ ##### actionClass
439
+
440
+ *typeof* `FetchAction`
441
+
442
+ #### Returns
443
+
444
+ `void`