@isdk/web-fetcher 0.3.1 → 0.3.3

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 (88) hide show
  1. package/README.action.cn.md +28 -4
  2. package/README.action.md +27 -4
  3. package/README.cn.md +21 -0
  4. package/README.engine.cn.md +35 -7
  5. package/README.engine.md +30 -2
  6. package/README.md +23 -1
  7. package/dist/index.d.mts +1571 -1448
  8. package/dist/index.d.ts +1571 -1448
  9. package/dist/index.js +1 -1
  10. package/dist/index.mjs +1 -1
  11. package/docs/README.md +23 -1
  12. package/docs/_media/README.action.md +27 -4
  13. package/docs/_media/README.cn.md +21 -0
  14. package/docs/_media/README.engine.md +30 -2
  15. package/docs/classes/CheerioFetchEngine.md +169 -93
  16. package/docs/classes/ClickAction.md +29 -29
  17. package/docs/classes/EngineUpgradeError.md +335 -0
  18. package/docs/classes/EvaluateAction.md +29 -29
  19. package/docs/classes/ExtractAction.md +29 -29
  20. package/docs/classes/FetchAction.md +31 -29
  21. package/docs/classes/FetchEngine.md +159 -91
  22. package/docs/classes/FetchSession.md +14 -14
  23. package/docs/classes/FillAction.md +29 -29
  24. package/docs/classes/GetContentAction.md +29 -29
  25. package/docs/classes/GotoAction.md +29 -29
  26. package/docs/classes/KeyboardPressAction.md +29 -29
  27. package/docs/classes/KeyboardTypeAction.md +29 -29
  28. package/docs/classes/MouseClickAction.md +29 -29
  29. package/docs/classes/MouseMoveAction.md +29 -29
  30. package/docs/classes/MouseWheelAction.md +533 -0
  31. package/docs/classes/PauseAction.md +29 -29
  32. package/docs/classes/PlaywrightFetchEngine.md +252 -118
  33. package/docs/classes/ScrollIntoViewAction.md +533 -0
  34. package/docs/classes/SubmitAction.md +29 -29
  35. package/docs/classes/TrimAction.md +29 -29
  36. package/docs/classes/WaitForAction.md +29 -29
  37. package/docs/classes/WebFetcher.md +5 -5
  38. package/docs/enumerations/FetchActionResultStatus.md +4 -4
  39. package/docs/functions/fetchWeb.md +2 -2
  40. package/docs/functions/getRandomDelay.md +25 -0
  41. package/docs/globals.md +8 -1
  42. package/docs/interfaces/BaseFetchActionProperties.md +13 -13
  43. package/docs/interfaces/BaseFetchCollectorActionProperties.md +17 -17
  44. package/docs/interfaces/BaseFetcherProperties.md +44 -28
  45. package/docs/interfaces/DispatchedEngineAction.md +4 -4
  46. package/docs/interfaces/EvaluateActionOptions.md +3 -3
  47. package/docs/interfaces/ExtractActionProperties.md +13 -13
  48. package/docs/interfaces/FetchActionMeta.md +73 -0
  49. package/docs/interfaces/FetchActionProperties.md +15 -19
  50. package/docs/interfaces/FetchActionResult.md +7 -7
  51. package/docs/interfaces/FetchContext.md +65 -41
  52. package/docs/interfaces/FetchEngineContext.md +57 -33
  53. package/docs/interfaces/FetchMetadata.md +5 -5
  54. package/docs/interfaces/FetchResponse.md +14 -14
  55. package/docs/interfaces/FetchReturnTypeRegistry.md +7 -7
  56. package/docs/interfaces/FetchSite.md +55 -31
  57. package/docs/interfaces/FetcherOptions.md +55 -31
  58. package/docs/interfaces/GotoActionOptions.md +8 -8
  59. package/docs/interfaces/KeyboardPressParams.md +3 -3
  60. package/docs/interfaces/KeyboardTypeParams.md +3 -3
  61. package/docs/interfaces/MouseClickParams.md +6 -6
  62. package/docs/interfaces/MouseMoveParams.md +5 -5
  63. package/docs/interfaces/MouseWheelParams.md +69 -0
  64. package/docs/interfaces/PendingEngineRequest.md +3 -3
  65. package/docs/interfaces/ScrollIntoViewParams.md +17 -0
  66. package/docs/interfaces/StorageOptions.md +5 -5
  67. package/docs/interfaces/SubmitActionOptions.md +2 -2
  68. package/docs/interfaces/TrimActionOptions.md +3 -3
  69. package/docs/interfaces/WaitForActionOptions.md +5 -5
  70. package/docs/type-aliases/BaseFetchActionOptions.md +1 -1
  71. package/docs/type-aliases/BaseFetchCollectorOptions.md +1 -1
  72. package/docs/type-aliases/BrowserEngine.md +1 -1
  73. package/docs/type-aliases/FetchActionCapabilities.md +1 -1
  74. package/docs/type-aliases/FetchActionCapabilityMode.md +1 -1
  75. package/docs/type-aliases/FetchActionInContext.md +38 -0
  76. package/docs/type-aliases/FetchActionOptions.md +1 -1
  77. package/docs/type-aliases/FetchEngineAction.md +2 -2
  78. package/docs/type-aliases/FetchEngineType.md +1 -1
  79. package/docs/type-aliases/FetchReturnType.md +1 -1
  80. package/docs/type-aliases/FetchReturnTypeFor.md +1 -1
  81. package/docs/type-aliases/OnFetchPauseCallback.md +1 -1
  82. package/docs/type-aliases/ResourceType.md +1 -1
  83. package/docs/type-aliases/TrimPreset.md +1 -1
  84. package/docs/variables/DefaultFetcherProperties.md +1 -1
  85. package/docs/variables/FetcherOptionKeys.md +1 -1
  86. package/docs/variables/TRIM_PRESETS.md +1 -1
  87. package/package.json +7 -7
  88. package/docs/interfaces/FetchActionInContext.md +0 -190
