@cookiemunch/sdk 0.37.0 → 0.39.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
@@ -2,6 +2,23 @@
2
2
 
3
3
  Every published release, newest first. Dates are the day the version was cut.
4
4
 
5
+ ## 0.39.0 (2026-11-25)
6
+
7
+ - Added: `client.tenants` (`create`, `createBulk`, `list`, `listAll`, `get`, `update`, `delete`): sites for your own customers, each the controller for its own visitors. See /docs/tenants.
8
+ - Added: `client.sites.move(cbid, { to, from?, keepOld?, trustOldDays? }, { dryRun })` moves a site to a new domain in one call.
9
+ - Added: rights handlers `stateless: true` (or `{ jwks }` / `{ jwksUrl }`): with no stored state for a request, the state Cookie Munch signs in `Cookiemunch-Request-State` is used, so no table is needed.
10
+ - Added: `lookup` receives the request's `scope` (`{ tenant }` for a tenant's case), finders get it as their last argument, and the lookup answer echoes it.
11
+ - Added: `lookup: { bySubject, byEmail }` and `lookupByRule`: the identity-first rule, enforced.
12
+ - Added: `DsarCase.alsoFiledBy` and `merged`; `ApprovalExcept` and `approvalExcept` on connections; `okMeaning` and the `preDeploy` option on health; `attributes` on the install snippet; `keepPreviousDays` on a site's rights identity; `parent` on a site.
13
+
14
+ ## 0.38.0 (2026-11-25)
15
+
16
+ - Added: `prismaStore(prisma)`, a rights-handler store on a Prisma client, and `RIGHTS_STORE_PRISMA_MODEL`, the `sqlStore` table as a Prisma model to paste into `schema.prisma`. The `sqlStore` query contract is documented.
17
+
18
+ ## 0.37.0 (2026-11-20)
19
+
20
+ - Changed: doc comments say a full-access key already holds the partner-sync scopes and can manage keys in every org on its account (`orgs:keys`). No API change.
21
+
5
22
  ## 0.36.0 (2026-11-18)
6
23
 
7
24
  - Added: `@cookiemunch/sdk/rights/fastify`, a Fastify (v4/v5) plugin for the rights handlers: `app.register(fastifyRights(handlers), { prefix: '/privacy' })`. It reads request bodies as raw bytes inside its own scope, so signatures verify and the rest of the app keeps its JSON parser.
package/dist/index.cjs CHANGED
@@ -572,7 +572,7 @@ async function exchangeOperatorToken(input) {
572
572
  }
573
573
 
574
574
  // src/index.ts
575
- var SDK_VERSION = "0.37.0";
575
+ var SDK_VERSION = "0.39.0";
576
576
  var CookieMunchApiError = class extends Error {
577
577
  constructor(status, message, code, body) {
578
578
  super(message);
@@ -681,6 +681,7 @@ function createCookieMunch(opts) {
681
681
  create: (input) => request("POST", "/sites", input),
682
682
  get: (cbid) => get(`/sites/${enc(cbid)}`),
683
683
  update: (cbid, patch, o) => request("PATCH", `/sites/${enc(cbid)}${qs({ dryRun: o?.dryRun ? "1" : void 0 })}`, patch),
684
+ move: (cbid, input, o) => request("POST", `/sites/${enc(cbid)}/move${qs({ dryRun: o?.dryRun ? "1" : void 0 })}`, input),
684
685
  delete: async (cbid) => {
685
686
  await request("DELETE", `/sites/${enc(cbid)}`);
686
687
  },
@@ -998,7 +999,7 @@ function createCookieMunch(opts) {
998
999
  create: (input) => request("POST", "/sandbox", input ?? {}),
999
1000
  delete: () => request("DELETE", "/sandbox")
1000
1001
  },
1001
- integrationHealth: (cbid) => get(`/integration-health${qs({ cbid })}`),
1002
+ integrationHealth: (cbid, opts2) => get(`/integration-health${qs({ cbid, ...opts2?.preDeploy ? { preDeploy: "1" } : {} })}`),
1002
1003
  healthWaivers: {
1003
1004
  list: (cbid) => get(`/integration-health/waivers${qs({ cbid })}`),
1004
1005
  set: (input) => request("PUT", "/integration-health/waivers", input),
@@ -1087,6 +1088,22 @@ function createCookieMunch(opts) {
1087
1088
  rotate: (cbid) => request("POST", `/sites/${enc(cbid)}/consent-sync-secret`),
1088
1089
  remove: (cbid) => request("DELETE", `/sites/${enc(cbid)}/consent-sync-secret`)
1089
1090
  },
1091
+ tenants: {
1092
+ create: (p, input, o) => request("POST", `/sites/${enc(p)}/tenants${qs({ dryRun: o?.dryRun ? "1" : void 0 })}`, input),
1093
+ createBulk: (p, tenants, o) => request("POST", `/sites/${enc(p)}/tenants/bulk${qs({ dryRun: o?.dryRun ? "1" : void 0 })}`, { tenants }),
1094
+ list: (p, o) => get(`/sites/${enc(p)}/tenants${qs({ limit: o?.limit !== void 0 ? String(o.limit) : void 0, cursor: o?.cursor })}`),
1095
+ async *listAll(p) {
1096
+ let cursor;
1097
+ do {
1098
+ const page = await get(`/sites/${enc(p)}/tenants${qs({ limit: "500", cursor })}`);
1099
+ yield* page.tenants;
1100
+ cursor = page.nextCursor ?? void 0;
1101
+ } while (cursor);
1102
+ },
1103
+ get: (p, id) => get(`/sites/${enc(p)}/tenants/${enc(id)}`),
1104
+ update: (p, id, patch, o) => request("PATCH", `/sites/${enc(p)}/tenants/${enc(id)}${qs({ dryRun: o?.dryRun ? "1" : void 0 })}`, patch),
1105
+ delete: (p, id, o) => request("DELETE", `/sites/${enc(p)}/tenants/${enc(id)}${qs({ dryRun: o?.dryRun ? "1" : void 0 })}`)
1106
+ },
1090
1107
  rightsCaptcha: {
1091
1108
  get: (cbid) => get(`/sites/${enc(cbid)}/rights-captcha`),
1092
1109
  set: (cbid, input) => request("PUT", `/sites/${enc(cbid)}/rights-captcha`, input),