@isdk/web-fetcher 0.2.11 → 0.3.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 (72) hide show
  1. package/README.action.cn.md +381 -19
  2. package/README.action.md +394 -4
  3. package/README.cn.md +13 -11
  4. package/README.engine.cn.md +124 -21
  5. package/README.engine.md +121 -21
  6. package/README.md +11 -9
  7. package/dist/index.d.mts +890 -24
  8. package/dist/index.d.ts +890 -24
  9. package/dist/index.js +1 -1
  10. package/dist/index.mjs +1 -1
  11. package/docs/README.md +11 -9
  12. package/docs/_media/README.action.md +394 -4
  13. package/docs/_media/README.cn.md +13 -11
  14. package/docs/_media/README.engine.md +121 -21
  15. package/docs/classes/CheerioFetchEngine.md +996 -187
  16. package/docs/classes/ClickAction.md +33 -33
  17. package/docs/classes/EvaluateAction.md +559 -0
  18. package/docs/classes/ExtractAction.md +33 -33
  19. package/docs/classes/FetchAction.md +35 -33
  20. package/docs/classes/FetchEngine.md +740 -85
  21. package/docs/classes/FetchSession.md +143 -24
  22. package/docs/classes/FillAction.md +33 -33
  23. package/docs/classes/GetContentAction.md +33 -33
  24. package/docs/classes/GotoAction.md +33 -33
  25. package/docs/classes/PauseAction.md +33 -33
  26. package/docs/classes/PlaywrightFetchEngine.md +901 -180
  27. package/docs/classes/SubmitAction.md +33 -33
  28. package/docs/classes/TrimAction.md +533 -0
  29. package/docs/classes/WaitForAction.md +33 -33
  30. package/docs/classes/WebFetcher.md +57 -9
  31. package/docs/enumerations/FetchActionResultStatus.md +4 -4
  32. package/docs/functions/fetchWeb.md +6 -6
  33. package/docs/globals.md +6 -0
  34. package/docs/interfaces/BaseFetchActionProperties.md +19 -11
  35. package/docs/interfaces/BaseFetchCollectorActionProperties.md +27 -15
  36. package/docs/interfaces/BaseFetcherProperties.md +28 -28
  37. package/docs/interfaces/DispatchedEngineAction.md +4 -4
  38. package/docs/interfaces/EvaluateActionOptions.md +81 -0
  39. package/docs/interfaces/ExtractActionProperties.md +23 -11
  40. package/docs/interfaces/FetchActionInContext.md +32 -15
  41. package/docs/interfaces/FetchActionProperties.md +24 -12
  42. package/docs/interfaces/FetchActionResult.md +6 -6
  43. package/docs/interfaces/FetchContext.md +81 -38
  44. package/docs/interfaces/FetchEngineContext.md +52 -33
  45. package/docs/interfaces/FetchMetadata.md +5 -5
  46. package/docs/interfaces/FetchResponse.md +14 -14
  47. package/docs/interfaces/FetchReturnTypeRegistry.md +8 -8
  48. package/docs/interfaces/FetchSite.md +31 -31
  49. package/docs/interfaces/FetcherOptions.md +30 -30
  50. package/docs/interfaces/GotoActionOptions.md +6 -6
  51. package/docs/interfaces/PendingEngineRequest.md +3 -3
  52. package/docs/interfaces/StorageOptions.md +5 -5
  53. package/docs/interfaces/SubmitActionOptions.md +2 -2
  54. package/docs/interfaces/TrimActionOptions.md +27 -0
  55. package/docs/interfaces/WaitForActionOptions.md +5 -5
  56. package/docs/type-aliases/BaseFetchActionOptions.md +1 -1
  57. package/docs/type-aliases/BaseFetchCollectorOptions.md +1 -1
  58. package/docs/type-aliases/BrowserEngine.md +1 -1
  59. package/docs/type-aliases/FetchActionCapabilities.md +1 -1
  60. package/docs/type-aliases/FetchActionCapabilityMode.md +1 -1
  61. package/docs/type-aliases/FetchActionOptions.md +1 -1
  62. package/docs/type-aliases/FetchEngineAction.md +2 -2
  63. package/docs/type-aliases/FetchEngineType.md +1 -1
  64. package/docs/type-aliases/FetchReturnType.md +1 -1
  65. package/docs/type-aliases/FetchReturnTypeFor.md +1 -1
  66. package/docs/type-aliases/OnFetchPauseCallback.md +1 -1
  67. package/docs/type-aliases/ResourceType.md +1 -1
  68. package/docs/type-aliases/TrimPreset.md +13 -0
  69. package/docs/variables/DefaultFetcherProperties.md +1 -1
  70. package/docs/variables/FetcherOptionKeys.md +1 -1
  71. package/docs/variables/TRIM_PRESETS.md +11 -0
  72. package/package.json +10 -7
