apify 3.0.0-beta.49 → 3.0.0-beta.51

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.
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.KeyValueStore = void 0;
4
+ const core_1 = require("@crawlee/core");
5
+ /**
6
+ * @inheritDoc
7
+ */
8
+ class KeyValueStore extends core_1.KeyValueStore {
9
+ /**
10
+ * Returns a URL for the given key that may be used to publicly
11
+ * access the value in the remote key-value store.
12
+ */
13
+ getPublicUrl(key) {
14
+ return `https://api.apify.com/v2/key-value-stores/${this.id}/records/${key}`;
15
+ }
16
+ /**
17
+ * @inheritDoc
18
+ */
19
+ static async open(storeIdOrName, options = {}) {
20
+ return super.open(storeIdOrName, options);
21
+ }
22
+ }
23
+ exports.KeyValueStore = KeyValueStore;
24
+ // @ts-expect-error extension of the core class to make this only a type-issue
25
+ core_1.KeyValueStore.prototype.getPublicUrl = KeyValueStore.prototype.getPublicUrl;
26
+ //# sourceMappingURL=key_value_store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"key_value_store.js","sourceRoot":"","sources":["../src/key_value_store.ts"],"names":[],"mappings":";;;AACA,wCAAmE;AAEnE;;GAEG;AACH,MAAa,aAAc,SAAQ,oBAAiB;IAChD;;;OAGG;IACH,YAAY,CAAC,GAAW;QACpB,OAAO,6CAA6C,IAAI,CAAC,EAAE,YAAY,GAAG,EAAE,CAAC;IACjF,CAAC;IAED;;OAEG;IACH,MAAM,CAAU,KAAK,CAAC,IAAI,CAAC,aAA6B,EAAE,UAAiC,EAAE;QACzF,OAAO,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAA6B,CAAC;IAC1E,CAAC;CACJ;AAfD,sCAeC;AAED,8EAA8E;AAC9E,oBAAiB,CAAC,SAAS,CAAC,YAAY,GAAG,aAAa,CAAC,SAAS,CAAC,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apify",
3
- "version": "3.0.0-beta.49",
3
+ "version": "3.0.0-beta.51",
4
4
  "description": "The scalable web crawling and scraping library for JavaScript/Node.js. Enables development of data extraction and web automation jobs (not only) with headless Chrome and Puppeteer.",
5
5
  "engines": {
6
6
  "node": ">=16.0.0"
@@ -57,12 +57,12 @@
57
57
  "@apify/consts": "^2.0.0",
58
58
  "@apify/log": "^2.0.0",
59
59
  "@apify/utilities": "^2.0.0",
60
- "@crawlee/core": "^3.0.0-beta.49",
61
- "@crawlee/types": "^3.0.0-beta.49",
62
- "@crawlee/utils": "^3.0.0-beta.49",
60
+ "@crawlee/core": "^3.0.0-beta.51",
61
+ "@crawlee/types": "^3.0.0-beta.51",
62
+ "@crawlee/utils": "^3.0.0-beta.51",
63
63
  "semver": "^7.3.7",
64
64
  "apify-client": "^2.5.0",
65
65
  "ow": "^0.28.1",
66
- "ws": "^8.7.0"
66
+ "ws": "^7.5.8"
67
67
  }
68
68
  }
@@ -55,11 +55,11 @@ export interface ProxyConfigurationOptions extends CoreProxyConfigurationOptions
55
55
  * const crawler = new CheerioCrawler({
56
56
  * // ...
57
57
  * proxyConfiguration,
58
- * handlePageFunction: ({ proxyInfo }) => {
59
- * // Getting used proxy URL
58
+ * requestHandler({ proxyInfo }) {
59
+ * // Getting used proxy URL
60
60
  * const proxyUrl = proxyInfo.url;
61
61
  *
62
- * // Getting ID of used Session
62
+ * // Getting ID of used Session
63
63
  * const sessionIdentifier = proxyInfo.sessionId;
64
64
  * }
65
65
  * })
@@ -115,7 +115,7 @@ export interface ProxyInfo extends CoreProxyInfo {
115
115
  * const crawler = new CheerioCrawler({
116
116
  * // ...
117
117
  * proxyConfiguration,
118
- * handlePageFunction: ({ proxyInfo }) => {
118
+ * requestHandler({ proxyInfo }) {
119
119
  * const usedProxyUrl = proxyInfo.url; // Getting the proxy URL
120
120
  * }
121
121
  * })
@@ -147,7 +147,7 @@ export declare class ProxyConfiguration extends CoreProxyConfiguration {
147
147
  /**
148
148
  * This function creates a new {@link ProxyInfo} info object.
149
149
  * It is used by CheerioCrawler and PuppeteerCrawler to generate proxy URLs and also to allow the user to inspect
150
- * the currently used proxy via the handlePageFunction parameter: proxyInfo.
150
+ * the currently used proxy via the requestHandler parameter `proxyInfo`.
151
151
  * Use it if you want to work with a rich representation of a proxy URL.
152
152
  * If you need the URL string only, use {@link ProxyConfiguration.newUrl}.
153
153
  * @param [sessionId]
@@ -37,7 +37,7 @@ const COUNTRY_CODE_REGEX = /^[A-Z]{2}$/;
37
37
  * const crawler = new CheerioCrawler({
38
38
  * // ...
39
39
  * proxyConfiguration,
40
- * handlePageFunction: ({ proxyInfo }) => {
40
+ * requestHandler({ proxyInfo }) {
41
41
  * const usedProxyUrl = proxyInfo.url; // Getting the proxy URL
42
42
  * }
43
43
  * })
@@ -140,7 +140,7 @@ class ProxyConfiguration extends core_1.ProxyConfiguration {
140
140
  /**
141
141
  * This function creates a new {@link ProxyInfo} info object.
142
142
  * It is used by CheerioCrawler and PuppeteerCrawler to generate proxy URLs and also to allow the user to inspect
143
- * the currently used proxy via the handlePageFunction parameter: proxyInfo.
143
+ * the currently used proxy via the requestHandler parameter `proxyInfo`.
144
144
  * Use it if you want to work with a rich representation of a proxy URL.
145
145
  * If you need the URL string only, use {@link ProxyConfiguration.newUrl}.
146
146
  * @param [sessionId]