apify 2.3.1-beta.4 → 3.0.0-alpha.0

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 (211) hide show
  1. package/README.md +6 -5
  2. package/package.json +69 -128
  3. package/build/actor.d.ts +0 -113
  4. package/build/actor.d.ts.map +0 -1
  5. package/build/actor.js +0 -582
  6. package/build/actor.js.map +0 -1
  7. package/build/apify.d.ts +0 -752
  8. package/build/apify.d.ts.map +0 -1
  9. package/build/apify.js +0 -877
  10. package/build/apify.js.map +0 -1
  11. package/build/autoscaling/autoscaled_pool.d.ts +0 -384
  12. package/build/autoscaling/autoscaled_pool.d.ts.map +0 -1
  13. package/build/autoscaling/autoscaled_pool.js +0 -557
  14. package/build/autoscaling/autoscaled_pool.js.map +0 -1
  15. package/build/autoscaling/snapshotter.d.ts +0 -278
  16. package/build/autoscaling/snapshotter.d.ts.map +0 -1
  17. package/build/autoscaling/snapshotter.js +0 -447
  18. package/build/autoscaling/snapshotter.js.map +0 -1
  19. package/build/autoscaling/system_status.d.ts +0 -224
  20. package/build/autoscaling/system_status.d.ts.map +0 -1
  21. package/build/autoscaling/system_status.js +0 -228
  22. package/build/autoscaling/system_status.js.map +0 -1
  23. package/build/browser_launchers/browser_launcher.d.ts +0 -154
  24. package/build/browser_launchers/browser_launcher.d.ts.map +0 -1
  25. package/build/browser_launchers/browser_launcher.js +0 -160
  26. package/build/browser_launchers/browser_launcher.js.map +0 -1
  27. package/build/browser_launchers/browser_plugin.d.ts +0 -23
  28. package/build/browser_launchers/browser_plugin.d.ts.map +0 -1
  29. package/build/browser_launchers/browser_plugin.js +0 -25
  30. package/build/browser_launchers/browser_plugin.js.map +0 -1
  31. package/build/browser_launchers/playwright_launcher.d.ts +0 -131
  32. package/build/browser_launchers/playwright_launcher.d.ts.map +0 -1
  33. package/build/browser_launchers/playwright_launcher.js +0 -150
  34. package/build/browser_launchers/playwright_launcher.js.map +0 -1
  35. package/build/browser_launchers/puppeteer_launcher.d.ts +0 -153
  36. package/build/browser_launchers/puppeteer_launcher.d.ts.map +0 -1
  37. package/build/browser_launchers/puppeteer_launcher.js +0 -197
  38. package/build/browser_launchers/puppeteer_launcher.js.map +0 -1
  39. package/build/cache_container.d.ts +0 -31
  40. package/build/cache_container.d.ts.map +0 -1
  41. package/build/cache_container.js +0 -48
  42. package/build/cache_container.js.map +0 -1
  43. package/build/configuration.d.ts +0 -226
  44. package/build/configuration.d.ts.map +0 -1
  45. package/build/configuration.js +0 -325
  46. package/build/configuration.js.map +0 -1
  47. package/build/constants.d.ts +0 -37
  48. package/build/constants.d.ts.map +0 -1
  49. package/build/constants.js +0 -41
  50. package/build/constants.js.map +0 -1
  51. package/build/crawlers/basic_crawler.d.ts +0 -443
  52. package/build/crawlers/basic_crawler.d.ts.map +0 -1
  53. package/build/crawlers/basic_crawler.js +0 -664
  54. package/build/crawlers/basic_crawler.js.map +0 -1
  55. package/build/crawlers/browser_crawler.d.ts +0 -512
  56. package/build/crawlers/browser_crawler.d.ts.map +0 -1
  57. package/build/crawlers/browser_crawler.js +0 -540
  58. package/build/crawlers/browser_crawler.js.map +0 -1
  59. package/build/crawlers/cheerio_crawler.d.ts +0 -931
  60. package/build/crawlers/cheerio_crawler.d.ts.map +0 -1
  61. package/build/crawlers/cheerio_crawler.js +0 -913
  62. package/build/crawlers/cheerio_crawler.js.map +0 -1
  63. package/build/crawlers/crawler_extension.d.ts +0 -10
  64. package/build/crawlers/crawler_extension.d.ts.map +0 -1
  65. package/build/crawlers/crawler_extension.js +0 -19
  66. package/build/crawlers/crawler_extension.js.map +0 -1
  67. package/build/crawlers/crawler_utils.d.ts +0 -34
  68. package/build/crawlers/crawler_utils.d.ts.map +0 -1
  69. package/build/crawlers/crawler_utils.js +0 -87
  70. package/build/crawlers/crawler_utils.js.map +0 -1
  71. package/build/crawlers/playwright_crawler.d.ts +0 -448
  72. package/build/crawlers/playwright_crawler.d.ts.map +0 -1
  73. package/build/crawlers/playwright_crawler.js +0 -299
  74. package/build/crawlers/playwright_crawler.js.map +0 -1
  75. package/build/crawlers/puppeteer_crawler.d.ts +0 -425
  76. package/build/crawlers/puppeteer_crawler.d.ts.map +0 -1
  77. package/build/crawlers/puppeteer_crawler.js +0 -299
  78. package/build/crawlers/puppeteer_crawler.js.map +0 -1
  79. package/build/crawlers/statistics.d.ts +0 -185
  80. package/build/crawlers/statistics.d.ts.map +0 -1
  81. package/build/crawlers/statistics.js +0 -331
  82. package/build/crawlers/statistics.js.map +0 -1
  83. package/build/enqueue_links/click_elements.d.ts +0 -179
  84. package/build/enqueue_links/click_elements.d.ts.map +0 -1
  85. package/build/enqueue_links/click_elements.js +0 -434
  86. package/build/enqueue_links/click_elements.js.map +0 -1
  87. package/build/enqueue_links/enqueue_links.d.ts +0 -117
  88. package/build/enqueue_links/enqueue_links.d.ts.map +0 -1
  89. package/build/enqueue_links/enqueue_links.js +0 -163
  90. package/build/enqueue_links/enqueue_links.js.map +0 -1
  91. package/build/enqueue_links/shared.d.ts +0 -42
  92. package/build/enqueue_links/shared.d.ts.map +0 -1
  93. package/build/enqueue_links/shared.js +0 -121
  94. package/build/enqueue_links/shared.js.map +0 -1
  95. package/build/errors.d.ts +0 -29
  96. package/build/errors.d.ts.map +0 -1
  97. package/build/errors.js +0 -38
  98. package/build/errors.js.map +0 -1
  99. package/build/events.d.ts +0 -11
  100. package/build/events.d.ts.map +0 -1
  101. package/build/events.js +0 -147
  102. package/build/events.js.map +0 -1
  103. package/build/index.d.ts +0 -4
  104. package/build/index.d.ts.map +0 -1
  105. package/build/index.js +0 -7
  106. package/build/index.js.map +0 -1
  107. package/build/main.d.ts +0 -179
  108. package/build/main.d.ts.map +0 -1
  109. package/build/main.js +0 -81
  110. package/build/main.js.map +0 -1
  111. package/build/playwright_utils.d.ts +0 -9
  112. package/build/playwright_utils.d.ts.map +0 -1
  113. package/build/playwright_utils.js +0 -90
  114. package/build/playwright_utils.js.map +0 -1
  115. package/build/proxy_configuration.d.ts +0 -411
  116. package/build/proxy_configuration.d.ts.map +0 -1
  117. package/build/proxy_configuration.js +0 -517
  118. package/build/proxy_configuration.js.map +0 -1
  119. package/build/pseudo_url.d.ts +0 -86
  120. package/build/pseudo_url.d.ts.map +0 -1
  121. package/build/pseudo_url.js +0 -153
  122. package/build/pseudo_url.js.map +0 -1
  123. package/build/puppeteer_request_interception.d.ts +0 -8
  124. package/build/puppeteer_request_interception.d.ts.map +0 -1
  125. package/build/puppeteer_request_interception.js +0 -235
  126. package/build/puppeteer_request_interception.js.map +0 -1
  127. package/build/puppeteer_utils.d.ts +0 -250
  128. package/build/puppeteer_utils.d.ts.map +0 -1
  129. package/build/puppeteer_utils.js +0 -551
  130. package/build/puppeteer_utils.js.map +0 -1
  131. package/build/request.d.ts +0 -180
  132. package/build/request.d.ts.map +0 -1
  133. package/build/request.js +0 -261
  134. package/build/request.js.map +0 -1
  135. package/build/request_list.d.ts +0 -581
  136. package/build/request_list.d.ts.map +0 -1
  137. package/build/request_list.js +0 -826
  138. package/build/request_list.js.map +0 -1
  139. package/build/serialization.d.ts +0 -5
  140. package/build/serialization.d.ts.map +0 -1
  141. package/build/serialization.js +0 -139
  142. package/build/serialization.js.map +0 -1
  143. package/build/session_pool/errors.d.ts +0 -11
  144. package/build/session_pool/errors.d.ts.map +0 -1
  145. package/build/session_pool/errors.js +0 -18
  146. package/build/session_pool/errors.js.map +0 -1
  147. package/build/session_pool/events.d.ts +0 -5
  148. package/build/session_pool/events.d.ts.map +0 -1
  149. package/build/session_pool/events.js +0 -6
  150. package/build/session_pool/events.js.map +0 -1
  151. package/build/session_pool/session.d.ts +0 -286
  152. package/build/session_pool/session.d.ts.map +0 -1
  153. package/build/session_pool/session.js +0 -355
  154. package/build/session_pool/session.js.map +0 -1
  155. package/build/session_pool/session_pool.d.ts +0 -280
  156. package/build/session_pool/session_pool.d.ts.map +0 -1
  157. package/build/session_pool/session_pool.js +0 -393
  158. package/build/session_pool/session_pool.js.map +0 -1
  159. package/build/session_pool/session_utils.d.ts +0 -4
  160. package/build/session_pool/session_utils.d.ts.map +0 -1
  161. package/build/session_pool/session_utils.js +0 -24
  162. package/build/session_pool/session_utils.js.map +0 -1
  163. package/build/stealth/hiding_tricks.d.ts +0 -22
  164. package/build/stealth/hiding_tricks.d.ts.map +0 -1
  165. package/build/stealth/hiding_tricks.js +0 -308
  166. package/build/stealth/hiding_tricks.js.map +0 -1
  167. package/build/stealth/stealth.d.ts +0 -56
  168. package/build/stealth/stealth.d.ts.map +0 -1
  169. package/build/stealth/stealth.js +0 -125
  170. package/build/stealth/stealth.js.map +0 -1
  171. package/build/storages/dataset.d.ts +0 -288
  172. package/build/storages/dataset.d.ts.map +0 -1
  173. package/build/storages/dataset.js +0 -480
  174. package/build/storages/dataset.js.map +0 -1
  175. package/build/storages/key_value_store.d.ts +0 -243
  176. package/build/storages/key_value_store.d.ts.map +0 -1
  177. package/build/storages/key_value_store.js +0 -462
  178. package/build/storages/key_value_store.js.map +0 -1
  179. package/build/storages/request_queue.d.ts +0 -318
  180. package/build/storages/request_queue.d.ts.map +0 -1
  181. package/build/storages/request_queue.js +0 -636
  182. package/build/storages/request_queue.js.map +0 -1
  183. package/build/storages/storage_manager.d.ts +0 -87
  184. package/build/storages/storage_manager.d.ts.map +0 -1
  185. package/build/storages/storage_manager.js +0 -150
  186. package/build/storages/storage_manager.js.map +0 -1
  187. package/build/tsconfig.tsbuildinfo +0 -1
  188. package/build/typedefs.d.ts +0 -146
  189. package/build/typedefs.d.ts.map +0 -1
  190. package/build/typedefs.js +0 -88
  191. package/build/typedefs.js.map +0 -1
  192. package/build/utils.d.ts +0 -175
  193. package/build/utils.d.ts.map +0 -1
  194. package/build/utils.js +0 -731
  195. package/build/utils.js.map +0 -1
  196. package/build/utils_log.d.ts +0 -41
  197. package/build/utils_log.d.ts.map +0 -1
  198. package/build/utils_log.js +0 -192
  199. package/build/utils_log.js.map +0 -1
  200. package/build/utils_request.d.ts +0 -77
  201. package/build/utils_request.d.ts.map +0 -1
  202. package/build/utils_request.js +0 -385
  203. package/build/utils_request.js.map +0 -1
  204. package/build/utils_social.d.ts +0 -210
  205. package/build/utils_social.d.ts.map +0 -1
  206. package/build/utils_social.js +0 -787
  207. package/build/utils_social.js.map +0 -1
  208. package/build/validators.d.ts +0 -23
  209. package/build/validators.d.ts.map +0 -1
  210. package/build/validators.js +0 -29
  211. package/build/validators.js.map +0 -1