@@ -6,15 +6,27 @@
6
6
 
7
7
  # Class: FetchSession
8
8
 
9
- Defined in: [packages/web-fetcher/src/core/session.ts:11](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/core/session.ts#L11)
9
+ Defined in: [packages/web-fetcher/src/core/session.ts:24](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/core/session.ts#L24)
10
+
11
+ Represents a stateful web fetching session.
12
+
13
+ ## Remarks
14
+
15
+ A `FetchSession` manages the lifecycle of a single crawling operation, including engine initialization,
16
+ cookie persistence, and sequential action execution. It maintains a `FetchContext` that stores
17
+ session-level configurations and outputs.
18
+
19
+ Sessions are isolated; each has its own unique ID and (by default) its own storage and cookies.
10
20
 
11
21
  ## Constructors
12
22
 
13
23
  ### Constructor
14
24
 
15
- > **new FetchSession**(`options`, `engine?`): `FetchSession`
25
+ > **new FetchSession**(`options`): `FetchSession`
26
+
27
+ Defined in: [packages/web-fetcher/src/core/session.ts:42](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/core/session.ts#L42)
16
28
 
17
- Defined in: [packages/web-fetcher/src/core/session.ts:18](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/core/session.ts#L18)
29
+ Creates a new FetchSession.
18
30
 
19
31
  #### Parameters
20
32
 
@@ -22,9 +34,7 @@ Defined in: [packages/web-fetcher/src/core/session.ts:18](https://github.com/isd
22
34
 
23
35
  [`FetcherOptions`](../interfaces/FetcherOptions.md) = `{}`
24
36
 
25
- ##### engine?
26
-
27
- `string`
37
+ Configuration options for the fetcher.
28
38
 
29
39
  #### Returns
30
40
 
@@ -32,19 +42,21 @@ Defined in: [packages/web-fetcher/src/core/session.ts:18](https://github.com/isd
32
42
 
33
43
  ## Properties
34
44
 
35
- ### context
45
+ ### closed
36
46
 
37
- > `readonly` **context**: [`FetchContext`](../interfaces/FetchContext.md)
47
+ > `protected` **closed**: `boolean` = `false`
38
48
 
39
- Defined in: [packages/web-fetcher/src/core/session.ts:13](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/core/session.ts#L13)
49
+ Defined in: [packages/web-fetcher/src/core/session.ts:35](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/core/session.ts#L35)
40
50
 
41
51
  ***
42
52
 
43
- ### engine?
53
+ ### context
54
+
55
+ > `readonly` **context**: [`FetchContext`](../interfaces/FetchContext.md)
44
56
 
45
- > `readonly` `optional` **engine**: `string`
57
+ Defined in: [packages/web-fetcher/src/core/session.ts:32](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/core/session.ts#L32)
46
58
 
47
- Defined in: [packages/web-fetcher/src/core/session.ts:18](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/core/session.ts#L18)
59
+ The execution context for this session, containing configurations, event bus, and shared state.
48
60
 
49
61
  ***
50
62
 
@@ -52,29 +64,88 @@ Defined in: [packages/web-fetcher/src/core/session.ts:18](https://github.com/isd
52
64
 
53
65
  > `readonly` **id**: `string`
54
66
 
55
- Defined in: [packages/web-fetcher/src/core/session.ts:12](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/core/session.ts#L12)
67
+ Defined in: [packages/web-fetcher/src/core/session.ts:28](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/core/session.ts#L28)
68
+
69
+ Unique identifier for the session.
70
+
71
+ ***
72
+
73
+ ### options
74
+
75
+ > `protected` **options**: [`FetcherOptions`](../interfaces/FetcherOptions.md) = `{}`
76
+
77
+ Defined in: [packages/web-fetcher/src/core/session.ts:42](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/core/session.ts#L42)
78
+
79
+ Configuration options for the fetcher.
56
80
 
57
81
  ## Methods
58
82
 
83
+ ### \_logDebug()
84
+
85
+ > `protected` **\_logDebug**(`category`, ...`args`): `void`
86
+
87
+ Defined in: [packages/web-fetcher/src/core/session.ts:47](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/core/session.ts#L47)
88
+
89
+ #### Parameters
90
+
91
+ ##### category
92
+
93
+ `string`
94
+
95
+ ##### args
96
+
97
+ ...`any`[]
98
+
99
+ #### Returns
100
+
101
+ `void`
102
+
103
+ ***
104
+
105
+ ### createContext()
106
+
107
+ > `protected` **createContext**(`options`): [`FetchContext`](../interfaces/FetchContext.md)
108
+
109
+ Defined in: [packages/web-fetcher/src/core/session.ts:235](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/core/session.ts#L235)
110
+
111
+ #### Parameters
112
+
113
+ ##### options
114
+
115
+ [`FetcherOptions`](../interfaces/FetcherOptions.md) = `...`
116
+
117
+ #### Returns
118
+
119
+ [`FetchContext`](../interfaces/FetchContext.md)
120
+
121
+ ***
122
+
59
123
  ### dispose()
60
124
 
61
125
  > **dispose**(): `Promise`\<`void`\>
62
126
 
63
- Defined in: [packages/web-fetcher/src/core/session.ts:91](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/core/session.ts#L91)
127
+ Defined in: [packages/web-fetcher/src/core/session.ts:204](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/core/session.ts#L204)
128
+
129
+ Disposes of the session and its associated engine.
64
130
 
65
131
  #### Returns
66
132
 
67
133
  `Promise`\<`void`\>
68
134
 
135
+ #### Remarks
136
+
137
+ This method should be called when the session is no longer needed to free up resources
138
+ (e.g., closing browser instances, purging temporary storage).
139
+
69
140
  ***
70
141
 
71
142
  ### execute()
72
143
 
73
- > **execute**\<`R`\>(`actionOptions`): `Promise`\<[`FetchActionResult`](../interfaces/FetchActionResult.md)\<`R`\>\>
144
+ > **execute**\<`R`\>(`actionOptions`, `context`): `Promise`\<[`FetchActionResult`](../interfaces/FetchActionResult.md)\<`R`\>\>
74
145
 
75
- Defined in: [packages/web-fetcher/src/core/session.ts:27](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/core/session.ts#L27)
146
+ Defined in: [packages/web-fetcher/src/core/session.ts:68](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/core/session.ts#L68)
76
147
 
77
- 执行单个动作
148
+ Executes a single action within the session.
78
149
 
79
150
  #### Type Parameters
80
151
 
@@ -82,23 +153,43 @@ Defined in: [packages/web-fetcher/src/core/session.ts:27](https://github.com/isd
82
153
 
83
154
  `R` *extends* [`FetchReturnType`](../type-aliases/FetchReturnType.md) = `"response"`
84
155
 
156
+ The expected return type of the action.
157
+
85
158
  #### Parameters
86
159
 
87
160
  ##### actionOptions
88
161
 
89
162
  `_RequireAtLeastOne`
90
163
 
164
+ Configuration for the action to be executed.
165
+
166
+ ##### context
167
+
168
+ [`FetchContext`](../interfaces/FetchContext.md) = `...`
169
+
170
+ Optional context override for this specific execution. Defaults to the session context.
171
+
91
172
  #### Returns
92
173
 
93
174
  `Promise`\<[`FetchActionResult`](../interfaces/FetchActionResult.md)\<`R`\>\>
94
175
 
176
+ A promise that resolves to the result of the action.
177
+
178
+ #### Example
179
+
180
+ ```ts
181
+ await session.execute({ name: 'goto', params: { url: 'https://example.com' } });
182
+ ```
183
+
95
184
  ***
96
185
 
97
186
  ### executeAll()
98
187
 
99
- > **executeAll**(`actions`): `Promise`\<\{ `outputs`: `Record`\<`string`, `any`\>; `result`: `undefined` \| [`FetchResponse`](../interfaces/FetchResponse.md); \}\>
188
+ > **executeAll**(`actions`, `options?`): `Promise`\<\{ `outputs`: `Record`\<`string`, `any`\>; `result`: [`FetchResponse`](../interfaces/FetchResponse.md) \| `undefined`; \}\>
100
189
 
101
- Defined in: [packages/web-fetcher/src/core/session.ts:61](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/core/session.ts#L61)
190
+ Defined in: [packages/web-fetcher/src/core/session.ts:130](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/core/session.ts#L130)
191
+
192
+ Executes a sequence of actions.
102
193
 
103
194
  #### Parameters
104
195
 
@@ -106,9 +197,29 @@ Defined in: [packages/web-fetcher/src/core/session.ts:61](https://github.com/isd
106
197
 
107
198
  `_RequireAtLeastOne`\<[`FetchActionProperties`](../interfaces/FetchActionProperties.md), `"name"` \| `"id"` \| `"action"`\>[]
108
199
 
200
+ An array of action options to be executed in order.
201
+
202
+ ##### options?
203
+
204
+ `Partial`\<[`FetcherOptions`](../interfaces/FetcherOptions.md)\> & `object`
205
+
206
+ Optional temporary configuration overrides (e.g., timeoutMs, headers) for this batch of actions.
207
+ These overrides do not affect the main session context.
208
+
109
209
  #### Returns
110
210
 
111
- `Promise`\<\{ `outputs`: `Record`\<`string`, `any`\>; `result`: `undefined` \| [`FetchResponse`](../interfaces/FetchResponse.md); \}\>
211
+ `Promise`\<\{ `outputs`: `Record`\<`string`, `any`\>; `result`: [`FetchResponse`](../interfaces/FetchResponse.md) \| `undefined`; \}\>
212
+
213
+ A promise that resolves to an object containing the result of the last action and all accumulated outputs.
214
+
215
+ #### Example
216
+
217
+ ```ts
218
+ const { result, outputs } = await session.executeAll([
219
+ { name: 'goto', params: { url: 'https://example.com' } },
220
+ { name: 'extract', params: { schema: { title: 'h1' } }, storeAs: 'data' }
221
+ ], { timeoutMs: 30000 });
222
+ ```
112
223
 
113
224
  ***
114
225
 
@@ -116,20 +227,28 @@ Defined in: [packages/web-fetcher/src/core/session.ts:61](https://github.com/isd
116
227
 
117
228
  > **getOutputs**(): `Record`\<`string`, `any`\>
118
229
 
119
- Defined in: [packages/web-fetcher/src/core/session.ts:83](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/core/session.ts#L83)
230
+ Defined in: [packages/web-fetcher/src/core/session.ts:182](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/core/session.ts#L182)
231
+
232
+ Retrieves all outputs accumulated during the session.
120
233
 
121
234
  #### Returns
122
235
 
123
236
  `Record`\<`string`, `any`\>
124
237
 
238
+ A record of stored output data.
239
+
125
240
  ***
126
241
 
127
242
  ### getState()
128
243
 
129
- > **getState**(): `Promise`\<`undefined` \| \{ `cookies`: [`Cookie`](../interfaces/Cookie.md)[]; `sessionState?`: `any`; \}\>
244
+ > **getState**(): `Promise`\<\{ `cookies`: [`Cookie`](../interfaces/Cookie.md)[]; `sessionState?`: `any`; \} \| `undefined`\>
130
245
 
131
- Defined in: [packages/web-fetcher/src/core/session.ts:87](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/core/session.ts#L87)
246
+ Defined in: [packages/web-fetcher/src/core/session.ts:191](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/core/session.ts#L191)
247
+
248
+ Gets the current state of the session, including cookies and engine-specific state.
132
249
 
133
250
  #### Returns
134
251
 
135
- `Promise`\<`undefined` \| \{ `cookies`: [`Cookie`](../interfaces/Cookie.md)[]; `sessionState?`: `any`; \}\>
252
+ `Promise`\<\{ `cookies`: [`Cookie`](../interfaces/Cookie.md)[]; `sessionState?`: `any`; \} \| `undefined`\>
253
+
254
+ A promise resolving to the session state, or undefined if no engine is initialized.
@@ -6,7 +6,7 @@
6
6
 
7
7
  # Class: FillAction
8
8
 
9
- Defined in: [packages/web-fetcher/src/action/definitions/fill.ts:4](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/action/definitions/fill.ts#L4)
9
+ Defined in: [packages/web-fetcher/src/action/definitions/fill.ts:4](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/action/definitions/fill.ts#L4)
10
10
 
11
11
  ## Extends
12
12
 
@@ -32,7 +32,7 @@ Defined in: [packages/web-fetcher/src/action/definitions/fill.ts:4](https://gith
32
32
 
33
33
  > `static` **capabilities**: `object`
34
34
 
35
- Defined in: [packages/web-fetcher/src/action/definitions/fill.ts:7](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/action/definitions/fill.ts#L7)
35
+ Defined in: [packages/web-fetcher/src/action/definitions/fill.ts:7](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/action/definitions/fill.ts#L7)
36
36
 
37
37
  #### browser
38
38
 
@@ -52,7 +52,7 @@ Defined in: [packages/web-fetcher/src/action/definitions/fill.ts:7](https://gith
52
52
 
53
53
  > `static` **id**: `string` = `'fill'`
54
54
 
55
- Defined in: [packages/web-fetcher/src/action/definitions/fill.ts:5](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/action/definitions/fill.ts#L5)
55
+ Defined in: [packages/web-fetcher/src/action/definitions/fill.ts:5](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/action/definitions/fill.ts#L5)
56
56
 
57
57
  #### Overrides
58
58
 
@@ -64,7 +64,7 @@ Defined in: [packages/web-fetcher/src/action/definitions/fill.ts:5](https://gith
64
64
 
65
65
  > `static` **returnType**: `"none"`
66
66
 
67
- Defined in: [packages/web-fetcher/src/action/definitions/fill.ts:6](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/action/definitions/fill.ts#L6)
67
+ Defined in: [packages/web-fetcher/src/action/definitions/fill.ts:6](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/action/definitions/fill.ts#L6)
68
68
 
69
69
  #### Overrides
70
70
 
@@ -78,7 +78,7 @@ Defined in: [packages/web-fetcher/src/action/definitions/fill.ts:6](https://gith
78
78
 
79
79
  > **get** **capabilities**(): [`FetchActionCapabilities`](../type-aliases/FetchActionCapabilities.md)
80
80
 
81
- Defined in: [packages/web-fetcher/src/action/fetch-action.ts:139](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/action/fetch-action.ts#L139)
81
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:163](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/action/fetch-action.ts#L163)
82
82
 
83
83
  ##### Returns
84
84
 
@@ -96,7 +96,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:139](https://github
96
96
 
97
97
  > **get** **id**(): `string`
98
98
 
99
- Defined in: [packages/web-fetcher/src/action/fetch-action.ts:131](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/action/fetch-action.ts#L131)
99
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:155](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/action/fetch-action.ts#L155)
100
100
 
101
101
  ##### Returns
102
102
 
@@ -114,7 +114,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:131](https://github
114
114
 
115
115
  > **get** **returnType**(): [`FetchReturnType`](../type-aliases/FetchReturnType.md)
116
116
 
117
- Defined in: [packages/web-fetcher/src/action/fetch-action.ts:135](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/action/fetch-action.ts#L135)
117
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:159](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/action/fetch-action.ts#L159)
118
118
 
119
119
  ##### Returns
120
120
 
@@ -130,7 +130,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:135](https://github
130
130
 
131
131
  > **afterExec**(`context`, `options?`, `result?`, `scope?`): `Promise`\<`void`\>
132
132
 
133
- Defined in: [packages/web-fetcher/src/action/fetch-action.ts:313](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/action/fetch-action.ts#L313)
133
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:391](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/action/fetch-action.ts#L391)
134
134
 
135
135
  Action 结束生命周期
136
136
  负责:调用钩子、赋值lastResult, 触发事件、清理 stack、恢复 currentAction
@@ -171,9 +171,9 @@ Action 结束生命周期
171
171
 
172
172
  ### beforeExec()
173
173
 
174
- > **beforeExec**(`context`, `options?`): `Promise`\<\{ `collectors`: `undefined` \| `CollectorsRuntime`; `entry`: [`FetchActionInContext`](../interfaces/FetchActionInContext.md); \}\>
174
+ > **beforeExec**(`context`, `options?`): `Promise`\<\{ `collectors`: `CollectorsRuntime` \| `undefined`; `entry`: [`FetchActionInContext`](../interfaces/FetchActionInContext.md); \}\>
175
175
 
176
- Defined in: [packages/web-fetcher/src/action/fetch-action.ts:267](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/action/fetch-action.ts#L267)
176
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:347](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/action/fetch-action.ts#L347)
177
177
 
178
178
  Action 开始生命周期
179
179
  负责:初始化 stack、设置 currentAction、触发事件、调用钩子
@@ -190,7 +190,7 @@ Action 开始生命周期
190
190
 
191
191
  #### Returns
192
192
 
193
- `Promise`\<\{ `collectors`: `undefined` \| `CollectorsRuntime`; `entry`: [`FetchActionInContext`](../interfaces/FetchActionInContext.md); \}\>
193
+ `Promise`\<\{ `collectors`: `CollectorsRuntime` \| `undefined`; `entry`: [`FetchActionInContext`](../interfaces/FetchActionInContext.md); \}\>
194
194
 
195
195
  #### Inherited from
196
196
 
@@ -202,7 +202,7 @@ Action 开始生命周期
202
202
 
203
203
  > `protected` **delegateToEngine**(`context`, `method`, ...`args`): `Promise`\<`any`\>
204
204
 
205
- Defined in: [packages/web-fetcher/src/action/fetch-action.ts:150](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/action/fetch-action.ts#L150)
205
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:184](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/action/fetch-action.ts#L184)
206
206
 
207
207
  #### Parameters
208
208
 
@@ -232,7 +232,7 @@ keyof [`FetchEngine`](FetchEngine.md)\<`any`, `any`, `any`\>
232
232
 
233
233
  > **execute**\<`R`\>(`context`, `options?`): `Promise`\<[`FetchActionResult`](../interfaces/FetchActionResult.md)\<`R`\>\>
234
234
 
235
- Defined in: [packages/web-fetcher/src/action/fetch-action.ts:365](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/action/fetch-action.ts#L365)
235
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:448](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/action/fetch-action.ts#L448)
236
236
 
237
237
  #### Type Parameters
238
238
 
@@ -264,7 +264,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:365](https://github
264
264
 
265
265
  > **getCapability**(`mode?`): [`FetchActionCapabilityMode`](../type-aliases/FetchActionCapabilityMode.md)
266
266
 
267
- Defined in: [packages/web-fetcher/src/action/fetch-action.ts:126](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/action/fetch-action.ts#L126)
267
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:150](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/action/fetch-action.ts#L150)
268
268
 
269
269
  #### Parameters
270
270
 
@@ -284,9 +284,9 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:126](https://github
284
284
 
285
285
  ### installCollectors()
286
286
 
287
- > `protected` **installCollectors**(`context`, `options?`): `undefined` \| `CollectorsRuntime`
287
+ > `protected` **installCollectors**(`context`, `options?`): `CollectorsRuntime` \| `undefined`
288
288
 
289
- Defined in: [packages/web-fetcher/src/action/fetch-action.ts:167](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/action/fetch-action.ts#L167)
289
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:201](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/action/fetch-action.ts#L201)
290
290
 
291
291
  #### Parameters
292
292
 
@@ -300,7 +300,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:167](https://github
300
300
 
301
301
  #### Returns
302
302
 
303
- `undefined` \| `CollectorsRuntime`
303
+ `CollectorsRuntime` \| `undefined`
304
304
 
305
305
  #### Inherited from
306
306
 
@@ -312,7 +312,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:167](https://github
312
312
 
313
313
  > `protected` `optional` **onAfterExec**(`context`, `options?`): `void` \| `Promise`\<`void`\>
314
314
 
315
- Defined in: [packages/web-fetcher/src/action/fetch-action.ts:145](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/action/fetch-action.ts#L145)
315
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:172](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/action/fetch-action.ts#L172)
316
316
 
317
317
  #### Parameters
318
318
 
@@ -338,7 +338,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:145](https://github
338
338
 
339
339
  > `protected` `optional` **onBeforeExec**(`context`, `options?`): `void` \| `Promise`\<`void`\>
340
340
 
341
- Defined in: [packages/web-fetcher/src/action/fetch-action.ts:144](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/action/fetch-action.ts#L144)
341
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:168](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/action/fetch-action.ts#L168)
342
342
 
343
343
  #### Parameters
344
344
 
@@ -364,7 +364,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:144](https://github
364
364
 
365
365
  > **onExecute**(`context`, `options?`): `Promise`\<`void`\>
366
366
 
367
- Defined in: [packages/web-fetcher/src/action/definitions/fill.ts:9](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/action/definitions/fill.ts#L9)
367
+ Defined in: [packages/web-fetcher/src/action/definitions/fill.ts:12](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/action/definitions/fill.ts#L12)
368
368
 
369
369
  #### Parameters
370
370
 
@@ -390,9 +390,9 @@ Defined in: [packages/web-fetcher/src/action/definitions/fill.ts:9](https://gith
390
390
 
391
391
  #### Call Signature
392
392
 
393
- > `static` **create**(`id`): `undefined` \| [`FetchAction`](FetchAction.md)
393
+ > `static` **create**(`id`): [`FetchAction`](FetchAction.md) \| `undefined`
394
394
 
395
- Defined in: [packages/web-fetcher/src/action/fetch-action.ts:100](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/action/fetch-action.ts#L100)
395
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:113](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/action/fetch-action.ts#L113)
396
396
 
397
397
  ##### Parameters
398
398
 
@@ -402,7 +402,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:100](https://github
402
402
 
403
403
  ##### Returns
404
404
 
405
- `undefined` \| [`FetchAction`](FetchAction.md)
405
+ [`FetchAction`](FetchAction.md) \| `undefined`
406
406
 
407
407
  ##### Inherited from
408
408
 
@@ -410,9 +410,9 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:100](https://github
410
410
 
411
411
  #### Call Signature
412
412
 
413
- > `static` **create**(`id`): `undefined` \| [`FetchAction`](FetchAction.md)
413
+ > `static` **create**(`id`): [`FetchAction`](FetchAction.md) \| `undefined`
414
414
 
415
- Defined in: [packages/web-fetcher/src/action/fetch-action.ts:101](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/action/fetch-action.ts#L101)
415
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:114](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/action/fetch-action.ts#L114)
416
416
 
417
417
  ##### Parameters
418
418
 
@@ -422,7 +422,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:101](https://github
422
422
 
423
423
  ##### Returns
424
424
 
425
- `undefined` \| [`FetchAction`](FetchAction.md)
425
+ [`FetchAction`](FetchAction.md) \| `undefined`
426
426
 
427
427
  ##### Inherited from
428
428
 
@@ -432,9 +432,9 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:101](https://github
432
432
 
433
433
  ### get()
434
434
 
435
- > `static` **get**(`id`): `undefined` \| *typeof* [`FetchAction`](FetchAction.md)
435
+ > `static` **get**(`id`): *typeof* [`FetchAction`](FetchAction.md) \| `undefined`
436
436
 
437
- Defined in: [packages/web-fetcher/src/action/fetch-action.ts:96](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/action/fetch-action.ts#L96)
437
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:109](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/action/fetch-action.ts#L109)
438
438
 
439
439
  #### Parameters
440
440
 
@@ -444,7 +444,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:96](https://github.
444
444
 
445
445
  #### Returns
446
446
 
447
- `undefined` \| *typeof* [`FetchAction`](FetchAction.md)
447
+ *typeof* [`FetchAction`](FetchAction.md) \| `undefined`
448
448
 
449
449
  #### Inherited from
450
450
 
@@ -456,7 +456,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:96](https://github.
456
456
 
457
457
  > `static` **getCapability**(`mode?`): [`FetchActionCapabilityMode`](../type-aliases/FetchActionCapabilityMode.md)
458
458
 
459
- Defined in: [packages/web-fetcher/src/action/fetch-action.ts:122](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/action/fetch-action.ts#L122)
459
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:146](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/action/fetch-action.ts#L146)
460
460
 
461
461
  #### Parameters
462
462
 
@@ -478,7 +478,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:122](https://github
478
478
 
479
479
  > `static` **has**(`name`): `boolean`
480
480
 
481
- Defined in: [packages/web-fetcher/src/action/fetch-action.ts:109](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/action/fetch-action.ts#L109)
481
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:130](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/action/fetch-action.ts#L130)
482
482
 
483
483
  #### Parameters
484
484
 
@@ -500,7 +500,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:109](https://github
500
500
 
501
501
  > `static` **list**(): `string`[]
502
502
 
503
- Defined in: [packages/web-fetcher/src/action/fetch-action.ts:113](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/action/fetch-action.ts#L113)
503
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:134](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/action/fetch-action.ts#L134)
504
504
 
505
505
  #### Returns
506
506
 
@@ -516,7 +516,7 @@ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:113](https://github
516
516
 
517
517
  > `static` **register**(`actionClass`): `void`
518
518
 
519
- Defined in: [packages/web-fetcher/src/action/fetch-action.ts:90](https://github.com/isdk/web-fetcher.js/blob/1f3a81cc4fe8a2cf40fe3f3e8030d14a75c9d27c/src/action/fetch-action.ts#L90)
519
+ Defined in: [packages/web-fetcher/src/action/fetch-action.ts:103](https://github.com/isdk/web-fetcher.js/blob/1f80c3c783d0455bd4ff73248c57c2c39ab9f7c9/src/action/fetch-action.ts#L103)
520
520
 
521
521
  #### Parameters
522
522