@crawlee/core 4.0.0-beta.6 → 4.0.0-beta.60

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 (196) hide show
  1. package/README.md +9 -5
  2. package/autoscaling/autoscaled_pool.d.ts +3 -5
  3. package/autoscaling/autoscaled_pool.d.ts.map +1 -1
  4. package/autoscaling/autoscaled_pool.js +3 -9
  5. package/autoscaling/autoscaled_pool.js.map +1 -1
  6. package/autoscaling/snapshotter.d.ts +3 -13
  7. package/autoscaling/snapshotter.d.ts.map +1 -1
  8. package/autoscaling/snapshotter.js +18 -29
  9. package/autoscaling/snapshotter.js.map +1 -1
  10. package/autoscaling/system_status.d.ts +0 -3
  11. package/autoscaling/system_status.d.ts.map +1 -1
  12. package/autoscaling/system_status.js +2 -3
  13. package/autoscaling/system_status.js.map +1 -1
  14. package/configuration.d.ts +85 -227
  15. package/configuration.d.ts.map +1 -1
  16. package/configuration.js +159 -223
  17. package/configuration.js.map +1 -1
  18. package/cookie_utils.d.ts +4 -2
  19. package/cookie_utils.d.ts.map +1 -1
  20. package/cookie_utils.js +18 -12
  21. package/cookie_utils.js.map +1 -1
  22. package/crawlers/context_pipeline.d.ts +71 -0
  23. package/crawlers/context_pipeline.d.ts.map +1 -0
  24. package/crawlers/context_pipeline.js +123 -0
  25. package/crawlers/context_pipeline.js.map +1 -0
  26. package/crawlers/crawler_commons.d.ts +19 -28
  27. package/crawlers/crawler_commons.d.ts.map +1 -1
  28. package/crawlers/crawler_commons.js +12 -20
  29. package/crawlers/crawler_commons.js.map +1 -1
  30. package/crawlers/crawler_utils.d.ts +2 -2
  31. package/crawlers/crawler_utils.d.ts.map +1 -1
  32. package/crawlers/crawler_utils.js +1 -1
  33. package/crawlers/crawler_utils.js.map +1 -1
  34. package/crawlers/error_snapshotter.d.ts +3 -2
  35. package/crawlers/error_snapshotter.d.ts.map +1 -1
  36. package/crawlers/error_snapshotter.js +2 -2
  37. package/crawlers/error_snapshotter.js.map +1 -1
  38. package/crawlers/error_tracker.d.ts +2 -1
  39. package/crawlers/error_tracker.d.ts.map +1 -1
  40. package/crawlers/error_tracker.js.map +1 -1
  41. package/crawlers/index.d.ts +1 -1
  42. package/crawlers/index.d.ts.map +1 -1
  43. package/crawlers/index.js +1 -1
  44. package/crawlers/index.js.map +1 -1
  45. package/crawlers/internals/types.d.ts +8 -0
  46. package/crawlers/internals/types.d.ts.map +1 -0
  47. package/crawlers/internals/types.js +2 -0
  48. package/crawlers/internals/types.js.map +1 -0
  49. package/crawlers/statistics.d.ts +15 -15
  50. package/crawlers/statistics.d.ts.map +1 -1
  51. package/crawlers/statistics.js +21 -18
  52. package/crawlers/statistics.js.map +1 -1
  53. package/enqueue_links/enqueue_links.d.ts +32 -18
  54. package/enqueue_links/enqueue_links.d.ts.map +1 -1
  55. package/enqueue_links/enqueue_links.js +45 -24
  56. package/enqueue_links/enqueue_links.js.map +1 -1
  57. package/enqueue_links/shared.d.ts +25 -8
  58. package/enqueue_links/shared.d.ts.map +1 -1
  59. package/enqueue_links/shared.js +69 -37
  60. package/enqueue_links/shared.js.map +1 -1
  61. package/errors.d.ts +33 -3
  62. package/errors.d.ts.map +1 -1
  63. package/errors.js +48 -4
  64. package/errors.js.map +1 -1
  65. package/events/event_manager.d.ts +8 -5
  66. package/events/event_manager.d.ts.map +1 -1
  67. package/events/event_manager.js +7 -9
  68. package/events/event_manager.js.map +1 -1
  69. package/events/local_event_manager.d.ts +14 -4
  70. package/events/local_event_manager.d.ts.map +1 -1
  71. package/events/local_event_manager.js +33 -39
  72. package/events/local_event_manager.js.map +1 -1
  73. package/index.d.ts +3 -2
  74. package/index.d.ts.map +1 -1
  75. package/index.js +2 -1
  76. package/index.js.map +1 -1
  77. package/log.d.ts +82 -2
  78. package/log.d.ts.map +1 -1
  79. package/log.js +102 -0
  80. package/log.js.map +1 -1
  81. package/package.json +9 -10
  82. package/proxy_configuration.d.ts +14 -148
  83. package/proxy_configuration.d.ts.map +1 -1
  84. package/proxy_configuration.js +19 -167
  85. package/proxy_configuration.js.map +1 -1
  86. package/recoverable_state.d.ts +121 -0
  87. package/recoverable_state.d.ts.map +1 -0
  88. package/recoverable_state.js +142 -0
  89. package/recoverable_state.js.map +1 -0
  90. package/request.d.ts +74 -10
  91. package/request.d.ts.map +1 -1
  92. package/request.js +85 -23
  93. package/request.js.map +1 -1
  94. package/router.d.ts.map +1 -1
  95. package/router.js.map +1 -1
  96. package/serialization.js +1 -1
  97. package/serialization.js.map +1 -1
  98. package/service_locator.d.ts +157 -0
  99. package/service_locator.d.ts.map +1 -0
  100. package/service_locator.js +234 -0
  101. package/service_locator.js.map +1 -0
  102. package/session_pool/index.d.ts +0 -1
  103. package/session_pool/index.d.ts.map +1 -1
  104. package/session_pool/index.js +0 -1
  105. package/session_pool/index.js.map +1 -1
  106. package/session_pool/session.d.ts +26 -72
  107. package/session_pool/session.d.ts.map +1 -1
  108. package/session_pool/session.js +36 -98
  109. package/session_pool/session.js.map +1 -1
  110. package/session_pool/session_pool.d.ts +65 -71
  111. package/session_pool/session_pool.d.ts.map +1 -1
  112. package/session_pool/session_pool.js +102 -95
  113. package/session_pool/session_pool.js.map +1 -1
  114. package/storages/dataset.d.ts +64 -19
  115. package/storages/dataset.d.ts.map +1 -1
  116. package/storages/dataset.js +92 -25
  117. package/storages/dataset.js.map +1 -1
  118. package/storages/index.d.ts +3 -1
  119. package/storages/index.d.ts.map +1 -1
  120. package/storages/index.js +3 -1
  121. package/storages/index.js.map +1 -1
  122. package/storages/key_value_store.d.ts +80 -10
  123. package/storages/key_value_store.d.ts.map +1 -1
  124. package/storages/key_value_store.js +110 -26
  125. package/storages/key_value_store.js.map +1 -1
  126. package/storages/request_list.d.ts +9 -9
  127. package/storages/request_list.d.ts.map +1 -1
  128. package/storages/request_list.js +13 -8
  129. package/storages/request_list.js.map +1 -1
  130. package/storages/request_list_adapter.d.ts +58 -0
  131. package/storages/request_list_adapter.d.ts.map +1 -0
  132. package/storages/request_list_adapter.js +81 -0
  133. package/storages/request_list_adapter.js.map +1 -0
  134. package/storages/request_manager_tandem.d.ts +68 -0
  135. package/storages/request_manager_tandem.d.ts.map +1 -0
  136. package/storages/request_manager_tandem.js +124 -0
  137. package/storages/request_manager_tandem.js.map +1 -0
  138. package/storages/request_provider.d.ts +87 -22
  139. package/storages/request_provider.d.ts.map +1 -1
  140. package/storages/request_provider.js +126 -76
  141. package/storages/request_provider.js.map +1 -1
  142. package/storages/request_queue.d.ts +1 -3
  143. package/storages/request_queue.d.ts.map +1 -1
  144. package/storages/request_queue.js +2 -4
  145. package/storages/request_queue.js.map +1 -1
  146. package/storages/request_queue_v2.d.ts +3 -3
  147. package/storages/request_queue_v2.d.ts.map +1 -1
  148. package/storages/request_queue_v2.js +4 -5
  149. package/storages/request_queue_v2.js.map +1 -1
  150. package/storages/sitemap_request_list.d.ts +5 -5
  151. package/storages/sitemap_request_list.d.ts.map +1 -1
  152. package/storages/sitemap_request_list.js +10 -7
  153. package/storages/sitemap_request_list.js.map +1 -1
  154. package/storages/storage_instance_manager.d.ts +91 -0
  155. package/storages/storage_instance_manager.d.ts.map +1 -0
  156. package/storages/storage_instance_manager.js +236 -0
  157. package/storages/storage_instance_manager.js.map +1 -0
  158. package/storages/utils.d.ts +25 -1
  159. package/storages/utils.d.ts.map +1 -1
  160. package/storages/utils.js +6 -5
  161. package/storages/utils.js.map +1 -1
  162. package/typedefs.d.ts +1 -1
  163. package/typedefs.d.ts.map +1 -1
  164. package/validators.d.ts +4 -0
  165. package/validators.d.ts.map +1 -1
  166. package/validators.js +4 -0
  167. package/validators.js.map +1 -1
  168. package/crawlers/crawler_extension.d.ts +0 -12
  169. package/crawlers/crawler_extension.d.ts.map +0 -1
  170. package/crawlers/crawler_extension.js +0 -14
  171. package/crawlers/crawler_extension.js.map +0 -1
  172. package/http_clients/base-http-client.d.ts +0 -134
  173. package/http_clients/base-http-client.d.ts.map +0 -1
  174. package/http_clients/base-http-client.js +0 -33
  175. package/http_clients/base-http-client.js.map +0 -1
  176. package/http_clients/form-data-like.d.ts +0 -67
  177. package/http_clients/form-data-like.d.ts.map +0 -1
  178. package/http_clients/form-data-like.js +0 -5
  179. package/http_clients/form-data-like.js.map +0 -1
  180. package/http_clients/got-scraping-http-client.d.ts +0 -15
  181. package/http_clients/got-scraping-http-client.d.ts.map +0 -1
  182. package/http_clients/got-scraping-http-client.js +0 -69
  183. package/http_clients/got-scraping-http-client.js.map +0 -1
  184. package/http_clients/index.d.ts +0 -3
  185. package/http_clients/index.d.ts.map +0 -1
  186. package/http_clients/index.js +0 -3
  187. package/http_clients/index.js.map +0 -1
  188. package/session_pool/events.d.ts +0 -3
  189. package/session_pool/events.d.ts.map +0 -1
  190. package/session_pool/events.js +0 -3
  191. package/session_pool/events.js.map +0 -1
  192. package/storages/storage_manager.d.ts +0 -58
  193. package/storages/storage_manager.d.ts.map +0 -1
  194. package/storages/storage_manager.js +0 -105
  195. package/storages/storage_manager.js.map +0 -1
  196. package/tsconfig.build.tsbuildinfo +0 -1
