soundlink 2.9.0 → 2.11.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.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#46](https://github.com/Fan-ID/typescript-sdk/pull/46) [`6999a0c`](https://github.com/Fan-ID/typescript-sdk/commit/6999a0c643162bdf6c2346977556104d70879e98) Thanks [@jotanarciso](https://github.com/jotanarciso)! - Accept `streamValueEventEnabled` on soundlink create and return it on soundlink detail.
8
+
9
+ ## 2.10.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#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.
14
+
15
+ ### Patch Changes
16
+
17
+ - [#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()`.
18
+
3
19
  ## 2.9.0
4
20
 
5
21
  ### Minor Changes
package/README.md CHANGED
@@ -205,7 +205,7 @@ const { data: created } = await soundlink.soundlinks.create(
205
205
  );
206
206
 
207
207
  const { data: detail } = await soundlink.soundlinks.get('sl_abc123');
208
- // detail.autoFollow, detail.appleMusicUrl, detail.youtubeMusicUrl
208
+ // detail.streamValueEventEnabled, detail.autoFollow, detail.appleMusicUrl, detail.youtubeMusicUrl
209
209
 
210
210
  const { data: archived } = await soundlink.soundlinks.delete('sl_abc123');
211
211
  // archived.status === 'archived'
@@ -375,6 +375,41 @@ SOUNDLINK_API_KEY=sk_... \
375
375
  npm run test:live
376
376
  ```
377
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
+
378
413
  ## Roadmap
379
414
 
380
415
  - Video import helpers (`videos:write`) — when prioritized