@crawlee/core 4.0.0-beta.21 → 4.0.0-beta.210

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.
Files changed (270) hide show
  1. package/README.md +14 -14
  2. package/byte_utils.d.ts +17 -0
  3. package/byte_utils.js +42 -0
  4. package/configuration.d.ts +88 -227
  5. package/configuration.js +162 -226
  6. package/debug.d.ts +36 -0
  7. package/debug.js +70 -0
  8. package/errors.d.ts +45 -18
  9. package/errors.js +58 -27
  10. package/events/event_manager.d.ts +35 -9
  11. package/events/event_manager.js +12 -13
  12. package/events/index.d.ts +1 -1
  13. package/events/index.js +0 -1
  14. package/events/local_event_manager.d.ts +15 -3
  15. package/events/local_event_manager.js +39 -13
  16. package/events/system_info.d.ts +38 -0
  17. package/events/system_info.js +1 -0
  18. package/index.d.ts +7 -11
  19. package/index.js +8 -10
  20. package/internal.d.ts +8 -0
  21. package/internal.js +9 -0
  22. package/iterables.d.ts +79 -0
  23. package/iterables.js +134 -0
  24. package/log.d.ts +77 -1
  25. package/log.js +134 -1
  26. package/memory-storage/consts.d.ts +4 -0
  27. package/memory-storage/consts.js +4 -0
  28. package/memory-storage/index.d.ts +1 -0
  29. package/memory-storage/index.js +1 -0
  30. package/memory-storage/memory-storage.d.ts +43 -0
  31. package/memory-storage/memory-storage.js +158 -0
  32. package/memory-storage/resource-clients/common/base-client.d.ts +4 -0
  33. package/memory-storage/resource-clients/common/base-client.js +6 -0
  34. package/memory-storage/resource-clients/dataset.d.ts +40 -0
  35. package/memory-storage/resource-clients/dataset.js +106 -0
  36. package/memory-storage/resource-clients/key-value-store.d.ts +56 -0
  37. package/memory-storage/resource-clients/key-value-store.js +180 -0
  38. package/memory-storage/resource-clients/request-queue.d.ts +77 -0
  39. package/memory-storage/resource-clients/request-queue.js +414 -0
  40. package/memory-storage/utils.d.ts +16 -0
  41. package/memory-storage/utils.js +41 -0
  42. package/owned_or_injected.d.ts +58 -0
  43. package/owned_or_injected.js +98 -0
  44. package/package.json +19 -20
  45. package/proxy_configuration.d.ts +28 -77
  46. package/proxy_configuration.js +37 -146
  47. package/recoverable_state.d.ts +106 -52
  48. package/recoverable_state.js +200 -72
  49. package/request.d.ts +48 -93
  50. package/request.js +112 -230
  51. package/serialization.d.ts +0 -1
  52. package/serialization.js +18 -18
  53. package/service_locator.d.ts +168 -0
  54. package/service_locator.js +255 -0
  55. package/storages/batched_adds.d.ts +37 -0
  56. package/storages/batched_adds.js +73 -0
  57. package/storages/dataset.d.ts +115 -58
  58. package/storages/dataset.js +291 -149
  59. package/storages/index.d.ts +8 -9
  60. package/storages/index.js +4 -9
  61. package/storages/key_value_store.d.ts +186 -71
  62. package/storages/key_value_store.js +449 -194
  63. package/storages/key_value_store_codec.d.ts +32 -0
  64. package/storages/key_value_store_codec.js +113 -0
  65. package/storages/request_dedup_cache.d.ts +22 -0
  66. package/storages/request_dedup_cache.js +48 -0
  67. package/storages/request_list.d.ts +50 -133
  68. package/storages/request_list.js +269 -248
  69. package/storages/request_loader.d.ts +127 -0
  70. package/storages/request_loader.js +36 -0
  71. package/storages/request_manager.d.ts +119 -0
  72. package/storages/request_manager.js +1 -0
  73. package/storages/request_manager_tandem.d.ts +50 -24
  74. package/storages/request_manager_tandem.js +134 -58
  75. package/storages/request_queue.d.ts +293 -48
  76. package/storages/request_queue.js +766 -216
  77. package/storages/storage_instance_manager.d.ts +86 -0
  78. package/storages/storage_instance_manager.js +256 -0
  79. package/storages/storage_stats.d.ts +48 -0
  80. package/storages/storage_stats.js +29 -0
  81. package/storages/transaction.d.ts +271 -0
  82. package/storages/transaction.js +296 -0
  83. package/storages/utils.d.ts +59 -11
  84. package/storages/utils.js +75 -15
  85. package/system-info/cpu-info.d.ts +67 -0
  86. package/system-info/cpu-info.js +216 -0
  87. package/system-info/memory-info.d.ts +31 -0
  88. package/system-info/memory-info.js +115 -0
  89. package/system-info/ps-tree.d.ts +17 -0
  90. package/system-info/ps-tree.js +144 -0
  91. package/system-info/runtime.d.ts +14 -0
  92. package/system-info/runtime.js +80 -0
  93. package/typedefs.d.ts +0 -6
  94. package/typedefs.js +0 -1
  95. package/url.d.ts +9 -0
  96. package/url.js +11 -0
  97. package/validators.d.ts +23 -18
  98. package/validators.js +14 -18
  99. package/autoscaling/autoscaled_pool.d.ts +0 -300
  100. package/autoscaling/autoscaled_pool.d.ts.map +0 -1
  101. package/autoscaling/autoscaled_pool.js +0 -533
  102. package/autoscaling/autoscaled_pool.js.map +0 -1
  103. package/autoscaling/index.d.ts +0 -4
  104. package/autoscaling/index.d.ts.map +0 -1
  105. package/autoscaling/index.js +0 -4
  106. package/autoscaling/index.js.map +0 -1
  107. package/autoscaling/snapshotter.d.ts +0 -189
  108. package/autoscaling/snapshotter.d.ts.map +0 -1
  109. package/autoscaling/snapshotter.js +0 -285
  110. package/autoscaling/snapshotter.js.map +0 -1
  111. package/autoscaling/system_status.d.ts +0 -181
  112. package/autoscaling/system_status.d.ts.map +0 -1
  113. package/autoscaling/system_status.js +0 -169
  114. package/autoscaling/system_status.js.map +0 -1
  115. package/configuration.d.ts.map +0 -1
  116. package/configuration.js.map +0 -1
  117. package/cookie_utils.d.ts +0 -43
  118. package/cookie_utils.d.ts.map +0 -1
  119. package/cookie_utils.js +0 -111
  120. package/cookie_utils.js.map +0 -1
  121. package/crawlers/context_pipeline.d.ts +0 -61
  122. package/crawlers/context_pipeline.d.ts.map +0 -1
  123. package/crawlers/context_pipeline.js +0 -99
  124. package/crawlers/context_pipeline.js.map +0 -1
  125. package/crawlers/crawler_commons.d.ts +0 -194
  126. package/crawlers/crawler_commons.d.ts.map +0 -1
  127. package/crawlers/crawler_commons.js +0 -108
  128. package/crawlers/crawler_commons.js.map +0 -1
  129. package/crawlers/crawler_utils.d.ts +0 -10
  130. package/crawlers/crawler_utils.d.ts.map +0 -1
  131. package/crawlers/crawler_utils.js +0 -12
  132. package/crawlers/crawler_utils.js.map +0 -1
  133. package/crawlers/error_snapshotter.d.ts +0 -60
  134. package/crawlers/error_snapshotter.d.ts.map +0 -1
  135. package/crawlers/error_snapshotter.js +0 -118
  136. package/crawlers/error_snapshotter.js.map +0 -1
  137. package/crawlers/error_tracker.d.ts +0 -55
  138. package/crawlers/error_tracker.d.ts.map +0 -1
  139. package/crawlers/error_tracker.js +0 -309
  140. package/crawlers/error_tracker.js.map +0 -1
  141. package/crawlers/index.d.ts +0 -7
  142. package/crawlers/index.d.ts.map +0 -1
  143. package/crawlers/index.js +0 -7
  144. package/crawlers/index.js.map +0 -1
  145. package/crawlers/internals/types.d.ts +0 -8
  146. package/crawlers/internals/types.d.ts.map +0 -1
  147. package/crawlers/internals/types.js +0 -2
  148. package/crawlers/internals/types.js.map +0 -1
  149. package/crawlers/statistics.d.ts +0 -213
  150. package/crawlers/statistics.d.ts.map +0 -1
  151. package/crawlers/statistics.js +0 -349
  152. package/crawlers/statistics.js.map +0 -1
  153. package/enqueue_links/enqueue_links.d.ts +0 -249
  154. package/enqueue_links/enqueue_links.d.ts.map +0 -1
  155. package/enqueue_links/enqueue_links.js +0 -269
  156. package/enqueue_links/enqueue_links.js.map +0 -1
  157. package/enqueue_links/index.d.ts +0 -3
  158. package/enqueue_links/index.d.ts.map +0 -1
  159. package/enqueue_links/index.js +0 -3
  160. package/enqueue_links/index.js.map +0 -1
  161. package/enqueue_links/shared.d.ts +0 -73
  162. package/enqueue_links/shared.d.ts.map +0 -1
  163. package/enqueue_links/shared.js +0 -212
  164. package/enqueue_links/shared.js.map +0 -1
  165. package/errors.d.ts.map +0 -1
  166. package/errors.js.map +0 -1
  167. package/events/event_manager.d.ts.map +0 -1
  168. package/events/event_manager.js.map +0 -1
  169. package/events/index.d.ts.map +0 -1
  170. package/events/index.js.map +0 -1
  171. package/events/local_event_manager.d.ts.map +0 -1
  172. package/events/local_event_manager.js.map +0 -1
  173. package/http_clients/base-http-client.d.ts +0 -12
  174. package/http_clients/base-http-client.d.ts.map +0 -1
  175. package/http_clients/base-http-client.js +0 -44
  176. package/http_clients/base-http-client.js.map +0 -1
  177. package/http_clients/form-data-like.d.ts +0 -67
  178. package/http_clients/form-data-like.d.ts.map +0 -1
  179. package/http_clients/form-data-like.js +0 -5
  180. package/http_clients/form-data-like.js.map +0 -1
  181. package/http_clients/got-scraping-http-client.d.ts +0 -22
  182. package/http_clients/got-scraping-http-client.d.ts.map +0 -1
  183. package/http_clients/got-scraping-http-client.js +0 -116
  184. package/http_clients/got-scraping-http-client.js.map +0 -1
  185. package/http_clients/index.d.ts +0 -3
  186. package/http_clients/index.d.ts.map +0 -1
  187. package/http_clients/index.js +0 -3
  188. package/http_clients/index.js.map +0 -1
  189. package/index.d.ts.map +0 -1
  190. package/index.js.map +0 -1
  191. package/log.d.ts.map +0 -1
  192. package/log.js.map +0 -1
  193. package/proxy_configuration.d.ts.map +0 -1
  194. package/proxy_configuration.js.map +0 -1
  195. package/recoverable_state.d.ts.map +0 -1
  196. package/recoverable_state.js.map +0 -1
  197. package/request.d.ts.map +0 -1
  198. package/request.js.map +0 -1
  199. package/router.d.ts +0 -134
  200. package/router.d.ts.map +0 -1
  201. package/router.js +0 -164
  202. package/router.js.map +0 -1
  203. package/serialization.d.ts.map +0 -1
  204. package/serialization.js.map +0 -1
  205. package/session_pool/consts.d.ts +0 -4
  206. package/session_pool/consts.d.ts.map +0 -1
  207. package/session_pool/consts.js +0 -4
  208. package/session_pool/consts.js.map +0 -1
  209. package/session_pool/errors.d.ts +0 -8
  210. package/session_pool/errors.d.ts.map +0 -1
  211. package/session_pool/errors.js +0 -12
  212. package/session_pool/errors.js.map +0 -1
  213. package/session_pool/events.d.ts +0 -3
  214. package/session_pool/events.d.ts.map +0 -1
  215. package/session_pool/events.js +0 -3
  216. package/session_pool/events.js.map +0 -1
  217. package/session_pool/index.d.ts +0 -6
  218. package/session_pool/index.d.ts.map +0 -1
  219. package/session_pool/index.js +0 -6
  220. package/session_pool/index.js.map +0 -1
  221. package/session_pool/session.d.ts +0 -186
  222. package/session_pool/session.d.ts.map +0 -1
  223. package/session_pool/session.js +0 -278
  224. package/session_pool/session.js.map +0 -1
  225. package/session_pool/session_pool.d.ts +0 -258
  226. package/session_pool/session_pool.d.ts.map +0 -1
  227. package/session_pool/session_pool.js +0 -387
  228. package/session_pool/session_pool.js.map +0 -1
  229. package/storages/access_checking.d.ts +0 -13
  230. package/storages/access_checking.d.ts.map +0 -1
  231. package/storages/access_checking.js +0 -14
  232. package/storages/access_checking.js.map +0 -1
  233. package/storages/dataset.d.ts.map +0 -1
  234. package/storages/dataset.js.map +0 -1
  235. package/storages/index.d.ts.map +0 -1
  236. package/storages/index.js.map +0 -1
  237. package/storages/key_value_store.d.ts.map +0 -1
  238. package/storages/key_value_store.js.map +0 -1
  239. package/storages/request_list.d.ts.map +0 -1
  240. package/storages/request_list.js.map +0 -1
  241. package/storages/request_list_adapter.d.ts +0 -58
  242. package/storages/request_list_adapter.d.ts.map +0 -1
  243. package/storages/request_list_adapter.js +0 -81
  244. package/storages/request_list_adapter.js.map +0 -1
  245. package/storages/request_manager_tandem.d.ts.map +0 -1
  246. package/storages/request_manager_tandem.js.map +0 -1
  247. package/storages/request_provider.d.ts +0 -372
  248. package/storages/request_provider.d.ts.map +0 -1
  249. package/storages/request_provider.js +0 -591
  250. package/storages/request_provider.js.map +0 -1
  251. package/storages/request_queue.d.ts.map +0 -1
  252. package/storages/request_queue.js.map +0 -1
  253. package/storages/request_queue_v2.d.ts +0 -87
  254. package/storages/request_queue_v2.d.ts.map +0 -1
  255. package/storages/request_queue_v2.js +0 -438
  256. package/storages/request_queue_v2.js.map +0 -1
  257. package/storages/sitemap_request_list.d.ts +0 -250
  258. package/storages/sitemap_request_list.d.ts.map +0 -1
  259. package/storages/sitemap_request_list.js +0 -431
  260. package/storages/sitemap_request_list.js.map +0 -1
  261. package/storages/storage_manager.d.ts +0 -62
  262. package/storages/storage_manager.d.ts.map +0 -1
  263. package/storages/storage_manager.js +0 -105
  264. package/storages/storage_manager.js.map +0 -1
  265. package/storages/utils.d.ts.map +0 -1
  266. package/storages/utils.js.map +0 -1
  267. package/typedefs.d.ts.map +0 -1
  268. package/typedefs.js.map +0 -1
  269. package/validators.d.ts.map +0 -1
  270. package/validators.js.map +0 -1
