soundlink 2.8.0 → 2.10.0

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
@@ -1,5 +1,21 @@
1
1
  # soundlink
2
2
 
3
+ ## 2.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#42](https://github.com/Fan-ID/typescript-sdk/pull/42) [`39e7138`](https://github.com/Fan-ID/typescript-sdk/commit/39e71386d981eff12be880f0096867dfa7042d3f) Thanks [@jotanarciso](https://github.com/jotanarciso)! - Add `soundlink/api-emulator` — local stateful Public API emulator for lifecycle tests (`create` → activate/spend → `stop`/`end` refund) without Meta spend.
8
+
9
+ ### Patch Changes
10
+
11
+ - [#43](https://github.com/Fan-ID/typescript-sdk/pull/43) [`03e87a4`](https://github.com/Fan-ID/typescript-sdk/commit/03e87a48ac5b1b787ccb3ca68ff954297185782c) Thanks [@jotanarciso](https://github.com/jotanarciso)! - Add emulator plan presets so paid-campaign tests can set fee with `plan` and `getPlan()`.
12
+
13
+ ## 2.9.0
14
+
15
+ ### Minor Changes
16
+
17
+ - [#39](https://github.com/Fan-ID/typescript-sdk/pull/39) [`4a19ee6`](https://github.com/Fan-ID/typescript-sdk/commit/4a19ee6a0fb3fb85c71c6435e05b34d8564b62d9) Thanks [@jotanarciso](https://github.com/jotanarciso)! - Sync pixels with SOU-7372 / SOU-7376: `isDefault` + send-health on `Pixel`, optional `isDefault` on update, `pixels.delete` (`204` / `pixel_in_use`), and ID-only `metaPixelId` on soundlink create.
18
+
3
19
  ## 2.8.0
4
20
 
5
21
  ### Minor Changes
package/README.md CHANGED
@@ -154,13 +154,16 @@ const { data: wallet } = await soundlink.wallet.get();
154
154
 
155
155
  ```typescript
156
156
  const { data: pixels } = await soundlink.pixels.list();
157
+ // pixels[0].isDefault, .status, .lastErrorCode, .errorSince
157
158
 
158
159
  await soundlink.pixels.update('1234567890123456', {
159
160
  platform: 'meta',
160
161
  accessToken: process.env.META_CAPI_TOKEN!,
162
+ isDefault: true,
161
163
  });
162
164
 
163
165
  await soundlink.pixels.sendTestEvent('1234567890123456');
166
+ await soundlink.pixels.delete('1234567890123456'); // 204 → { data: null, error: null }
164
167
  ```
165
168
 
166
169
  Custom strategy create (requires `tierTargeting`):
@@ -372,6 +375,41 @@ SOUNDLINK_API_KEY=sk_... \
372
375
  npm run test:live
373
376
  ```
374
377
 
378
+ ## Local Public API emulator
379
+
380
+ Local integration tests without Meta spend: import `soundlink/api-emulator`, `listen` on loopback, drive lifecycle with harness transitions (`activate` / `set_spend` / `reject_meta` / `end`). Works with the SDK **or** plain `fetch` / curl (fix `port` and call from another local process).
381
+
382
+ Full guide: **[docs/api-emulator.md](./docs/api-emulator.md)**.
383
+
384
+ ```ts
385
+ import { Soundlink } from 'soundlink';
386
+ import { createApiEmulator } from 'soundlink/api-emulator';
387
+
388
+ const apiKey = 'sk_emulator_test';
389
+ const emu = createApiEmulator({
390
+ apiKey,
391
+ initialWalletBalance: 500,
392
+ plan: 'enterprise',
393
+ });
394
+ const server = await emu.listen(); // or { port: 8787 } for fetch from another process
395
+ const soundlink = new Soundlink({ apiKey, baseUrl: server.baseUrl });
396
+
397
+ const { data: created } = await soundlink.campaigns.create(
398
+ {
399
+ spotifyUrl: 'https://open.spotify.com/track/4iV5W9uYEdYUVa79Axb7Rh',
400
+ dailyBudget: 10,
401
+ durationDays: 7,
402
+ genre: 'Pop',
403
+ strategyType: 'maximum_growth',
404
+ },
405
+ { idempotencyKey: 'demo-1' },
406
+ );
407
+ await emu.transition(created!.campaignId, 'activate');
408
+ await soundlink.metrics.overview(created!.campaignId);
409
+ await soundlink.campaigns.stop(created!.campaignId, { idempotencyKey: 'stop-1' });
410
+ await server.close();
411
+ ```
412
+
375
413
  ## Roadmap
376
414
 
377
415
  - Video import helpers (`videos:write`) — when prioritized