@cookiemunch/sdk 0.4.0 → 0.4.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 +44 -0
- package/LICENSE +21 -0
- package/dist/index.cjs +4 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -6
- package/dist/index.d.ts +18 -6
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +14 -6
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Changelog: @cookiemunch/sdk
|
|
2
|
+
|
|
3
|
+
Every published release, newest first. Dates are the day the version was cut.
|
|
4
|
+
|
|
5
|
+
## 0.4.1 (2026-10-22)
|
|
6
|
+
|
|
7
|
+
- Added: the `referally` cookie preset (`cookieDomain`, `cookieDays`, `category` parameters on `applyCookiePreset`).
|
|
8
|
+
- Added: every request sends `User-Agent: cookiemunch-js/<version>`; set your own with the `userAgent` option.
|
|
9
|
+
|
|
10
|
+
## 0.4.0 (2026-10-19)
|
|
11
|
+
|
|
12
|
+
- Added: site PATCH (rename or move a site, keeping its cbid), integration health, `provision` and partner links.
|
|
13
|
+
- Added: the executor presets and canary health checks for connected systems; `connectExecutor` takes a `preset`.
|
|
14
|
+
- Added: declaration presets for the platforms a site is built on, observed-cookie removal and storage types on declarations.
|
|
15
|
+
- Added: opt-in strict writes and API key hygiene (`X-14`, `X-15`).
|
|
16
|
+
|
|
17
|
+
## 0.3.0 (2026-10-15)
|
|
18
|
+
|
|
19
|
+
- Added: `retireCookie` and `unretireCookie`.
|
|
20
|
+
- Added: `scan` can wait for the result, and `waitForScan`.
|
|
21
|
+
|
|
22
|
+
## 0.2.0 (2026-10-15)
|
|
23
|
+
|
|
24
|
+
- Added: executor webhook test and delivery log, with dry runs.
|
|
25
|
+
- Added: `purposes` (per-language text) and `dryRun` on declared cookies; `?lang=` on the public cookie feed.
|
|
26
|
+
- Added: document verification on rights-request intake answers (`trustEmailClaim`, `oidc_jwt`).
|
|
27
|
+
- Added: rights-page identity configuration.
|
|
28
|
+
- Fixed: design warnings say what happened and notices are not blamed on Accept.
|
|
29
|
+
|
|
30
|
+
## 0.1.2 (2026-10-15)
|
|
31
|
+
|
|
32
|
+
- Changed: the package builds standalone from its public repository and is published with npm provenance.
|
|
33
|
+
|
|
34
|
+
## 0.1.1 (2026-10-14)
|
|
35
|
+
|
|
36
|
+
- Added: `declareCookie`, bulk declare, `undeclareCookie` and applying a scan import.
|
|
37
|
+
- Added: `PUT ?keep=unspecified` and `null` in a PATCH removes the key.
|
|
38
|
+
- Added: `dryRunConfig`, and `lintConfig` with `designWarnings` on every config read and write.
|
|
39
|
+
- Added: `client.rightsPage`: draft, dry run, publish, versions, rollback (with `baseUpdatedAt` conflicts), custom domains, mail provider and account-linked rights links.
|
|
40
|
+
- Fixed: per-claim CNAME targets; a hostname already pointing at us is proven with the TXT token.
|
|
41
|
+
|
|
42
|
+
## 0.1.0 (2026-10-14)
|
|
43
|
+
|
|
44
|
+
- First release: a typed client for the Cookie Munch Developer API (`/v1`): sites, config, consent log and stats, DSAR, vendors and RoPA.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Cookie Munch
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.cjs
CHANGED
|
@@ -22,6 +22,7 @@ var src_exports = {};
|
|
|
22
22
|
__export(src_exports, {
|
|
23
23
|
CONSENT_COOKIE_NAME: () => CONSENT_COOKIE_NAME,
|
|
24
24
|
CookieMunchApiError: () => CookieMunchApiError,
|
|
25
|
+
SDK_VERSION: () => SDK_VERSION,
|
|
25
26
|
createCookieMunch: () => createCookieMunch,
|
|
26
27
|
getConsent: () => getConsent,
|
|
27
28
|
isAllowed: () => isAllowed,
|
|
@@ -148,6 +149,7 @@ function verifyWebhookSignature(input) {
|
|
|
148
149
|
}
|
|
149
150
|
|
|
150
151
|
// src/index.ts
|
|
152
|
+
var SDK_VERSION = "0.4.1";
|
|
151
153
|
var CookieMunchApiError = class extends Error {
|
|
152
154
|
constructor(status, message, code, body) {
|
|
153
155
|
super(message);
|
|
@@ -174,7 +176,7 @@ function createCookieMunch(opts) {
|
|
|
174
176
|
const doFetch = opts.fetch ?? globalThis.fetch;
|
|
175
177
|
if (!doFetch) throw new Error("No fetch available; pass { fetch } in CookieMunchOptions.");
|
|
176
178
|
async function request(method, path, body, raw = false) {
|
|
177
|
-
const headers = { Authorization: `Bearer ${opts.apiKey}` };
|
|
179
|
+
const headers = { Authorization: `Bearer ${opts.apiKey}`, "User-Agent": opts.userAgent ?? `cookiemunch-js/${SDK_VERSION}` };
|
|
178
180
|
if (opts.strictUnknownFields && method !== "GET") headers["Prefer"] = "strict-unknown-fields";
|
|
179
181
|
const init = { method, headers };
|
|
180
182
|
if (body !== void 0) {
|
|
@@ -558,6 +560,7 @@ function createCookieMunch(opts) {
|
|
|
558
560
|
0 && (module.exports = {
|
|
559
561
|
CONSENT_COOKIE_NAME,
|
|
560
562
|
CookieMunchApiError,
|
|
563
|
+
SDK_VERSION,
|
|
561
564
|
createCookieMunch,
|
|
562
565
|
getConsent,
|
|
563
566
|
isAllowed,
|