@isdk/web-fetcher 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.action.cn.md +53 -312
- package/README.action.extract.cn.md +263 -0
- package/README.action.extract.md +263 -0
- package/README.action.md +53 -311
- package/README.cn.md +10 -2
- package/README.engine.cn.md +22 -1
- package/README.engine.md +22 -1
- package/README.md +8 -1
- package/dist/index.d.mts +147 -1
- package/dist/index.d.ts +147 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/docs/README.md +8 -1
- package/docs/_media/README.action.md +53 -311
- package/docs/_media/README.cn.md +10 -2
- package/docs/_media/README.engine.md +22 -1
- package/docs/classes/CheerioFetchEngine.md +236 -88
- package/docs/classes/ClickAction.md +23 -23
- package/docs/classes/EvaluateAction.md +23 -23
- package/docs/classes/ExtractAction.md +23 -23
- package/docs/classes/FetchAction.md +27 -23
- package/docs/classes/FetchEngine.md +218 -86
- package/docs/classes/FetchSession.md +13 -13
- package/docs/classes/FillAction.md +23 -23
- package/docs/classes/GetContentAction.md +23 -23
- package/docs/classes/GotoAction.md +23 -23
- package/docs/classes/KeyboardPressAction.md +533 -0
- package/docs/classes/KeyboardTypeAction.md +533 -0
- package/docs/classes/MouseClickAction.md +533 -0
- package/docs/classes/MouseMoveAction.md +533 -0
- package/docs/classes/PauseAction.md +23 -23
- package/docs/classes/PlaywrightFetchEngine.md +337 -87
- package/docs/classes/SubmitAction.md +23 -23
- package/docs/classes/TrimAction.md +23 -23
- package/docs/classes/WaitForAction.md +23 -23
- package/docs/classes/WebFetcher.md +5 -5
- package/docs/enumerations/FetchActionResultStatus.md +4 -4
- package/docs/functions/fetchWeb.md +2 -2
- package/docs/globals.md +8 -0
- package/docs/interfaces/BaseFetchActionProperties.md +12 -12
- package/docs/interfaces/BaseFetchCollectorActionProperties.md +16 -16
- package/docs/interfaces/BaseFetcherProperties.md +31 -27
- package/docs/interfaces/Cookie.md +14 -14
- package/docs/interfaces/DispatchedEngineAction.md +4 -4
- package/docs/interfaces/EvaluateActionOptions.md +3 -3
- package/docs/interfaces/ExtractActionProperties.md +12 -12
- package/docs/interfaces/FetchActionInContext.md +15 -15
- package/docs/interfaces/FetchActionProperties.md +13 -13
- package/docs/interfaces/FetchActionResult.md +6 -6
- package/docs/interfaces/FetchContext.md +41 -37
- package/docs/interfaces/FetchEngineContext.md +36 -32
- package/docs/interfaces/FetchMetadata.md +5 -5
- package/docs/interfaces/FetchResponse.md +14 -14
- package/docs/interfaces/FetchReturnTypeRegistry.md +7 -7
- package/docs/interfaces/FetchSite.md +34 -30
- package/docs/interfaces/FetcherOptions.md +33 -29
- package/docs/interfaces/GotoActionOptions.md +14 -6
- package/docs/interfaces/KeyboardPressParams.md +25 -0
- package/docs/interfaces/KeyboardTypeParams.md +25 -0
- package/docs/interfaces/MouseClickParams.md +49 -0
- package/docs/interfaces/MouseMoveParams.md +41 -0
- package/docs/interfaces/PendingEngineRequest.md +3 -3
- package/docs/interfaces/StorageOptions.md +5 -5
- package/docs/interfaces/SubmitActionOptions.md +2 -2
- package/docs/interfaces/TrimActionOptions.md +3 -3
- package/docs/interfaces/WaitForActionOptions.md +5 -5
- package/docs/type-aliases/BaseFetchActionOptions.md +1 -1
- package/docs/type-aliases/BaseFetchCollectorOptions.md +1 -1
- package/docs/type-aliases/BrowserEngine.md +1 -1
- package/docs/type-aliases/FetchActionCapabilities.md +1 -1
- package/docs/type-aliases/FetchActionCapabilityMode.md +1 -1
- package/docs/type-aliases/FetchActionOptions.md +1 -1
- package/docs/type-aliases/FetchEngineAction.md +2 -2
- package/docs/type-aliases/FetchEngineType.md +1 -1
- package/docs/type-aliases/FetchReturnType.md +1 -1
- package/docs/type-aliases/FetchReturnTypeFor.md +1 -1
- package/docs/type-aliases/OnFetchPauseCallback.md +1 -1
- package/docs/type-aliases/ResourceType.md +1 -1
- package/docs/type-aliases/TrimPreset.md +1 -1
- package/docs/variables/DefaultFetcherProperties.md +1 -1
- package/docs/variables/FetcherOptionKeys.md +1 -1
- package/docs/variables/TRIM_PRESETS.md +1 -1
- package/package.json +10 -10
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
|
|
9
9
|
> **BaseFetchCollectorOptions** = `RequireAtLeastOne`\<[`BaseFetchCollectorActionProperties`](../interfaces/BaseFetchCollectorActionProperties.md), `"id"` \| `"name"` \| `"action"`\>
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:81](https://github.com/isdk/web-fetcher.js/blob/
|
|
11
|
+
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:81](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L81)
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
|
|
9
9
|
> **BrowserEngine** = `"playwright"` \| `"puppeteer"`
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/web-fetcher/src/core/types.ts:21](https://github.com/isdk/web-fetcher.js/blob/
|
|
11
|
+
Defined in: [packages/web-fetcher/src/core/types.ts:21](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/core/types.ts#L21)
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
|
|
9
9
|
> **FetchActionCapabilities** = `{ [mode in FetchEngineType]?: FetchActionCapabilityMode }`
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:95](https://github.com/isdk/web-fetcher.js/blob/
|
|
11
|
+
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:95](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L95)
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
|
|
9
9
|
> **FetchActionCapabilityMode** = `"native"` \| `"simulate"` \| `"noop"`
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:23](https://github.com/isdk/web-fetcher.js/blob/
|
|
11
|
+
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:23](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L23)
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
|
|
9
9
|
> **FetchActionOptions** = `RequireAtLeastOne`\<[`FetchActionProperties`](../interfaces/FetchActionProperties.md), `"id"` \| `"name"` \| `"action"`\>
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:90](https://github.com/isdk/web-fetcher.js/blob/
|
|
11
|
+
Defined in: [packages/web-fetcher/src/action/fetch-action.ts:90](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/action/fetch-action.ts#L90)
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
# Type Alias: FetchEngineAction
|
|
8
8
|
|
|
9
|
-
> **FetchEngineAction** = \{ `selector`: `string`; `type`: `"click"`; \} \| \{ `selector`: `string`; `type`: `"fill"`; `value`: `string`; \} \| \{ `options?`: [`WaitForActionOptions`](../interfaces/WaitForActionOptions.md); `type`: `"waitFor"`; \} \| \{ `options?`: [`SubmitActionOptions`](../interfaces/SubmitActionOptions.md); `selector?`: `any`; `type`: `"submit"`; \} \| \{ `type`: `"getContent"`; \} \| \{ `opts?`: [`GotoActionOptions`](../interfaces/GotoActionOptions.md); `type`: `"navigate"`; `url`: `string`; \} \| \{ `schema`: `ExtractSchema`; `type`: `"extract"`; \} \| \{ `message?`: `string`; `type`: `"pause"`; \} \| \{ `options`: [`TrimActionOptions`](../interfaces/TrimActionOptions.md); `type`: `"trim"`; \} \| \{ `params`: [`EvaluateActionOptions`](../interfaces/EvaluateActionOptions.md); `type`: `"evaluate"`; \} \| \{ `type`: `"dispose"`; \}
|
|
9
|
+
> **FetchEngineAction** = \{ `selector`: `string`; `type`: `"click"`; \} \| \{ `selector`: `string`; `type`: `"fill"`; `value`: `string`; \} \| \{ `params`: \{ `selector?`: `string`; `steps?`: `number`; `x?`: `number`; `y?`: `number`; \}; `type`: `"mouseMove"`; \} \| \{ `params`: \{ `button?`: `"left"` \| `"right"` \| `"middle"`; `clickCount?`: `number`; `delay?`: `number`; `x?`: `number`; `y?`: `number`; \}; `type`: `"mouseClick"`; \} \| \{ `params`: \{ `delay?`: `number`; `text`: `string`; \}; `type`: `"keyboardType"`; \} \| \{ `params`: \{ `delay?`: `number`; `key`: `string`; \}; `type`: `"keyboardPress"`; \} \| \{ `options?`: [`WaitForActionOptions`](../interfaces/WaitForActionOptions.md); `type`: `"waitFor"`; \} \| \{ `options?`: [`SubmitActionOptions`](../interfaces/SubmitActionOptions.md); `selector?`: `any`; `type`: `"submit"`; \} \| \{ `type`: `"getContent"`; \} \| \{ `opts?`: [`GotoActionOptions`](../interfaces/GotoActionOptions.md); `type`: `"navigate"`; `url`: `string`; \} \| \{ `schema`: `ExtractSchema`; `type`: `"extract"`; \} \| \{ `message?`: `string`; `type`: `"pause"`; \} \| \{ `options`: [`TrimActionOptions`](../interfaces/TrimActionOptions.md); `type`: `"trim"`; \} \| \{ `params`: [`EvaluateActionOptions`](../interfaces/EvaluateActionOptions.md); `type`: `"evaluate"`; \} \| \{ `type`: `"dispose"`; \}
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/web-fetcher/src/engine/base.ts:
|
|
11
|
+
Defined in: [packages/web-fetcher/src/engine/base.ts:210](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/engine/base.ts#L210)
|
|
12
12
|
|
|
13
13
|
Union type representing all possible engine actions that can be dispatched.
|
|
14
14
|
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
|
|
9
9
|
> **FetchEngineType** = `"http"` \| `"browser"`
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/web-fetcher/src/core/types.ts:20](https://github.com/isdk/web-fetcher.js/blob/
|
|
11
|
+
Defined in: [packages/web-fetcher/src/core/types.ts:20](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/core/types.ts#L20)
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
|
|
9
9
|
> **FetchReturnType** = `"response"` \| `"context"` \| `"outputs"` \| `"any"` \| `"none"`
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/web-fetcher/src/core/fetch-return-type.ts:5](https://github.com/isdk/web-fetcher.js/blob/
|
|
11
|
+
Defined in: [packages/web-fetcher/src/core/fetch-return-type.ts:5](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/core/fetch-return-type.ts#L5)
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **FetchReturnTypeFor**\<`R`\> = `R` *extends* keyof [`FetchReturnTypeRegistry`](../interfaces/FetchReturnTypeRegistry.md) ? [`FetchReturnTypeRegistry`](../interfaces/FetchReturnTypeRegistry.md)\[`R`\] : `never`
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/web-fetcher/src/core/fetch-return-type.ts:27](https://github.com/isdk/web-fetcher.js/blob/
|
|
11
|
+
Defined in: [packages/web-fetcher/src/core/fetch-return-type.ts:27](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/core/fetch-return-type.ts#L27)
|
|
12
12
|
|
|
13
13
|
## Type Parameters
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **OnFetchPauseCallback** = (`options`) => `Promise`\<`void`\>
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/web-fetcher/src/core/types.ts:
|
|
11
|
+
Defined in: [packages/web-fetcher/src/core/types.ts:141](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/core/types.ts#L141)
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
|
|
9
9
|
> **ResourceType** = `"image"` \| `"stylesheet"` \| `"font"` \| `"script"` \| `"media"` \| `string`
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/web-fetcher/src/core/types.ts:24](https://github.com/isdk/web-fetcher.js/blob/
|
|
11
|
+
Defined in: [packages/web-fetcher/src/core/types.ts:24](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/core/types.ts#L24)
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
> **TrimPreset** = `"scripts"` \| `"styles"` \| `"svgs"` \| `"images"` \| `"comments"` \| `"hidden"` \| `"all"`
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/web-fetcher/src/engine/base.ts:
|
|
11
|
+
Defined in: [packages/web-fetcher/src/engine/base.ts:117](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/engine/base.ts#L117)
|
|
12
12
|
|
|
13
13
|
Predefined cleanup groups for the [FetchEngine.trim](../classes/FetchEngine.md#trim) action.
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
|
|
9
9
|
> `const` **DefaultFetcherProperties**: [`BaseFetcherProperties`](../interfaces/BaseFetcherProperties.md)
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/web-fetcher/src/core/types.ts:
|
|
11
|
+
Defined in: [packages/web-fetcher/src/core/types.ts:183](https://github.com/isdk/web-fetcher.js/blob/e691a2370f59d15979b47994c8ca14d7b7d2edd3/src/core/types.ts#L183)
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
|
|
9
9
|
> `const` **FetcherOptionKeys**: `string`[]
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/web-fetcher/src/core/types.ts:
|
|
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)
|
|
@@ -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:
|
|
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)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@isdk/web-fetcher",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
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,15 +20,15 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@isdk/common-error": "^0.2.0",
|
|
23
|
-
"camoufox-js": "^0.
|
|
24
|
-
"cheerio": "^1.
|
|
25
|
-
"crawlee": "^3.
|
|
26
|
-
"events-ex": "^2.
|
|
27
|
-
"jsdom": "^
|
|
28
|
-
"lodash-es": "^4.17.
|
|
29
|
-
"nanoid": "^5.1.
|
|
30
|
-
"playwright": "^1.
|
|
31
|
-
"util-ex": "^2.5.
|
|
23
|
+
"camoufox-js": "^0.9.3",
|
|
24
|
+
"cheerio": "^1.2.0",
|
|
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",
|
|
31
|
+
"util-ex": "^2.5.2"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@antfu/eslint-config": "^6.7.3",
|