scrapely 1.2.29 → 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.
Files changed (2) hide show
  1. package/dist/solver.js +6 -3
  2. package/package.json +1 -1
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.29",
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",