@@ -8,4 +8,4 @@
8
8
 
9
9
  > `const` **FetcherOptionKeys**: `string`[]
10
10
 
11
- Defined in: [packages/web-fetcher/src/core/types.ts:219](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/core/types.ts#L219)
11
+ Defined in: [packages/web-fetcher/src/core/types.ts:306](https://github.com/isdk/web-fetcher.js/blob/4cd06ed0bedeb2fc8c9242e05d3d068c125ab8a8/src/core/types.ts#L306)
@@ -8,4 +8,4 @@
8
8
 
9
9
  > `const` **TRIM\_PRESETS**: `Record`\<`string`, `string`[]\>
10
10
 
11
- Defined in: [packages/web-fetcher/src/engine/base.ts:134](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/engine/base.ts#L134)
11
+ Defined in: [packages/web-fetcher/src/engine/base.ts:134](https://github.com/isdk/web-fetcher.js/blob/4cd06ed0bedeb2fc8c9242e05d3d068c125ab8a8/src/engine/base.ts#L134)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isdk/web-fetcher",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "A powerful and flexible web automation and data extraction library featuring a dual-engine architecture (HTTP/Cheerio and Browser/Playwright) with declarative JSON action scripts.",
5
5
  "license": "MIT",
6
6
  "author": "Riceball LEE <snowyu.lee@gmail.com>",
@@ -20,14 +20,14 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@isdk/common-error": "^0.2.0",
23
- "camoufox-js": "^0.9.3",
23
+ "camoufox-js": "^0.10.2",
24
24
  "cheerio": "^1.2.0",
25
25
  "crawlee": "^3.16.0",
26
- "events-ex": "^2.2.0",
27
- "jsdom": "^29.0.1",
28
- "lodash-es": "^4.17.23",
29
- "nanoid": "^5.1.7",
30
- "playwright": "^1.58.2",
26
+ "events-ex": "^2.3.1",
27
+ "jsdom": "^29.1.1",
28
+ "lodash-es": "^4.18.1",
29
+ "nanoid": "^5.1.11",
30
+ "playwright": "^1.59.1",
31
31
  "util-ex": "^2.5.2"
32
32
  },
33
33
  "devDependencies": {
@@ -1,190 +0,0 @@
1
- [**@isdk/web-fetcher**](../README.md)
2
-
3
- ***
4
-
5
- [@isdk/web-fetcher](../globals.md) / FetchActionInContext
6
-
7
- # Interface: FetchActionInContext
8
-
9
- Defined in: [packages/web-fetcher/src/core/context.ts:18](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/core/context.ts#L18)
10
-
11
- Represents the state of an action being executed within a context.
12
-
13
- ## Remarks
14
-
15
- Extends the basic action properties with runtime metadata like execution index,
16
- nesting depth, and any errors encountered during execution.
17
-
18
- ## Extends
19
-
20
- - [`FetchActionProperties`](FetchActionProperties.md)
21
-
22
- ## Indexable
23
-
24
- \[`key`: `string`\]: `any`
25
-
26
- ## Properties
27
-
28
- ### action?
29
-
30
- > `optional` **action**: `string` \| [`FetchAction`](../classes/FetchAction.md)
31
-
32
- Defined in: [packages/web-fetcher/src/action/fetch-action.ts:49](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L49)
33
-
34
- #### Inherited from
35
-
36
- [`FetchActionProperties`](FetchActionProperties.md).[`action`](FetchActionProperties.md#action)
37
-
38
- ***
39
-
40
- ### args?
41
-
42
- > `optional` **args**: `any`
43
-
44
- Defined in: [packages/web-fetcher/src/action/fetch-action.ts:52](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L52)
45
-
46
- #### Inherited from
47
-
48
- [`FetchActionProperties`](FetchActionProperties.md).[`args`](FetchActionProperties.md#args)
49
-
50
- ***
51
-
52
- ### collectors?
53
-
54
- > `optional` **collectors**: `_RequireAtLeastOne`\<[`BaseFetchCollectorActionProperties`](BaseFetchCollectorActionProperties.md), `"name"` \| `"id"` \| `"action"`\>[]
55
-
56
- Defined in: [packages/web-fetcher/src/action/fetch-action.ts:87](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L87)
57
-
58
- #### Inherited from
59
-
60
- [`FetchActionProperties`](FetchActionProperties.md).[`collectors`](FetchActionProperties.md#collectors)
61
-
62
- ***
63
-
64
- ### depth?
65
-
66
- > `optional` **depth**: `number`
67
-
68
- Defined in: [packages/web-fetcher/src/core/context.ts:30](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/core/context.ts#L30)
69
-
70
- The nesting depth of the action. Top-level actions (executed directly by the session) have a depth of 0.
71
-
72
- ***
73
-
74
- ### error?
75
-
76
- > `optional` **error**: `Error`
77
-
78
- Defined in: [packages/web-fetcher/src/core/context.ts:26](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/core/context.ts#L26)
79
-
80
- Error encountered during action execution, if any.
81
-
82
- ***
83
-
84
- ### failOnError?
85
-
86
- > `optional` **failOnError**: `boolean`
87
-
88
- Defined in: [packages/web-fetcher/src/action/fetch-action.ts:57](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L57)
89
-
90
- #### Inherited from
91
-
92
- [`FetchActionProperties`](FetchActionProperties.md).[`failOnError`](FetchActionProperties.md#failonerror)
93
-
94
- ***
95
-
96
- ### failOnTimeout?
97
-
98
- > `optional` **failOnTimeout**: `boolean`
99
-
100
- Defined in: [packages/web-fetcher/src/action/fetch-action.ts:59](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L59)
101
-
102
- #### Inherited from
103
-
104
- [`FetchActionProperties`](FetchActionProperties.md).[`failOnTimeout`](FetchActionProperties.md#failontimeout)
105
-
106
- ***
107
-
108
- ### id?
109
-
110
- > `optional` **id**: `string`
111
-
112
- Defined in: [packages/web-fetcher/src/action/fetch-action.ts:47](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L47)
113
-
114
- #### Inherited from
115
-
116
- [`FetchActionProperties`](FetchActionProperties.md).[`id`](FetchActionProperties.md#id)
117
-
118
- ***
119
-
120
- ### index?
121
-
122
- > `optional` **index**: `number`
123
-
124
- Defined in: [packages/web-fetcher/src/core/context.ts:22](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/core/context.ts#L22)
125
-
126
- The 0-based index of the action in the execution sequence.
127
-
128
- #### Overrides
129
-
130
- [`FetchActionProperties`](FetchActionProperties.md).[`index`](FetchActionProperties.md#index)
131
-
132
- ***
133
-
134
- ### maxRetries?
135
-
136
- > `optional` **maxRetries**: `number`
137
-
138
- Defined in: [packages/web-fetcher/src/action/fetch-action.ts:61](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L61)
139
-
140
- #### Inherited from
141
-
142
- [`FetchActionProperties`](FetchActionProperties.md).[`maxRetries`](FetchActionProperties.md#maxretries)
143
-
144
- ***
145
-
146
- ### name?
147
-
148
- > `optional` **name**: `string`
149
-
150
- Defined in: [packages/web-fetcher/src/action/fetch-action.ts:48](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L48)
151
-
152
- #### Inherited from
153
-
154
- [`FetchActionProperties`](FetchActionProperties.md).[`name`](FetchActionProperties.md#name)
155
-
156
- ***
157
-
158
- ### params?
159
-
160
- > `optional` **params**: `any`
161
-
162
- Defined in: [packages/web-fetcher/src/action/fetch-action.ts:51](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L51)
163
-
164
- #### Inherited from
165
-
166
- [`FetchActionProperties`](FetchActionProperties.md).[`params`](FetchActionProperties.md#params)
167
-
168
- ***
169
-
170
- ### storeAs?
171
-
172
- > `optional` **storeAs**: `string`
173
-
174
- Defined in: [packages/web-fetcher/src/action/fetch-action.ts:54](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L54)
175
-
176
- #### Inherited from
177
-
178
- [`FetchActionProperties`](FetchActionProperties.md).[`storeAs`](FetchActionProperties.md#storeas)
179
-
180
- ***
181
-
182
- ### timeoutMs?
183
-
184
- > `optional` **timeoutMs**: `number`
185
-
186
- Defined in: [packages/web-fetcher/src/action/fetch-action.ts:60](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L60)
187
-
188
- #### Inherited from
189
-
190
- [`FetchActionProperties`](FetchActionProperties.md).[`timeoutMs`](FetchActionProperties.md#timeoutms)