@crawlee/core 4.0.0-beta.212 → 4.0.0-beta.213

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crawlee/core",
3
- "version": "4.0.0-beta.212",
3
+ "version": "4.0.0-beta.213",
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
6
  "node": ">=22.0.0"
@@ -53,10 +53,10 @@
53
53
  "@apify/log": "^3.0.1",
54
54
  "@apify/timeout": "^1.0.1",
55
55
  "@apify/utilities": "^3.0.1",
56
- "@crawlee/fs-storage": "4.0.0-beta.212",
57
- "@crawlee/http-client": "4.0.0-beta.212",
58
- "@crawlee/types": "4.0.0-beta.212",
59
- "@crawlee/utils": "4.0.0-beta.212",
56
+ "@crawlee/fs-storage": "4.0.0-beta.213",
57
+ "@crawlee/http-client": "4.0.0-beta.213",
58
+ "@crawlee/types": "4.0.0-beta.213",
59
+ "@crawlee/utils": "4.0.0-beta.213",
60
60
  "@sapphire/async-queue": "^1.5.5",
61
61
  "@standard-schema/spec": "^1.0.0",
62
62
  "@vladfrangu/async_event_emitter": "^2.4.6",
@@ -76,5 +76,5 @@
76
76
  }
77
77
  }
78
78
  },
79
- "gitHead": "171a63a5d7f2a6d74cbce58479204ac20d30b87e"
79
+ "gitHead": "99d9370281d90291b8d20b4ad597fc2d0bcbcd80"
80
80
  }
@@ -38,8 +38,12 @@ export interface IProxyConfiguration {
38
38
  /**
39
39
  * Creates a new {@link ProxyInfo} object describing the proxy to use.
40
40
  * Returns `undefined` when no proxy should be used.
41
+ *
42
+ * @param proxyInfo A previously created `ProxyInfo`, e.g. one restored with a persisted session. Implementations
43
+ * should return an equivalent `ProxyInfo` that is usable in the current environment, or the argument itself when
44
+ * there is nothing to refresh.
41
45
  */
42
- newProxyInfo(): Promise<ProxyInfo | undefined>;
46
+ newProxyInfo(proxyInfo?: ProxyInfo): Promise<ProxyInfo | undefined>;
43
47
  }
44
48
  /**
45
49
  * Configures connection to a proxy server with the provided options. Proxy servers are used to prevent target websites from blocking
@@ -100,9 +104,10 @@ export declare class ProxyConfiguration implements IProxyConfiguration {
100
104
  * Use it if you want to work with a rich representation of a proxy URL.
101
105
  * If you need the URL string only, use {@link ProxyConfiguration.newUrl}.
102
106
  *
107
+ * @param proxyInfo A previously created `ProxyInfo`, returned unchanged.
103
108
  * @return Represents information about used proxy and its configuration.
104
109
  */
105
- newProxyInfo(): Promise<ProxyInfo | undefined>;
110
+ newProxyInfo(proxyInfo?: ProxyInfo): Promise<ProxyInfo | undefined>;
106
111
  /**
107
112
  * Returns a new proxy URL based on provided configuration options.
108
113
  *
@@ -84,9 +84,12 @@ export class ProxyConfiguration {
84
84
  * Use it if you want to work with a rich representation of a proxy URL.
85
85
  * If you need the URL string only, use {@link ProxyConfiguration.newUrl}.
86
86
  *
87
+ * @param proxyInfo A previously created `ProxyInfo`, returned unchanged.
87
88
  * @return Represents information about used proxy and its configuration.
88
89
  */
89
- async newProxyInfo() {
90
+ async newProxyInfo(proxyInfo) {
91
+ if (proxyInfo)
92
+ return proxyInfo;
90
93
  const url = await this.newUrl();
91
94
  if (!url)
92
95
  return undefined;