@@ -1,146 +0,0 @@
1
- /**
2
- * Represents information about an actor run, as returned by the
3
- * {@link Apifycall } or {@link ApifycallTask } function.
4
- * The object is almost equivalent to the JSON response
5
- * of the
6
- * [Actor run](https://apify.com/docs/api/v2#/reference/actors/run-collection/run-actor)
7
- * Apify API endpoint and extended with certain fields.
8
- * For more details, see
9
- * [Runs.](https://docs.apify.com/actor/run)
10
- */
11
- export type ActorRun = {
12
- /**
13
- * Actor run ID
14
- */
15
- id: string;
16
- /**
17
- * Actor ID
18
- */
19
- actId: string;
20
- /**
21
- * Time when the actor run started
22
- */
23
- startedAt: Date;
24
- /**
25
- * Time when the actor run finished. Contains `null` for running actors.
26
- */
27
- finishedAt: Date;
28
- /**
29
- * Status of the run. For possible values, see
30
- * [Run lifecycle](https://docs.apify.com/actors/running#lifecycle)
31
- * in Apify actor documentation.
32
- */
33
- status: string;
34
- /**
35
- * Actor run meta-data. For example:
36
- * ```
37
- * {
38
- * "origin": "API",
39
- * "clientIp": "1.2.3.4",
40
- * "userAgent": "ApifyClient/0.2.13 (Linux; Node/v8.11.3)"
41
- * }
42
- * ```
43
- */
44
- meta: {
45
- [x: string]: string;
46
- };
47
- /**
48
- * An object containing various actor run statistics. For example:
49
- * ```
50
- * {
51
- * "inputBodyLen": 22,
52
- * "restartCount": 0,
53
- * "workersUsed": 1,
54
- * }
55
- * ```
56
- * Beware that object fields might change in future releases.
57
- */
58
- stats: {
59
- [x: string]: number;
60
- };
61
- /**
62
- * Actor run options. For example:
63
- * ```
64
- * {
65
- * "build": "latest",
66
- * "waitSecs": 0,
67
- * "memoryMbytes": 256,
68
- * "diskMbytes": 512
69
- * }
70
- * ```
71
- */
72
- options: {
73
- [x: string]: any;
74
- };
75
- /**
76
- * ID of the actor build used for the run. For details, see
77
- * [Builds](https://docs.apify.com/actor/build)
78
- * in Apify actor documentation.
79
- */
80
- buildId: string;
81
- /**
82
- * Number of the actor build used for the run. For example, `0.0.10`.
83
- */
84
- buildNumber: string;
85
- /**
86
- * Exit code of the actor run process. It's `null` if actor is still running.
87
- */
88
- exitCode: number;
89
- /**
90
- * ID of the default key-value store associated with the actor run. See {@link KeyValueStore } for details.
91
- */
92
- defaultKeyValueStoreId: string;
93
- /**
94
- * ID of the default dataset associated with the actor run. See {@link Dataset } for details.
95
- */
96
- defaultDatasetId: string;
97
- /**
98
- * ID of the default request queue associated with the actor run. See {@link RequestQueue } for details.
99
- */
100
- defaultRequestQueueId: string;
101
- /**
102
- * URL on which the web server running inside actor run's Docker container can be accessed.
103
- * For more details, see
104
- * [Container web server](https://docs.apify.com/actor/run#container-web-server)
105
- * in Apify actor documentation.
106
- */
107
- containerUrl: string;
108
- /**
109
- * Contains output of the actor run. The value is `null` or `undefined` in case the actor is still running,
110
- * or if you pass `false` to the `fetchOutput` option of {@link Apifycall }.
111
- *
112
- * For example:
113
- * ```
114
- * {
115
- * "contentType": "application/json; charset=utf-8",
116
- * "body": {
117
- * "message": "Hello world!"
118
- * }
119
- * }
120
- * ```
121
- */
122
- output: ({
123
- [x: string]: any;
124
- } | null | undefined);
125
- };
126
- export type DirectNavigationOptions = {
127
- /**
128
- * Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The
129
- * default value can be changed by using the browserContext.setDefaultNavigationTimeout(timeout),
130
- * browserContext.setDefaultTimeout(timeout), page.setDefaultNavigationTimeout(timeout) or
131
- * page.setDefaultTimeout(timeout) methods.
132
- */
133
- timeout?: number | undefined;
134
- /**
135
- * When to consider operation succeeded, defaults to `load`. Events can be either:
136
- * - `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.
137
- * - `'load'` - consider operation to be finished when the `load` event is fired.
138
- * - `'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.
139
- */
140
- waitUntil?: "domcontentloaded" | "load" | "networkidle" | undefined;
141
- /**
142
- * Referer header value. If provided it will take preference over the referer header value set by page.setExtraHTTPHeaders(headers).
143
- */
144
- referer?: string | undefined;
145
- };
146
- //# sourceMappingURL=typedefs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"typedefs.d.ts","sourceRoot":"","sources":["../src/typedefs.js"],"names":[],"mappings":";;;;;;;;;;;;;;QAWc,MAAM;;;;WAEN,MAAM;;;;eAEN,IAAI;;;;gBAEJ,IAAI;;;;;;YAEJ,MAAM;;;;;;;;;;;;YAIC,MAAM,GAAE,MAAM;;;;;;;;;;;;;;YASd,MAAM,GAAE,MAAM;;;;;;;;;;;;;;YAUd,MAAM;;;;;;;aAUb,MAAM;;;;iBAIN,MAAM;;;;cAEN,MAAM;;;;4BAEN,MAAM;;;;sBAEN,MAAM;;;;2BAEN,MAAM;;;;;;;kBAEN,MAAM;;;;;;;;;;;;;;;YAKN,CAAC;YAAO,MAAM;QAAK,IAAI,GAAC,SAAS,CAAC"}
package/build/typedefs.js DELETED
@@ -1,88 +0,0 @@
1
- "use strict";
2
- /**
3
- * Represents information about an actor run, as returned by the
4
- * {@link Apify#call} or {@link Apify#callTask} function.
5
- * The object is almost equivalent to the JSON response
6
- * of the
7
- * [Actor run](https://apify.com/docs/api/v2#/reference/actors/run-collection/run-actor)
8
- * Apify API endpoint and extended with certain fields.
9
- * For more details, see
10
- * [Runs.](https://docs.apify.com/actor/run)
11
- *
12
- * @typedef ActorRun
13
- * @property {string} id
14
- * Actor run ID
15
- * @property {string} actId
16
- * Actor ID
17
- * @property {Date} startedAt
18
- * Time when the actor run started
19
- * @property {Date} finishedAt
20
- * Time when the actor run finished. Contains `null` for running actors.
21
- * @property {string} status
22
- * Status of the run. For possible values, see
23
- * [Run lifecycle](https://docs.apify.com/actors/running#lifecycle)
24
- * in Apify actor documentation.
25
- * @property {Object<string, string>} meta
26
- * Actor run meta-data. For example:
27
- * ```
28
- * {
29
- * "origin": "API",
30
- * "clientIp": "1.2.3.4",
31
- * "userAgent": "ApifyClient/0.2.13 (Linux; Node/v8.11.3)"
32
- * }
33
- * ```
34
- * @property {Object<string, number>} stats
35
- * An object containing various actor run statistics. For example:
36
- * ```
37
- * {
38
- * "inputBodyLen": 22,
39
- * "restartCount": 0,
40
- * "workersUsed": 1,
41
- * }
42
- * ```
43
- * Beware that object fields might change in future releases.
44
- * @property {Object<string, *>} options
45
- * Actor run options. For example:
46
- * ```
47
- * {
48
- * "build": "latest",
49
- * "waitSecs": 0,
50
- * "memoryMbytes": 256,
51
- * "diskMbytes": 512
52
- * }
53
- * ```
54
- * @property {string} buildId
55
- * ID of the actor build used for the run. For details, see
56
- * [Builds](https://docs.apify.com/actor/build)
57
- * in Apify actor documentation.
58
- * @property {string} buildNumber
59
- * Number of the actor build used for the run. For example, `0.0.10`.
60
- * @property {number} exitCode
61
- * Exit code of the actor run process. It's `null` if actor is still running.
62
- * @property {string} defaultKeyValueStoreId
63
- * ID of the default key-value store associated with the actor run. See {@link KeyValueStore} for details.
64
- * @property {string} defaultDatasetId
65
- * ID of the default dataset associated with the actor run. See {@link Dataset} for details.
66
- * @property {string} defaultRequestQueueId
67
- * ID of the default request queue associated with the actor run. See {@link RequestQueue} for details.
68
- * @property {string} containerUrl
69
- * URL on which the web server running inside actor run's Docker container can be accessed.
70
- * For more details, see
71
- * [Container web server](https://docs.apify.com/actor/run#container-web-server)
72
- * in Apify actor documentation.
73
- * @property {(Object<string, *>|null|undefined)} output
74
- * Contains output of the actor run. The value is `null` or `undefined` in case the actor is still running,
75
- * or if you pass `false` to the `fetchOutput` option of {@link Apify#call}.
76
- *
77
- * For example:
78
- * ```
79
- * {
80
- * "contentType": "application/json; charset=utf-8",
81
- * "body": {
82
- * "message": "Hello world!"
83
- * }
84
- * }
85
- * ```
86
- */
87
- Object.defineProperty(exports, "__esModule", { value: true });
88
- //# sourceMappingURL=typedefs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"typedefs.js","sourceRoot":"","sources":["../src/typedefs.js"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoFG"}
package/build/utils.d.ts DELETED
@@ -1,175 +0,0 @@
1
- /// <reference types="node" />
2
- export function newClient(options?: {
3
- token?: string | undefined;
4
- maxRetries?: string | undefined;
5
- minDelayBetweenRetriesMillis?: string | undefined;
6
- } | undefined): ApifyClient;
7
- export function logSystemInfo(): void;
8
- /**
9
- * The default instance of `ApifyClient` used internally
10
- * by the SDK.
11
- *
12
- * @type {*}
13
- * @ignore
14
- */
15
- export const apifyClient: any;
16
- export function addCharsetToContentType(contentType: string): string;
17
- export function isDocker(forceReset: boolean): Promise<boolean>;
18
- export function weightedAvg(arrValues: number[], arrWeights: number[]): number;
19
- export function getMemoryInfo(): Promise<MemoryInfo>;
20
- export function getFirstKey(dict: any): string | undefined;
21
- export function getTypicalChromeExecutablePath(): string;
22
- export function isAtHome(): boolean;
23
- export function sleep(millis: number): Promise<void>;
24
- export function snakeCaseToCamelCase(snakeCaseStr: string): string;
25
- export function printOutdatedSdkWarning(): void;
26
- export function parseContentTypeFromResponse(response: IncomingMessage): {
27
- type: string;
28
- charset: string;
29
- };
30
- export function waitForRunToFinish(options: {
31
- actorId: string;
32
- runId: string;
33
- waitSecs?: string | undefined;
34
- token?: string | undefined;
35
- }): Promise<ActorRun>;
36
- export function purgeLocalStorage(folder?: string | undefined): Promise<void>;
37
- export namespace publicUtils {
38
- export { isDocker };
39
- export { sleep };
40
- export { downloadListOfUrls };
41
- export { extractUrls };
42
- export { htmlToText };
43
- export { URL_NO_COMMAS_REGEX };
44
- export { URL_WITH_COMMAS_REGEX };
45
- export { createRequestDebugInfo };
46
- export { waitForRunToFinish };
47
- export { purgeLocalStorage };
48
- }
49
- /**
50
- * Describes memory usage of an Actor.
51
- */
52
- export type MemoryInfo = {
53
- /**
54
- * Total memory available in the system or container
55
- */
56
- totalBytes: number;
57
- /**
58
- * Amount of free memory in the system or container
59
- */
60
- freeBytes: number;
61
- /**
62
- * Amount of memory used (= totalBytes - freeBytes)
63
- */
64
- usedBytes: number;
65
- /**
66
- * Amount of memory used the current Node.js process
67
- */
68
- mainProcessBytes: number;
69
- /**
70
- * Amount of memory used by child processes of the current Node.js process
71
- */
72
- childProcessesBytes: number;
73
- };
74
- import { ApifyClient } from "apify-client/dist/apify_client";
75
- import { IncomingMessage } from "http";
76
- import { ActorRun } from "./typedefs";
77
- /**
78
- * Returns a promise that resolves to an array of urls parsed from the resource available at the provided url.
79
- * Optionally, custom regular expression and encoding may be provided.
80
- *
81
- * @param {object} options
82
- * @param {string} options.url URL to the file
83
- * @param {string} [options.encoding='utf8'] The encoding of the file.
84
- * @param {string} [options.proxyUrl] The proxy url to be used for the request.
85
- * @param {RegExp} [options.urlRegExp=URL_NO_COMMAS_REGEX]
86
- * Custom regular expression to identify the URLs in the file to extract.
87
- * The regular expression should be case-insensitive and have global flag set (i.e. `/something/gi`).
88
- * @returns {Promise<Array<string>>}
89
- * @memberOf utils
90
- */
91
- declare function downloadListOfUrls(options: {
92
- url: string;
93
- encoding?: string | undefined;
94
- proxyUrl?: string | undefined;
95
- urlRegExp?: RegExp | undefined;
96
- }): Promise<Array<string>>;
97
- /**
98
- * Collects all URLs in an arbitrary string to an array, optionally using a custom regular expression.
99
- * @param {object} options
100
- * @param {string} options.string
101
- * @param {RegExp} [options.urlRegExp=Apify.utils.URL_NO_COMMAS_REGEX]
102
- * @returns {string[]}
103
- * @memberOf utils
104
- */
105
- declare function extractUrls(options: {
106
- string: string;
107
- urlRegExp?: RegExp | undefined;
108
- }): string[];
109
- /**
110
- * The function converts a HTML document to a plain text.
111
- *
112
- * The plain text generated by the function is similar to a text captured
113
- * by pressing Ctrl+A and Ctrl+C on a page when loaded in a web browser.
114
- * The function doesn't aspire to preserve the formatting or to be perfectly correct with respect to HTML specifications.
115
- * However, it attempts to generate newlines and whitespaces in and around HTML elements
116
- * to avoid merging distinct parts of text and thus enable extraction of data from the text (e.g. phone numbers).
117
- *
118
- * **Example usage**
119
- * ```javascript
120
- * const text = htmlToText('<html><body>Some text</body></html>');
121
- * console.log(text);
122
- * ```
123
- *
124
- * Note that the function uses [cheerio](https://www.npmjs.com/package/cheerio) to parse the HTML.
125
- * Optionally, to avoid duplicate parsing of HTML and thus improve performance, you can pass
126
- * an existing Cheerio object to the function instead of the HTML text. The HTML should be parsed
127
- * with the `decodeEntities` option set to `true`. For example:
128
- *
129
- * ```javascript
130
- * const cheerio = require('cheerio');
131
- * const html = '<html><body>Some text</body></html>';
132
- * const text = htmlToText(cheerio.load(html, { decodeEntities: true }));
133
- * ```
134
- * @param {(string|CheerioAPI)} html HTML text or parsed HTML represented using a
135
- * [cheerio](https://www.npmjs.com/package/cheerio) function.
136
- * @return {string} Plain text
137
- * @memberOf utils
138
- * @function
139
- */
140
- declare function htmlToText(html: (string | CheerioAPI)): string;
141
- /**
142
- * Default regular expression to match URLs in a string that may be plain text, JSON, CSV or other. It supports common URL characters
143
- * and does not support URLs containing commas or spaces. The URLs also may contain Unicode letters (not symbols).
144
- * @memberOf utils
145
- */
146
- declare const URL_NO_COMMAS_REGEX: RegExp;
147
- /**
148
- * Regular expression that, in addition to the default regular expression `URL_NO_COMMAS_REGEX`, supports matching commas in URL path and query.
149
- * Note, however, that this may prevent parsing URLs from comma delimited lists, or the URLs may become malformed.
150
- * @memberOf utils
151
- */
152
- declare const URL_WITH_COMMAS_REGEX: RegExp;
153
- /**
154
- * Creates a standardized debug info from request and response. This info is usually added to dataset under the hidden `#debug` field.
155
- *
156
- * @param {(Request|RequestOptions)} request [Apify.Request](https://sdk.apify.com/docs/api/request) object.
157
- * @param {(*|IncomingMessage|PuppeteerResponse)} [response]
158
- * Puppeteer [`Response`](https://pptr.dev/#?product=Puppeteer&version=v1.11.0&show=api-class-response)
159
- * or NodeJS [`http.IncomingMessage`](https://nodejs.org/api/http.html#http_class_http_serverresponse).
160
- * @param {Object<string, *>} [additionalFields] Object containing additional fields to be added.
161
-
162
- * @return {Object<string, *>}
163
- */
164
- declare function createRequestDebugInfo(request: (Request | RequestOptions), response?: (any | IncomingMessage | PuppeteerResponse), additionalFields?: {
165
- [x: string]: any;
166
- } | undefined): {
167
- [x: string]: any;
168
- };
169
- import { CheerioAPI } from "cheerio/lib/load";
170
- import Request from "./request";
171
- import { RequestOptions } from "./request";
172
- // @ts-ignore optional peer dependency
173
- import { HTTPResponse as PuppeteerResponse } from "puppeteer";
174
- export {};
175
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.js"],"names":[],"mappings":";AA+EO;;;;gBAFK,WAAW,CAmBtB;AAKM,sCAON;AAED;;;;;;GAMG;AACH,8BAAuE;AAUhE,qDALI,MAAM,GACJ,MAAM,CAclB;AA6BM,qCAPI,OAAO,GACN,QAAQ,OAAO,CAAC,CAW3B;AAWM,uCANI,MAAM,EAAE,cACR,MAAM,EAAE,GACP,MAAM,CAajB;AA4BM,iCANM,QAAQ,UAAU,CAAC,CA2H/B;AAOM,2DAIN;AAQM,kDAHK,MAAM,CA6BjB;AAWM,4BANM,OAAO,CAM4C;AAsBzD,8BANI,MAAM,GAIL,QAAQ,IAAI,CAAC,CAIxB;AAgLM,mDAJI,MAAM,GACL,MAAM,CAajB;AAOM,gDAQN;AAQM,uDAJI,eAAe,GACd;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAgC5C;AA+BM;IApBoB,OAAO,EAAvB,MAAM;IAEU,KAAK,EAArB,MAAM;IAEW,QAAQ;IAIR,KAAK;IAIpB,QAAQ,QAAQ,CAAC,CA+C7B;AAcM,gEALM,QAAQ,IAAI,CAAC,CAazB;;;;;;;;;;;;;;;;;;;;gBAriBa,MAAM;;;;eACN,MAAM;;;;eACN,MAAM;;;;sBACN,MAAM;;;;yBACN,MAAM;;;;;AAyNpB;;;;;;;;;;;;;GAaG;AACH;IAT2B,GAAG,EAAnB,MAAM;IACW,QAAQ;IACR,QAAQ;IACR,SAAS;IAGxB,QAAQ,MAAM,MAAM,CAAC,CAAC,CAsBlC;AAED;;;;;;;GAOG;AACH;IAL2B,MAAM,EAAtB,MAAM;IACW,SAAS;IACxB,MAAM,EAAE,CAUpB;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,kCANW,CAAC,MAAM,GAAC,UAAU,CAAC,GAElB,MAAM,CAqDjB;AAxgBD;;;;GAIG;AACH,0CAAoL;AACpL;;;;GAIG;AACH,4CAAuL;AA+fvL;;;;;;;;;;GAUG;AACH,iDARW,CAAC,OAAO,GAAC,cAAc,CAAC,aACxB,CAAC,MAAE,eAAe,GAAC,iBAAiB,CAAC;;;QAK7B,MAAM;EAkBxB"}