apify 3.7.3-beta.24 → 3.7.3-beta.26

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/dist/actor.js CHANGED
@@ -1031,7 +1031,12 @@ class Actor {
1031
1031
  userAgentSuffix: [`SDK/${apifyVersion}`, `Crawlee/${crawleeVersion}`],
1032
1032
  ...storageClientOptions,
1033
1033
  ...options, // allow overriding the instance configuration
1034
- }, this);
1034
+ }, {
1035
+ config: this.config,
1036
+ // Hand over the raw manager rather than the public getChargingManager(), which
1037
+ // warns about a missing init() — a standalone client is a supported use case.
1038
+ getChargingManager: () => this.chargingManager,
1039
+ });
1035
1040
  }
1036
1041
  /**
1037
1042
  * Returns `true` when code is running on Apify platform and `false` otherwise (for example locally).
@@ -76,6 +76,11 @@ export declare class ChargingManager {
76
76
  */
77
77
  init(): Promise<void>;
78
78
  private ensureChargingLogDatasetOnPlatform;
79
+ /**
80
+ * Whether {@link ChargingManager.init} has run. All charging operations (including
81
+ * {@link ChargingManager.getPricingInfo}) require an initialized manager.
82
+ */
83
+ get isInitialized(): boolean;
79
84
  /**
80
85
  * Get information about the pricing for this Actor.
81
86
  */
package/dist/charging.js CHANGED
@@ -208,6 +208,13 @@ class ChargingManager {
208
208
  await defaultStore.setValue(this.PLATFORM_CHARGING_LOG_DATASET_ID_KEY, dataset.id);
209
209
  return dataset.id;
210
210
  }
211
+ /**
212
+ * Whether {@link ChargingManager.init} has run. All charging operations (including
213
+ * {@link ChargingManager.getPricingInfo}) require an initialized manager.
214
+ */
215
+ get isInitialized() {
216
+ return this.chargingState !== undefined;
217
+ }
211
218
  /**
212
219
  * Get information about the pricing for this Actor.
213
220
  */
@@ -55,7 +55,12 @@ function createPatchedApifyClient(options, actor) {
55
55
  apifyClient: this,
56
56
  httpClient: this.httpClient,
57
57
  };
58
- const hasDefaultDatasetItemEvent = charging_js_1.DEFAULT_DATASET_ITEM_EVENT in actor.getChargingManager().getPricingInfo().perEventPrices;
58
+ // Charging is only configured for an initialized Actor (a platform run). A
59
+ // standalone client from `Actor.newClient()` without `Actor.init()` has no
60
+ // charging state, so skip interception rather than letting getPricingInfo() throw.
61
+ const chargingManager = actor.getChargingManager();
62
+ const hasDefaultDatasetItemEvent = chargingManager.isInitialized &&
63
+ charging_js_1.DEFAULT_DATASET_ITEM_EVENT in chargingManager.getPricingInfo().perEventPrices;
59
64
  if (!isDefaultDataset || !hasDefaultDatasetItemEvent) {
60
65
  return new apify_client_1.DatasetClient(datasetOptions);
61
66
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apify",
3
- "version": "3.7.3-beta.24",
3
+ "version": "3.7.3-beta.26",
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"
@@ -87,7 +87,7 @@
87
87
  "husky": "^9.1.7",
88
88
  "lint-staged": "^17.0.0",
89
89
  "oxfmt": "0.56.0",
90
- "oxlint": "1.71.0",
90
+ "oxlint": "1.72.0",
91
91
  "oxlint-tsgolint": "0.22.0",
92
92
  "playwright": "^1.60.0",
93
93
  "puppeteer": "^25.0.0",