@zaplier/sdk 1.1.6 → 1.1.7
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 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +8 -8
- package/dist/index.esm.js.map +1 -1
- package/dist/sdk.js +8 -8
- package/dist/sdk.js.map +1 -1
- package/dist/sdk.min.js +1 -1
- package/dist/src/modules/anti-adblock.d.ts +3 -3
- package/dist/src/modules/anti-adblock.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -6320,11 +6320,11 @@ class ResourceSpoofTransport {
|
|
|
6320
6320
|
}
|
|
6321
6321
|
}
|
|
6322
6322
|
/**
|
|
6323
|
-
*
|
|
6323
|
+
* Socket.io Transport (Real-time bidirectional communication for anti-adblock)
|
|
6324
6324
|
*/
|
|
6325
|
-
class
|
|
6325
|
+
class SocketIOTransport {
|
|
6326
6326
|
constructor(baseUrl) {
|
|
6327
|
-
this.name = '
|
|
6327
|
+
this.name = 'socketio';
|
|
6328
6328
|
this.available = typeof WebSocket !== 'undefined';
|
|
6329
6329
|
this.connected = false;
|
|
6330
6330
|
this.baseUrl = baseUrl;
|
|
@@ -6380,9 +6380,9 @@ class GeckosTransport {
|
|
|
6380
6380
|
try {
|
|
6381
6381
|
// Use dynamic import to load socket.io-client only when needed
|
|
6382
6382
|
Promise.resolve().then(function () { return index; }).then(({ io }) => {
|
|
6383
|
-
// Extract domain from baseUrl
|
|
6383
|
+
// Extract domain from baseUrl - use same port as main API
|
|
6384
6384
|
const url = new URL(this.baseUrl);
|
|
6385
|
-
const socketUrl = `${url.protocol}//${url.host}
|
|
6385
|
+
const socketUrl = `${url.protocol}//${url.host}`;
|
|
6386
6386
|
this.socket = io(socketUrl, {
|
|
6387
6387
|
transports: ['websocket', 'polling'],
|
|
6388
6388
|
timeout: 5000
|
|
@@ -6503,7 +6503,7 @@ class AntiAdblockManager {
|
|
|
6503
6503
|
this.baseUrl = baseUrl;
|
|
6504
6504
|
this.config = {
|
|
6505
6505
|
enabled: true,
|
|
6506
|
-
methods: ['
|
|
6506
|
+
methods: ['socketio', 'fetch', 'websocket', 'resource'], // Socket.io as primary
|
|
6507
6507
|
fallbackDelay: 100,
|
|
6508
6508
|
maxRetries: 2,
|
|
6509
6509
|
debug: false,
|
|
@@ -6513,7 +6513,7 @@ class AntiAdblockManager {
|
|
|
6513
6513
|
}
|
|
6514
6514
|
initializeTransports() {
|
|
6515
6515
|
const transportMap = {
|
|
6516
|
-
|
|
6516
|
+
socketio: () => new SocketIOTransport(this.baseUrl),
|
|
6517
6517
|
fetch: () => new FetchTransport(),
|
|
6518
6518
|
websocket: () => new WebSocketTransport(this.baseUrl),
|
|
6519
6519
|
resource: () => new ResourceSpoofTransport(this.baseUrl),
|
|
@@ -7761,7 +7761,7 @@ class ZaplierSDK {
|
|
|
7761
7761
|
try {
|
|
7762
7762
|
this.antiAdblockManager = new AntiAdblockManager(this.config.apiEndpoint, {
|
|
7763
7763
|
enabled: true,
|
|
7764
|
-
methods: ["
|
|
7764
|
+
methods: ["socketio", "fetch", "websocket", "resource"], // Socket.io as primary
|
|
7765
7765
|
fallbackDelay: 100,
|
|
7766
7766
|
maxRetries: 2,
|
|
7767
7767
|
debug: this.config.debug,
|