package/request.d.ts CHANGED
@@ -1,21 +1,12 @@
1
1
  import type { BinaryLike } from 'node:crypto';
2
- import type { Dictionary } from '@crawlee/types';
3
- import type { EnqueueLinksOptions } from './enqueue_links/enqueue_links.js';
4
- import type { SkippedRequestReason } from './enqueue_links/shared.js';
5
- import type { AllowedHttpMethods } from './typedefs.js';
6
- export declare enum RequestState {
7
- UNPROCESSED = 0,
8
- BEFORE_NAV = 1,
9
- AFTER_NAV = 2,
10
- REQUEST_HANDLER = 3,
11
- DONE = 4,
12
- ERROR_HANDLER = 5,
13
- ERROR = 6,
14
- SKIPPED = 7
15
- }
2
+ import type { AllowedHttpMethods, Dictionary, RequestSchema } from '@crawlee/types';
3
+ import type { EnqueueStrategy } from '@crawlee/utils';
4
+ /** The `strategy` option accepted by {@link ExtractLinksOptions} and {@link EnqueueUrlsOptions}. */
5
+ export type EnqueueStrategyOption = EnqueueStrategy | 'all' | 'same-domain' | 'same-hostname' | 'same-origin';
16
6
  /**
17
- * Represents a URL to be crawled, optionally including HTTP method, headers, payload and other metadata.
18
- * The `Request` object also stores information about errors that occurred during processing of the request.
7
+ * Represents a URL to be crawled, optionally including HTTP method, headers, payload and other metadata, together
8
+ * with the processing state a request queue keeps about it (`retryCount`, `errorMessages`, `handledAt`, ...).
9
+ * Inside a crawler, requests are {@link CrawlingRequest}s, which add the crawler's own per-request settings.
19
10
  *
20
11
  * Each `Request` instance has the `uniqueKey` property, which can be either specified
21
12
  * manually in the constructor or generated automatically from the URL. Two requests with the same `uniqueKey`
@@ -31,21 +22,16 @@ export declare enum RequestState {
31
22
  * const request = new Request({
32
23
  * url: 'http://www.example.com',
33
24
  * headers: { Accept: 'application/json' },
25
+ * userData: { foo: 'bar' },
34
26
  * });
35
27
  *
36
- * ...
37
- *
38
- * request.userData.foo = 'bar';
39
- * request.pushErrorMessage(new Error('Request failed!'));
40
- *
41
- * ...
42
- *
43
- * const foo = request.userData.foo;
28
+ * await requestQueue.addRequest(request);
44
29
  * ```
45
30
  * @category Sources
46
31
  */
