@referalli/sdk 0.0.0-stage → 0.3.20
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 +128 -0
- package/LICENSE +21 -0
- package/README.md +236 -2
- package/dist/cjs/attribution.d.ts +105 -0
- package/dist/cjs/attribution.js +200 -0
- package/dist/cjs/browser.d.ts +41 -0
- package/dist/cjs/browser.js +88 -0
- package/dist/cjs/client.d.ts +97 -0
- package/dist/cjs/client.js +301 -0
- package/dist/cjs/consent/adapters/cookiebot.d.ts +7 -0
- package/dist/cjs/consent/adapters/cookiebot.js +49 -0
- package/dist/cjs/consent/adapters/cookiemunch.d.ts +8 -0
- package/dist/cjs/consent/adapters/cookiemunch.js +56 -0
- package/dist/cjs/consent/adapters/custom.d.ts +8 -0
- package/dist/cjs/consent/adapters/custom.js +39 -0
- package/dist/cjs/consent/adapters/didomi.d.ts +9 -0
- package/dist/cjs/consent/adapters/didomi.js +67 -0
- package/dist/cjs/consent/adapters/gcm.d.ts +10 -0
- package/dist/cjs/consent/adapters/gcm.js +78 -0
- package/dist/cjs/consent/adapters/gpp.d.ts +9 -0
- package/dist/cjs/consent/adapters/gpp.js +92 -0
- package/dist/cjs/consent/adapters/none.d.ts +3 -0
- package/dist/cjs/consent/adapters/none.js +30 -0
- package/dist/cjs/consent/adapters/onetrust.d.ts +8 -0
- package/dist/cjs/consent/adapters/onetrust.js +71 -0
- package/dist/cjs/consent/adapters/osano.d.ts +9 -0
- package/dist/cjs/consent/adapters/osano.js +71 -0
- package/dist/cjs/consent/adapters/tcf.d.ts +8 -0
- package/dist/cjs/consent/adapters/tcf.js +79 -0
- package/dist/cjs/consent/adapters/termly.d.ts +10 -0
- package/dist/cjs/consent/adapters/termly.js +61 -0
- package/dist/cjs/consent/adapters/usercentrics.d.ts +9 -0
- package/dist/cjs/consent/adapters/usercentrics.js +106 -0
- package/dist/cjs/consent/conformance.d.ts +22 -0
- package/dist/cjs/consent/conformance.js +33 -0
- package/dist/cjs/consent/gate.d.ts +23 -0
- package/dist/cjs/consent/gate.js +220 -0
- package/dist/cjs/consent/port.d.ts +105 -0
- package/dist/cjs/consent/port.js +72 -0
- package/dist/cjs/consent/registry.d.ts +17 -0
- package/dist/cjs/consent/registry.js +61 -0
- package/dist/cjs/consent/served.d.ts +15 -0
- package/dist/cjs/consent/served.js +26 -0
- package/dist/cjs/core.d.ts +77 -0
- package/dist/cjs/core.js +64 -0
- package/dist/cjs/errors.d.ts +42 -0
- package/dist/cjs/errors.generated.d.ts +183 -0
- package/dist/cjs/errors.generated.js +279 -0
- package/dist/cjs/errors.js +47 -0
- package/dist/cjs/generated.d.ts +15146 -0
- package/dist/cjs/generated.js +625 -0
- package/dist/cjs/index.d.ts +22 -0
- package/dist/cjs/index.js +93 -0
- package/dist/cjs/mobile.d.ts +66 -0
- package/dist/cjs/mobile.js +69 -0
- package/dist/cjs/node.d.ts +209 -0
- package/dist/cjs/node.js +140 -0
- package/dist/cjs/outbox.d.ts +186 -0
- package/dist/cjs/outbox.js +324 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/resources.generated.d.ts +6002 -0
- package/dist/cjs/resources.generated.js +2090 -0
- package/dist/cjs/served.d.ts +25 -0
- package/dist/cjs/served.js +214 -0
- package/dist/cjs/sha256.d.ts +2 -0
- package/dist/cjs/sha256.js +86 -0
- package/dist/cjs/snippet.d.ts +99 -0
- package/dist/cjs/snippet.js +213 -0
- package/dist/cjs/stripe-events.d.ts +25 -0
- package/dist/cjs/stripe-events.js +117 -0
- package/dist/cjs/version.d.ts +2 -0
- package/dist/cjs/version.js +5 -0
- package/dist/cjs/webhooks.d.ts +76 -0
- package/dist/cjs/webhooks.js +159 -0
- package/dist/esm/attribution.d.ts +105 -0
- package/dist/esm/attribution.js +186 -0
- package/dist/esm/browser.d.ts +41 -0
- package/dist/esm/browser.js +68 -0
- package/dist/esm/client.d.ts +97 -0
- package/dist/esm/client.js +297 -0
- package/dist/esm/consent/adapters/cookiebot.d.ts +7 -0
- package/dist/esm/consent/adapters/cookiebot.js +46 -0
- package/dist/esm/consent/adapters/cookiemunch.d.ts +8 -0
- package/dist/esm/consent/adapters/cookiemunch.js +53 -0
- package/dist/esm/consent/adapters/custom.d.ts +8 -0
- package/dist/esm/consent/adapters/custom.js +36 -0
- package/dist/esm/consent/adapters/didomi.d.ts +9 -0
- package/dist/esm/consent/adapters/didomi.js +64 -0
- package/dist/esm/consent/adapters/gcm.d.ts +10 -0
- package/dist/esm/consent/adapters/gcm.js +75 -0
- package/dist/esm/consent/adapters/gpp.d.ts +9 -0
- package/dist/esm/consent/adapters/gpp.js +89 -0
- package/dist/esm/consent/adapters/none.d.ts +3 -0
- package/dist/esm/consent/adapters/none.js +27 -0
- package/dist/esm/consent/adapters/onetrust.d.ts +8 -0
- package/dist/esm/consent/adapters/onetrust.js +68 -0
- package/dist/esm/consent/adapters/osano.d.ts +9 -0
- package/dist/esm/consent/adapters/osano.js +68 -0
- package/dist/esm/consent/adapters/tcf.d.ts +8 -0
- package/dist/esm/consent/adapters/tcf.js +76 -0
- package/dist/esm/consent/adapters/termly.d.ts +10 -0
- package/dist/esm/consent/adapters/termly.js +58 -0
- package/dist/esm/consent/adapters/usercentrics.d.ts +9 -0
- package/dist/esm/consent/adapters/usercentrics.js +103 -0
- package/dist/esm/consent/conformance.d.ts +22 -0
- package/dist/esm/consent/conformance.js +30 -0
- package/dist/esm/consent/gate.d.ts +23 -0
- package/dist/esm/consent/gate.js +217 -0
- package/dist/esm/consent/port.d.ts +105 -0
- package/dist/esm/consent/port.js +67 -0
- package/dist/esm/consent/registry.d.ts +17 -0
- package/dist/esm/consent/registry.js +55 -0
- package/dist/esm/consent/served.d.ts +15 -0
- package/dist/esm/consent/served.js +22 -0
- package/dist/esm/core.d.ts +77 -0
- package/dist/esm/core.js +60 -0
- package/dist/esm/errors.d.ts +42 -0
- package/dist/esm/errors.generated.d.ts +183 -0
- package/dist/esm/errors.generated.js +231 -0
- package/dist/esm/errors.js +40 -0
- package/dist/esm/generated.d.ts +15146 -0
- package/dist/esm/generated.js +622 -0
- package/dist/esm/index.d.ts +22 -0
- package/dist/esm/index.js +22 -0
- package/dist/esm/mobile.d.ts +66 -0
- package/dist/esm/mobile.js +64 -0
- package/dist/esm/node.d.ts +209 -0
- package/dist/esm/node.js +135 -0
- package/dist/esm/outbox.d.ts +186 -0
- package/dist/esm/outbox.js +316 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/resources.generated.d.ts +6002 -0
- package/dist/esm/resources.generated.js +2086 -0
- package/dist/esm/served.d.ts +25 -0
- package/dist/esm/served.js +207 -0
- package/dist/esm/sha256.d.ts +2 -0
- package/dist/esm/sha256.js +82 -0
- package/dist/esm/snippet.d.ts +99 -0
- package/dist/esm/snippet.js +210 -0
- package/dist/esm/stripe-events.d.ts +25 -0
- package/dist/esm/stripe-events.js +114 -0
- package/dist/esm/version.d.ts +2 -0
- package/dist/esm/version.js +2 -0
- package/dist/esm/webhooks.d.ts +76 -0
- package/dist/esm/webhooks.js +153 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/tsconfig.cjs.tsbuildinfo +1 -0
- package/package.json +105 -4
- package/src/attribution.ts +216 -0
- package/src/browser.ts +107 -0
- package/src/client.ts +351 -0
- package/src/codegen.ts +130 -0
- package/src/consent/adapters/cookiebot.ts +42 -0
- package/src/consent/adapters/cookiemunch.ts +49 -0
- package/src/consent/adapters/custom.ts +37 -0
- package/src/consent/adapters/didomi.ts +59 -0
- package/src/consent/adapters/gcm.ts +68 -0
- package/src/consent/adapters/gpp.ts +81 -0
- package/src/consent/adapters/none.ts +28 -0
- package/src/consent/adapters/onetrust.ts +64 -0
- package/src/consent/adapters/osano.ts +63 -0
- package/src/consent/adapters/tcf.ts +67 -0
- package/src/consent/adapters/termly.ts +54 -0
- package/src/consent/adapters/usercentrics.ts +97 -0
- package/src/consent/conformance.ts +47 -0
- package/src/consent/gate.ts +216 -0
- package/src/consent/port.ts +148 -0
- package/src/consent/registry.ts +60 -0
- package/src/consent/served.ts +24 -0
- package/src/core.ts +127 -0
- package/src/errors.generated.ts +277 -0
- package/src/errors.ts +57 -0
- package/src/generated.ts +14540 -0
- package/src/index.ts +100 -0
- package/src/mobile.ts +96 -0
- package/src/node.ts +291 -0
- package/src/outbox.ts +452 -0
- package/src/resources.generated.ts +2097 -0
- package/src/served.ts +229 -0
- package/src/sha256.ts +82 -0
- package/src/snippet.ts +305 -0
- package/src/stripe-events.ts +130 -0
- package/src/version.ts +2 -0
- package/src/webhooks.ts +207 -0
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import { ListPromise } from './core.js';
|
|
2
|
+
import { ApiConnectionError, ApiError, ApiTimeoutError, ReferalliError } from './errors.js';
|
|
3
|
+
import { errorClasses } from './errors.generated.js';
|
|
4
|
+
import { API_VERSION, buildResources, operations } from './resources.generated.js';
|
|
5
|
+
import { SDK_VERSION } from './version.js';
|
|
6
|
+
const OPTION_KEYS = new Set(['idempotencyKey', 'timeout', 'maxRetries', 'signal', 'headers', 'apiVersion']);
|
|
7
|
+
/** A method that gained a query parameter keeps its old `(id, options)` call working: request options in the query slot move back. */
|
|
8
|
+
function splitOptions(queryNames, input, options) {
|
|
9
|
+
const q = input.query;
|
|
10
|
+
if (!q || Object.keys(q).length === 0 || !Object.keys(q).every((k) => OPTION_KEYS.has(k) && !queryNames.includes(k)))
|
|
11
|
+
return { input, options };
|
|
12
|
+
return { input: { ...input, query: undefined }, options: { ...q, ...options } };
|
|
13
|
+
}
|
|
14
|
+
import { webhooks } from './webhooks.js';
|
|
15
|
+
/** Production API. */
|
|
16
|
+
export const DEFAULT_BASE_URL = 'https://referalli.com';
|
|
17
|
+
const RETRY_STATUSES = new Set([408, 429, 500, 502, 503, 504]);
|
|
18
|
+
const IDEMPOTENT = new Set(['GET', 'HEAD', 'PUT', 'DELETE', 'OPTIONS']);
|
|
19
|
+
const MAX_BACKOFF_MS = 8_000;
|
|
20
|
+
const MAX_RETRY_AFTER_MS = 60_000;
|
|
21
|
+
const env = (name) => {
|
|
22
|
+
try {
|
|
23
|
+
return globalThis.process?.env?.[name];
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
|
|
30
|
+
export class Referalli {
|
|
31
|
+
baseUrl;
|
|
32
|
+
apiVersion;
|
|
33
|
+
mode;
|
|
34
|
+
timeout;
|
|
35
|
+
maxRetries;
|
|
36
|
+
retryBaseDelay;
|
|
37
|
+
/** Webhook verification (`await referalli.webhooks.constructEvent(body, headers, secret)`). */
|
|
38
|
+
webhooks = webhooks;
|
|
39
|
+
apiKey;
|
|
40
|
+
fetchFn;
|
|
41
|
+
headers;
|
|
42
|
+
constructor(options = {}) {
|
|
43
|
+
this.apiKey = options.apiKey ?? env('REFERALLI_API_KEY');
|
|
44
|
+
this.baseUrl = (options.baseUrl ?? env('REFERALLI_BASE_URL') ?? DEFAULT_BASE_URL).replace(/\/+$/, '');
|
|
45
|
+
this.apiVersion = options.apiVersion === undefined ? API_VERSION : options.apiVersion;
|
|
46
|
+
this.mode = options.mode;
|
|
47
|
+
this.timeout = options.timeout ?? 60_000;
|
|
48
|
+
this.maxRetries = Math.max(0, options.maxRetries ?? 2);
|
|
49
|
+
this.retryBaseDelay = options.retryBaseDelay ?? 500;
|
|
50
|
+
this.fetchFn = options.fetch ?? ((input, init) => globalThis.fetch(input, init));
|
|
51
|
+
this.headers = { ...(options.headers ?? {}) };
|
|
52
|
+
const transport = {
|
|
53
|
+
op: (id, input, opts) => this.call(id, input, opts),
|
|
54
|
+
list: (id, input, opts) => this.listPages(id, input, opts),
|
|
55
|
+
};
|
|
56
|
+
Object.assign(this, buildResources(transport));
|
|
57
|
+
}
|
|
58
|
+
/** Call any operation by its id (`postPartners`, `getReferralsId`, … see `operations`). */
|
|
59
|
+
async call(id, input = {}, options = {}) {
|
|
60
|
+
const spec = operations[id];
|
|
61
|
+
if (!spec)
|
|
62
|
+
throw new ReferalliError(`unknown operation ${String(id)}`);
|
|
63
|
+
({ input, options } = splitOptions(spec.query, input, options));
|
|
64
|
+
const path = spec.path.replace(/\{(\w+)\}/g, (_, name) => {
|
|
65
|
+
const value = input.path?.[name];
|
|
66
|
+
if (value === undefined || value === null || value === '')
|
|
67
|
+
throw new ReferalliError(`${id}: missing path parameter "${name}"`);
|
|
68
|
+
return encodeURIComponent(String(value));
|
|
69
|
+
});
|
|
70
|
+
return this.request({
|
|
71
|
+
...options,
|
|
72
|
+
idempotencyKey: options.idempotencyKey ?? input.idempotencyKey,
|
|
73
|
+
method: spec.method,
|
|
74
|
+
path,
|
|
75
|
+
query: input.query,
|
|
76
|
+
body: spec.body ? input.body : undefined,
|
|
77
|
+
kind: spec.kind,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
/** Every item of a list operation, following `next_cursor`: `for await (const p of referalli.listAll('getPartners'))`. */
|
|
81
|
+
listAll(id, input = {}, options = {}) {
|
|
82
|
+
return this.listPages(id, input, options);
|
|
83
|
+
}
|
|
84
|
+
listPages(id, input, options = {}) {
|
|
85
|
+
({ input, options } = splitOptions(operations[id]?.query ?? [], input, options));
|
|
86
|
+
return new ListPromise((cursor) => this.call(id, cursor ? { ...input, query: { ...(input.query ?? {}), starting_after: cursor } } : input, options));
|
|
87
|
+
}
|
|
88
|
+
/** A raw request to any path (`/v1/...`), with the client's auth, retries and error mapping. */
|
|
89
|
+
async request(req) {
|
|
90
|
+
const method = req.method.toUpperCase();
|
|
91
|
+
const url = this.baseUrl + req.path + encodeQuery(req.query);
|
|
92
|
+
const version = req.apiVersion === undefined ? this.apiVersion : req.apiVersion;
|
|
93
|
+
const headers = { accept: 'application/json', ...this.headers };
|
|
94
|
+
if (version)
|
|
95
|
+
headers['referalli-version'] = version;
|
|
96
|
+
if (this.mode)
|
|
97
|
+
headers['referalli-mode'] = this.mode;
|
|
98
|
+
if (this.apiKey)
|
|
99
|
+
headers.authorization = `Bearer ${this.apiKey}`;
|
|
100
|
+
if (typeof globalThis.window === 'undefined')
|
|
101
|
+
headers['user-agent'] = `referalli-js/${SDK_VERSION}`;
|
|
102
|
+
const hasBody = req.body !== undefined;
|
|
103
|
+
if (hasBody)
|
|
104
|
+
headers['content-type'] = 'application/json';
|
|
105
|
+
const key = req.idempotencyKey ?? (method === 'POST' ? await newIdempotencyKey() : undefined);
|
|
106
|
+
if (key)
|
|
107
|
+
headers['idempotency-key'] = key;
|
|
108
|
+
Object.assign(headers, req.headers ?? {});
|
|
109
|
+
const body = hasBody ? JSON.stringify(req.body) : undefined;
|
|
110
|
+
const retryable = IDEMPOTENT.has(method) || Boolean(key);
|
|
111
|
+
const maxRetries = retryable ? Math.max(0, req.maxRetries ?? this.maxRetries) : 0;
|
|
112
|
+
const timeout = req.timeout ?? this.timeout;
|
|
113
|
+
for (let attempt = 0;; attempt++) {
|
|
114
|
+
let res;
|
|
115
|
+
const { signal, cancel, timedOut } = withTimeout(timeout, req.signal);
|
|
116
|
+
try {
|
|
117
|
+
res = await this.fetchFn(url, { method, headers, body, signal });
|
|
118
|
+
}
|
|
119
|
+
catch (err) {
|
|
120
|
+
cancel();
|
|
121
|
+
if (req.signal?.aborted)
|
|
122
|
+
throw req.signal.reason ?? err;
|
|
123
|
+
if (attempt < maxRetries) {
|
|
124
|
+
await sleep(this.backoff(attempt), req.signal);
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
if (timedOut())
|
|
128
|
+
throw new ApiTimeoutError(`${method} ${req.path} timed out after ${timeout} ms`, { cause: err });
|
|
129
|
+
throw new ApiConnectionError(`${method} ${req.path} failed: ${err instanceof Error ? err.message : String(err)}`, { cause: err });
|
|
130
|
+
}
|
|
131
|
+
try {
|
|
132
|
+
if (res.ok) {
|
|
133
|
+
if (req.kind === 'text')
|
|
134
|
+
return (await res.text());
|
|
135
|
+
const raw = await res.text();
|
|
136
|
+
if (req.kind === 'empty' || raw === '')
|
|
137
|
+
return undefined;
|
|
138
|
+
return JSON.parse(raw);
|
|
139
|
+
}
|
|
140
|
+
const raw = await res.text().catch(() => '');
|
|
141
|
+
const resHeaders = headerRecord(res.headers);
|
|
142
|
+
const retryAfterMs = parseRetryAfter(resHeaders);
|
|
143
|
+
if (RETRY_STATUSES.has(res.status) && attempt < maxRetries && resHeaders['x-should-retry'] !== 'false') {
|
|
144
|
+
await sleep(retryAfterMs ?? this.backoff(attempt), req.signal);
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
throw toApiError(res.status, raw, resHeaders, retryAfterMs);
|
|
148
|
+
}
|
|
149
|
+
catch (err) {
|
|
150
|
+
if (err instanceof ReferalliError || req.signal?.aborted)
|
|
151
|
+
throw err;
|
|
152
|
+
if (timedOut()) {
|
|
153
|
+
if (attempt < maxRetries)
|
|
154
|
+
continue;
|
|
155
|
+
throw new ApiTimeoutError(`${method} ${req.path} timed out after ${timeout} ms`, { cause: err });
|
|
156
|
+
}
|
|
157
|
+
throw new ApiConnectionError(`${method} ${req.path}: could not read the response`, { cause: err });
|
|
158
|
+
}
|
|
159
|
+
finally {
|
|
160
|
+
cancel();
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
backoff(attempt) {
|
|
165
|
+
const base = Math.min(this.retryBaseDelay * 2 ** attempt, MAX_BACKOFF_MS);
|
|
166
|
+
return base * (0.75 + Math.random() * 0.25);
|
|
167
|
+
}
|
|
168
|
+
// --- Helpers kept from the hand-written SDK -----------------------------------------
|
|
169
|
+
/** Attribute a new customer to the partner who referred them: the key server-side call at signup. */
|
|
170
|
+
associate(body, options) {
|
|
171
|
+
return this.referrals.associate(body, { idempotencyKey: body.idempotencyKey, ...options });
|
|
172
|
+
}
|
|
173
|
+
/** Report a customer's product event (`activation` or a custom name) that can pay a bounty. */
|
|
174
|
+
trackEvent(body, options) {
|
|
175
|
+
return this.track.events({ type: 'event', ...body }, { idempotencyKey: body.idempotencyKey, ...options });
|
|
176
|
+
}
|
|
177
|
+
/** Report value facts (payments, credit, costs). Up to 500 per call, each idempotent by `externalId`. */
|
|
178
|
+
reportValueEvents(events, options) {
|
|
179
|
+
return this.value.events({ events }, options);
|
|
180
|
+
}
|
|
181
|
+
/** A payment, with the cash received and any store credit or discount that paid part of it. */
|
|
182
|
+
reportPayment(input, options) {
|
|
183
|
+
return this.reportValueEvents([{ ...input, kind: 'payment' }], options);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
function encodeQuery(query) {
|
|
187
|
+
if (!query)
|
|
188
|
+
return '';
|
|
189
|
+
const qs = new URLSearchParams();
|
|
190
|
+
for (const [k, v] of Object.entries(query)) {
|
|
191
|
+
if (v === undefined || v === null)
|
|
192
|
+
continue;
|
|
193
|
+
if (Array.isArray(v))
|
|
194
|
+
for (const x of v)
|
|
195
|
+
qs.append(k, String(x));
|
|
196
|
+
else
|
|
197
|
+
qs.append(k, v instanceof Date ? v.toISOString() : String(v));
|
|
198
|
+
}
|
|
199
|
+
const s = qs.toString();
|
|
200
|
+
return s ? `?${s}` : '';
|
|
201
|
+
}
|
|
202
|
+
function headerRecord(h) {
|
|
203
|
+
const out = {};
|
|
204
|
+
h.forEach((v, k) => (out[k.toLowerCase()] = v));
|
|
205
|
+
return out;
|
|
206
|
+
}
|
|
207
|
+
/** Milliseconds from `retry-after-ms` / `retry-after` (seconds or an HTTP date), capped at 60 s. */
|
|
208
|
+
function parseRetryAfter(h) {
|
|
209
|
+
const ms = Number(h['retry-after-ms']);
|
|
210
|
+
if (h['retry-after-ms'] && Number.isFinite(ms))
|
|
211
|
+
return Math.min(Math.max(0, ms), MAX_RETRY_AFTER_MS);
|
|
212
|
+
const v = h['retry-after'];
|
|
213
|
+
if (!v)
|
|
214
|
+
return null;
|
|
215
|
+
const secs = Number(v);
|
|
216
|
+
if (Number.isFinite(secs))
|
|
217
|
+
return Math.min(Math.max(0, secs * 1000), MAX_RETRY_AFTER_MS);
|
|
218
|
+
const at = Date.parse(v);
|
|
219
|
+
return Number.isNaN(at) ? null : Math.min(Math.max(0, at - Date.now()), MAX_RETRY_AFTER_MS);
|
|
220
|
+
}
|
|
221
|
+
function toApiError(status, raw, headers, retryAfterMs) {
|
|
222
|
+
let err = {};
|
|
223
|
+
try {
|
|
224
|
+
const parsed = JSON.parse(raw);
|
|
225
|
+
if (parsed && typeof parsed.error === 'object' && parsed.error)
|
|
226
|
+
err = parsed.error;
|
|
227
|
+
}
|
|
228
|
+
catch {
|
|
229
|
+
/* not JSON */
|
|
230
|
+
}
|
|
231
|
+
const code = typeof err.code === 'string' && err.code ? err.code : 'http_error';
|
|
232
|
+
const Cls = errorClasses[code] ?? ApiError;
|
|
233
|
+
return new Cls({
|
|
234
|
+
status,
|
|
235
|
+
code,
|
|
236
|
+
message: typeof err.message === 'string' ? err.message : raw.slice(0, 500) || `HTTP ${status}`,
|
|
237
|
+
requestId: (typeof err.requestId === 'string' ? err.requestId : undefined) ?? headers['x-request-id'] ?? null,
|
|
238
|
+
docsUrl: typeof err.docs_url === 'string' ? err.docs_url : null,
|
|
239
|
+
details: err.details,
|
|
240
|
+
retryAfter: retryAfterMs === null ? null : retryAfterMs / 1000,
|
|
241
|
+
headers,
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
/** An AbortSignal that fires on `timeout` ms or when `parent` aborts (no `AbortSignal.any`: Node 18). */
|
|
245
|
+
function withTimeout(timeout, parent) {
|
|
246
|
+
const controller = new AbortController();
|
|
247
|
+
let fired = false;
|
|
248
|
+
const timer = timeout > 0 && Number.isFinite(timeout) ? setTimeout(() => ((fired = true), controller.abort()), timeout) : undefined;
|
|
249
|
+
const onAbort = () => controller.abort(parent?.reason);
|
|
250
|
+
if (parent) {
|
|
251
|
+
if (parent.aborted)
|
|
252
|
+
controller.abort(parent.reason);
|
|
253
|
+
else
|
|
254
|
+
parent.addEventListener('abort', onAbort, { once: true });
|
|
255
|
+
}
|
|
256
|
+
return {
|
|
257
|
+
signal: controller.signal,
|
|
258
|
+
cancel: () => {
|
|
259
|
+
if (timer)
|
|
260
|
+
clearTimeout(timer);
|
|
261
|
+
parent?.removeEventListener('abort', onAbort);
|
|
262
|
+
},
|
|
263
|
+
timedOut: () => fired,
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
function sleep(ms, signal) {
|
|
267
|
+
return new Promise((resolve, reject) => {
|
|
268
|
+
if (signal?.aborted)
|
|
269
|
+
return reject(signal.reason);
|
|
270
|
+
const t = setTimeout(() => {
|
|
271
|
+
signal?.removeEventListener('abort', onAbort);
|
|
272
|
+
resolve();
|
|
273
|
+
}, ms);
|
|
274
|
+
const onAbort = () => {
|
|
275
|
+
clearTimeout(t);
|
|
276
|
+
reject(signal?.reason);
|
|
277
|
+
};
|
|
278
|
+
signal?.addEventListener('abort', onAbort, { once: true });
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
async function newIdempotencyKey() {
|
|
282
|
+
const c = globalThis.crypto;
|
|
283
|
+
if (c?.randomUUID)
|
|
284
|
+
return c.randomUUID();
|
|
285
|
+
let bytes = new Uint8Array(16);
|
|
286
|
+
if (c?.getRandomValues)
|
|
287
|
+
c.getRandomValues(bytes);
|
|
288
|
+
else {
|
|
289
|
+
const mod = 'node:crypto';
|
|
290
|
+
const nodeCrypto = (await import(/* webpackIgnore: true */ /* @vite-ignore */ mod));
|
|
291
|
+
bytes = new Uint8Array(nodeCrypto.randomBytes(16));
|
|
292
|
+
}
|
|
293
|
+
bytes[6] = (bytes[6] & 0x0f) | 0x40;
|
|
294
|
+
bytes[8] = (bytes[8] & 0x3f) | 0x80;
|
|
295
|
+
const hex = [...bytes].map((b) => b.toString(16).padStart(2, '0')).join('');
|
|
296
|
+
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
|
|
297
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ConsentSource } from '../port.js';
|
|
2
|
+
/**
|
|
3
|
+
* Cookiebot: `Cookiebot.consent.<category>`, `Cookiebot.hasResponse` and the
|
|
4
|
+
* `CookiebotOnConsentReady` / `OnAccept` / `OnDecline` window events.
|
|
5
|
+
* Category `marketing` by default; `consentID` is the evidence stamp.
|
|
6
|
+
*/
|
|
7
|
+
export declare const cookiebot: ConsentSource;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { browserCheck } from '../port.js';
|
|
2
|
+
/**
|
|
3
|
+
* Cookiebot: `Cookiebot.consent.<category>`, `Cookiebot.hasResponse` and the
|
|
4
|
+
* `CookiebotOnConsentReady` / `OnAccept` / `OnDecline` window events.
|
|
5
|
+
* Category `marketing` by default; `consentID` is the evidence stamp.
|
|
6
|
+
*/
|
|
7
|
+
export const cookiebot = {
|
|
8
|
+
id: 'cookiebot',
|
|
9
|
+
name: 'Cookiebot',
|
|
10
|
+
defaultCategory: 'marketing',
|
|
11
|
+
status: 'ga',
|
|
12
|
+
docsUrl: 'https://referalli.com/docs/tracking-consent#cookiebot',
|
|
13
|
+
vendorDocsUrl: 'https://www.cookiebot.com/en/developer/',
|
|
14
|
+
check: (cfg) => browserCheck(cookiebot, cfg),
|
|
15
|
+
factory: function cookiebotConsent(w) {
|
|
16
|
+
const EVENTS = ['CookiebotOnConsentReady', 'CookiebotOnAccept', 'CookiebotOnDecline', 'CookiebotOnLoad'];
|
|
17
|
+
return {
|
|
18
|
+
detect() {
|
|
19
|
+
if (w.Cookiebot)
|
|
20
|
+
return true;
|
|
21
|
+
const d = w.document;
|
|
22
|
+
return !!(d && typeof d.getElementById === 'function' && d.getElementById('Cookiebot'));
|
|
23
|
+
},
|
|
24
|
+
state(cfg) {
|
|
25
|
+
const cb = w.Cookiebot;
|
|
26
|
+
if (!cb || !cb.consent)
|
|
27
|
+
return 'unknown';
|
|
28
|
+
if (cb.consent[cfg.category || 'marketing'] === true)
|
|
29
|
+
return 'granted';
|
|
30
|
+
return cb.hasResponse ? 'denied' : 'unknown';
|
|
31
|
+
},
|
|
32
|
+
subscribe(_cfg, cb) {
|
|
33
|
+
for (let i = 0; i < EVENTS.length; i++)
|
|
34
|
+
w.addEventListener(EVENTS[i], cb);
|
|
35
|
+
return function () {
|
|
36
|
+
for (let i = 0; i < EVENTS.length; i++)
|
|
37
|
+
w.removeEventListener(EVENTS[i], cb);
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
evidence() {
|
|
41
|
+
const c = w.Cookiebot;
|
|
42
|
+
return c && c.consentID ? { stamp: String(c.consentID) } : {};
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ConsentSource } from '../port.js';
|
|
2
|
+
/**
|
|
3
|
+
* Cookie Munch: `window.CookieMunch.{hasResponse, consent}` and the
|
|
4
|
+
* `CookieMunchOnChange` window event (Cookie Munch guide R4: read the
|
|
5
|
+
* snapshot, never the event payload). Category `referrals`, falling back to
|
|
6
|
+
* `marketing` when the site declares no `referrals` category.
|
|
7
|
+
*/
|
|
8
|
+
export declare const cookiemunch: ConsentSource;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { browserCheck } from '../port.js';
|
|
2
|
+
/**
|
|
3
|
+
* Cookie Munch: `window.CookieMunch.{hasResponse, consent}` and the
|
|
4
|
+
* `CookieMunchOnChange` window event (Cookie Munch guide R4: read the
|
|
5
|
+
* snapshot, never the event payload). Category `referrals`, falling back to
|
|
6
|
+
* `marketing` when the site declares no `referrals` category.
|
|
7
|
+
*/
|
|
8
|
+
export const cookiemunch = {
|
|
9
|
+
id: 'cookiemunch',
|
|
10
|
+
name: 'Cookie Munch',
|
|
11
|
+
defaultCategory: 'referrals',
|
|
12
|
+
status: 'ga',
|
|
13
|
+
docsUrl: 'https://referalli.com/docs/tracking-consent#cookie-munch',
|
|
14
|
+
vendorDocsUrl: 'https://cookiemunch.net/docs',
|
|
15
|
+
check: (cfg) => browserCheck(cookiemunch, cfg),
|
|
16
|
+
factory: function cookiemunchConsent(w) {
|
|
17
|
+
return {
|
|
18
|
+
detect() {
|
|
19
|
+
if (w.CookieMunch)
|
|
20
|
+
return true;
|
|
21
|
+
const d = w.document;
|
|
22
|
+
return !!(d && typeof d.getElementById === 'function' && d.getElementById('CookieMunch'));
|
|
23
|
+
},
|
|
24
|
+
state(cfg) {
|
|
25
|
+
const cm = w.CookieMunch;
|
|
26
|
+
if (!cm || !cm.hasResponse)
|
|
27
|
+
return 'unknown';
|
|
28
|
+
const consent = cm.consent || {};
|
|
29
|
+
let v = consent[cfg.category || 'referrals'];
|
|
30
|
+
if (typeof v !== 'boolean' && !cfg.category)
|
|
31
|
+
v = consent.marketing;
|
|
32
|
+
return v === true ? 'granted' : 'denied';
|
|
33
|
+
},
|
|
34
|
+
subscribe(_cfg, cb) {
|
|
35
|
+
w.addEventListener('CookieMunchOnChange', cb);
|
|
36
|
+
w.addEventListener('CookieMunchOnLoad', cb);
|
|
37
|
+
return function () {
|
|
38
|
+
w.removeEventListener('CookieMunchOnChange', cb);
|
|
39
|
+
w.removeEventListener('CookieMunchOnLoad', cb);
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
evidence() {
|
|
43
|
+
const cm = w.CookieMunch;
|
|
44
|
+
let stamp = null;
|
|
45
|
+
if (cm && typeof cm.consentId === 'function')
|
|
46
|
+
stamp = cm.consentId();
|
|
47
|
+
else if (cm && cm.consent && cm.consent.stamp)
|
|
48
|
+
stamp = cm.consent.stamp;
|
|
49
|
+
return stamp ? { stamp: String(stamp) } : {};
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ConsentSource } from '../port.js';
|
|
2
|
+
/**
|
|
3
|
+
* The contract for any CMP we don't cover: define `window.referalliConsent()`
|
|
4
|
+
* returning `true` (granted), `false` (denied) or `null` (no decision yet),
|
|
5
|
+
* and dispatch a `referalli:consent` window event when it changes. The push
|
|
6
|
+
* path (`aff.consent(true|false)`) needs no adapter at all.
|
|
7
|
+
*/
|
|
8
|
+
export declare const custom: ConsentSource;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { browserCheck } from '../port.js';
|
|
2
|
+
/**
|
|
3
|
+
* The contract for any CMP we don't cover: define `window.referalliConsent()`
|
|
4
|
+
* returning `true` (granted), `false` (denied) or `null` (no decision yet),
|
|
5
|
+
* and dispatch a `referalli:consent` window event when it changes. The push
|
|
6
|
+
* path (`aff.consent(true|false)`) needs no adapter at all.
|
|
7
|
+
*/
|
|
8
|
+
export const custom = {
|
|
9
|
+
id: 'custom',
|
|
10
|
+
name: 'Custom (window.referalliConsent)',
|
|
11
|
+
defaultCategory: null,
|
|
12
|
+
status: 'ga',
|
|
13
|
+
docsUrl: 'https://referalli.com/docs/tracking-consent#custom',
|
|
14
|
+
vendorDocsUrl: 'https://referalli.com/docs/tracking-consent#custom',
|
|
15
|
+
check: (cfg) => browserCheck(custom, cfg),
|
|
16
|
+
factory: function customConsent(w) {
|
|
17
|
+
return {
|
|
18
|
+
detect() {
|
|
19
|
+
return typeof w.referalliConsent === 'function';
|
|
20
|
+
},
|
|
21
|
+
state() {
|
|
22
|
+
const v = w.referalliConsent();
|
|
23
|
+
return v === true ? 'granted' : v === false ? 'denied' : 'unknown';
|
|
24
|
+
},
|
|
25
|
+
subscribe(_cfg, cb) {
|
|
26
|
+
w.addEventListener('referalli:consent', cb);
|
|
27
|
+
return function () {
|
|
28
|
+
w.removeEventListener('referalli:consent', cb);
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
evidence() {
|
|
32
|
+
return {};
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ConsentSource } from '../port.js';
|
|
2
|
+
/**
|
|
3
|
+
* Didomi: `Didomi.getUserStatus()` (purposes and vendors, each with
|
|
4
|
+
* `global.enabled`), `didomiOnReady` and the `consent.changed` event via
|
|
5
|
+
* `didomiEventListeners`. `category` is a purpose id (default `cookies`), or a
|
|
6
|
+
* vendor id when it contains a colon (`c:referalli-…`) or is numeric (IAB).
|
|
7
|
+
* Not enabled counts as denied only once `shouldConsentBeCollected()` is false.
|
|
8
|
+
*/
|
|
9
|
+
export declare const didomi: ConsentSource;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { browserCheck } from '../port.js';
|
|
2
|
+
/**
|
|
3
|
+
* Didomi: `Didomi.getUserStatus()` (purposes and vendors, each with
|
|
4
|
+
* `global.enabled`), `didomiOnReady` and the `consent.changed` event via
|
|
5
|
+
* `didomiEventListeners`. `category` is a purpose id (default `cookies`), or a
|
|
6
|
+
* vendor id when it contains a colon (`c:referalli-…`) or is numeric (IAB).
|
|
7
|
+
* Not enabled counts as denied only once `shouldConsentBeCollected()` is false.
|
|
8
|
+
*/
|
|
9
|
+
export const didomi = {
|
|
10
|
+
id: 'didomi',
|
|
11
|
+
name: 'Didomi',
|
|
12
|
+
defaultCategory: 'cookies',
|
|
13
|
+
status: 'beta',
|
|
14
|
+
docsUrl: 'https://referalli.com/docs/tracking-consent#didomi',
|
|
15
|
+
vendorDocsUrl: 'https://developers.didomi.io/',
|
|
16
|
+
check: (cfg) => browserCheck(didomi, cfg),
|
|
17
|
+
factory: function didomiConsent(w) {
|
|
18
|
+
return {
|
|
19
|
+
detect() {
|
|
20
|
+
return !!(w.Didomi || w.didomiOnReady || w.didomiConfig);
|
|
21
|
+
},
|
|
22
|
+
state(cfg) {
|
|
23
|
+
const d = w.Didomi;
|
|
24
|
+
if (!d || typeof d.getUserStatus !== 'function')
|
|
25
|
+
return 'unknown';
|
|
26
|
+
if (typeof d.isConsentRequired === 'function' && d.isConsentRequired() === false)
|
|
27
|
+
return 'granted';
|
|
28
|
+
const cat = String(cfg.category || 'cookies');
|
|
29
|
+
const vendor = cat.indexOf(':') >= 0 || /^\d+$/.test(cat);
|
|
30
|
+
const st = d.getUserStatus() || {};
|
|
31
|
+
const set = vendor ? st.vendors : st.purposes;
|
|
32
|
+
const enabled = (set && set.global && set.global.enabled) || [];
|
|
33
|
+
for (let i = 0; i < enabled.length; i++)
|
|
34
|
+
if (String(enabled[i]) === cat)
|
|
35
|
+
return 'granted';
|
|
36
|
+
if (typeof d.shouldConsentBeCollected === 'function' && d.shouldConsentBeCollected())
|
|
37
|
+
return 'unknown';
|
|
38
|
+
return 'denied';
|
|
39
|
+
},
|
|
40
|
+
subscribe(_cfg, cb) {
|
|
41
|
+
let off = false;
|
|
42
|
+
const fire = function () {
|
|
43
|
+
if (!off)
|
|
44
|
+
cb();
|
|
45
|
+
};
|
|
46
|
+
w.didomiEventListeners = w.didomiEventListeners || [];
|
|
47
|
+
w.didomiEventListeners.push({ event: 'consent.changed', listener: fire });
|
|
48
|
+
w.didomiOnReady = w.didomiOnReady || [];
|
|
49
|
+
w.didomiOnReady.push(fire);
|
|
50
|
+
return function () {
|
|
51
|
+
off = true;
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
evidence() {
|
|
55
|
+
const d = w.Didomi;
|
|
56
|
+
const st = d && typeof d.getUserStatus === 'function' ? d.getUserStatus() || {} : {};
|
|
57
|
+
return {
|
|
58
|
+
...(st.user_id ? { stamp: String(st.user_id) } : {}),
|
|
59
|
+
...(typeof st.consent_string === 'string' && st.consent_string ? { tcString: st.consent_string } : {}),
|
|
60
|
+
};
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
},
|
|
64
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ConsentSource } from '../port.js';
|
|
2
|
+
/**
|
|
3
|
+
* Google Consent Mode v2: `gtag('consent', 'default' | 'update', {...})`
|
|
4
|
+
* commands in `window.dataLayer`, following `ad_storage` (or
|
|
5
|
+
* `analytics_storage` via `gcmSignal`). An `update` decides. A default of
|
|
6
|
+
* `granted` everywhere grants; a `denied` default (often region-scoped) with
|
|
7
|
+
* no update yet is no decision. gtag.js replaces `dataLayer.push`, so changes
|
|
8
|
+
* are picked up by watching the queue (every 250 ms).
|
|
9
|
+
*/
|
|
10
|
+
export declare const gcm: ConsentSource;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { browserCheck } from '../port.js';
|
|
2
|
+
/**
|
|
3
|
+
* Google Consent Mode v2: `gtag('consent', 'default' | 'update', {...})`
|
|
4
|
+
* commands in `window.dataLayer`, following `ad_storage` (or
|
|
5
|
+
* `analytics_storage` via `gcmSignal`). An `update` decides. A default of
|
|
6
|
+
* `granted` everywhere grants; a `denied` default (often region-scoped) with
|
|
7
|
+
* no update yet is no decision. gtag.js replaces `dataLayer.push`, so changes
|
|
8
|
+
* are picked up by watching the queue (every 250 ms).
|
|
9
|
+
*/
|
|
10
|
+
export const gcm = {
|
|
11
|
+
id: 'gcm',
|
|
12
|
+
name: 'Google Consent Mode v2',
|
|
13
|
+
defaultCategory: 'ad_storage',
|
|
14
|
+
status: 'ga',
|
|
15
|
+
docsUrl: 'https://referalli.com/docs/tracking-consent#google-consent-mode',
|
|
16
|
+
vendorDocsUrl: 'https://developers.google.com/tag-platform/security/guides/consent',
|
|
17
|
+
check: (cfg) => browserCheck(gcm, cfg),
|
|
18
|
+
factory: function gcmConsent(w) {
|
|
19
|
+
function cmd(e) {
|
|
20
|
+
return !!(e && typeof e === 'object' && e[0] === 'consent' && (e[1] === 'default' || e[1] === 'update') && e[2] && typeof e[2] === 'object');
|
|
21
|
+
}
|
|
22
|
+
function queue() {
|
|
23
|
+
const dl = w.dataLayer;
|
|
24
|
+
return dl && typeof dl.length === 'number' ? dl : [];
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
detect() {
|
|
28
|
+
const dl = queue();
|
|
29
|
+
for (let i = 0; i < dl.length; i++)
|
|
30
|
+
if (cmd(dl[i]))
|
|
31
|
+
return true;
|
|
32
|
+
return false;
|
|
33
|
+
},
|
|
34
|
+
state(cfg) {
|
|
35
|
+
const sig = cfg.gcmSignal || 'ad_storage';
|
|
36
|
+
const dl = queue();
|
|
37
|
+
let update = null;
|
|
38
|
+
let anyDenied = false;
|
|
39
|
+
let anyGranted = false;
|
|
40
|
+
for (let i = 0; i < dl.length; i++) {
|
|
41
|
+
const e = dl[i];
|
|
42
|
+
if (!cmd(e) || typeof e[2][sig] !== 'string')
|
|
43
|
+
continue;
|
|
44
|
+
if (e[1] === 'update')
|
|
45
|
+
update = e[2][sig];
|
|
46
|
+
else if (e[2][sig] === 'granted')
|
|
47
|
+
anyGranted = true;
|
|
48
|
+
else
|
|
49
|
+
anyDenied = true;
|
|
50
|
+
}
|
|
51
|
+
if (update !== null)
|
|
52
|
+
return update === 'granted' ? 'granted' : 'denied';
|
|
53
|
+
if (anyGranted && !anyDenied)
|
|
54
|
+
return 'granted';
|
|
55
|
+
return 'unknown';
|
|
56
|
+
},
|
|
57
|
+
subscribe(_cfg, cb) {
|
|
58
|
+
let n = queue().length;
|
|
59
|
+
const t = w.setInterval(function () {
|
|
60
|
+
const l = queue().length;
|
|
61
|
+
if (l !== n) {
|
|
62
|
+
n = l;
|
|
63
|
+
cb();
|
|
64
|
+
}
|
|
65
|
+
}, 250);
|
|
66
|
+
return function () {
|
|
67
|
+
w.clearInterval(t);
|
|
68
|
+
};
|
|
69
|
+
},
|
|
70
|
+
evidence(cfg) {
|
|
71
|
+
return { purposes: [cfg.gcmSignal || 'ad_storage'] };
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ConsentSource } from '../port.js';
|
|
2
|
+
/**
|
|
3
|
+
* IAB GPP: `__gpp('addEventListener', cb)` and `__gpp('ping', cb)`. Waits for
|
|
4
|
+
* `signalStatus: 'ready'`. The EU TCF section (id 2) follows the `tcf`
|
|
5
|
+
* rules (purpose 1 plus 7 or 9); US state sections are opt-out, so any
|
|
6
|
+
* `SaleOptOut`, `SharingOptOut` or `TargetedAdvertisingOptOut` of 1 (opted
|
|
7
|
+
* out) denies and anything else grants. Evidence: `gppString`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const gpp: ConsentSource;
|