@cookiemunch/sdk 0.21.1 → 0.23.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 +17 -0
- package/dist/{chunk-OSVTQPQG.js → chunk-OQJYQMQR.js} +1 -1
- package/dist/chunk-OQJYQMQR.js.map +1 -0
- package/dist/{chunk-ACZIJ3KB.js → chunk-VXN75KHK.js} +63 -3
- package/dist/chunk-VXN75KHK.js.map +1 -0
- package/dist/consent.cjs.map +1 -1
- package/dist/consent.d.ts +1 -1
- package/dist/consent.js +1 -1
- package/dist/executor-conformance.d.ts +4 -2
- package/dist/index.cjs +73 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +155 -18
- package/dist/index.js +15 -9
- package/dist/index.js.map +1 -1
- package/dist/rights.cjs +62 -17
- package/dist/rights.cjs.map +1 -1
- package/dist/rights.d.ts +35 -16
- package/dist/rights.js +62 -18
- package/dist/rights.js.map +1 -1
- package/dist/token-exchange.d.ts +1 -1
- package/dist/types.d.ts +17 -5
- package/package.json +5 -12
- package/LICENSE +0 -21
- package/dist/chunk-ACZIJ3KB.js.map +0 -1
- package/dist/chunk-OSVTQPQG.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ import type { ConformanceReport } from './executor-conformance.js';
|
|
|
20
20
|
* This package's version, sent in the default User-Agent. Cloudflare answers a request with
|
|
21
21
|
* no recognisable User-Agent with `403 error code: 1010`; a test pins this to package.json.
|
|
22
22
|
*/
|
|
23
|
-
export declare const SDK_VERSION = "0.
|
|
23
|
+
export declare const SDK_VERSION = "0.23.0";
|
|
24
24
|
export interface CookieMunchOptions {
|
|
25
25
|
apiKey: string;
|
|
26
26
|
/** "https://api.cookiemunch.net" — the /v1 prefix is appended automatically. */
|
|
@@ -32,11 +32,16 @@ export interface CookieMunchOptions {
|
|
|
32
32
|
* declare is refused (`400 unknown_field`, with `field`) instead of ignored. Catches typos.
|
|
33
33
|
*/
|
|
34
34
|
strictUnknownFields?: boolean;
|
|
35
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* The `User-Agent` sent on every request. Default `cookiemunch-js/<version>`. Without `apiVersion`, a request whose
|
|
37
|
+
* User-Agent starts `cookiemunch-` is served no later than API version 2026-10-24, the shapes this SDK's types
|
|
38
|
+
* describe; another User-Agent is served as the key is pinned.
|
|
39
|
+
*/
|
|
36
40
|
userAgent?: string;
|
|
37
41
|
/**
|
|
38
42
|
* Serve every request under this dated API version (`CookieMunch-Version`, e.g. `'2026-10-24'`) instead of the
|
|
39
|
-
* one your key is pinned to. `versions()` lists them; `keys.updateSelf({ apiVersion })` re-pins the key.
|
|
43
|
+
* one your key is pinned to. `versions()` lists them; `keys.updateSelf({ apiVersion })` re-pins the key. Lists are
|
|
44
|
+
* unwrapped under any version; from 2026-11-11, `consent.stats` rows are camelCase and partner links snake_case.
|
|
40
45
|
*/
|
|
41
46
|
apiVersion?: string;
|
|
42
47
|
/**
|
|
@@ -50,7 +55,7 @@ export interface CookieMunchOptions {
|
|
|
50
55
|
*/
|
|
51
56
|
headers?: Record<string, string>;
|
|
52
57
|
}
|
|
53
|
-
/** Tags on a created resource
|
|
58
|
+
/** Tags on a created resource. `stack_sandbox: true` can only be set at creation. */
|
|
54
59
|
export type ResourceMetadata = Record<string, string | number | boolean>;
|
|
55
60
|
/** Keep only resources whose tags match, e.g. `{ stack_product: 'referalli' }`. */
|
|
56
61
|
export interface MetadataFilter {
|
|
@@ -88,7 +93,7 @@ export interface SandboxPurge {
|
|
|
88
93
|
orgId?: string;
|
|
89
94
|
counts: Record<string, number>;
|
|
90
95
|
}
|
|
91
|
-
/** A partner link in the suite-standard shape
|
|
96
|
+
/** A partner link in the suite-standard shape. */
|
|
92
97
|
export interface StandardPartnerLink {
|
|
93
98
|
id: string;
|
|
94
99
|
partner: string;
|
|
@@ -259,6 +264,11 @@ export interface CategorizedCookie {
|
|
|
259
264
|
* `not_seen_recently` = unseen for the site's `staleAfterDays`, owner views only.
|
|
260
265
|
*/
|
|
261
266
|
review?: 'unclassified' | 'category_disabled' | 'category_unknown' | 'retired_but_seen' | 'awaiting_corroboration' | 'suspicious_report' | 'foreign_cmp' | 'not_seen_recently';
|
|
267
|
+
/** Owner views only, on a `suspicious_report` row: the introducing report's new names and vendors. */
|
|
268
|
+
suspiciousReport?: {
|
|
269
|
+
names: number;
|
|
270
|
+
vendors: number;
|
|
271
|
+
};
|
|
262
272
|
/** Epoch-ms a crawl or a real visit last saw it. Absent on older rows. */
|
|
263
273
|
lastSeenAt?: number;
|
|
264
274
|
/** Owner views only: the site owner retired this cookie (see `sites.retireCookie`). */
|
|
@@ -411,7 +421,7 @@ export interface ConfigTranslateResult {
|
|
|
411
421
|
}>;
|
|
412
422
|
}
|
|
413
423
|
/** A platform whose cookies and storage a preset declares. */
|
|
414
|
-
export type CookiePresetVendor = 'atlas' | 'forumulate' | 'chatly' | 'cookiemunch' | 'referalli' | 'firstpromoter' | 'partnerstack' | 'tapfiliate' | 'impact' | 'seolyticize'
|
|
424
|
+
export type CookiePresetVendor = 'atlas' | 'forumulate' | 'chatly' | 'cookiemunch' | 'referalli' | 'firstpromoter' | 'partnerstack' | 'tapfiliate' | 'impact' | 'seolyticize' | 'lucida' | 'hermetica' | 'watchtower'
|
|
415
425
|
/** @deprecated the old name of `referalli`, accepted until 2027-10-23. */
|
|
416
426
|
| 'referally';
|
|
417
427
|
/** Where a vendor's live manifest will come from, and whether it exists yet. */
|
|
@@ -497,7 +507,7 @@ export interface CookieSuggestionsDeclared {
|
|
|
497
507
|
declared?: DeclaredCookie[];
|
|
498
508
|
diff?: DeclarationDiff;
|
|
499
509
|
}
|
|
500
|
-
/** Preset parameters: Atlas `frontendApiHost`/`crossSubdomainCookies`/`publishableKey`; Chatly `publicId`/`dragging`/`storage`/`tracking`/`category`; referral and affiliate presets (referalli, firstpromoter, partnerstack, tapfiliate, impact) `cookieDomain`/`cookieDays`/`category`, referalli `legacyName`/`programHandle`, impact `campaignId`. */
|
|
510
|
+
/** Preset parameters: Atlas `frontendApiHost`/`crossSubdomainCookies`/`publishableKey`; Chatly `publicId`/`dragging`/`storage`/`tracking`/`category`; referral and affiliate presets (referalli, firstpromoter, partnerstack, tapfiliate, impact) `cookieDomain`/`cookieDays`/`category`, referalli `legacyName`/`programHandle`, impact `campaignId`; lucida `publicKey`/`cookieDomain`/`category`; hermetica `storage`/`category`; watchtower `category`. */
|
|
501
511
|
export interface CookiePresetParams {
|
|
502
512
|
frontendApiHost?: string;
|
|
503
513
|
crossSubdomainCookies?: boolean;
|
|
@@ -505,8 +515,8 @@ export interface CookiePresetParams {
|
|
|
505
515
|
publishableKey?: string;
|
|
506
516
|
publicId?: string;
|
|
507
517
|
dragging?: boolean;
|
|
508
|
-
/** Chatly: the widget's own storage option, as passed to Chatly.init; analytics 'deny' leaves chatly:seen out, marketing 'deny' chatly:utm. */
|
|
509
|
-
storage?: 'allow' | 'deny' | 'on-open' | {
|
|
518
|
+
/** Chatly: the widget's own storage option, as passed to Chatly.init; analytics 'deny' leaves chatly:seen out, marketing 'deny' chatly:utm. Hermetica: 'localStorage' (default) or 'cookie'. */
|
|
519
|
+
storage?: 'allow' | 'deny' | 'on-open' | 'localStorage' | 'cookie' | {
|
|
510
520
|
functional?: 'allow' | 'deny' | 'on-open';
|
|
511
521
|
analytics?: 'allow' | 'deny' | 'on-open';
|
|
512
522
|
marketing?: 'allow' | 'deny' | 'on-open';
|
|
@@ -528,6 +538,8 @@ export interface CookiePresetParams {
|
|
|
528
538
|
orgToken?: string;
|
|
529
539
|
/** impact: your program id; declares IR_<campaignId> too. */
|
|
530
540
|
campaignId?: string;
|
|
541
|
+
/** lucida: your public project key; the rows are then exact names ending in its last 8 word characters (else prefix patterns). */
|
|
542
|
+
publicKey?: string;
|
|
531
543
|
}
|
|
532
544
|
/** One browser key a surface writes, in an embed manifest. */
|
|
533
545
|
export interface EmbedManifestStorage {
|
|
@@ -735,6 +747,17 @@ export interface ScanStatus {
|
|
|
735
747
|
finalUrl?: string;
|
|
736
748
|
/** Why it failed. */
|
|
737
749
|
error?: string;
|
|
750
|
+
/** Once done: cookies the scan saw (or a visit since) that no declaration covers. Reporting only. */
|
|
751
|
+
undeclared?: Array<{
|
|
752
|
+
name: string;
|
|
753
|
+
domain?: string;
|
|
754
|
+
category: string;
|
|
755
|
+
}>;
|
|
756
|
+
/** Once done: declarations the scan did not see and nothing has seen for `staleAfterDays`. Reporting only. */
|
|
757
|
+
stale?: Array<{
|
|
758
|
+
name: string;
|
|
759
|
+
lastSeenAt: number | null;
|
|
760
|
+
}>;
|
|
738
761
|
}
|
|
739
762
|
/** Consent-button parity of the banner a real browser saw on the site (see ScanStatus). */
|
|
740
763
|
export interface ButtonParityScan {
|
|
@@ -785,6 +808,10 @@ export interface InstallSnippet {
|
|
|
785
808
|
blockingMode: string;
|
|
786
809
|
/** Where `blockingMode` came from: the site's config, or the `blockingMode` option. */
|
|
787
810
|
blockingModeSource?: 'config' | 'query';
|
|
811
|
+
/** The site's `embedChannel`: `stable`, or `pinned:<version>` (then `src` is that release's immutable URL). */
|
|
812
|
+
channel?: string;
|
|
813
|
+
/** Pinned releases only: the loader's `sha384-` hash, also on the tag with `crossorigin="anonymous"`. */
|
|
814
|
+
integrity?: string;
|
|
788
815
|
/** The tag's data-culture, when it has one. */
|
|
789
816
|
culture?: string;
|
|
790
817
|
/** CSP sources this site needs, by directive, plus a paste-able `policy`. */
|
|
@@ -1663,7 +1690,7 @@ export interface Org {
|
|
|
1663
1690
|
plan: string;
|
|
1664
1691
|
logoUrl: string | null;
|
|
1665
1692
|
}
|
|
1666
|
-
export type MailProviderKind = 'brevo' | 'sendgrid' | 'postmark' | 'resend' | 'ses' | 'smtp';
|
|
1693
|
+
export type MailProviderKind = 'brevo' | 'sendgrid' | 'postmark' | 'resend' | 'ses' | 'smtp' | 'hermetica';
|
|
1667
1694
|
/**
|
|
1668
1695
|
* The org's own mail provider for rights-request mail. The credential is never returned —
|
|
1669
1696
|
* `secretLast4` only. `sender` says whether verification codes go through it right now
|
|
@@ -1788,6 +1815,17 @@ export type RightsIdentityType = 'clerk' | 'atlas' | 'oidc_jwt';
|
|
|
1788
1815
|
* The sign-in provider rights requests are verified with: a visitor signed in to your site is
|
|
1789
1816
|
* verified by their session, with no code mail. Nothing here is secret.
|
|
1790
1817
|
*/
|
|
1818
|
+
/** What the rights intake would make of one session token (`rightsIdentity.check`). The email is never echoed. */
|
|
1819
|
+
export interface RightsIdentityCheck {
|
|
1820
|
+
verified: boolean;
|
|
1821
|
+
reason?: 'not_configured' | 'unavailable' | 'invalid' | 'no_email' | 'email_unverified';
|
|
1822
|
+
/** For `invalid`: which JWT check failed. */
|
|
1823
|
+
jwt?: 'malformed' | 'alg' | 'no_key' | 'signature' | 'expired' | 'claims' | 'azp';
|
|
1824
|
+
detail: string;
|
|
1825
|
+
/** The claim names the token carries (never their values). */
|
|
1826
|
+
claims?: string[];
|
|
1827
|
+
provider?: 'clerk' | 'atlas' | 'oidc_jwt';
|
|
1828
|
+
}
|
|
1791
1829
|
export interface RightsIdentity {
|
|
1792
1830
|
/** `site`: the site's own setting; `org`: the organisation default; `default`: neither (none). */
|
|
1793
1831
|
source: 'site' | 'org' | 'default';
|
|
@@ -2175,7 +2213,7 @@ export interface ChildKeyInput {
|
|
|
2175
2213
|
cbids?: string[];
|
|
2176
2214
|
}
|
|
2177
2215
|
export interface PolicyOptions {
|
|
2178
|
-
/** Contact email
|
|
2216
|
+
/** Contact email the policy publishes. Falls back to the controller's (org, else site config); with none the API answers 422 `contact_email_required`. */
|
|
2179
2217
|
contactEmail?: string;
|
|
2180
2218
|
/** YYYY-MM-DD. Defaults to today. */
|
|
2181
2219
|
effectiveDate?: string;
|
|
@@ -2185,6 +2223,8 @@ export interface PolicyOptions {
|
|
|
2185
2223
|
fragment?: 'cookies';
|
|
2186
2224
|
/** With `fragment: 'cookies'`: Markdown (default) or escaped HTML tables. */
|
|
2187
2225
|
format?: 'markdown' | 'html';
|
|
2226
|
+
/** With `fragment: 'cookies'`: `review` lists the owner's raw rows (retired and quarantined too), for checking, not publishing. */
|
|
2227
|
+
include?: 'review';
|
|
2188
2228
|
/** The text's language; the policy is written in English only (`en`). */
|
|
2189
2229
|
lang?: string;
|
|
2190
2230
|
}
|
|
@@ -2351,7 +2391,9 @@ export interface DsarExecutor {
|
|
|
2351
2391
|
completionSecretPrefix?: string;
|
|
2352
2392
|
/** When a signed completion last verified; running work is then polled every 6 hours. */
|
|
2353
2393
|
lastSignedCompletionAt?: number | null;
|
|
2354
|
-
/** Where signed cm-standard-v2 completions go. */
|
|
2394
|
+
/** Where signed cm-standard-v2 completions go, signed with `completionSecret` (not `webhookUrl`, which profile-based systems use). */
|
|
2395
|
+
completionUrl?: string;
|
|
2396
|
+
/** The same URL as `completionUrl`, under its earlier name. */
|
|
2355
2397
|
completionsUrl?: string;
|
|
2356
2398
|
/** True: its erasures wait (status `awaiting_approval`) for `approveTask` or `rejectTask`. */
|
|
2357
2399
|
requireApproval?: boolean;
|
|
@@ -2370,12 +2412,21 @@ export interface DsarExecutor {
|
|
|
2370
2412
|
/** On create only: the completion secret, shown this once. */
|
|
2371
2413
|
completionSecret?: string;
|
|
2372
2414
|
}
|
|
2415
|
+
/** GET …/completion-secret: the current secret again (dsar:write, audited). */
|
|
2416
|
+
export interface CompletionSecret {
|
|
2417
|
+
id: string;
|
|
2418
|
+
completionSecret: string;
|
|
2419
|
+
completionSecretPrefix: string;
|
|
2420
|
+
completionUrl: string;
|
|
2421
|
+
completionsUrl?: string;
|
|
2422
|
+
}
|
|
2373
2423
|
/** POST …/completion-secret/roll. */
|
|
2374
2424
|
export interface CompletionSecretRolled {
|
|
2375
2425
|
id: string;
|
|
2376
2426
|
completionSecret: string;
|
|
2377
2427
|
completionSecretPrefix: string;
|
|
2378
2428
|
previousRetiresAt: string | null;
|
|
2429
|
+
completionUrl?: string;
|
|
2379
2430
|
completionsUrl?: string;
|
|
2380
2431
|
}
|
|
2381
2432
|
/** POST …/test {conformance: true}: the conformance kit's report. */
|
|
@@ -2433,6 +2484,12 @@ export interface DsarExecutorPresetInput {
|
|
|
2433
2484
|
orchestrator?: 1 | 2;
|
|
2434
2485
|
/** Park its erasures for a person's approval. Default false. */
|
|
2435
2486
|
requireApproval?: boolean;
|
|
2487
|
+
/**
|
|
2488
|
+
* Any of the preset's params by name, as `executorPresets()` lists them: `{ programId }` for referalli
|
|
2489
|
+
* (one program of a shared organisation), `{ projectId }` for lucida, `{ scopeName, scopeId }` for
|
|
2490
|
+
* cm-standard-v2. A name the preset does not list is a 400 naming `params.<name>`.
|
|
2491
|
+
*/
|
|
2492
|
+
params?: Record<string, string | boolean>;
|
|
2436
2493
|
}
|
|
2437
2494
|
/** What `upgradeExecutorPreset` takes: a version, a preset to adopt, or params to add. */
|
|
2438
2495
|
export interface ExecutorPresetUpgrade {
|
|
@@ -2441,10 +2498,12 @@ export interface ExecutorPresetUpgrade {
|
|
|
2441
2498
|
orgId?: string;
|
|
2442
2499
|
atlasIdAppId?: string;
|
|
2443
2500
|
revokeAtlasIdGrant?: boolean;
|
|
2501
|
+
/** Any of the preset's params by name (see `DsarExecutorPresetInput.params`). */
|
|
2502
|
+
params?: Record<string, string | boolean>;
|
|
2444
2503
|
/** Overridden paths (`profileOverrides`) that take the preset's value again; every other override is kept. */
|
|
2445
2504
|
acceptPreset?: string | string[];
|
|
2446
2505
|
}
|
|
2447
|
-
/** One step a preset builds, and whether it can run now
|
|
2506
|
+
/** One step a preset builds, and whether it can run now. */
|
|
2448
2507
|
export interface ExecutorPresetStep {
|
|
2449
2508
|
name: 'subjectLookup' | 'open' | 'poll' | 'webhook' | 'grantRevoke';
|
|
2450
2509
|
available: boolean;
|
|
@@ -2461,6 +2520,20 @@ export interface ExecutorPresetStep {
|
|
|
2461
2520
|
};
|
|
2462
2521
|
}
|
|
2463
2522
|
/** The presets, which are usable now, and this org's canary address. */
|
|
2523
|
+
/** GET /v1/dsar/executors/suggestions: platforms a site runs on that no connected system covers yet. */
|
|
2524
|
+
export interface ExecutorSuggestion {
|
|
2525
|
+
cbid: string;
|
|
2526
|
+
preset: ExecutorPresetName;
|
|
2527
|
+
platform: string;
|
|
2528
|
+
/** Which cookie rows and partner link implied it. */
|
|
2529
|
+
reason: string;
|
|
2530
|
+
available: boolean;
|
|
2531
|
+
waitingOn?: {
|
|
2532
|
+
platform: string;
|
|
2533
|
+
items: string[];
|
|
2534
|
+
operations: string[];
|
|
2535
|
+
};
|
|
2536
|
+
}
|
|
2464
2537
|
export interface ExecutorPresets {
|
|
2465
2538
|
canaryEmail: string;
|
|
2466
2539
|
/** The same list as `presets`, under the name every list answer uses. */
|
|
@@ -2770,10 +2843,44 @@ export interface CookieMunchClient {
|
|
|
2770
2843
|
};
|
|
2771
2844
|
warnings?: string[];
|
|
2772
2845
|
}>;
|
|
2846
|
+
/**
|
|
2847
|
+
* What `create` would do, without creating anything (`POST /v1/orgs?dryRun=1`). `provision` is a
|
|
2848
|
+
* `provision()` body, planned against the org that would be created (its id reads `<new org>`).
|
|
2849
|
+
*/
|
|
2850
|
+
createDryRun(name: string, opts?: {
|
|
2851
|
+
mintKey?: boolean;
|
|
2852
|
+
keyScopes?: string[];
|
|
2853
|
+
keyExpiresInDays?: number;
|
|
2854
|
+
inheritFrom?: string;
|
|
2855
|
+
provision?: ProvisionRequest | ProvisionRequestV2;
|
|
2856
|
+
}): Promise<{
|
|
2857
|
+
dryRun: true;
|
|
2858
|
+
org: {
|
|
2859
|
+
name: string;
|
|
2860
|
+
wouldCreate: boolean;
|
|
2861
|
+
inheritFrom?: string;
|
|
2862
|
+
};
|
|
2863
|
+
refusal?: {
|
|
2864
|
+
error: 'org_limit';
|
|
2865
|
+
orgLimit: {
|
|
2866
|
+
max: number | null;
|
|
2867
|
+
plan: string;
|
|
2868
|
+
used: number;
|
|
2869
|
+
};
|
|
2870
|
+
upgradeUrl?: string;
|
|
2871
|
+
};
|
|
2872
|
+
key?: {
|
|
2873
|
+
scopes: string[] | 'all';
|
|
2874
|
+
expiresInDays: number;
|
|
2875
|
+
};
|
|
2876
|
+
/** The provision dry run's answer (a ProvisionResult on 200, an error body otherwise). */
|
|
2877
|
+
provision?: unknown;
|
|
2878
|
+
provisionStatus?: number;
|
|
2879
|
+
}>;
|
|
2773
2880
|
/** Hard-delete a SANDBOX organisation of this account (created with metadata.stack_sandbox). Anything else: 403 not_a_sandbox. */
|
|
2774
2881
|
deleteSandbox(id: string): Promise<SandboxPurge>;
|
|
2775
2882
|
};
|
|
2776
|
-
/** Tags on any created resource
|
|
2883
|
+
/** Tags on any created resource. */
|
|
2777
2884
|
metadata: {
|
|
2778
2885
|
get(type: TaggedType, id: string): Promise<ResourceTags>;
|
|
2779
2886
|
/** Merge tags (null removes one). `stack_sandbox` cannot be set here. `{ dryRun: true }` answers with the diff. */
|
|
@@ -2781,7 +2888,7 @@ export interface CookieMunchClient {
|
|
|
2781
2888
|
dryRun?: boolean;
|
|
2782
2889
|
}): Promise<ResourceTagsUpdate>;
|
|
2783
2890
|
};
|
|
2784
|
-
/** Partner links in the suite-standard shape
|
|
2891
|
+
/** Partner links in the suite-standard shape. */
|
|
2785
2892
|
partnerLinks: {
|
|
2786
2893
|
list(opts?: MetadataFilter): Promise<StandardPartnerLink[]>;
|
|
2787
2894
|
create(input: StandardPartnerLinkCreate): Promise<StandardPartnerLink>;
|
|
@@ -2853,10 +2960,16 @@ export interface CookieMunchClient {
|
|
|
2853
2960
|
cookies(cbid: string): Promise<CookieDeclaration>;
|
|
2854
2961
|
/**
|
|
2855
2962
|
* Start a cookie crawl. Answers at once with `scanId` and `state: 'queued'`; `wait`
|
|
2856
|
-
* (seconds, ≤60) holds the request until the scan is done or failed.
|
|
2963
|
+
* (seconds, ≤60) holds the request until the scan is done or failed. `cookies` (a Cookie
|
|
2964
|
+
* header value or `[{ name, value }]`, a test account's session) makes it a signed-in crawl:
|
|
2965
|
+
* set only on the site's own hosts, never stored or returned.
|
|
2857
2966
|
*/
|
|
2858
2967
|
scan(cbid: string, opts?: {
|
|
2859
2968
|
wait?: number;
|
|
2969
|
+
cookies?: string | Array<{
|
|
2970
|
+
name: string;
|
|
2971
|
+
value: string;
|
|
2972
|
+
}>;
|
|
2860
2973
|
}): Promise<ScanStatus>;
|
|
2861
2974
|
/** The last scan's state. `wait` (seconds, ≤60) holds the request until a running scan settles. */
|
|
2862
2975
|
scanStatus(cbid: string, opts?: {
|
|
@@ -2940,7 +3053,7 @@ export interface CookieMunchClient {
|
|
|
2940
3053
|
dryRun: true;
|
|
2941
3054
|
retired: RetiredCookie[];
|
|
2942
3055
|
}>;
|
|
2943
|
-
/** Every declaration preset (atlas, forumulate, chatly, cookiemunch, referalli, firstpromoter, partnerstack, tapfiliate, impact, seolyticize): params, what it declared here, manifest status. */
|
|
3056
|
+
/** Every declaration preset (atlas, forumulate, chatly, cookiemunch, referalli, firstpromoter, partnerstack, tapfiliate, impact, seolyticize, lucida, hermetica, watchtower): params, what it declared here, manifest status. */
|
|
2944
3057
|
cookiePresets(cbid: string): Promise<{
|
|
2945
3058
|
presets: CookiePreset[];
|
|
2946
3059
|
aliases?: Record<string, string>;
|
|
@@ -3484,6 +3597,10 @@ export interface CookieMunchClient {
|
|
|
3484
3597
|
dryRunConnectExecutor(input: DsarExecutorInput | DsarExecutorPresetInput): Promise<DsarExecutorDryRun>;
|
|
3485
3598
|
/** The versioned presets, whether each is usable now (or waits on another platform), and the org canary address. */
|
|
3486
3599
|
executorPresets(): Promise<ExecutorPresets>;
|
|
3600
|
+
/** The platforms a site's cookie rows and partner links imply that have no connected system yet; every site the key reaches without `cbid`. */
|
|
3601
|
+
executorSuggestions(cbid?: string): Promise<{
|
|
3602
|
+
data: ExecutorSuggestion[];
|
|
3603
|
+
}>;
|
|
3487
3604
|
/**
|
|
3488
3605
|
* Rebuild a connection from its preset's latest version (or `presetVersion`), keeping its id
|
|
3489
3606
|
* and credentials; or adopt a preset on a hand-written one by naming it. Answers with `diff`.
|
|
@@ -3537,6 +3654,8 @@ export interface CookieMunchClient {
|
|
|
3537
3654
|
}): Promise<ExecutorHealth[]>;
|
|
3538
3655
|
/** Run the cm-standard-v2 conformance kit against a connection, on the canary subject only. */
|
|
3539
3656
|
executorConformance(id: string): Promise<ExecutorConformanceResult>;
|
|
3657
|
+
/** The connection's current completion secret and the URL it signs for (dsar:write; each read is audited). */
|
|
3658
|
+
getExecutorCompletionSecret(id: string): Promise<CompletionSecret>;
|
|
3540
3659
|
/** A new completion secret, shown once; the old one keeps verifying for 24 hours. */
|
|
3541
3660
|
rollExecutorCompletionSecret(id: string): Promise<CompletionSecretRolled>;
|
|
3542
3661
|
};
|
|
@@ -3736,9 +3855,13 @@ export interface CookieMunchClient {
|
|
|
3736
3855
|
};
|
|
3737
3856
|
};
|
|
3738
3857
|
/** The org's audit log, newest first. API actions appear as `apikey:<prefix>`. */
|
|
3739
|
-
/**
|
|
3858
|
+
/**
|
|
3859
|
+
* `{ actor: 'self' }` reads the calling key's own rows, which any key may call. Otherwise an unscoped key or
|
|
3860
|
+
* `audit:read`. `since` (ISO 8601 or epoch ms) keeps rows at or after it.
|
|
3861
|
+
*/
|
|
3740
3862
|
audit(limit?: number, opts?: {
|
|
3741
3863
|
actor?: string;
|
|
3864
|
+
since?: string | number;
|
|
3742
3865
|
}): Promise<{
|
|
3743
3866
|
entries: AuditEntry[];
|
|
3744
3867
|
}>;
|
|
@@ -3848,9 +3971,23 @@ export interface CookieMunchClient {
|
|
|
3848
3971
|
*/
|
|
3849
3972
|
rightsIdentity: {
|
|
3850
3973
|
get(cbid: string): Promise<RightsIdentity>;
|
|
3974
|
+
/** `dryRun`: checked in full (the key set fetched), nothing saved; answers `{ dryRun, setting, diff }`. */
|
|
3851
3975
|
set(cbid: string, input: RightsIdentityInput): Promise<RightsIdentity>;
|
|
3976
|
+
set(cbid: string, input: RightsIdentityInput, opts: {
|
|
3977
|
+
dryRun: true;
|
|
3978
|
+
}): Promise<{
|
|
3979
|
+
dryRun: true;
|
|
3980
|
+
setting: RightsIdentity;
|
|
3981
|
+
diff: Array<{
|
|
3982
|
+
path: string;
|
|
3983
|
+
from?: unknown;
|
|
3984
|
+
to?: unknown;
|
|
3985
|
+
}>;
|
|
3986
|
+
}>;
|
|
3852
3987
|
/** Remove the site's own setting: it inherits the organisation default again. */
|
|
3853
3988
|
remove(cbid: string): Promise<RightsIdentity>;
|
|
3989
|
+
/** Check one session token as the rights intake would, and say why it fails. Files nothing. */
|
|
3990
|
+
check(cbid: string, token: string): Promise<RightsIdentityCheck>;
|
|
3854
3991
|
};
|
|
3855
3992
|
/** A site's rights-request settings: graceDays (0–30; 7 for a new site, 0 until set for one that existed before). Requires dsar:read / dsar:write. */
|
|
3856
3993
|
dsarSettings: {
|
package/dist/index.js
CHANGED
|
@@ -8,13 +8,14 @@ import {
|
|
|
8
8
|
readConsent,
|
|
9
9
|
verifyDecisionSignature,
|
|
10
10
|
verifyToken
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-OQJYQMQR.js";
|
|
12
12
|
import {
|
|
13
13
|
CANARY_ISSUER,
|
|
14
14
|
CONFORMANCE_RULES,
|
|
15
15
|
canaryIdentityFor,
|
|
16
|
-
runExecutorConformance
|
|
17
|
-
|
|
16
|
+
runExecutorConformance,
|
|
17
|
+
secretPaths
|
|
18
|
+
} from "./chunk-VXN75KHK.js";
|
|
18
19
|
|
|
19
20
|
// src/webhooks.ts
|
|
20
21
|
import { createHmac, timingSafeEqual } from "crypto";
|
|
@@ -88,7 +89,7 @@ async function exchangeOperatorToken(input) {
|
|
|
88
89
|
}
|
|
89
90
|
|
|
90
91
|
// src/index.ts
|
|
91
|
-
var SDK_VERSION = "0.
|
|
92
|
+
var SDK_VERSION = "0.23.0";
|
|
92
93
|
var CookieMunchApiError = class extends Error {
|
|
93
94
|
constructor(status, message, code, body) {
|
|
94
95
|
super(message);
|
|
@@ -178,6 +179,7 @@ function createCookieMunch(opts) {
|
|
|
178
179
|
orgs: {
|
|
179
180
|
list: (o) => get(`/orgs${metaQs(o)}`),
|
|
180
181
|
create: (name, opts2) => request("POST", "/orgs", { name, ...opts2 ?? {} }),
|
|
182
|
+
createDryRun: (name, opts2) => request("POST", "/orgs?dryRun=1", { name, ...opts2 ?? {} }),
|
|
181
183
|
deleteSandbox: (id) => request("DELETE", `/orgs/${enc(id)}?hard=1`)
|
|
182
184
|
},
|
|
183
185
|
metadata: {
|
|
@@ -212,7 +214,7 @@ function createCookieMunch(opts) {
|
|
|
212
214
|
),
|
|
213
215
|
lintConfig: (cbid, config, opts2) => request("POST", `/sites/${enc(cbid)}/config/lint${qs({ replace: opts2?.replace ? 1 : void 0 })}`, config),
|
|
214
216
|
cookies: (cbid) => get(`/sites/${enc(cbid)}/cookies`),
|
|
215
|
-
scan: (cbid, o) => request("POST", `/sites/${enc(cbid)}/scan${qs({ wait: o?.wait })}
|
|
217
|
+
scan: (cbid, o) => request("POST", `/sites/${enc(cbid)}/scan${qs({ wait: o?.wait })}`, o?.cookies !== void 0 ? { cookies: o.cookies } : void 0),
|
|
216
218
|
scanStatus: (cbid, o) => get(`/sites/${enc(cbid)}/scan${qs({ wait: o?.wait })}`),
|
|
217
219
|
waitForScan: async (cbid, o) => {
|
|
218
220
|
const until = Date.now() + (o?.timeoutMs ?? 12e4);
|
|
@@ -229,7 +231,7 @@ function createCookieMunch(opts) {
|
|
|
229
231
|
ab: (cbid) => get(`/sites/${enc(cbid)}/ab`),
|
|
230
232
|
policy: (cbid, o) => request(
|
|
231
233
|
"GET",
|
|
232
|
-
`/sites/${enc(cbid)}/policy${qs({ contactEmail: o?.contactEmail, effectiveDate: o?.effectiveDate, jurisdictions: o?.jurisdictions?.join(","), fragment: o?.fragment, format: o?.format, lang: o?.lang })}`,
|
|
234
|
+
`/sites/${enc(cbid)}/policy${qs({ contactEmail: o?.contactEmail, effectiveDate: o?.effectiveDate, jurisdictions: o?.jurisdictions?.join(","), fragment: o?.fragment, format: o?.format, include: o?.include, lang: o?.lang })}`,
|
|
233
235
|
void 0,
|
|
234
236
|
true
|
|
235
237
|
),
|
|
@@ -440,6 +442,7 @@ function createCookieMunch(opts) {
|
|
|
440
442
|
upsertExecutor: (input, o) => request("PUT", `/dsar/executors${qs({ verify: o?.verify === true ? "1" : o?.verify })}`, input),
|
|
441
443
|
dryRunConnectExecutor: (input) => request("POST", "/dsar/executors?dryRun=1", input),
|
|
442
444
|
executorPresets: () => get("/dsar/executors/presets"),
|
|
445
|
+
executorSuggestions: (cbid) => get(`/dsar/executors/suggestions${qs({ cbid })}`),
|
|
443
446
|
upgradeExecutorPreset: (id, input = {}) => request("POST", `/dsar/executors/${enc(id)}/upgrade-preset`, input),
|
|
444
447
|
dryRunUpgradeExecutorPreset: (id, input = {}) => request("POST", `/dsar/executors/${enc(id)}/upgrade-preset?dryRun=1`, input),
|
|
445
448
|
dryRunUpdateExecutor: (id, patch) => request("PATCH", `/dsar/executors/${enc(id)}?dryRun=1`, patch),
|
|
@@ -456,6 +459,7 @@ function createCookieMunch(opts) {
|
|
|
456
459
|
recheckExecutor: (id) => request("POST", `/dsar/executors/${enc(id)}/recheck`),
|
|
457
460
|
executorHealthHistory: (id, opts2 = {}) => get(`/dsar/executors/${enc(id)}/health/history${qs({ limit: opts2.limit })}`),
|
|
458
461
|
executorConformance: (id) => request("POST", `/dsar/executors/${enc(id)}/test`, { conformance: true }),
|
|
462
|
+
getExecutorCompletionSecret: (id) => request("GET", `/dsar/executors/${enc(id)}/completion-secret`),
|
|
459
463
|
rollExecutorCompletionSecret: (id) => request("POST", `/dsar/executors/${enc(id)}/completion-secret/roll`)
|
|
460
464
|
},
|
|
461
465
|
preferences: {
|
|
@@ -540,7 +544,7 @@ function createCookieMunch(opts) {
|
|
|
540
544
|
remove: () => request("DELETE", "/org/rights-identity")
|
|
541
545
|
}
|
|
542
546
|
},
|
|
543
|
-
audit: (limit, opts2) => get(`/audit${qs({ limit, actor: opts2?.actor })}`),
|
|
547
|
+
audit: (limit, opts2) => get(`/audit${qs({ limit, actor: opts2?.actor, since: opts2?.since })}`),
|
|
544
548
|
auditSink: {
|
|
545
549
|
get: () => get("/audit/sink"),
|
|
546
550
|
set: (input) => request("PUT", "/audit/sink", input),
|
|
@@ -597,8 +601,9 @@ function createCookieMunch(opts) {
|
|
|
597
601
|
},
|
|
598
602
|
rightsIdentity: {
|
|
599
603
|
get: (cbid) => get(`/sites/${enc(cbid)}/rights-identity`),
|
|
600
|
-
set: (cbid, input) => request("PUT", `/sites/${enc(cbid)}/rights-identity`, input),
|
|
601
|
-
remove: (cbid) => request("DELETE", `/sites/${enc(cbid)}/rights-identity`)
|
|
604
|
+
set: ((cbid, input, o) => request("PUT", `/sites/${enc(cbid)}/rights-identity${qs({ dryRun: o?.dryRun ? "1" : void 0 })}`, input)),
|
|
605
|
+
remove: (cbid) => request("DELETE", `/sites/${enc(cbid)}/rights-identity`),
|
|
606
|
+
check: (cbid, token) => request("POST", `/sites/${enc(cbid)}/rights-identity/check`, { token })
|
|
602
607
|
},
|
|
603
608
|
dsarSettings: {
|
|
604
609
|
get: (cbid) => get(`/sites/${enc(cbid)}/dsar-settings`),
|
|
@@ -643,6 +648,7 @@ export {
|
|
|
643
648
|
parseConsentValue,
|
|
644
649
|
readConsent,
|
|
645
650
|
runExecutorConformance,
|
|
651
|
+
secretPaths,
|
|
646
652
|
verifyDecisionSignature,
|
|
647
653
|
verifyToken,
|
|
648
654
|
verifyWebhookSignature
|