@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.
- package/README.action.cn.md +381 -19
- package/README.action.md +394 -4
- package/README.cn.md +13 -11
- package/README.engine.cn.md +124 -21
- package/README.engine.md +121 -21
- package/README.md +11 -9
- package/dist/index.d.mts +890 -24
- package/dist/index.d.ts +890 -24
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/docs/README.md +11 -9
- package/docs/_media/README.action.md +394 -4
- package/docs/_media/README.cn.md +13 -11
- package/docs/_media/README.engine.md +121 -21
- package/docs/classes/CheerioFetchEngine.md +996 -187
- package/docs/classes/ClickAction.md +33 -33
- package/docs/classes/EvaluateAction.md +559 -0
- package/docs/classes/ExtractAction.md +33 -33
- package/docs/classes/FetchAction.md +35 -33
- package/docs/classes/FetchEngine.md +740 -85
- package/docs/classes/FetchSession.md +143 -24
- package/docs/classes/FillAction.md +33 -33
- package/docs/classes/GetContentAction.md +33 -33
- package/docs/classes/GotoAction.md +33 -33
- package/docs/classes/PauseAction.md +33 -33
- package/docs/classes/PlaywrightFetchEngine.md +901 -180
- package/docs/classes/SubmitAction.md +33 -33
- package/docs/classes/TrimAction.md +533 -0
- package/docs/classes/WaitForAction.md +33 -33
- package/docs/classes/WebFetcher.md +57 -9
- package/docs/enumerations/FetchActionResultStatus.md +4 -4
- package/docs/functions/fetchWeb.md +6 -6
- package/docs/globals.md +6 -0
- package/docs/interfaces/BaseFetchActionProperties.md +19 -11
- package/docs/interfaces/BaseFetchCollectorActionProperties.md +27 -15
- package/docs/interfaces/BaseFetcherProperties.md +28 -28
- package/docs/interfaces/DispatchedEngineAction.md +4 -4
- package/docs/interfaces/EvaluateActionOptions.md +81 -0
- package/docs/interfaces/ExtractActionProperties.md +23 -11
- package/docs/interfaces/FetchActionInContext.md +32 -15
- package/docs/interfaces/FetchActionProperties.md +24 -12
- package/docs/interfaces/FetchActionResult.md +6 -6
- package/docs/interfaces/FetchContext.md +81 -38
- package/docs/interfaces/FetchEngineContext.md +52 -33
- package/docs/interfaces/FetchMetadata.md +5 -5
- package/docs/interfaces/FetchResponse.md +14 -14
- package/docs/interfaces/FetchReturnTypeRegistry.md +8 -8
- package/docs/interfaces/FetchSite.md +31 -31
- package/docs/interfaces/FetcherOptions.md +30 -30
- package/docs/interfaces/GotoActionOptions.md +6 -6
- 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 +27 -0
- 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 +13 -0
- package/docs/variables/DefaultFetcherProperties.md +1 -1
- package/docs/variables/FetcherOptionKeys.md +1 -1
- package/docs/variables/TRIM_PRESETS.md +11 -0
- 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:
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
###
|
|
45
|
+
### closed
|
|
36
46
|
|
|
37
|
-
> `
|
|
47
|
+
> `protected` **closed**: `boolean` = `false`
|
|
38
48
|
|
|
39
|
-
Defined in: [packages/web-fetcher/src/core/session.ts:
|
|
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
|
-
###
|
|
53
|
+
### context
|
|
54
|
+
|
|
55
|
+
> `readonly` **context**: [`FetchContext`](../interfaces/FetchContext.md)
|
|
44
56
|
|
|
45
|
-
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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:
|
|
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`:
|
|
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:
|
|
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`:
|
|
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:
|
|
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
|
|
244
|
+
> **getState**(): `Promise`\<\{ `cookies`: [`Cookie`](../interfaces/Cookie.md)[]; `sessionState?`: `any`; \} \| `undefined`\>
|
|
130
245
|
|
|
131
|
-
Defined in: [packages/web-fetcher/src/core/session.ts:
|
|
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
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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`: `
|
|
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:
|
|
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`: `
|
|
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:
|
|
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:
|
|
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:
|
|
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?`): `
|
|
287
|
+
> `protected` **installCollectors**(`context`, `options?`): `CollectorsRuntime` \| `undefined`
|
|
288
288
|
|
|
289
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:
|
|
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
|
-
`
|
|
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:
|
|
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:
|
|
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:
|
|
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`):
|
|
393
|
+
> `static` **create**(`id`): [`FetchAction`](FetchAction.md) \| `undefined`
|
|
394
394
|
|
|
395
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:
|
|
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
|
-
|
|
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`):
|
|
413
|
+
> `static` **create**(`id`): [`FetchAction`](FetchAction.md) \| `undefined`
|
|
414
414
|
|
|
415
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:
|
|
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
|
-
|
|
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`):
|
|
435
|
+
> `static` **get**(`id`): *typeof* [`FetchAction`](FetchAction.md) \| `undefined`
|
|
436
436
|
|
|
437
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
|