@crawlee/core 4.0.0-beta.250 → 4.0.0-beta.251
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 +6 -6
- package/request.js +7 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crawlee/core",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.251",
|
|
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.13.0"
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
"@apify/log": "^3.0.1",
|
|
54
54
|
"@apify/timeout": "^1.0.1",
|
|
55
55
|
"@apify/utilities": "^3.1.0",
|
|
56
|
-
"@crawlee/fs-storage": "4.0.0-beta.
|
|
57
|
-
"@crawlee/http-client": "4.0.0-beta.
|
|
58
|
-
"@crawlee/types": "4.0.0-beta.
|
|
59
|
-
"@crawlee/utils": "4.0.0-beta.
|
|
56
|
+
"@crawlee/fs-storage": "4.0.0-beta.251",
|
|
57
|
+
"@crawlee/http-client": "4.0.0-beta.251",
|
|
58
|
+
"@crawlee/types": "4.0.0-beta.251",
|
|
59
|
+
"@crawlee/utils": "4.0.0-beta.251",
|
|
60
60
|
"@sapphire/async-queue": "^1.5.5",
|
|
61
61
|
"@standard-schema/spec": "^1.1.0",
|
|
62
62
|
"@vladfrangu/async_event_emitter": "^2.4.7",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "e8a0d8a538fabf624c73b6354dbf7194882300a5"
|
|
80
80
|
}
|
package/request.js
CHANGED
|
@@ -2,6 +2,7 @@ import crypto from 'node:crypto';
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { cryptoRandomObjectId, normalizeUrl } from '@apify/utilities';
|
|
4
4
|
import { serviceLocator } from './service-locator.js';
|
|
5
|
+
import { snapshotValue } from './storages/transaction.js';
|
|
5
6
|
import { parseArgument, schemas } from './validators.js';
|
|
6
7
|
// new properties on the Request object breaks serialization
|
|
7
8
|
// Compiled once: every `Request` runs it, and the generated fast path skips zod's interpreter.
|
|
@@ -161,7 +162,10 @@ class CrawleeRequest {
|
|
|
161
162
|
// Read `__crawlee` explicitly - on a `userData` coming from another Request instance the
|
|
162
163
|
// bag is non-enumerable, so the spread alone would silently drop the internal state
|
|
163
164
|
// (e.g. `skipNavigation`) when a request is re-wrapped after a storage round trip.
|
|
164
|
-
this.#userData = {
|
|
165
|
+
this.#userData = {
|
|
166
|
+
...snapshotValue(userData),
|
|
167
|
+
__crawlee: snapshotValue(userData.__crawlee ?? {}),
|
|
168
|
+
};
|
|
165
169
|
// `userData` must stay an enumerable own accessor — serialization in the storages relies on it
|
|
166
170
|
Object.defineProperties(this, {
|
|
167
171
|
userData: {
|
|
@@ -192,8 +196,8 @@ class CrawleeRequest {
|
|
|
192
196
|
enumerable: true,
|
|
193
197
|
},
|
|
194
198
|
});
|
|
195
|
-
// reassign userData
|
|
196
|
-
this.userData = userData;
|
|
199
|
+
// reassign the copy, not the possibly shared `userData`, so that internal `__crawlee` object is non-enumerable
|
|
200
|
+
this.userData = this.#userData;
|
|
197
201
|
const crawlee = (this.userData.__crawlee ??= {});
|
|
198
202
|
if (skipNavigation != null)
|
|
199
203
|
crawlee.skipNavigation = skipNavigation;
|