47
32
  declare class CrawleeRequest<UserData extends Dictionary = Dictionary> {
48
- /** Request ID */
33
+ #private;
34
+ /** Storage-assigned request ID. Only present on requests that went through a {@link RequestQueue}. */
49
35
  id?: string;
50
36
  /** URL of the web page to crawl. */
51
37
  url: string;
@@ -75,9 +61,12 @@ declare class CrawleeRequest<UserData extends Dictionary = Dictionary> {
75
61
  errorMessages: string[];
76
62
  /** Object with HTTP headers. Key is header name, value is the value. */
77
63
  headers?: Record<string, string>;
78
- /** Private store for the custom user data assigned to the request. */
79
- private _userData;
80
- /** Custom user data assigned to the request. */
64
+ /**
65
+ * Custom user data assigned to the request.
66
+ *
67
+ * All data stored in `userData` must be JSON-serializable.
68
+ * Storing non-serializable values (e.g. functions, symbols) may result in unexpected results.
69
+ */
81
70
  userData: UserData;
82
71
  /**
83
72
  * ISO datetime string that indicates the time when the request has been processed.
@@ -86,61 +75,27 @@ declare class CrawleeRequest<UserData extends Dictionary = Dictionary> {
86
75
  handledAt?: string;
87
76
  /**
88
77
  * `Request` parameters including the URL, HTTP method and headers, and others.
78
+ *
79
+ * Processing state (`retryCount`, `errorMessages`, `handledAt`, `loadedUrl`, `id`) is not an option;
80
+ * requests coming back from a storage are rebuilt with {@link Request.fromSchema}.
89
81
  */
90
82
  constructor(options: RequestOptions<UserData>);
83
+ /**
84
+ * Rebuilds a request from its stored form, including the processing state a
85
+ * {@link RequestOptions} object cannot carry. Subclasses get instances of themselves.
86
+ */
87
+ static fromSchema<UserData extends Dictionary = Dictionary>(schema: RequestSchema): CrawleeRequest<UserData>;
91
88
  /**
92
89
  * Converts the Crawlee Request object to a `fetch` API Request object.
93
90
  * @returns The native `fetch` API Request object.
94
91
  */
95
92
  intoFetchAPIRequest(): Request;
96
- /** Tells the crawler processing this request to skip the navigation and process the request directly. */
97
- get skipNavigation(): boolean;
98
- /** Tells the crawler processing this request to skip the navigation and process the request directly. */
99
- set skipNavigation(value: boolean);
100
- /**
101
- * Depth of the request in the current crawl tree.
102
- * Note that this is dependent on the crawler setup and might produce unexpected results when used with multiple crawlers.
103
- */
104
- get crawlDepth(): number;
105
- /**
106
- * Depth of the request in the current crawl tree.
107
- * Note that this is dependent on the crawler setup and might produce unexpected results when used with multiple crawlers.
108
- */
109
- set crawlDepth(value: number);
110
- /** Indicates the number of times the crawling of the request has rotated the session due to a session or a proxy error. */
111
- get sessionRotationCount(): number;
112
- /** Indicates the number of times the crawling of the request has rotated the session due to a session or a proxy error. */
113
- set sessionRotationCount(value: number);
114
93
  /** shortcut for getting `request.userData.label` */
115
94
  get label(): string | undefined;
116
95
  /** shortcut for setting `request.userData.label` */
117
96
  set label(value: string | undefined);
118
- /** Maximum number of retries for this request. Allows to override the global `maxRequestRetries` option of `BasicCrawler`. */
119
- get maxRetries(): number | undefined;
120
- /** Maximum number of retries for this request. Allows to override the global `maxRequestRetries` option of `BasicCrawler`. */
121
- set maxRetries(value: number | undefined);
122
- /** Describes the request's current lifecycle state. */
123
- get state(): RequestState;
124
- /** Describes the request's current lifecycle state. */
125
- set state(value: RequestState);
126
- private get enqueueStrategy();
127
- private set enqueueStrategy(value);
128
- /**
129
- * Stores information about an error that occurred during processing of this request.
130
- *
131
- * You should always use Error instances when throwing errors in JavaScript.
132
- *
133
- * Nevertheless, to improve the debugging experience when using third party libraries
134
- * that may not always throw an Error instance, the function performs a type
135
- * inspection of the passed argument and attempts to extract as much information
136
- * as possible, since just throwing a bad type error makes any debugging rather difficult.
137
- *
138
- * @param errorOrMessage Error object or error message to be stored in the request.
139
- * @param [options]
140
- */
141
- pushErrorMessage(errorOrMessage: unknown, options?: PushErrorMessageOptions): void;
142
97
  /** @internal */
143
- static computeUniqueKey({ url, method, payload, keepUrlFragment, useExtendedUniqueKey, }: ComputeUniqueKeyOptions): string;
98
+ static computeUniqueKey({ url, method, payload, keepUrlFragment, useExtendedUniqueKey, alwaysEnqueue, }: ComputeUniqueKeyOptions): string;
144
99
  /** @internal */
145
100
  static hashPayload(payload: BinaryLike): string;
146
101
  }
@@ -161,7 +116,7 @@ export interface RequestOptions<UserData extends Dictionary = Dictionary> {
161
116
  * The `keepUrlFragment` option determines whether URL hash fragment is included in the `uniqueKey` or not.
162
117
  *
163
118
  * The `useExtendedUniqueKey` options determines whether method and payload are included in the `uniqueKey`,
164
- * producing a `uniqueKey` in the following format: `METHOD(payloadHash):normalizedUrl`. This is useful
119
+ * producing a `uniqueKey` in the following format: `METHOD|payloadHash|normalizedUrl`. This is useful
165
120
  * when requests point to the same URL, but with different methods and payloads. For example: form submits.
166
121
  *
167
122
  * Pass an arbitrary non-empty text value to the `uniqueKey` property
@@ -185,6 +140,9 @@ export interface RequestOptions<UserData extends Dictionary = Dictionary> {
185
140
  /**
186
141
  * Custom user data assigned to the request. Use this to save any request related data to the
187
142
  * request's scope, keeping them accessible on retries, failures etc.
143
+ *
144
+ * All data stored in `userData` must be JSON-serializable.
145
+ * Storing non-serializable values (e.g. functions, symbols) may result in unexpected results.
188
146
  */
189
147
  userData?: UserData;
190
148
  /**
@@ -206,14 +164,30 @@ export interface RequestOptions<UserData extends Dictionary = Dictionary> {
206
164
  * @default false
207
165
  */
208
166
  useExtendedUniqueKey?: boolean;
167
+ /**
168
+ * If `true` then a random value is included in the `uniqueKey` computation, ensuring the request
169
+ * is always enqueued even if a request with the same URL (and method/payload) is already present
170
+ * in the queue. Cannot be used together with a custom `uniqueKey`.
171
+ * @default false
172
+ */
173
+ alwaysEnqueue?: boolean;
209
174
  /**
210
175
  * The `true` value indicates that the request will not be automatically retried on error.
211
176
  * @default false
212
177
  */
213
178
  noRetry?: boolean;
179
+ /**
180
+ * ID of a session from the crawler's `SessionPool` to use for this request.
181
+ * When set, the crawler will fetch this session from the pool instead of creating a new one.
182
+ */
183
+ sessionId?: string;
214
184
  /**
215
185
  * If set to `true` then the crawler processing this request evaluates
216
186
  * the `requestHandler` immediately without prior browser navigation.
187
+ *
188
+ * When enabled, the crawling context will not contain the results of the navigation
189
+ * (e.g. `response`, `body`, `contentType`, `$` or `request.loadedUrl`).
190
+ * Accessing these properties will throw a {@link NavigationSkippedError} at runtime.
217
191
  * @default false
218
192
  */
219
193
  skipNavigation?: boolean;
@@ -223,31 +197,12 @@ export interface RequestOptions<UserData extends Dictionary = Dictionary> {
223
197
  * @default 0
224
198
  */
225
199
  crawlDepth?: number;
226
- /**
227
- * Reason for skipping this request.
228
- * This is used to provide more information about why the request was skipped.
229
- * @internal
230
- */
231
- skippedReason?: SkippedRequestReason;
232
200
  /**
233
201
  * Maximum number of retries for this request. Allows to override the global `maxRequestRetries` option of `BasicCrawler`.
234
202
  */
235
203
  maxRetries?: number;
236
204
  /** @internal */
237
- id?: string;
238
- /** @internal */
239
- handledAt?: string;
240
- /** @internal */
241
- lockExpiresAt?: Date;
242
- /** @internal */
243
- enqueueStrategy?: EnqueueLinksOptions['strategy'];
244
- }
245
- export interface PushErrorMessageOptions {
246
- /**
247
- * Only push the error message without stack trace when true.
248
- * @default false
249
- */
250
- omitStack?: boolean;
205
+ enqueueStrategy?: EnqueueStrategyOption;
251
206
  }
252
207
  interface ComputeUniqueKeyOptions {
253
208
  url: string;
@@ -255,6 +210,7 @@ interface ComputeUniqueKeyOptions {
255
210
  payload?: string | Buffer;
256
211
  keepUrlFragment?: boolean;
257
212
  useExtendedUniqueKey?: boolean;
213
+ alwaysEnqueue?: boolean;
258
214
  }
259
215
  export type Source = (Partial<RequestOptions> & {
260
216
  requestsFromUrl?: string;
@@ -266,4 +222,3 @@ export interface InternalSource {
266
222
  regex?: RegExp;
267
223
  }
268
224
  export { CrawleeRequest as Request };
269
- //# sourceMappingURL=request.d.ts.map