@crawlee/core 4.0.0-beta.26 → 4.0.0-beta.260
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 +15 -15
- package/byte-utils.d.ts +17 -0
- package/byte-utils.js +42 -0
- package/configuration.d.ts +77 -235
- package/configuration.js +159 -227
- package/debug.d.ts +36 -0
- package/debug.js +70 -0
- package/errors.d.ts +45 -18
- package/errors.js +58 -27
- package/events/event-manager.d.ts +78 -0
- package/events/{event_manager.js → event-manager.js} +12 -13
- package/events/index.d.ts +3 -3
- package/events/index.js +2 -3
- package/events/local-event-manager.d.ts +32 -0
- package/events/local-event-manager.js +101 -0
- package/events/system-info.d.ts +38 -0
- package/events/system-info.js +1 -0
- package/index.d.ts +9 -12
- package/index.js +10 -11
- package/internal.d.ts +8 -0
- package/internal.js +9 -0
- package/iterables.d.ts +79 -0
- package/iterables.js +134 -0
- package/log.d.ts +77 -1
- package/log.js +134 -1
- package/memory-storage/consts.d.ts +4 -0
- package/memory-storage/consts.js +4 -0
- package/memory-storage/index.d.ts +1 -0
- package/memory-storage/index.js +1 -0
- package/memory-storage/memory-storage.d.ts +43 -0
- package/memory-storage/memory-storage.js +158 -0
- package/memory-storage/resource-clients/common/base-client.d.ts +4 -0
- package/memory-storage/resource-clients/common/base-client.js +6 -0
- package/memory-storage/resource-clients/dataset.d.ts +35 -0
- package/memory-storage/resource-clients/dataset.js +108 -0
- package/memory-storage/resource-clients/key-value-store.d.ts +54 -0
- package/memory-storage/resource-clients/key-value-store.js +179 -0
- package/memory-storage/resource-clients/request-queue.d.ts +55 -0
- package/memory-storage/resource-clients/request-queue.js +413 -0
- package/memory-storage/utils.d.ts +16 -0
- package/memory-storage/utils.js +41 -0
- package/owned-or-injected.d.ts +58 -0
- package/owned-or-injected.js +98 -0
- package/package.json +23 -23
- package/proxy-configuration.d.ts +118 -0
- package/proxy-configuration.js +141 -0
- package/recoverable-state.d.ts +177 -0
- package/recoverable-state.js +268 -0
- package/request.d.ts +48 -93
- package/request.js +139 -232
- package/serialization.d.ts +0 -1
- package/serialization.js +18 -18
- package/service-locator.d.ts +168 -0
- package/service-locator.js +255 -0
- package/storages/batched-adds.d.ts +39 -0
- package/storages/batched-adds.js +78 -0
- package/storages/dataset.d.ts +105 -58
- package/storages/dataset.js +292 -150
- package/storages/index.d.ts +11 -12
- package/storages/index.js +7 -12
- package/storages/key-value-store-codec.d.ts +32 -0
- package/storages/key-value-store-codec.js +108 -0
- package/storages/{key_value_store.d.ts → key-value-store.d.ts} +169 -72
- package/storages/key-value-store.js +767 -0
- package/storages/request-dedup-cache.d.ts +20 -0
- package/storages/request-dedup-cache.js +48 -0
- package/storages/{request_list.d.ts → request-list.d.ts} +33 -173
- package/storages/{request_list.js → request-list.js} +276 -255
- package/storages/request-loader.d.ts +127 -0
- package/storages/request-loader.js +36 -0
- package/storages/request-manager-tandem.d.ts +82 -0
- package/storages/request-manager-tandem.js +200 -0
- package/storages/request-manager.d.ts +119 -0
- package/storages/request-manager.js +1 -0
- package/storages/{request_provider.d.ts → request-queue.d.ts} +128 -159
- package/storages/request-queue.js +871 -0
- package/storages/storage-instance-manager.d.ts +86 -0
- package/storages/storage-instance-manager.js +256 -0
- package/storages/storage-stats.d.ts +48 -0
- package/storages/storage-stats.js +29 -0
- package/storages/transaction.d.ts +270 -0
- package/storages/transaction.js +296 -0
- package/storages/utils.d.ts +59 -11
- package/storages/utils.js +76 -16
- package/system-info/cpu-info.d.ts +67 -0
- package/system-info/cpu-info.js +216 -0
- package/system-info/memory-info.d.ts +31 -0
- package/system-info/memory-info.js +115 -0
- package/system-info/ps-tree.d.ts +17 -0
- package/system-info/ps-tree.js +144 -0
- package/system-info/runtime.d.ts +14 -0
- package/system-info/runtime.js +80 -0
- package/typedefs.d.ts +0 -6
- package/typedefs.js +0 -1
- package/url.d.ts +9 -0
- package/url.js +11 -0
- package/validators.d.ts +23 -18
- package/validators.js +14 -18
- package/autoscaling/autoscaled_pool.d.ts +0 -300
- package/autoscaling/autoscaled_pool.d.ts.map +0 -1
- package/autoscaling/autoscaled_pool.js +0 -533
- package/autoscaling/autoscaled_pool.js.map +0 -1
- package/autoscaling/index.d.ts +0 -4
- package/autoscaling/index.d.ts.map +0 -1
- package/autoscaling/index.js +0 -4
- package/autoscaling/index.js.map +0 -1
- package/autoscaling/snapshotter.d.ts +0 -189
- package/autoscaling/snapshotter.d.ts.map +0 -1
- package/autoscaling/snapshotter.js +0 -285
- package/autoscaling/snapshotter.js.map +0 -1
- package/autoscaling/system_status.d.ts +0 -181
- package/autoscaling/system_status.d.ts.map +0 -1
- package/autoscaling/system_status.js +0 -169
- package/autoscaling/system_status.js.map +0 -1
- package/configuration.d.ts.map +0 -1
- package/configuration.js.map +0 -1
- package/cookie_utils.d.ts +0 -43
- package/cookie_utils.d.ts.map +0 -1
- package/cookie_utils.js +0 -111
- package/cookie_utils.js.map +0 -1
- package/crawlers/context_pipeline.d.ts +0 -61
- package/crawlers/context_pipeline.d.ts.map +0 -1
- package/crawlers/context_pipeline.js +0 -99
- package/crawlers/context_pipeline.js.map +0 -1
- package/crawlers/crawler_commons.d.ts +0 -191
- package/crawlers/crawler_commons.d.ts.map +0 -1
- package/crawlers/crawler_commons.js +0 -108
- package/crawlers/crawler_commons.js.map +0 -1
- package/crawlers/crawler_utils.d.ts +0 -10
- package/crawlers/crawler_utils.d.ts.map +0 -1
- package/crawlers/crawler_utils.js +0 -12
- package/crawlers/crawler_utils.js.map +0 -1
- package/crawlers/error_snapshotter.d.ts +0 -60
- package/crawlers/error_snapshotter.d.ts.map +0 -1
- package/crawlers/error_snapshotter.js +0 -118
- package/crawlers/error_snapshotter.js.map +0 -1
- package/crawlers/error_tracker.d.ts +0 -55
- package/crawlers/error_tracker.d.ts.map +0 -1
- package/crawlers/error_tracker.js +0 -309
- package/crawlers/error_tracker.js.map +0 -1
- package/crawlers/index.d.ts +0 -7
- package/crawlers/index.d.ts.map +0 -1
- package/crawlers/index.js +0 -7
- package/crawlers/index.js.map +0 -1
- package/crawlers/internals/types.d.ts +0 -8
- package/crawlers/internals/types.d.ts.map +0 -1
- package/crawlers/internals/types.js +0 -2
- package/crawlers/internals/types.js.map +0 -1
- package/crawlers/statistics.d.ts +0 -213
- package/crawlers/statistics.d.ts.map +0 -1
- package/crawlers/statistics.js +0 -349
- package/crawlers/statistics.js.map +0 -1
- package/enqueue_links/enqueue_links.d.ts +0 -249
- package/enqueue_links/enqueue_links.d.ts.map +0 -1
- package/enqueue_links/enqueue_links.js +0 -269
- package/enqueue_links/enqueue_links.js.map +0 -1
- package/enqueue_links/index.d.ts +0 -3
- package/enqueue_links/index.d.ts.map +0 -1
- package/enqueue_links/index.js +0 -3
- package/enqueue_links/index.js.map +0 -1
- package/enqueue_links/shared.d.ts +0 -73
- package/enqueue_links/shared.d.ts.map +0 -1
- package/enqueue_links/shared.js +0 -212
- package/enqueue_links/shared.js.map +0 -1
- package/errors.d.ts.map +0 -1
- package/errors.js.map +0 -1
- package/events/event_manager.d.ts +0 -52
- package/events/event_manager.d.ts.map +0 -1
- package/events/event_manager.js.map +0 -1
- package/events/index.d.ts.map +0 -1
- package/events/index.js.map +0 -1
- package/events/local_event_manager.d.ts +0 -27
- package/events/local_event_manager.d.ts.map +0 -1
- package/events/local_event_manager.js +0 -75
- package/events/local_event_manager.js.map +0 -1
- package/index.d.ts.map +0 -1
- package/index.js.map +0 -1
- package/log.d.ts.map +0 -1
- package/log.js.map +0 -1
- package/proxy_configuration.d.ts +0 -169
- package/proxy_configuration.d.ts.map +0 -1
- package/proxy_configuration.js +0 -247
- package/proxy_configuration.js.map +0 -1
- package/recoverable_state.d.ts +0 -123
- package/recoverable_state.d.ts.map +0 -1
- package/recoverable_state.js +0 -140
- package/recoverable_state.js.map +0 -1
- package/request.d.ts.map +0 -1
- package/request.js.map +0 -1
- package/router.d.ts +0 -134
- package/router.d.ts.map +0 -1
- package/router.js +0 -164
- package/router.js.map +0 -1
- package/serialization.d.ts.map +0 -1
- package/serialization.js.map +0 -1
- package/session_pool/consts.d.ts +0 -4
- package/session_pool/consts.d.ts.map +0 -1
- package/session_pool/consts.js +0 -4
- package/session_pool/consts.js.map +0 -1
- package/session_pool/errors.d.ts +0 -8
- package/session_pool/errors.d.ts.map +0 -1
- package/session_pool/errors.js +0 -12
- package/session_pool/errors.js.map +0 -1
- package/session_pool/events.d.ts +0 -3
- package/session_pool/events.d.ts.map +0 -1
- package/session_pool/events.js +0 -3
- package/session_pool/events.js.map +0 -1
- package/session_pool/index.d.ts +0 -6
- package/session_pool/index.d.ts.map +0 -1
- package/session_pool/index.js +0 -6
- package/session_pool/index.js.map +0 -1
- package/session_pool/session.d.ts +0 -186
- package/session_pool/session.d.ts.map +0 -1
- package/session_pool/session.js +0 -278
- package/session_pool/session.js.map +0 -1
- package/session_pool/session_pool.d.ts +0 -258
- package/session_pool/session_pool.d.ts.map +0 -1
- package/session_pool/session_pool.js +0 -387
- package/session_pool/session_pool.js.map +0 -1
- package/storages/access_checking.d.ts +0 -13
- package/storages/access_checking.d.ts.map +0 -1
- package/storages/access_checking.js +0 -14
- package/storages/access_checking.js.map +0 -1
- package/storages/dataset.d.ts.map +0 -1
- package/storages/dataset.js.map +0 -1
- package/storages/index.d.ts.map +0 -1
- package/storages/index.js.map +0 -1
- package/storages/key_value_store.d.ts.map +0 -1
- package/storages/key_value_store.js +0 -512
- package/storages/key_value_store.js.map +0 -1
- package/storages/request_list.d.ts.map +0 -1
- package/storages/request_list.js.map +0 -1
- package/storages/request_list_adapter.d.ts +0 -58
- package/storages/request_list_adapter.d.ts.map +0 -1
- package/storages/request_list_adapter.js +0 -81
- package/storages/request_list_adapter.js.map +0 -1
- package/storages/request_manager_tandem.d.ts +0 -68
- package/storages/request_manager_tandem.d.ts.map +0 -1
- package/storages/request_manager_tandem.js +0 -124
- package/storages/request_manager_tandem.js.map +0 -1
- package/storages/request_provider.d.ts.map +0 -1
- package/storages/request_provider.js +0 -591
- package/storages/request_provider.js.map +0 -1
- package/storages/request_queue.d.ts +0 -128
- package/storages/request_queue.d.ts.map +0 -1
- package/storages/request_queue.js +0 -320
- package/storages/request_queue.js.map +0 -1
- package/storages/request_queue_v2.d.ts +0 -87
- package/storages/request_queue_v2.d.ts.map +0 -1
- package/storages/request_queue_v2.js +0 -438
- package/storages/request_queue_v2.js.map +0 -1
- package/storages/sitemap_request_list.d.ts +0 -250
- package/storages/sitemap_request_list.d.ts.map +0 -1
- package/storages/sitemap_request_list.js +0 -431
- package/storages/sitemap_request_list.js.map +0 -1
- package/storages/storage_manager.d.ts +0 -62
- package/storages/storage_manager.d.ts.map +0 -1
- package/storages/storage_manager.js +0 -105
- package/storages/storage_manager.js.map +0 -1
- package/storages/utils.d.ts.map +0 -1
- package/storages/utils.js.map +0 -1
- package/typedefs.d.ts.map +0 -1
- package/typedefs.js.map +0 -1
- package/validators.d.ts.map +0 -1
- package/validators.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/session_pool/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IAC3B,QAAQ,CAAC,kBAAkB,EAAE,OAAO;gBAA3B,kBAAkB,EAAE,OAAO;CAInD"}
|
package/session_pool/errors.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @ignore
|
|
3
|
-
*/
|
|
4
|
-
export class CookieParseError extends Error {
|
|
5
|
-
cookieHeaderString;
|
|
6
|
-
constructor(cookieHeaderString) {
|
|
7
|
-
super(`Could not parse cookie header string: ${cookieHeaderString}`);
|
|
8
|
-
this.cookieHeaderString = cookieHeaderString;
|
|
9
|
-
Error.captureStackTrace(this, CookieParseError);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/session_pool/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAClB;IAArB,YAAqB,kBAA2B;QAC5C,KAAK,CAAC,yCAAyC,kBAAkB,EAAE,CAAC,CAAC;QADpD,uBAAkB,GAAlB,kBAAkB,CAAS;QAE5C,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;IACpD,CAAC;CACJ"}
|
package/session_pool/events.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/session_pool/events.ts"],"names":[],"mappings":"AAAA,gBAAgB;AAChB,eAAO,MAAM,qBAAqB,mBAAmB,CAAC"}
|
package/session_pool/events.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/session_pool/events.ts"],"names":[],"mappings":"AAAA,gBAAgB;AAChB,MAAM,CAAC,MAAM,qBAAqB,GAAG,gBAAgB,CAAC"}
|
package/session_pool/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/session_pool/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC"}
|
package/session_pool/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/session_pool/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC"}
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
import type { Cookie as CookieObject, Dictionary, ISession, ProxyInfo, SessionState } from '@crawlee/types';
|
|
2
|
-
import type { Cookie } from 'tough-cookie';
|
|
3
|
-
import { CookieJar } from 'tough-cookie';
|
|
4
|
-
import type { Log } from '@apify/log';
|
|
5
|
-
export interface SessionOptions {
|
|
6
|
-
/** Id of session used for generating fingerprints. It is used as proxy session name. */
|
|
7
|
-
id?: string;
|
|
8
|
-
/**
|
|
9
|
-
* Number of seconds after which the session is considered as expired.
|
|
10
|
-
* @default 3000
|
|
11
|
-
*/
|
|
12
|
-
maxAgeSecs?: number;
|
|
13
|
-
/** Object where custom user data can be stored. For example custom headers. */
|
|
14
|
-
userData?: Dictionary;
|
|
15
|
-
/**
|
|
16
|
-
* Maximum number of marking session as blocked usage.
|
|
17
|
-
* If the `errorScore` reaches the `maxErrorScore` session is marked as block and it is thrown away.
|
|
18
|
-
* It starts at 0. Calling the `markBad` function increases the `errorScore` by 1.
|
|
19
|
-
* Calling the `markGood` will decrease the `errorScore` by `errorScoreDecrement`
|
|
20
|
-
* @default 3
|
|
21
|
-
*/
|
|
22
|
-
maxErrorScore?: number;
|
|
23
|
-
/**
|
|
24
|
-
* It is used for healing the session.
|
|
25
|
-
* For example: if your session is marked bad two times, but it is successful on the third attempt it's errorScore
|
|
26
|
-
* is decremented by this number.
|
|
27
|
-
* @default 0.5
|
|
28
|
-
*/
|
|
29
|
-
errorScoreDecrement?: number;
|
|
30
|
-
/** Date of creation. */
|
|
31
|
-
createdAt?: Date;
|
|
32
|
-
/** Date of expiration. */
|
|
33
|
-
expiresAt?: Date;
|
|
34
|
-
/**
|
|
35
|
-
* Indicates how many times the session has been used.
|
|
36
|
-
* @default 0
|
|
37
|
-
*/
|
|
38
|
-
usageCount?: number;
|
|
39
|
-
/**
|
|
40
|
-
* Session should be used only a limited amount of times.
|
|
41
|
-
* This number indicates how many times the session is going to be used, before it is thrown away.
|
|
42
|
-
* @default 50
|
|
43
|
-
*/
|
|
44
|
-
maxUsageCount?: number;
|
|
45
|
-
/** SessionPool instance. Session will emit the `sessionRetired` event on this instance. */
|
|
46
|
-
sessionPool?: import('./session_pool.js').SessionPool;
|
|
47
|
-
log?: Log;
|
|
48
|
-
errorScore?: number;
|
|
49
|
-
cookieJar?: CookieJar;
|
|
50
|
-
proxyInfo?: ProxyInfo;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Sessions are used to store information such as cookies and can be used for generating fingerprints and proxy sessions.
|
|
54
|
-
* You can imagine each session as a specific user, with its own cookies, IP (via proxy) and potentially a unique browser fingerprint.
|
|
55
|
-
* Session internal state can be enriched with custom user data for example some authorization tokens and specific headers in general.
|
|
56
|
-
* @category Scaling
|
|
57
|
-
*/
|
|
58
|
-
export declare class Session implements ISession {
|
|
59
|
-
readonly id: string;
|
|
60
|
-
private maxAgeSecs;
|
|
61
|
-
userData: Dictionary;
|
|
62
|
-
private _maxErrorScore;
|
|
63
|
-
private _errorScoreDecrement;
|
|
64
|
-
private _createdAt;
|
|
65
|
-
private _expiresAt;
|
|
66
|
-
private _usageCount;
|
|
67
|
-
private _maxUsageCount;
|
|
68
|
-
private sessionPool;
|
|
69
|
-
private _errorScore;
|
|
70
|
-
private _proxyInfo?;
|
|
71
|
-
private _cookieJar;
|
|
72
|
-
private log;
|
|
73
|
-
get errorScore(): number;
|
|
74
|
-
get usageCount(): number;
|
|
75
|
-
get maxErrorScore(): number;
|
|
76
|
-
get errorScoreDecrement(): number;
|
|
77
|
-
get expiresAt(): Date;
|
|
78
|
-
get createdAt(): Date;
|
|
79
|
-
get maxUsageCount(): number;
|
|
80
|
-
get cookieJar(): CookieJar;
|
|
81
|
-
get proxyInfo(): ProxyInfo | undefined;
|
|
82
|
-
/**
|
|
83
|
-
* Session configuration.
|
|
84
|
-
*/
|
|
85
|
-
constructor(options: SessionOptions);
|
|
86
|
-
/**
|
|
87
|
-
* Indicates whether the session is blocked.
|
|
88
|
-
* Session is blocked once it reaches the `maxErrorScore`.
|
|
89
|
-
*/
|
|
90
|
-
isBlocked(): boolean;
|
|
91
|
-
/**
|
|
92
|
-
* Indicates whether the session is expired.
|
|
93
|
-
* Session expiration is determined by the `maxAgeSecs`.
|
|
94
|
-
* Once the session is older than `createdAt + maxAgeSecs` the session is considered expired.
|
|
95
|
-
*/
|
|
96
|
-
isExpired(): boolean;
|
|
97
|
-
/**
|
|
98
|
-
* Indicates whether the session is used maximum number of times.
|
|
99
|
-
* Session maximum usage count can be changed by `maxUsageCount` parameter.
|
|
100
|
-
*/
|
|
101
|
-
isMaxUsageCountReached(): boolean;
|
|
102
|
-
/**
|
|
103
|
-
* Indicates whether the session can be used for next requests.
|
|
104
|
-
* Session is usable when it is not expired, not blocked and the maximum usage count has not be reached.
|
|
105
|
-
*/
|
|
106
|
-
isUsable(): boolean;
|
|
107
|
-
/**
|
|
108
|
-
* This method should be called after a successful session usage.
|
|
109
|
-
* It increases `usageCount` and potentially lowers the `errorScore` by the `errorScoreDecrement`.
|
|
110
|
-
*/
|
|
111
|
-
markGood(): void;
|
|
112
|
-
/**
|
|
113
|
-
* Gets session state for persistence in KeyValueStore.
|
|
114
|
-
* @returns Represents session internal state.
|
|
115
|
-
*/
|
|
116
|
-
getState(): SessionState;
|
|
117
|
-
/**
|
|
118
|
-
* Marks session as blocked and emits event on the `SessionPool`
|
|
119
|
-
* This method should be used if the session usage was unsuccessful
|
|
120
|
-
* and you are sure that it is because of the session configuration and not any external matters.
|
|
121
|
-
* For example when server returns 403 status code.
|
|
122
|
-
* If the session does not work due to some external factors as server error such as 5XX you probably want to use `markBad` method.
|
|
123
|
-
*/
|
|
124
|
-
retire(): void;
|
|
125
|
-
/**
|
|
126
|
-
* Increases usage and error count.
|
|
127
|
-
* Should be used when the session has been used unsuccessfully. For example because of timeouts.
|
|
128
|
-
*/
|
|
129
|
-
markBad(): void;
|
|
130
|
-
/**
|
|
131
|
-
* With certain status codes: `401`, `403` or `429` we can be certain
|
|
132
|
-
* that the target website is blocking us. This function helps to do this conveniently
|
|
133
|
-
* by retiring the session when such code is received. Optionally, the default status
|
|
134
|
-
* codes can be extended in the second parameter.
|
|
135
|
-
* @param statusCode HTTP status code.
|
|
136
|
-
* @returns Whether the session was retired.
|
|
137
|
-
*/
|
|
138
|
-
retireOnBlockedStatusCodes(statusCode: number): boolean;
|
|
139
|
-
/**
|
|
140
|
-
* Saves cookies from an HTTP response to be used with the session.
|
|
141
|
-
* It expects an object with a `headers` property that's either an `Object`
|
|
142
|
-
* (typical Node.js responses) or a `Function` (Puppeteer Response).
|
|
143
|
-
*
|
|
144
|
-
* It then parses and saves the cookies from the `set-cookie` header, if available.
|
|
145
|
-
*/
|
|
146
|
-
setCookiesFromResponse(response: Response): void;
|
|
147
|
-
/**
|
|
148
|
-
* Saves an array with cookie objects to be used with the session.
|
|
149
|
-
* The objects should be in the format that
|
|
150
|
-
* [Puppeteer uses](https://pptr.dev/#?product=Puppeteer&version=v2.0.0&show=api-pagecookiesurls),
|
|
151
|
-
* but you can also use this function to set cookies manually:
|
|
152
|
-
*
|
|
153
|
-
* ```
|
|
154
|
-
* [
|
|
155
|
-
* { name: 'cookie1', value: 'my-cookie' },
|
|
156
|
-
* { name: 'cookie2', value: 'your-cookie' }
|
|
157
|
-
* ]
|
|
158
|
-
* ```
|
|
159
|
-
*/
|
|
160
|
-
setCookies(cookies: CookieObject[], url: string): void;
|
|
161
|
-
/**
|
|
162
|
-
* Returns cookies in a format compatible with puppeteer/playwright and ready to be used with `page.setCookie`.
|
|
163
|
-
* @param url website url. Only cookies stored for this url will be returned
|
|
164
|
-
*/
|
|
165
|
-
getCookies(url: string): CookieObject[];
|
|
166
|
-
/**
|
|
167
|
-
* Returns cookies saved with the session in the typical
|
|
168
|
-
* key1=value1; key2=value2 format, ready to be used in
|
|
169
|
-
* a cookie header or elsewhere.
|
|
170
|
-
* @returns Represents `Cookie` header.
|
|
171
|
-
*/
|
|
172
|
-
getCookieString(url: string): string;
|
|
173
|
-
/**
|
|
174
|
-
* Sets a cookie within this session for the specific URL.
|
|
175
|
-
*/
|
|
176
|
-
setCookie(rawCookie: string, url: string): void;
|
|
177
|
-
/**
|
|
178
|
-
* Sets cookies.
|
|
179
|
-
*/
|
|
180
|
-
protected _setCookies(cookies: Cookie[], url: string): void;
|
|
181
|
-
/**
|
|
182
|
-
* Checks if session is not usable. if it is not retires the session.
|
|
183
|
-
*/
|
|
184
|
-
protected _maybeSelfRetire(): void;
|
|
185
|
-
}
|
|
186
|
-
//# sourceMappingURL=session.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/session_pool/session.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,IAAI,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE5G,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAYtC,MAAM,WAAW,cAAc;IAC3B,wFAAwF;IACxF,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,UAAU,CAAC;IAEtB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B,wBAAwB;IACxB,SAAS,CAAC,EAAE,IAAI,CAAC;IAEjB,0BAA0B;IAC1B,SAAS,CAAC,EAAE,IAAI,CAAC;IAEjB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,2FAA2F;IAC3F,WAAW,CAAC,EAAE,OAAO,mBAAmB,EAAE,WAAW,CAAC;IAEtD,GAAG,CAAC,EAAE,G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IASvD;;;;;;OAMG;IACH,sBAAsB,CAAC,QAAQ,EAAE,QAAQ;IAWzC;;;;;;;;;;;;OAYG;IACH,UAAU,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,GAAG,EAAE,MAAM;IAK/C;;;OAGG;IACH,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,EAAE;IAKvC;;;;;OAKG;IACH,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAIpC;;OAEG;IACH,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAI/C;;OAEG;IACH,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAkB3D;;OAEG;IACH,SAAS,CAAC,gBAAgB,IAAI,IAAI;CAKrC"}
|
package/session_pool/session.js
DELETED
|
@@ -1,278 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from 'node:events';
|
|
2
|
-
import ow from 'ow';
|
|
3
|
-
import { CookieJar } from 'tough-cookie';
|
|
4
|
-
import { cryptoRandomObjectId } from '@apify/utilities';
|
|
5
|
-
import { browserPoolCookieToToughCookie, getCookiesFromResponse, getDefaultCookieExpirationDate, toughCookieToBrowserPoolCookie, } from '../cookie_utils.js';
|
|
6
|
-
import { log as defaultLog } from '../log.js';
|
|
7
|
-
import { EVENT_SESSION_RETIRED } from './events.js';
|
|
8
|
-
/**
|
|
9
|
-
* Sessions are used to store information such as cookies and can be used for generating fingerprints and proxy sessions.
|
|
10
|
-
* You can imagine each session as a specific user, with its own cookies, IP (via proxy) and potentially a unique browser fingerprint.
|
|
11
|
-
* Session internal state can be enriched with custom user data for example some authorization tokens and specific headers in general.
|
|
12
|
-
* @category Scaling
|
|
13
|
-
*/
|
|
14
|
-
export class Session {
|
|
15
|
-
id;
|
|
16
|
-
maxAgeSecs;
|
|
17
|
-
userData;
|
|
18
|
-
_maxErrorScore;
|
|
19
|
-
_errorScoreDecrement;
|
|
20
|
-
_createdAt;
|
|
21
|
-
_expiresAt;
|
|
22
|
-
_usageCount;
|
|
23
|
-
_maxUsageCount;
|
|
24
|
-
sessionPool;
|
|
25
|
-
_errorScore;
|
|
26
|
-
_proxyInfo;
|
|
27
|
-
_cookieJar;
|
|
28
|
-
log;
|
|
29
|
-
get errorScore() {
|
|
30
|
-
return this._errorScore;
|
|
31
|
-
}
|
|
32
|
-
get usageCount() {
|
|
33
|
-
return this._usageCount;
|
|
34
|
-
}
|
|
35
|
-
get maxErrorScore() {
|
|
36
|
-
return this._maxErrorScore;
|
|
37
|
-
}
|
|
38
|
-
get errorScoreDecrement() {
|
|
39
|
-
return this._errorScoreDecrement;
|
|
40
|
-
}
|
|
41
|
-
get expiresAt() {
|
|
42
|
-
return this._expiresAt;
|
|
43
|
-
}
|
|
44
|
-
get createdAt() {
|
|
45
|
-
return this._createdAt;
|
|
46
|
-
}
|
|
47
|
-
get maxUsageCount() {
|
|
48
|
-
return this._maxUsageCount;
|
|
49
|
-
}
|
|
50
|
-
get cookieJar() {
|
|
51
|
-
return this._cookieJar;
|
|
52
|
-
}
|
|
53
|
-
get proxyInfo() {
|
|
54
|
-
return this._proxyInfo;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Session configuration.
|
|
58
|
-
*/
|
|
59
|
-
constructor(options) {
|
|
60
|
-
ow(options, ow.object.exactShape({
|
|
61
|
-
sessionPool: ow.object.instanceOf(EventEmitter),
|
|
62
|
-
id: ow.optional.string,
|
|
63
|
-
cookieJar: ow.optional.object,
|
|
64
|
-
proxyInfo: ow.optional.object,
|
|
65
|
-
maxAgeSecs: ow.optional.number,
|
|
66
|
-
userData: ow.optional.object,
|
|
67
|
-
maxErrorScore: ow.optional.number,
|
|
68
|
-
errorScoreDecrement: ow.optional.number,
|
|
69
|
-
createdAt: ow.optional.date,
|
|
70
|
-
expiresAt: ow.optional.date,
|
|
71
|
-
usageCount: ow.optional.number,
|
|
72
|
-
errorScore: ow.optional.number,
|
|
73
|
-
maxUsageCount: ow.optional.number,
|
|
74
|
-
log: ow.optional.object,
|
|
75
|
-
}));
|
|
76
|
-
const { sessionPool, id = `session_${cryptoRandomObjectId(10)}`, cookieJar = new CookieJar(), proxyInfo = undefined, maxAgeSecs = 3000, userData = {}, maxErrorScore = 3, errorScoreDecrement = 0.5, createdAt = new Date(), usageCount = 0, errorScore = 0, maxUsageCount = 50, log = defaultLog, } = options;
|
|
77
|
-
const { expiresAt = getDefaultCookieExpirationDate(maxAgeSecs) } = options;
|
|
78
|
-
this.log = log.child({ prefix: 'Session' });
|
|
79
|
-
this._cookieJar = cookieJar.setCookie ? cookieJar : CookieJar.fromJSON(JSON.stringify(cookieJar));
|
|
80
|
-
this._proxyInfo = proxyInfo;
|
|
81
|
-
this.id = id;
|
|
82
|
-
this.maxAgeSecs = maxAgeSecs;
|
|
83
|
-
this.userData = userData;
|
|
84
|
-
this._maxErrorScore = maxErrorScore;
|
|
85
|
-
this._errorScoreDecrement = errorScoreDecrement;
|
|
86
|
-
// Internal
|
|
87
|
-
this._expiresAt = expiresAt;
|
|
88
|
-
this._createdAt = createdAt;
|
|
89
|
-
this._usageCount = usageCount; // indicates how many times the session has been used
|
|
90
|
-
this._errorScore = errorScore; // indicates number of markBaded request with the session
|
|
91
|
-
this._maxUsageCount = maxUsageCount;
|
|
92
|
-
this.sessionPool = sessionPool;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Indicates whether the session is blocked.
|
|
96
|
-
* Session is blocked once it reaches the `maxErrorScore`.
|
|
97
|
-
*/
|
|
98
|
-
isBlocked() {
|
|
99
|
-
return this.errorScore >= this.maxErrorScore;
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Indicates whether the session is expired.
|
|
103
|
-
* Session expiration is determined by the `maxAgeSecs`.
|
|
104
|
-
* Once the session is older than `createdAt + maxAgeSecs` the session is considered expired.
|
|
105
|
-
*/
|
|
106
|
-
isExpired() {
|
|
107
|
-
return this.expiresAt <= new Date();
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Indicates whether the session is used maximum number of times.
|
|
111
|
-
* Session maximum usage count can be changed by `maxUsageCount` parameter.
|
|
112
|
-
*/
|
|
113
|
-
isMaxUsageCountReached() {
|
|
114
|
-
return this.usageCount >= this.maxUsageCount;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Indicates whether the session can be used for next requests.
|
|
118
|
-
* Session is usable when it is not expired, not blocked and the maximum usage count has not be reached.
|
|
119
|
-
*/
|
|
120
|
-
isUsable() {
|
|
121
|
-
return !this.isBlocked() && !this.isExpired() && !this.isMaxUsageCountReached();
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* This method should be called after a successful session usage.
|
|
125
|
-
* It increases `usageCount` and potentially lowers the `errorScore` by the `errorScoreDecrement`.
|
|
126
|
-
*/
|
|
127
|
-
markGood() {
|
|
128
|
-
this._usageCount += 1;
|
|
129
|
-
if (this._errorScore > 0) {
|
|
130
|
-
this._errorScore -= this._errorScoreDecrement;
|
|
131
|
-
}
|
|
132
|
-
this._maybeSelfRetire();
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Gets session state for persistence in KeyValueStore.
|
|
136
|
-
* @returns Represents session internal state.
|
|
137
|
-
*/
|
|
138
|
-
getState() {
|
|
139
|
-
return {
|
|
140
|
-
id: this.id,
|
|
141
|
-
cookieJar: this.cookieJar.toJSON(),
|
|
142
|
-
proxyInfo: this._proxyInfo,
|
|
143
|
-
userData: this.userData,
|
|
144
|
-
maxErrorScore: this.maxErrorScore,
|
|
145
|
-
errorScoreDecrement: this.errorScoreDecrement,
|
|
146
|
-
expiresAt: this.expiresAt.toISOString(),
|
|
147
|
-
createdAt: this.createdAt.toISOString(),
|
|
148
|
-
usageCount: this.usageCount,
|
|
149
|
-
maxUsageCount: this.maxUsageCount,
|
|
150
|
-
errorScore: this.errorScore,
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Marks session as blocked and emits event on the `SessionPool`
|
|
155
|
-
* This method should be used if the session usage was unsuccessful
|
|
156
|
-
* and you are sure that it is because of the session configuration and not any external matters.
|
|
157
|
-
* For example when server returns 403 status code.
|
|
158
|
-
* If the session does not work due to some external factors as server error such as 5XX you probably want to use `markBad` method.
|
|
159
|
-
*/
|
|
160
|
-
retire() {
|
|
161
|
-
// mark it as an invalid by increasing the error score count.
|
|
162
|
-
this._errorScore += this._maxErrorScore;
|
|
163
|
-
this._usageCount += 1;
|
|
164
|
-
// emit event so we can retire browser in puppeteer pool
|
|
165
|
-
this.sessionPool.emit(EVENT_SESSION_RETIRED, this);
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Increases usage and error count.
|
|
169
|
-
* Should be used when the session has been used unsuccessfully. For example because of timeouts.
|
|
170
|
-
*/
|
|
171
|
-
markBad() {
|
|
172
|
-
this._errorScore += 1;
|
|
173
|
-
this._usageCount += 1;
|
|
174
|
-
this._maybeSelfRetire();
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* With certain status codes: `401`, `403` or `429` we can be certain
|
|
178
|
-
* that the target website is blocking us. This function helps to do this conveniently
|
|
179
|
-
* by retiring the session when such code is received. Optionally, the default status
|
|
180
|
-
* codes can be extended in the second parameter.
|
|
181
|
-
* @param statusCode HTTP status code.
|
|
182
|
-
* @returns Whether the session was retired.
|
|
183
|
-
*/
|
|
184
|
-
retireOnBlockedStatusCodes(statusCode) {
|
|
185
|
-
// eslint-disable-next-line dot-notation -- accessing private property
|
|
186
|
-
const isBlocked = this.sessionPool['blockedStatusCodes'].includes(statusCode);
|
|
187
|
-
if (isBlocked) {
|
|
188
|
-
this.retire();
|
|
189
|
-
}
|
|
190
|
-
return isBlocked;
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* Saves cookies from an HTTP response to be used with the session.
|
|
194
|
-
* It expects an object with a `headers` property that's either an `Object`
|
|
195
|
-
* (typical Node.js responses) or a `Function` (Puppeteer Response).
|
|
196
|
-
*
|
|
197
|
-
* It then parses and saves the cookies from the `set-cookie` header, if available.
|
|
198
|
-
*/
|
|
199
|
-
setCookiesFromResponse(response) {
|
|
200
|
-
try {
|
|
201
|
-
const cookies = getCookiesFromResponse(response).filter((c) => c);
|
|
202
|
-
this._setCookies(cookies, response.url);
|
|
203
|
-
}
|
|
204
|
-
catch (e) {
|
|
205
|
-
const err = e;
|
|
206
|
-
// if invalid Cookie header is provided just log the exception.
|
|
207
|
-
this.log.exception(err, 'Could not get cookies from response');
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* Saves an array with cookie objects to be used with the session.
|
|
212
|
-
* The objects should be in the format that
|
|
213
|
-
* [Puppeteer uses](https://pptr.dev/#?product=Puppeteer&version=v2.0.0&show=api-pagecookiesurls),
|
|
214
|
-
* but you can also use this function to set cookies manually:
|
|
215
|
-
*
|
|
216
|
-
* ```
|
|
217
|
-
* [
|
|
218
|
-
* { name: 'cookie1', value: 'my-cookie' },
|
|
219
|
-
* { name: 'cookie2', value: 'your-cookie' }
|
|
220
|
-
* ]
|
|
221
|
-
* ```
|
|
222
|
-
*/
|
|
223
|
-
setCookies(cookies, url) {
|
|
224
|
-
const normalizedCookies = cookies.map((c) => browserPoolCookieToToughCookie(c, this.maxAgeSecs));
|
|
225
|
-
this._setCookies(normalizedCookies, url);
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* Returns cookies in a format compatible with puppeteer/playwright and ready to be used with `page.setCookie`.
|
|
229
|
-
* @param url website url. Only cookies stored for this url will be returned
|
|
230
|
-
*/
|
|
231
|
-
getCookies(url) {
|
|
232
|
-
const cookies = this.cookieJar.getCookiesSync(url);
|
|
233
|
-
return cookies.map((c) => toughCookieToBrowserPoolCookie(c));
|
|
234
|
-
}
|
|
235
|
-
/**
|
|
236
|
-
* Returns cookies saved with the session in the typical
|
|
237
|
-
* key1=value1; key2=value2 format, ready to be used in
|
|
238
|
-
* a cookie header or elsewhere.
|
|
239
|
-
* @returns Represents `Cookie` header.
|
|
240
|
-
*/
|
|
241
|
-
getCookieString(url) {
|
|
242
|
-
return this.cookieJar.getCookieStringSync(url, {});
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* Sets a cookie within this session for the specific URL.
|
|
246
|
-
*/
|
|
247
|
-
setCookie(rawCookie, url) {
|
|
248
|
-
this.cookieJar.setCookieSync(rawCookie, url);
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* Sets cookies.
|
|
252
|
-
*/
|
|
253
|
-
_setCookies(cookies, url) {
|
|
254
|
-
const errorMessages = [];
|
|
255
|
-
for (const cookie of cookies) {
|
|
256
|
-
try {
|
|
257
|
-
this.cookieJar.setCookieSync(cookie, url, { ignoreError: false });
|
|
258
|
-
}
|
|
259
|
-
catch (e) {
|
|
260
|
-
const err = e;
|
|
261
|
-
errorMessages.push(err.message);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
// if invalid cookies are provided just log the exception. No need to retry the request automatically.
|
|
265
|
-
if (errorMessages.length) {
|
|
266
|
-
this.log.debug('Could not set cookies.', { errorMessages });
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
/**
|
|
270
|
-
* Checks if session is not usable. if it is not retires the session.
|
|
271
|
-
*/
|
|
272
|
-
_maybeSelfRetire() {
|
|
273
|
-
if (!this.isUsable()) {
|
|
274
|
-
this.retire();
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
//# sourceMappingURL=session.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/session_pool/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,EAAE,o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