@trillboards/ads-sdk 2.1.0 → 2.1.1

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/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  All notable changes to `@trillboards/ads-sdk` will be documented in this file.
4
4
 
5
+ ## [2.1.1] - 2026-02-15
6
+
7
+ ### Fixes
8
+ - **Exports map**: Fixed `package.json` exports — `import` now correctly resolves to `.mjs`/`.d.mts` and `require` to `.js`/`.d.ts` (matches actual tsup output)
9
+ - **204 handling**: `fetchWithAuth` no longer throws `SyntaxError` on HTTP 204 No Content responses (affects `CreativeClient.block()` and `unblock()`)
10
+ - **Browser debug mode**: `debug: true` in `TrillboardsConfig` now correctly activates the logger (was a no-op in v2.1.0)
11
+ - **Error `instanceof`**: Added `Object.setPrototypeOf` to `TrillboardsError` base class for correct `instanceof` checks in transpiled environments
12
+
5
13
  ## [2.1.0] - 2026-02-15
6
14
 
7
15
  ### Features
package/dist/cli.js CHANGED
@@ -28,7 +28,7 @@ var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
28
28
  var path__namespace = /*#__PURE__*/_interopNamespace(path);
29
29
 
30
30
  // src/core/config.ts
31
- var SDK_VERSION = "2.1.0";
31
+ var SDK_VERSION = "2.1.1";
32
32
 
33
33
  // src/cli.ts
34
34
  var BANNER = `
package/dist/index.d.mts CHANGED
@@ -317,7 +317,7 @@ declare class EventEmitter {
317
317
  }
318
318
 
319
319
  /** Single source of truth for the SDK version string. */
320
- declare const SDK_VERSION = "2.1.0";
320
+ declare const SDK_VERSION = "2.1.1";
321
321
  /**
322
322
  * Compile-time constants that mirror the original IIFE CONFIG
323
323
  * object. Every value here acts as a sensible production default
@@ -336,7 +336,7 @@ declare const DEFAULT_CONFIG: {
336
336
  readonly PROGRAMMATIC_MIN_INTERVAL_MS: 5000;
337
337
  readonly PROGRAMMATIC_RETRY_MS: 5000;
338
338
  readonly PROGRAMMATIC_BACKOFF_MAX_MS: number;
339
- readonly VERSION: "2.1.0";
339
+ readonly VERSION: "2.1.1";
340
340
  };
341
341
  /**
342
342
  * Merge a caller-supplied TrillboardsConfig with the defaults,
package/dist/index.d.ts CHANGED
@@ -317,7 +317,7 @@ declare class EventEmitter {
317
317
  }
318
318
 
319
319
  /** Single source of truth for the SDK version string. */
320
- declare const SDK_VERSION = "2.1.0";
320
+ declare const SDK_VERSION = "2.1.1";
321
321
  /**
322
322
  * Compile-time constants that mirror the original IIFE CONFIG
323
323
  * object. Every value here acts as a sensible production default
@@ -336,7 +336,7 @@ declare const DEFAULT_CONFIG: {
336
336
  readonly PROGRAMMATIC_MIN_INTERVAL_MS: 5000;
337
337
  readonly PROGRAMMATIC_RETRY_MS: 5000;
338
338
  readonly PROGRAMMATIC_BACKOFF_MAX_MS: number;
339
- readonly VERSION: "2.1.0";
339
+ readonly VERSION: "2.1.1";
340
340
  };
341
341
  /**
342
342
  * Merge a caller-supplied TrillboardsConfig with the defaults,
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  // src/core/config.ts
4
- var SDK_VERSION = "2.1.0";
4
+ var SDK_VERSION = "2.1.1";
5
5
  var DEFAULT_CONFIG = {
6
6
  API_BASE: "https://api.trillboards.com/v1/partner",
7
7
  CDN_BASE: "https://cdn.trillboards.com",
@@ -1400,6 +1400,9 @@ var _TrillboardsAds = class _TrillboardsAds {
1400
1400
  this.offlineHandler = null;
1401
1401
  this.visibilityHandler = null;
1402
1402
  this.config = resolveConfig(config);
1403
+ if (this.config.debug) {
1404
+ setLogLevel("debug");
1405
+ }
1403
1406
  this.state = createInitialState();
1404
1407
  this.events = new EventEmitter();
1405
1408
  this.api = new ApiClient(this.config.apiBase);
@@ -1808,6 +1811,7 @@ var TrillboardsAds = _TrillboardsAds;
1808
1811
  var TrillboardsError = class extends Error {
1809
1812
  constructor(message, options = {}) {
1810
1813
  super(message);
1814
+ Object.setPrototypeOf(this, new.target.prototype);
1811
1815
  this.name = "TrillboardsError";
1812
1816
  this.type = options.type ?? "api_error";
1813
1817
  this.code = options.code ?? "unknown_error";