@zaplier/sdk 1.2.2 → 1.2.3
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/index.cjs +8 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +8 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/sdk.js +8 -5
- package/dist/sdk.js.map +1 -1
- package/dist/sdk.min.js +1 -1
- package/dist/src/modules/anti-adblock.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -6446,8 +6446,11 @@ class AntiAdblockManager {
|
|
|
6446
6446
|
return { success: false, method: 'none', error: 'No transports available' };
|
|
6447
6447
|
}
|
|
6448
6448
|
let lastError = '';
|
|
6449
|
-
// Try each transport in order
|
|
6449
|
+
// Try each transport in order (sequential, not parallel)
|
|
6450
6450
|
for (const transport of this.transports) {
|
|
6451
|
+
if (this.config.debug) {
|
|
6452
|
+
console.log(`[Zaplier] Trying transport: ${transport.name}`);
|
|
6453
|
+
}
|
|
6451
6454
|
try {
|
|
6452
6455
|
const result = await transport.send(data, `${this.baseUrl}${endpoint}`);
|
|
6453
6456
|
// Update stats
|
|
@@ -6455,15 +6458,15 @@ class AntiAdblockManager {
|
|
|
6455
6458
|
this.stats.successfulRequests++;
|
|
6456
6459
|
this.updateMethodStats(transport.name, true);
|
|
6457
6460
|
if (this.config.debug) {
|
|
6458
|
-
console.log(`[Zaplier] Data sent successfully via ${transport.name}`, result);
|
|
6461
|
+
console.log(`[Zaplier] ✅ Data sent successfully via ${transport.name} - STOPPING fallback chain`, result);
|
|
6459
6462
|
}
|
|
6460
|
-
return result;
|
|
6463
|
+
return result; // SUCCESS - stop trying other transports
|
|
6461
6464
|
}
|
|
6462
6465
|
else {
|
|
6463
6466
|
this.updateMethodStats(transport.name, false);
|
|
6464
6467
|
lastError = result.error || 'Unknown error';
|
|
6465
6468
|
if (this.config.debug) {
|
|
6466
|
-
console.warn(`[Zaplier] Transport ${transport.name} failed:`, result.error);
|
|
6469
|
+
console.warn(`[Zaplier] ❌ Transport ${transport.name} failed:`, result.error);
|
|
6467
6470
|
}
|
|
6468
6471
|
}
|
|
6469
6472
|
}
|
|
@@ -6471,7 +6474,7 @@ class AntiAdblockManager {
|
|
|
6471
6474
|
lastError = error instanceof Error ? error.message : String(error);
|
|
6472
6475
|
this.updateMethodStats(transport.name, false);
|
|
6473
6476
|
if (this.config.debug) {
|
|
6474
|
-
console.warn(`[Zaplier] Transport ${transport.name} threw error:`, error);
|
|
6477
|
+
console.warn(`[Zaplier] ❌ Transport ${transport.name} threw error:`, error);
|
|
6475
6478
|
}
|
|
6476
6479
|
}
|
|
6477
6480
|
// Wait before trying next transport
|