@@ -0,0 +1,68 @@
1
+ import type { Dictionary } from '@crawlee/types';
2
+ import type { Request, Source } from '../request.js';
3
+ import type { IRequestList } from './request_list.js';
4
+ import type { AddRequestsBatchedOptions, AddRequestsBatchedResult, IRequestManager, RequestQueueOperationInfo, RequestQueueOperationOptions, RequestsLike } from './request_provider.js';
5
+ /**
6
+ * A request manager that combines a RequestList and a RequestQueue.
7
+ * It first reads requests from the RequestList and then, when needed,
8
+ * transfers them in batches to the RequestQueue.
9
+ */
10
+ export declare class RequestManagerTandem implements IRequestManager {
11
+ private log;
12
+ private requestList;
13
+ private requestQueue;
14
+ constructor(requestList: IRequestList, requestQueue: IRequestManager);
15
+ /**
16
+ * Transfers a batch of requests from the RequestList to the RequestQueue.
17
+ * Handles both successful transfers and failures appropriately.
18
+ * @private
19
+ */
20
+ private transferNextBatchToQueue;
21
+ /**
22
+ * Fetches the next request from the RequestQueue. If the queue is empty and the RequestList
23
+ * is not finished, it will transfer a batch of requests from the list to the queue first.
24
+ * @inheritdoc
25
+ */
26
+ fetchNextRequest<T extends Dictionary = Dictionary>(): Promise<Request<T> | null>;
27
+ /**
28
+ * @inheritdoc
29
+ */
30
+ isFinished(): Promise<boolean>;
31
+ /**
32
+ * @inheritdoc
33
+ */
34
+ isEmpty(): Promise<boolean>;
35
+ /**
36
+ * @inheritdoc
37
+ */
38
+ handledCount(): Promise<number>;
39
+ /**
40
+ * @inheritdoc
41
+ */
42
+ getTotalCount(): number;
43
+ /**
44
+ * @inheritdoc
45
+ */
46
+ getPendingCount(): number;
47
+ /**
48
+ * @inheritdoc
49
+ */
50
+ [Symbol.asyncIterator](): AsyncGenerator<Request<Dictionary>, void, unknown>;
51
+ /**
52
+ * @inheritdoc
53
+ */
54
+ markRequestHandled(request: Request): Promise<RequestQueueOperationInfo | void | null>;
55
+ /**
56
+ * @inheritdoc
57
+ */
58
+ reclaimRequest(request: Request, options?: RequestQueueOperationOptions): Promise<RequestQueueOperationInfo | null>;
59
+ /**
60
+ * @inheritdoc
61
+ */
62
+ addRequest(requestLike: Source, options?: RequestQueueOperationOptions): Promise<RequestQueueOperationInfo>;
63
+ /**
64
+ * @inheritdoc
65
+ */
66
+ addRequestsBatched(requests: RequestsLike, options?: AddRequestsBatchedOptions): Promise<AddRequestsBatchedResult>;
67
+ }
68
+ //# sourceMappingURL=request_manager_tandem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request_manager_tandem.d.ts","sourceRoot":"","sources":["../../src/storages/request_manager_tandem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EACR,yBAAyB,EACzB,wBAAwB,EACxB,eAAe,EACf,yBAAyB,EACzB,4BAA4B,EAC5B,YAAY,EACf,MAAM,uBAAuB,CAAC;AAE/B;;;;GAIG;AACH,qBAAa,oBAAqB,YAAW,eAAe;IACxD,OAAO,CAAC,GAAG,CAAgB;IAC3B,OAAO,CAAC,WAAW,CAAe;IAClC,OAAO,CAAC,YAAY,CAAkB;gBAE1B,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe;IAMpE;;;;OAIG;YACW,wBAAwB;IAuBtC;;;;OAIG;IACG,gBAAgB,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAevF;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAKpC;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;IAKjC;;OAEG;IACG,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC;IAKrC;;OAEG;IACH,aAAa,IAAI,MAAM;IAIvB;;OAEG;IACH,eAAe,IAAI,MAAM;IAIzB;;OAEG;IACI,CAAC,MAAM,CAAC,aAAa,CAAC;IAQ7B;;OAEG;IACG,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,yBAAyB,GAAG,IAAI,GAAG,IAAI,CAAC;IAI5F;;OAEG;IACG,cAAc,CAChB,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,4BAA4B,GACvC,OAAO,CAAC,yBAAyB,GAAG,IAAI,CAAC;IAI5C;;OAEG;IACG,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,4BAA4B,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAIjH;;OAEG;IACG,kBAAkB,CACpB,QAAQ,EAAE,YAAY,EACtB,OAAO,CAAC,EAAE,yBAAyB,GACpC,OAAO,CAAC,wBAAwB,CAAC;CAGvC"}
@@ -0,0 +1,124 @@
1
+ import { serviceLocator } from '../service_locator.js';
2
+ /**
3
+ * A request manager that combines a RequestList and a RequestQueue.
4
+ * It first reads requests from the RequestList and then, when needed,
5
+ * transfers them in batches to the RequestQueue.
6
+ */
7
+ export class RequestManagerTandem {
8
+ log;
9
+ requestList;
10
+ requestQueue;
11
+ constructor(requestList, requestQueue) {
12
+ this.log = serviceLocator.getLogger().child({ prefix: 'RequestManagerTandem' });
13
+ this.requestList = requestList;
14
+ this.requestQueue = requestQueue;
15
+ }
16
+ /**
17
+ * Transfers a batch of requests from the RequestList to the RequestQueue.
18
+ * Handles both successful transfers and failures appropriately.
19
+ * @private
20
+ */
21
+ async transferNextBatchToQueue() {
22
+ const request = await this.requestList.fetchNextRequest();
23
+ if (request === null) {
24
+ return;
25
+ }
26
+ try {
27
+ await this.requestQueue.addRequest(request, { forefront: true });
28
+ }
29
+ catch (error) {
30
+ // If requestQueue.addRequest() fails here then we must reclaim it back to
31
+ // the RequestList because probably it's not yet in the queue!
32
+ this.log.error('Adding of request from the RequestList to the RequestQueue failed, reclaiming request back to the list.', { request });
33
+ await this.requestList.reclaimRequest(request);
34
+ return;
35
+ }
36
+ await this.requestList.markRequestHandled(request);
37
+ }
38
+ /**
39
+ * Fetches the next request from the RequestQueue. If the queue is empty and the RequestList
40
+ * is not finished, it will transfer a batch of requests from the list to the queue first.
41
+ * @inheritdoc
42
+ */
43
+ async fetchNextRequest() {
44
+ // First, try to transfer a request from the requestList
45
+ const [listEmpty, listFinished] = await Promise.all([
46
+ this.requestList.isEmpty(),
47
+ this.requestList.isFinished(),
48
+ ]);
49
+ if (!listEmpty && !listFinished) {
50
+ await this.transferNextBatchToQueue();
51
+ }
52
+ // Try to fetch from queue after potential transfer
53
+ return this.requestQueue.fetchNextRequest();
54
+ }
55
+ /**
56
+ * @inheritdoc
57
+ */
58
+ async isFinished() {
59
+ const storagesFinished = await Promise.all([this.requestList.isFinished(), this.requestQueue.isFinished()]);
60
+ return storagesFinished.every(Boolean);
61
+ }
62
+ /**
63
+ * @inheritdoc
64
+ */
65
+ async isEmpty() {
66
+ const storagesEmpty = await Promise.all([this.requestList.isEmpty(), this.requestQueue.isEmpty()]);
67
+ return storagesEmpty.every(Boolean);
68
+ }
69
+ /**
70
+ * @inheritdoc
71
+ */
72
+ async handledCount() {
73
+ // Since one of the stores needs to have priority when both are present, we query the request queue - the request list will first be dumped into the queue and then left empty.
74
+ return await this.requestQueue.handledCount();
75
+ }
76
+ /**
77
+ * @inheritdoc
78
+ */
79
+ getTotalCount() {
80
+ return this.requestQueue.getTotalCount();
81
+ }
82
+ /**
83
+ * @inheritdoc
84
+ */
85
+ getPendingCount() {
86
+ return this.requestQueue.getPendingCount() + this.requestList.length() - this.requestList.handledCount();
87
+ }
88
+ /**
89
+ * @inheritdoc
90
+ */
91
+ async *[Symbol.asyncIterator]() {
92
+ while (true) {
93
+ const req = await this.fetchNextRequest();
94
+ if (!req)
95
+ break;
96
+ yield req;
97
+ }
98
+ }
99
+ /**
100
+ * @inheritdoc
101
+ */
102
+ async markRequestHandled(request) {
103
+ return this.requestQueue.markRequestHandled(request);
104
+ }
105
+ /**
106
+ * @inheritdoc
107
+ */
108
+ async reclaimRequest(request, options) {
109
+ return await this.requestQueue.reclaimRequest(request, options);
110
+ }
111
+ /**
112
+ * @inheritdoc
113
+ */
114
+ async addRequest(requestLike, options) {
115
+ return await this.requestQueue.addRequest(requestLike, options);
116
+ }
117
+ /**
118
+ * @inheritdoc
119
+ */
120
+ async addRequestsBatched(requests, options) {
121
+ return await this.requestQueue.addRequestsBatched(requests, options);
122
+ }
123
+ }
124
+ //# sourceMappingURL=request_manager_tandem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request_manager_tandem.js","sourceRoot":"","sources":["../../src/storages/request_manager_tandem.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAWvD;;;;GAIG;AACH,MAAM,OAAO,oBAAoB;IACrB,GAAG,CAAgB;IACnB,WAAW,CAAe;IAC1B,YAAY,CAAkB;IAEtC,YAAY,WAAyB,EAAE,YAA6B;Q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ACrC,OAAO,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACzD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,cAAc,CAChB,OAAgB,EAChB,OAAsC;QAEtC,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,UAAU,CAAC,WAAmB,EAAE,OAAsC;QACxE,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,kBAAkB,CACpB,QAAsB,EACtB,OAAmC;QAEnC,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACzE,CAAC;CACJ"}
@@ -1,25 +1,81 @@
1
- import type { BatchAddRequestsResult, Dictionary, ProcessedRequest, QueueOperationInfo, RequestQueueClient, RequestQueueInfo, StorageClient } from '@crawlee/types';
1
+ import type { BaseHttpClient, BatchAddRequestsResult, Dictionary, ProcessedRequest, QueueOperationInfo, RequestQueueClient, RequestQueueInfo } from '@crawlee/types';
2
+ import type { ReadonlyDeep } from 'type-fest';
2
3
  import { ListDictionary, LruCache } from '@apify/datastructures';
