@cookiemunch/sdk 0.5.0 → 0.5.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,10 @@
2
2
 
3
3
  Every published release, newest first. Dates are the day the version was cut.
4
4
 
5
+ ## 0.5.1 (2026-10-23)
6
+
7
+ - Fixed: `sites.waitForScan` no longer sends one extra poll in the last few milliseconds before its deadline when the server answers at once.
8
+
5
9
  ## 0.5.0 (2026-10-23)
6
10
 
7
11
  - Added: `org.controller.get()` / `set()` / `remove()`: the organisation's own data-controller identity, named in rights-request notices filed without a `cbid`. Needs an unscoped key or the new `rights:write` scope.
package/dist/index.cjs CHANGED
@@ -165,7 +165,7 @@ function mintConsentSyncToken(input) {
165
165
  }
166
166
 
167
167
  // src/index.ts
168
- var SDK_VERSION = "0.5.0";
168
+ var SDK_VERSION = "0.5.1";
169
169
  var CookieMunchApiError = class extends Error {
170
170
  constructor(status, message, code, body) {
171
171
  super(message);
@@ -257,7 +257,7 @@ function createCookieMunch(opts) {
257
257
  const asked = Math.max(0, Math.min(6e4, left));
258
258
  const t0 = Date.now();
259
259
  const s = await get(`/sites/${enc(cbid)}/scan${qs({ wait: asked / 1e3 })}`);
260
- if (s.status !== "scanning" || until - Date.now() <= 0) return s;
260
+ if (s.status !== "scanning" || until - Date.now() < 50) return s;
261
261
  const early = Math.min(1e3, until - Date.now()) - (Date.now() - t0);
262
262
  if (early > 0) await new Promise((r) => setTimeout(r, early));
263
263
  }