@crawlee/got-scraping-client 4.0.0-rc.0 → 4.0.0-rc.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.md CHANGED
@@ -34,7 +34,7 @@ Crawlee is available as the [`crawlee`](https://www.npmjs.com/package/crawlee) N
34
34
 
35
35
  We recommend visiting the [Introduction tutorial](https://crawlee.dev/js/docs/introduction) in Crawlee documentation for more information.
36
36
 
37
- > Crawlee requires **Node.js 16 or higher**.
37
+ > Crawlee requires **Node.js 22.13 or higher**.
38
38
 
39
39
  ### With Crawlee CLI
40
40
 
package/index.d.ts CHANGED
@@ -3,12 +3,6 @@ import { BaseHttpClient, type CustomFetchOptions } from '@crawlee/http-client';
3
3
  * A HTTP client implementation based on the `got-scraping` library.
4
4
  */
5
5
  export declare class GotScrapingHttpClient extends BaseHttpClient {
6
- /**
7
- * Type guard that validates the HTTP method (excluding CONNECT).
8
- * @param request - The HTTP request to validate
9
- */
10
- private validateRequest;
11
- private iterateHeaders;
12
- private parseHeaders;
13
- fetch(request: Request, options?: RequestInit & CustomFetchOptions): Promise<Response>;
6
+ #private;
7
+ protected fetch(request: Request, options?: RequestInit & CustomFetchOptions): Promise<Response>;
14
8
  }
package/index.js CHANGED
@@ -9,10 +9,10 @@ export class GotScrapingHttpClient extends BaseHttpClient {
9
9
  * Type guard that validates the HTTP method (excluding CONNECT).
10
10
  * @param request - The HTTP request to validate
11
11
  */
12
- validateRequest(request) {
12
+ #validateRequest(request) {
13
13
  return !['CONNECT', 'connect'].includes(request.method);
14
14
  }
15
- *iterateHeaders(headers) {
15
+ *#iterateHeaders(headers) {
16
16
  for (const [key, value] of Object.entries(headers)) {
17
17
  if (key.startsWith(':') || value === undefined)
18
18
  continue;
@@ -25,12 +25,12 @@ export class GotScrapingHttpClient extends BaseHttpClient {
25
25
  }
26
26
  }
27
27
  }
28
- parseHeaders(headers) {
29
- return new Headers([...this.iterateHeaders(headers)]);
28
+ #parseHeaders(headers) {
29
+ return new Headers([...this.#iterateHeaders(headers)]);
30
30
  }
31
31
  async fetch(request, options) {
32
32
  const { proxyUrl, redirect, ignoreTlsErrors } = options ?? {};
33
- if (!this.validateRequest(request)) {
33
+ if (!this.#validateRequest(request)) {
34
34
  throw new Error(`The HTTP method CONNECT is not supported by the GotScrapingHttpClient.`);
35
35
  }
36
36
  const gotResult = await gotScraping({
@@ -43,7 +43,7 @@ export class GotScrapingHttpClient extends BaseHttpClient {
43
43
  followRedirect: redirect === 'follow',
44
44
  ...(ignoreTlsErrors ? { https: { rejectUnauthorized: false } } : {}),
45
45
  });
46
- const responseHeaders = this.parseHeaders(gotResult.headers);
46
+ const responseHeaders = this.#parseHeaders(gotResult.headers);
47
47
  return new ResponseWithUrl(new Uint8Array(gotResult.rawBody), {
48
48
  headers: responseHeaders,
49
49
  status: gotResult.statusCode,
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@crawlee/got-scraping-client",
3
- "version": "4.0.0-rc.0",
3
+ "version": "4.0.0-rc.1",
4
4
  "description": "The scalable web crawling and scraping library for JavaScript/Node.js. Enables development of data extraction and web automation jobs (not only) with headless Chrome and Puppeteer.",
5
5
  "engines": {
6
- "node": ">=22.0.0"
6
+ "node": ">=22.13.0"
7
7
  },
8
8
  "type": "module",
9
9
  "exports": {
@@ -47,7 +47,7 @@
47
47
  "access": "public"
48
48
  },
49
49
  "dependencies": {
50
- "@crawlee/http-client": "4.0.0-rc.0",
50
+ "@crawlee/http-client": "4.0.0-rc.1",
51
51
  "got-scraping": "^4.2.1"
52
52
  },
53
53
  "lerna": {
@@ -57,5 +57,5 @@
57
57
  }
58
58
  }
59
59
  },
60
- "gitHead": "79ab33dacdacb83e0197e6516d145f3aceef80c7"
60
+ "gitHead": "f354ca5e943bed1a5c657a1fce1974c053f9fff0"
61
61
  }