3
- import type { Log } from '@apify/log';
4
4
  import { Configuration } from '../configuration.js';
5
+ import type { EventManager } from '../events/event_manager.js';
6
+ import type { CrawleeLogger } from '../log.js';
5
7
  import type { ProxyConfiguration } from '../proxy_configuration.js';
6
8
  import type { InternalSource, RequestOptions, Source } from '../request.js';
7
9
  import { Request } from '../request.js';
8
- import type { IStorage, StorageManagerOptions } from './storage_manager.js';
9
- export declare abstract class RequestProvider implements IStorage {
10
- readonly config: Configuration;
10
+ import type { IStorage, StorageIdentifier } from './storage_instance_manager.js';
11
+ import type { StorageOpenOptions } from './utils.js';
12
+ export type RequestsLike = AsyncIterable<Source | string> | Iterable<Source | string> | (Source | string)[];
13
+ /**
14
+ * Represents a provider of requests/URLs to crawl.
15
+ */
16
+ export interface IRequestManager {
17
+ /**
18
+ * Returns `true` if all requests were already handled and there are no more left.
19
+ */
20
+ isFinished(): Promise<boolean>;
21
+ /**
22
+ * Resolves to `true` if the next call to {@link IRequestManager.fetchNextRequest} function
23
+ * would return `null`, otherwise it resolves to `false`.
24
+ * Note that even if the provider is empty, there might be some pending requests currently being processed.
25
+ */
26
+ isEmpty(): Promise<boolean>;
27
+ /**
28
+ * Returns number of handled requests.
29
+ */
30
+ handledCount(): Promise<number>;
31
+ /**
32
+ * Get the total number of requests known to the request manager.
33
+ */
34
+ getTotalCount(): number;
35
+ /**
36
+ * Get an offline approximation of the number of pending requests.
37
+ */
38
+ getPendingCount(): number;
39
+ /**
40
+ * Gets the next {@link Request} to process.
41
+ *
42
+ * The function's `Promise` resolves to `null` if there are no more
43
+ * requests to process.
44
+ */
45
+ fetchNextRequest<T extends Dictionary = Dictionary>(): Promise<Request<T> | null>;
46
+ /**
47
+ * Can be used to iterate over the `RequestManager` instance in a `for await .. of` loop.
48
+ * Provides an alternative for the repeated use of `fetchNextRequest`.
49
+ */
50
+ [Symbol.asyncIterator](): AsyncGenerator<Request>;
51
+ /**
52
+ * Marks request as handled after successful processing.
53
+ */
54
+ markRequestHandled(request: Request): Promise<RequestQueueOperationInfo | void | null>;
55
+ /**
56
+ * Reclaims request to the provider if its processing failed.
57
+ * The request will become available in the next `fetchNextRequest()`.
58
+ */
59
+ reclaimRequest(request: Request, options?: RequestQueueOperationOptions): Promise<RequestQueueOperationInfo | null>;
60
+ addRequest(requestLike: Source, options?: RequestQueueOperationOptions): Promise<RequestQueueOperationInfo>;
61
+ addRequestsBatched(requests: RequestsLike, options?: AddRequestsBatchedOptions): Promise<AddRequestsBatchedResult>;
62
+ }
63
+ export declare abstract class RequestProvider implements IStorage, IRequestManager {
64
+ protected readonly config: Configuration;
11
65
  id: string;
12
66
  name?: string;
13
67
  timeoutSecs: number;
14
68
  clientKey: string;
15
69
  client: RequestQueueClient;
16
70
  protected proxyConfiguration?: ProxyConfiguration;
17
- log: Log;
71
+ log: CrawleeLogger;
18
72
  internalTimeoutMillis: number;
19
73
  requestLockSecs: number;
20
74
  assumedTotalCount: number;
21
75
  assumedHandledCount: number;
22
76
  private initialCount;
77
+ private initialHandledCount;
78
+ private isInitialized;
23
79
  protected queueHeadIds: ListDictionary<string>;
24
80
  protected requestCache: LruCache<RequestLruItem>;
25
81
  protected recentlyHandledRequestsCache: LruCache<boolean>;
@@ -27,6 +83,8 @@ export declare abstract class RequestProvider implements IStorage {
27
83
  protected lastActivity: Date;
28
84
  protected isFinishedCalledWhileHeadWasNotEmpty: number;
29
85
  protected inProgressRequestBatchCount: number;
86
+ protected httpClient?: BaseHttpClient;
87
+ protected readonly events: EventManager;
30
88
  constructor(options: InternalRequestProviderOptions, config?: Configuration);
31
89
  /**
32
90
  * Returns an offline approximation of the total number of requests in the queue (i.e. pending + handled).
@@ -34,6 +92,12 @@ export declare abstract class RequestProvider implements IStorage {
34
92
  * Survives restarts and actor migrations.
35
93
  */
36
94
  getTotalCount(): number;
95
+ /**
96
+ * Returns an offline approximation of the total number of pending requests in the queue.
97
+ *
98
+ * Survives restarts and Actor migrations.
99
+ */
100
+ getPendingCount(): number;
37
101
  /**
38
102
  * Adds a request to the queue.
39
103
  *
@@ -63,7 +127,7 @@ export declare abstract class RequestProvider implements IStorage {
63
127
  * Note that the function sets the `uniqueKey` and `id` fields to the passed requests if missing.
64
128
  * @param [options] Request queue operation options.
65
129
  */
66
- addRequests(requestsLike: Source[], options?: RequestQueueOperationOptions): Promise<BatchAddRequestsResult>;
130
+ addRequests(requestsLike: RequestsLike, options?: RequestQueueOperationOptions): Promise<BatchAddRequestsResult>;
67
131
  /**
68
132
  * Adds requests to the queue in batches. By default, it will resolve after the initial batch is added, and continue
69
133
  * adding the rest in the background. You can configure the batch size via `batchSize` option and the sleep time in between
@@ -73,7 +137,7 @@ export declare abstract class RequestProvider implements IStorage {
73
137
  * @param requests The requests to add
74
138
  * @param options Options for the request queue
75
139
  */
76
- addRequestsBatched(requests: (string | Source)[], options?: AddRequestsBatchedOptions): Promise<AddRequestsBatchedResult>;
140
+ addRequestsBatched(requests: ReadonlyDeep<RequestsLike>, options?: AddRequestsBatchedOptions): Promise<AddRequestsBatchedResult>;
77
141
  /**
78
142
  * Gets the request from the queue specified by ID.
79
143
  *
@@ -98,7 +162,7 @@ export declare abstract class RequestProvider implements IStorage {
98
162
  * @returns
99
163
  * Returns the request object or `null` if there are no more pending requests.
100
164
  */
101
- abstract fetchNextRequest<T extends Dictionary = Dictionary>(options?: RequestOptions): Promise<Request<T> | null>;
165
+ abstract fetchNextRequest<T extends Dictionary = Dictionary>(): Promise<Request<T> | null>;
102
166
  /**
103
167
  * Marks a request that was previously returned by the
104
168
  * {@link RequestQueue.fetchNextRequest}
@@ -142,6 +206,10 @@ export declare abstract class RequestProvider implements IStorage {
142
206
  * depending on the mode of operation.
143
207
  */
144
208
  drop(): Promise<void>;
209
+ /**
210
+ * @inheritdoc
211
+ */
212
+ [Symbol.asyncIterator](): AsyncGenerator<Request<Dictionary>, void, unknown>;
145
213
  /**
146
214
  * Returns the number of handled requests.
147
215
  *
@@ -150,23 +218,17 @@ export declare abstract class RequestProvider implements IStorage {
150
218
  * ```javascript
151
219
  * const { handledRequestCount } = await queue.getInfo();
152
220
  * ```
221
+ * @inheritdoc
153
222
  */
154
223
  handledCount(): Promise<number>;
155
224
  /**
156
225
  * Returns an object containing general information about the request queue.
157
226
  *
158
- * The function returns the same object as the Apify API Client's
159
- * [getQueue](https://docs.apify.com/api/apify-client-js/latest#ApifyClient-requestQueues)
160
- * function, which in turn calls the
161
- * [Get request queue](https://apify.com/docs/api/v2#/reference/request-queues/queue/get-request-queue)
162
- * API endpoint.
163
- *
164
227
  * **Example:**
165
228
  * ```
166
229
  * {
167
230
  * id: "WkzbQMuFYuamGv3YF",
168
231
  * name: "my-queue",
169
- * userId: "wRsJZtadYvn4mBZmm",
170
232
  * createdAt: new Date("2015-12-12T07:34:14.202Z"),
171
233
  * modifiedAt: new Date("2015-12-13T08:36:13.202Z"),
172
234
  * accessedAt: new Date("2015-12-14T08:36:13.202Z"),
@@ -175,8 +237,10 @@ export declare abstract class RequestProvider implements IStorage {
175
237
  * pendingRequestCount: 20,
176
238
  * }
177
239
  * ```
240
+ *
241
+ * @throws If the underlying storage no longer exists (e.g. it was deleted externally).
178
242
  */
179
- getInfo(): Promise<RequestQueueInfo | undefined>;
243
+ getInfo(): Promise<RequestQueueInfo>;
180
244
  /**
181
245
  * Fetches URLs from requestsFromUrl and returns them in format of list of requests
182
246
  */
@@ -200,12 +264,13 @@ export declare abstract class RequestProvider implements IStorage {
200
264
  *
201
265
  * For more details and code examples, see the {@link RequestQueue} class.
202
266
  *
203
- * @param [queueIdOrName]
204
- * ID or name of the request queue to be opened. If `null` or `undefined`,
205
- * the function returns the default request queue associated with the crawler run.
267
+ * @param [identifier]
268
+ * ID or name of the request queue to be opened. If a string is provided, it will first be
269
+ * looked up as an ID; if no such storage exists, it will be treated as a name.
270
+ * If `null` or `undefined`, the function returns the default request queue associated with the crawler run.
206
271
  * @param [options] Open Request Queue options.
207
272
  */
208
- static open(queueIdOrName?: string | null, options?: StorageManagerOptions): Promise<RequestProvider>;
273
+ static open(identifier?: string | StorageIdentifier | null, options?: StorageOpenOptions): Promise<RequestProvider>;
209
274
  }
210
275
  interface RequestLruItem {
211
276
  uniqueKey: string;
@@ -218,7 +283,7 @@ interface RequestLruItem {
218
283
  export interface RequestProviderOptions {
219
284
  id: string;
220
285
  name?: string;
221
- client: StorageClient;
286
+ client: RequestQueueClient;
222
287
  /**
223
288
  * Used to pass the proxy configuration for the `requestsFromUrl` objects.
224
289
  * Takes advantage of the internal address rotation and authentication process.
@@ -1 +1 @@
1
- {"version":3,"file":"request_provider.d.ts","sourceRoot":"","sources":["../../src/storages/request_provider.ts"],"names":[],"mappings":"AA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AAC,EAAE,kBAAkB,CAAC;CAC3C;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,sBAAsB;CAAG;AAEtE;;GAEG;AACH,MAAM,WAAW,8BAA+B,SAAQ,sBAAsB;IAC1E,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,8BAA8B,EAAE,MAAM,CAAC;CAC1C;AAED,MAAM,WAAW,4BAA4B;IACzC;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,yBAA0B,SAAQ,kBAAkB;IACjE,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,yBAA0B,SAAQ,4BAA4B;IAC3E;;;OAGG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;IAEtC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACrC;AAED,MAAM,WAAW,wBAAwB;IACrC,aAAa,EAAE,gBAAgB,EAAE,CAAC;IAClC;;;;;;;;;;;;;;;OAeG;IACH,2BAA2B,EAAE,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;CAC5D"}
1
+ {"version":3,"file":"request_provider.d.ts","sourceRoot":"","sources":["../../src/storages/request_provider.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACR,cAAc,EACd,sBAAsB,EACtB,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EACnB,MAAM,gBAAgB,CAAC;AAWxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjE,OAAO,EAAE,aAAa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