scrapely 1.2.28 → 1.2.30

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.d.ts CHANGED
@@ -469,6 +469,8 @@ export declare class Actor {
469
469
  * item's URL or id, for platform diagnostics. Does nothing unless the platform enabled
470
470
  * capture for this run (SCRAPELY_DEBUG_CAPTURE=1 on its own diagnostic runs).
471
471
  */
472
+ /** debugCapture for synchronous code: fire and forget. Does nothing unless capture is enabled for the run. */
473
+ static debugCaptureSync(key: string, payload: unknown): void;
472
474
  static debugCapture(key: string, payload: unknown): Promise<void>;
473
475
  /**
474
476
  * Helper to resolve storage identifier to a string ID or name.
package/dist/actor.js CHANGED
@@ -669,6 +669,12 @@ class Actor {
669
669
  * item's URL or id, for platform diagnostics. Does nothing unless the platform enabled
670
670
  * capture for this run (SCRAPELY_DEBUG_CAPTURE=1 on its own diagnostic runs).
671
671
  */
672
+ /** debugCapture for synchronous code: fire and forget. Does nothing unless capture is enabled for the run. */
673
+ static debugCaptureSync(key, payload) {
674
+ if (process.env.SCRAPELY_DEBUG_CAPTURE !== '1' || !key)
675
+ return;
676
+ void Actor.debugCapture(key, payload);
677
+ }
672
678
  static async debugCapture(key, payload) {
673
679
  if (process.env.SCRAPELY_DEBUG_CAPTURE !== '1' || !key)
674
680
  return;
package/dist/solver.js CHANGED
@@ -31,7 +31,7 @@ exports.solve = solve;
31
31
  exports.reportSolveOutcome = reportSolveOutcome;
32
32
  exports.clearSolverStatusCache = clearSolverStatusCache;
33
33
  exports.DEGRADED_STATUS_MESSAGE = 'Site protection temporarily unavailable, results may be incomplete';
34
- const COMPAT_SUFFIX = '/compat/xhrdev';
34
+ const COMPAT_SUFFIXES = ['/compat/v1', '/compat/xhrdev'];
35
35
  const STATUS_TTL_MS = 15_000;
36
36
  const MAX_BODY = 4 * 1024 * 1024;
37
37
  const UNAVAILABLE_CODES = new Set(['vendor_degraded', 'vendor_down', 'provider_unavailable', 'vendor_unsupported', 'solver_not_enabled']);
@@ -86,9 +86,12 @@ function solverEnv() {
86
86
  }
87
87
  function gateway() {
88
88
  const env = solverEnv();
89
- if (!env || !env.url.endsWith(COMPAT_SUFFIX))
89
+ if (!env)
90
90
  return null;
91
- return { base: env.url.slice(0, -COMPAT_SUFFIX.length), key: env.key };
91
+ const suffix = COMPAT_SUFFIXES.find((s) => env.url.endsWith(s));
92
+ if (!suffix)
93
+ return null;
94
+ return { base: env.url.slice(0, -suffix.length), key: env.key };
92
95
  }
93
96
  /** True when the platform solver API is available to this run. */
94
97
  function solverConfigured() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scrapely",
3
- "version": "1.2.28",
3
+ "version": "1.2.30",
4
4
  "description": "Scrapely SDK for building JavaScript and TypeScript Actors",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",