@sylphx/sdk 0.32.33 → 0.32.35
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/README.md +76 -0
- package/dist/data/objects.d.ts +11 -0
- package/dist/data/objects.js +28 -0
- package/dist/data/objects.js.map +1 -0
- package/dist/events.d.ts +1 -1
- package/dist/ids.d.ts +5 -0
- package/dist/ids.js +1 -0
- package/dist/ids.js.map +1 -1
- package/dist/methods.js +18 -8
- package/dist/methods.js.map +1 -1
- package/dist/money.d.ts +80 -25
- package/dist/money.js +23 -16
- package/dist/money.js.map +1 -1
- package/dist/release.d.ts +71 -0
- package/dist/release.js +55 -0
- package/dist/release.js.map +1 -1
- package/dist/sign-in/contract.d.ts +2 -1
- package/dist/sign-in/contract.js +4 -2
- package/dist/sign-in/contract.js.map +1 -1
- package/dist/sign-in/form.d.ts +51 -1
- package/dist/sign-in/form.js +93 -26
- package/dist/sign-in/form.js.map +1 -1
- package/dist/signal/attribution.d.ts +29 -0
- package/dist/signal/attribution.js +131 -0
- package/dist/signal/attribution.js.map +1 -0
- package/dist/signal/binding.d.ts +56 -0
- package/dist/signal/binding.js +85 -0
- package/dist/signal/binding.js.map +1 -0
- package/dist/signal/browser.d.ts +34 -0
- package/dist/signal/browser.js +154 -0
- package/dist/signal/browser.js.map +1 -0
- package/dist/signal/consent.d.ts +22 -0
- package/dist/signal/consent.js +56 -0
- package/dist/signal/consent.js.map +1 -0
- package/dist/signal.d.ts +4 -0
- package/dist/signal.js +6 -0
- package/dist/signal.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// @generated by sylphx-gen. Do not edit.
|
|
2
|
+
import { cleanAttribution, cleanValue, parseAttributionCookies, signalAdFields, signalPageLocation, } from './attribution.js';
|
|
3
|
+
import { resolveEffectiveConsent } from './consent.js';
|
|
4
|
+
function identifier(value, name) {
|
|
5
|
+
if (value === undefined)
|
|
6
|
+
return undefined;
|
|
7
|
+
const result = cleanValue(value, 255);
|
|
8
|
+
if (!result)
|
|
9
|
+
throw new TypeError(`Invalid ${name}`);
|
|
10
|
+
return result;
|
|
11
|
+
}
|
|
12
|
+
/** Upsert the complete consent snapshot. Denial includes checkout identity but no tracking fields. */
|
|
13
|
+
export async function bindCheckoutAttribution(checkout, options) {
|
|
14
|
+
const checkoutSessionId = identifier(checkout.checkoutSessionId, 'checkout session ID');
|
|
15
|
+
const processorSessionId = identifier(checkout.processorSessionId, 'processor session ID');
|
|
16
|
+
const subscriptionId = identifier(checkout.subscriptionId, 'subscription ID');
|
|
17
|
+
if (!checkoutSessionId && !processorSessionId)
|
|
18
|
+
throw new TypeError('A checkout or processor session ID is required');
|
|
19
|
+
if (!options.apiKey ||
|
|
20
|
+
(typeof window !== 'undefined' && !options.apiKey.startsWith('sylphx_pk_'))) {
|
|
21
|
+
throw new TypeError('Attribution binding requires an API key (publishable in browsers)');
|
|
22
|
+
}
|
|
23
|
+
const endpoint = new URL(options.baseUrl ?? 'https://api.sylphx.com');
|
|
24
|
+
if (endpoint.protocol !== 'https:' ||
|
|
25
|
+
endpoint.username ||
|
|
26
|
+
endpoint.password ||
|
|
27
|
+
endpoint.pathname !== '/' ||
|
|
28
|
+
endpoint.search ||
|
|
29
|
+
endpoint.hash) {
|
|
30
|
+
throw new TypeError('Attribution binding requires an HTTPS API origin');
|
|
31
|
+
}
|
|
32
|
+
endpoint.pathname = '/v1/events/attribution_bindings';
|
|
33
|
+
const consent = resolveEffectiveConsent(options.privacy, options.headers);
|
|
34
|
+
const payload = {
|
|
35
|
+
...(checkoutSessionId
|
|
36
|
+
? { checkout_session_id: checkoutSessionId, processor_session_id: processorSessionId }
|
|
37
|
+
: { processor_session_id: processorSessionId }),
|
|
38
|
+
subscription_id: subscriptionId,
|
|
39
|
+
consent,
|
|
40
|
+
};
|
|
41
|
+
if (consent.analytics_storage === 'granted' &&
|
|
42
|
+
consent.ad_storage === 'granted' &&
|
|
43
|
+
consent.ad_user_data === 'granted') {
|
|
44
|
+
const cookieHeader = options.headers?.get('Cookie') ??
|
|
45
|
+
options.readCookies?.() ??
|
|
46
|
+
(typeof document !== 'undefined' ? document.cookie : '');
|
|
47
|
+
const cookies = parseAttributionCookies(cookieHeader, options.gaMeasurementId);
|
|
48
|
+
const touch = cleanAttribution(options.attribution);
|
|
49
|
+
Object.assign(payload, signalAdFields(touch, cookies), {
|
|
50
|
+
ga_client_id: cookies.gaClientId,
|
|
51
|
+
ga_session_id: cookies.gaSessionId,
|
|
52
|
+
page_location: signalPageLocation(options.pageLocation, touch),
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
const response = await (options.fetch ?? fetch)(endpoint, {
|
|
56
|
+
method: 'POST',
|
|
57
|
+
headers: { 'X-Sylphx-Key': options.apiKey, 'Content-Type': 'application/json' },
|
|
58
|
+
credentials: 'omit',
|
|
59
|
+
redirect: 'error',
|
|
60
|
+
referrerPolicy: 'no-referrer',
|
|
61
|
+
cache: 'no-store',
|
|
62
|
+
body: JSON.stringify(payload),
|
|
63
|
+
signal: options.signal ?? AbortSignal.timeout(5000),
|
|
64
|
+
});
|
|
65
|
+
if (response.status !== 200 && response.status !== 201) {
|
|
66
|
+
throw new Error(`Attribution binding failed: HTTP ${response.status}`);
|
|
67
|
+
}
|
|
68
|
+
const result = await response.json();
|
|
69
|
+
if (!result || typeof result !== 'object')
|
|
70
|
+
throw new Error('Invalid attribution binding response');
|
|
71
|
+
const body = result;
|
|
72
|
+
if (typeof body.binding_id !== 'string' ||
|
|
73
|
+
typeof body.expires_at !== 'string' ||
|
|
74
|
+
(body.checkout_session_id !== null && typeof body.checkout_session_id !== 'string') ||
|
|
75
|
+
(body.processor_session_id !== null && typeof body.processor_session_id !== 'string')) {
|
|
76
|
+
throw new Error('Invalid attribution binding response');
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
binding_id: body.binding_id,
|
|
80
|
+
checkout_session_id: body.checkout_session_id,
|
|
81
|
+
processor_session_id: body.processor_session_id,
|
|
82
|
+
expires_at: body.expires_at,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=binding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binding.js","sourceRoot":"","sources":["../../src/signal/binding.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,OAAO,EACN,gBAAgB,EAChB,UAAU,EACV,uBAAuB,EAEvB,cAAc,EACd,kBAAkB,GAClB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,uBAAuB,EAA0C,MAAM,cAAc,CAAA;AAkD9F,SAAS,UAAU,CAAC,KAAyB,EAAE,IAAY;IAC1D,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAA;IACzC,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IACrC,IAAI,CAAC,MAAM;QAAE,MAAM,IAAI,SAAS,CAAC,WAAW,IAAI,EAAE,CAAC,CAAA;IACnD,OAAO,MAAM,CAAA;AACd,CAAC;AAED,sGAAsG;AACtG,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC5C,QAA6B,EAC7B,OAA4B;IAE5B,MAAM,iBAAiB,GAAG,UAAU,CAAC,QAAQ,CAAC,iBAAiB,EAAE,qBAAqB,CAAC,CAAA;IACvF,MAAM,kBAAkB,GAAG,UAAU,CAAC,QAAQ,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,CAAA;IAC1F,MAAM,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAA;IAC7E,IAAI,CAAC,iBAAiB,IAAI,CAAC,kBAAkB;QAC5C,MAAM,IAAI,SAAS,CAAC,gDAAgD,CAAC,CAAA;IACtE,IACC,CAAC,OAAO,CAAC,MAAM;QACf,CAAC,OAAO,MAAM,KAAK,WAAW,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,EAC1E,C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AK,QAAQ;QACnC,CAAC,IAAI,CAAC,mBAAmB,KAAK,IAAI,IAAI,OAAO,IAAI,CAAC,mBAAmB,KAAK,QAAQ,CAAC;QACnF,CAAC,IAAI,CAAC,oBAAoB,KAAK,IAAI,IAAI,OAAO,IAAI,CAAC,oBAAoB,KAAK,QAAQ,CAAC,EACpF,CAAC;QACF,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAA;IACxD,CAAC;IACD,OAAO;QACN,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;QAC7C,oBAAoB,EAAE,IAAI,CAAC,oBAAoB;QAC/C,UAAU,EAAE,IAAI,CAAC,UAAU;KAC3B,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type SignalAttribution } from './attribution.js';
|
|
2
|
+
import { type BindCheckoutOptions, type CheckoutIdentifiers } from './binding.js';
|
|
3
|
+
import { type ConsentChoice, type SignalConsent } from './consent.js';
|
|
4
|
+
export interface SignalGoogleConsent {
|
|
5
|
+
/** Basic never loads the tag before grant; Advanced permits denied cookieless pings. Default: Basic. */
|
|
6
|
+
mode?: 'basic' | 'advanced';
|
|
7
|
+
/** Queue consent commands before any config/event commands. */
|
|
8
|
+
gtag: (command: 'default' | 'update', consent: SignalConsent) => void;
|
|
9
|
+
/** Load and configure the tenant's Google tag. Called at most once. */
|
|
10
|
+
load: () => void;
|
|
11
|
+
}
|
|
12
|
+
export interface SignalBrowserOptions {
|
|
13
|
+
/** An explicit region overrides the same-origin trace lookup. */
|
|
14
|
+
region?: string;
|
|
15
|
+
/** True if the server received Sec-GPC: 1. A false value never overrides navigator GPC. */
|
|
16
|
+
gpc?: boolean;
|
|
17
|
+
/** Scope consent and campaign storage for this site (same-origin localStorage). */
|
|
18
|
+
storageKey?: string;
|
|
19
|
+
google?: SignalGoogleConsent;
|
|
20
|
+
}
|
|
21
|
+
type BrowserBindOptions = Pick<BindCheckoutOptions, 'apiKey' | 'baseUrl' | 'fetch' | 'signal' | 'pageLocation' | 'gaMeasurementId'>;
|
|
22
|
+
/** Call once per page, before configuring any Google tags. Does not inject any scripts itself. */
|
|
23
|
+
export declare function createSignalBrowser(options?: SignalBrowserOptions): {
|
|
24
|
+
/** Resolves after the region hint is known or the trace lookup fails closed. */
|
|
25
|
+
ready: Promise<void>;
|
|
26
|
+
getConsent: () => SignalConsent;
|
|
27
|
+
/** Persist only an explicit user choice. Recheck GPC before collecting. */
|
|
28
|
+
setConsent(choice: ConsentChoice): void;
|
|
29
|
+
/** Call on SPA navigation to capture newly consented campaign parameters. */
|
|
30
|
+
capture: () => SignalAttribution;
|
|
31
|
+
bindCheckoutAttribution(checkout: CheckoutIdentifiers, binding: BrowserBindOptions): Promise<import("./binding.js").AttributionBinding>;
|
|
32
|
+
dispose(): void;
|
|
33
|
+
};
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
// @generated by sylphx-gen. Do not edit.
|
|
2
|
+
import { cleanAttribution, parseSignalAttribution } from './attribution.js';
|
|
3
|
+
import { bindCheckoutAttribution, } from './binding.js';
|
|
4
|
+
import { detectSignalRegion, hasGpc, normalizeRegion, resolveEffectiveConsent, } from './consent.js';
|
|
5
|
+
const touchLifetime = 30 * 24 * 60 * 60 * 1000;
|
|
6
|
+
/** Call once per page, before configuring any Google tags. Does not inject any scripts itself. */
|
|
7
|
+
export function createSignalBrowser(options = {}) {
|
|
8
|
+
const privacy = { region: normalizeRegion(options.region), gpc: options.gpc };
|
|
9
|
+
const choiceKey = `${options.storageKey ?? 'sylphx.signal.v1'}.consent`;
|
|
10
|
+
const touchKey = `${options.storageKey ?? 'sylphx.signal.v1'}.touch`;
|
|
11
|
+
const google = options.google;
|
|
12
|
+
let choiceOverride;
|
|
13
|
+
let current;
|
|
14
|
+
let regionPending = options.region === undefined && !hasGpc(privacy);
|
|
15
|
+
let loaded = false;
|
|
16
|
+
let disposed = false;
|
|
17
|
+
let previous;
|
|
18
|
+
function storedChoice() {
|
|
19
|
+
if (choiceOverride)
|
|
20
|
+
return choiceOverride;
|
|
21
|
+
try {
|
|
22
|
+
const value = window.localStorage.getItem(choiceKey);
|
|
23
|
+
return value === 'granted' || value === null ? (value ?? undefined) : 'denied';
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return 'denied';
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function sync() {
|
|
30
|
+
privacy.storedChoice = storedChoice();
|
|
31
|
+
const consent = resolveEffectiveConsent(privacy);
|
|
32
|
+
if (google) {
|
|
33
|
+
if (!previous)
|
|
34
|
+
google.gtag('default', consent);
|
|
35
|
+
else if (consent.analytics_storage !== previous.analytics_storage ||
|
|
36
|
+
consent.ad_personalization !== previous.ad_personalization) {
|
|
37
|
+
google.gtag('update', consent);
|
|
38
|
+
}
|
|
39
|
+
previous = consent;
|
|
40
|
+
if (!loaded &&
|
|
41
|
+
(consent.analytics_storage === 'granted' ||
|
|
42
|
+
(google.mode === 'advanced' &&
|
|
43
|
+
privacy.region !== undefined &&
|
|
44
|
+
privacy.storedChoice === undefined &&
|
|
45
|
+
!hasGpc(privacy)))) {
|
|
46
|
+
loaded = true;
|
|
47
|
+
google.load();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (consent.analytics_storage === 'denied' &&
|
|
51
|
+
(!regionPending || privacy.storedChoice === 'denied' || hasGpc(privacy))) {
|
|
52
|
+
current = undefined;
|
|
53
|
+
try {
|
|
54
|
+
window.localStorage.removeItem(touchKey);
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
/* Private mode or disabled storage. */
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return consent;
|
|
61
|
+
}
|
|
62
|
+
function capture() {
|
|
63
|
+
if (sync().analytics_storage !== 'granted')
|
|
64
|
+
return {};
|
|
65
|
+
const now = Date.now();
|
|
66
|
+
if (current && current.expiresAt <= now)
|
|
67
|
+
current = undefined;
|
|
68
|
+
try {
|
|
69
|
+
const saved = JSON.parse(window.localStorage.getItem(touchKey) ?? 'null');
|
|
70
|
+
if (saved &&
|
|
71
|
+
typeof saved === 'object' &&
|
|
72
|
+
'expiresAt' in saved &&
|
|
73
|
+
typeof saved.expiresAt === 'number' &&
|
|
74
|
+
saved.expiresAt > now &&
|
|
75
|
+
saved.expiresAt <= now + touchLifetime &&
|
|
76
|
+
'touch' in saved) {
|
|
77
|
+
current = { expiresAt: saved.expiresAt, touch: cleanAttribution(saved.touch) };
|
|
78
|
+
}
|
|
79
|
+
else if (saved)
|
|
80
|
+
window.localStorage.removeItem(touchKey);
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
/* Stay usable in memory if storage is unavailable. */
|
|
84
|
+
}
|
|
85
|
+
const latest = parseSignalAttribution(new URL(window.location.href), now);
|
|
86
|
+
if (Object.keys(latest).length) {
|
|
87
|
+
if (latest.fbclid && latest.fbclid === current?.touch.fbclid)
|
|
88
|
+
latest.capturedAt = current?.touch.capturedAt ?? now;
|
|
89
|
+
if (JSON.stringify(latest) !== JSON.stringify(current?.touch)) {
|
|
90
|
+
current = { expiresAt: now + touchLifetime, touch: latest };
|
|
91
|
+
try {
|
|
92
|
+
window.localStorage.setItem(touchKey, JSON.stringify(current));
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
/* In-memory only. */
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return { ...current?.touch };
|
|
100
|
+
}
|
|
101
|
+
capture();
|
|
102
|
+
const ready = regionPending
|
|
103
|
+
? detectSignalRegion().then((region) => {
|
|
104
|
+
if (disposed)
|
|
105
|
+
return;
|
|
106
|
+
privacy.region = region;
|
|
107
|
+
regionPending = false;
|
|
108
|
+
capture();
|
|
109
|
+
})
|
|
110
|
+
: Promise.resolve();
|
|
111
|
+
function onStorage(event) {
|
|
112
|
+
if (event.key === choiceKey || event.key === null) {
|
|
113
|
+
choiceOverride = undefined;
|
|
114
|
+
capture();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
window.addEventListener('storage', onStorage);
|
|
118
|
+
return {
|
|
119
|
+
/** Resolves after the region hint is known or the trace lookup fails closed. */
|
|
120
|
+
ready,
|
|
121
|
+
getConsent: sync,
|
|
122
|
+
/** Persist only an explicit user choice. Recheck GPC before collecting. */
|
|
123
|
+
setConsent(choice) {
|
|
124
|
+
if (choice !== 'granted' && choice !== 'denied')
|
|
125
|
+
throw new TypeError('Invalid consent choice');
|
|
126
|
+
choiceOverride = choice;
|
|
127
|
+
try {
|
|
128
|
+
window.localStorage.setItem(choiceKey, choice);
|
|
129
|
+
choiceOverride = undefined;
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
/* Keep the choice for this page. */
|
|
133
|
+
}
|
|
134
|
+
capture();
|
|
135
|
+
},
|
|
136
|
+
/** Call on SPA navigation to capture newly consented campaign parameters. */
|
|
137
|
+
capture,
|
|
138
|
+
async bindCheckoutAttribution(checkout, binding) {
|
|
139
|
+
await ready;
|
|
140
|
+
const attribution = capture();
|
|
141
|
+
return bindCheckoutAttribution(checkout, {
|
|
142
|
+
...binding,
|
|
143
|
+
privacy,
|
|
144
|
+
attribution,
|
|
145
|
+
readCookies: () => document.cookie,
|
|
146
|
+
});
|
|
147
|
+
},
|
|
148
|
+
dispose() {
|
|
149
|
+
disposed = true;
|
|
150
|
+
window.removeEventListener('storage', onStorage);
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=browser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/signal/browser.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAA0B,MAAM,kBAAkB,CAAA;AACnG,OAAO,EAEN,uBAAuB,GAEvB,MAAM,cAAc,CAAA;AACrB,OAAO,EAEN,kBAAkB,EAClB,M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SAAS,EAAE,MAAM,CAAC,CAAA;gBAC9C,cAAc,GAAG,SAAS,CAAA;YAC3B,CAAC;YAAC,MAAM,CAAC;gBACR,oCAAoC;YACrC,CAAC;YACD,OAAO,EAAE,CAAA;QACV,CAAC;QACD,6EAA6E;QAC7E,OAAO;QACP,KAAK,CAAC,uBAAuB,CAAC,QAA6B,EAAE,OAA2B;YACvF,MAAM,KAAK,CAAA;YACX,MAAM,WAAW,GAAG,OAAO,EAAE,CAAA;YAC7B,OAAO,uBAAuB,CAAC,QAAQ,EAAE;gBACxC,GAAG,OAAO;gBACV,OAAO;gBACP,WAAW;gBACX,WAAW,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM;aAClC,CAAC,CAAA;QACH,CAAC;QACD,OAAO;YACN,QAAQ,GAAG,IAAI,CAAA;YACf,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;QACjD,CAAC;KACD,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type ConsentChoice = 'granted' | 'denied';
|
|
2
|
+
/** The four Consent Mode v2 flags, also used verbatim by the Events API. */
|
|
3
|
+
export interface SignalConsent {
|
|
4
|
+
readonly analytics_storage: ConsentChoice;
|
|
5
|
+
readonly ad_storage: ConsentChoice;
|
|
6
|
+
readonly ad_user_data: ConsentChoice;
|
|
7
|
+
readonly ad_personalization: ConsentChoice;
|
|
8
|
+
}
|
|
9
|
+
export interface SignalPrivacy {
|
|
10
|
+
/** EU/EEA/UK/CH, a two-letter country code, or explicit ROW. Missing/invalid is strict. */
|
|
11
|
+
region?: string;
|
|
12
|
+
/** The user's explicit choice, not a boolean inferred from banner visibility. */
|
|
13
|
+
storedChoice?: ConsentChoice;
|
|
14
|
+
/** An additional opt-out signal, e.g. received from the server. */
|
|
15
|
+
gpc?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare function normalizeRegion(value: string | undefined): string | undefined;
|
|
18
|
+
export declare function hasGpc(privacy: SignalPrivacy, headers?: Headers): boolean;
|
|
19
|
+
/** One policy for Consent Mode, first-party collection, and checkout. */
|
|
20
|
+
export declare function resolveEffectiveConsent(privacy?: SignalPrivacy, headers?: Headers): SignalConsent;
|
|
21
|
+
/** A trace is first-party only. Keep loc, never the IP or other fields. */
|
|
22
|
+
export declare function detectSignalRegion(fetcher?: typeof fetch): Promise<string | undefined>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const optIn = new Set('AT BE BG HR CY CZ DK EE FI FR DE GR HU IE IT LV LT LU MT NL PL PT RO SK SI ES SE IS LI NO GB UK CH EU EEA'.split(' '));
|
|
2
|
+
const countries = new Intl.DisplayNames(['en'], { type: 'region', fallback: 'none' });
|
|
3
|
+
export function normalizeRegion(value) {
|
|
4
|
+
const region = value?.trim().toUpperCase();
|
|
5
|
+
if (!region)
|
|
6
|
+
return undefined;
|
|
7
|
+
if (region === 'ROW' || optIn.has(region))
|
|
8
|
+
return region;
|
|
9
|
+
if (!/^[A-Z]{2}$/.test(region) ||
|
|
10
|
+
['XX', 'ZZ', 'T1', 'QO', 'UN', 'EZ', 'XA', 'XB'].includes(region))
|
|
11
|
+
return undefined;
|
|
12
|
+
return countries.of(region) ? region : undefined;
|
|
13
|
+
}
|
|
14
|
+
export function hasGpc(privacy, headers) {
|
|
15
|
+
return (privacy.gpc === true ||
|
|
16
|
+
headers
|
|
17
|
+
?.get('Sec-GPC')
|
|
18
|
+
?.split(',')
|
|
19
|
+
.some((value) => value.trim() === '1') === true ||
|
|
20
|
+
(typeof navigator !== 'undefined' &&
|
|
21
|
+
navigator.globalPrivacyControl === true));
|
|
22
|
+
}
|
|
23
|
+
/** One policy for Consent Mode, first-party collection, and checkout. */
|
|
24
|
+
export function resolveEffectiveConsent(privacy = {}, headers) {
|
|
25
|
+
const region = normalizeRegion(privacy.region);
|
|
26
|
+
const granted = !hasGpc(privacy, headers) &&
|
|
27
|
+
(privacy.storedChoice === 'granted' ||
|
|
28
|
+
(privacy.storedChoice === undefined && region !== undefined && !optIn.has(region)));
|
|
29
|
+
const storage = granted ? 'granted' : 'denied';
|
|
30
|
+
return {
|
|
31
|
+
analytics_storage: storage,
|
|
32
|
+
ad_storage: storage,
|
|
33
|
+
ad_user_data: storage,
|
|
34
|
+
ad_personalization: storage,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/** A trace is first-party only. Keep loc, never the IP or other fields. */
|
|
38
|
+
export async function detectSignalRegion(fetcher = fetch) {
|
|
39
|
+
try {
|
|
40
|
+
const response = await fetcher('/cdn-cgi/trace', {
|
|
41
|
+
credentials: 'omit',
|
|
42
|
+
redirect: 'error',
|
|
43
|
+
cache: 'no-store',
|
|
44
|
+
referrerPolicy: 'no-referrer',
|
|
45
|
+
signal: AbortSignal.timeout(1500),
|
|
46
|
+
});
|
|
47
|
+
if (!response.ok)
|
|
48
|
+
return undefined;
|
|
49
|
+
const locations = (await response.text()).match(/^loc=[^\r\n]*$/gm);
|
|
50
|
+
return locations?.length === 1 ? normalizeRegion(locations[0]?.slice(4)) : undefined;
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=consent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consent.js","sourceRoot":"","sources":["../../src/signal/consent.ts"],"names":[],"mappings":"AAoBA,MAAM,KAAK,GAAG,IAAI,GAAG,CACpB,2GAA2G,CAAC,KAAK,CAChH,GAAG,CACH,CACD,CAAA;AACD,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAA;AAErF,MAAM,UAAU,eAAe,CAAC,KAAyB;IACxD,MAAM,MAAM,GAAG,KAAK,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,CAAA;IAC1C,IAAI,CAA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A;IACrF,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAA;IAC9C,OAAO;QACN,iBAAiB,EAAE,OAAO;QAC1B,UAAU,EAAE,OAAO;QACnB,YAAY,EAAE,OAAO;QACrB,kBAAkB,EAAE,OAAO;KAC3B,CAAA;AACF,CAAC;AAED,2EAA2E;AAC3E,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACvC,UAAwB,KAAK;IAE7B,IAAI,CAAC;QACJ,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,gBAAgB,EAAE;YAChD,WAAW,EAAE,MAAM;YACnB,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,UAAU;YACjB,cAAc,EAAE,aAAa;YAC7B,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC;SACjC,CAAC,CAAA;QACF,IAAI,CAAC,QAAQ,CAAC,EAAE;YAAE,OAAO,SAAS,CAAA;QAClC,MAAM,SAAS,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAA;QACnE,OAAO,SAAS,EAAE,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IACrF,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,SAAS,CAAA;IACjB,CAAC;AACF,CAAC"}
|
package/dist/signal.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { type AttributionCookies, parseAttributionCookies, parseSignalAttribution, type SignalAttribution, } from './signal/attribution.js';
|
|
2
|
+
export { type AttributionBinding, type AttributionBindingRequest, type BindCheckoutOptions, bindCheckoutAttribution, type CheckoutIdentifiers, } from './signal/binding.js';
|
|
3
|
+
export { createSignalBrowser, type SignalBrowserOptions, type SignalGoogleConsent, } from './signal/browser.js';
|
|
4
|
+
export { type ConsentChoice, detectSignalRegion, resolveEffectiveConsent, type SignalConsent, type SignalPrivacy, } from './signal/consent.js';
|
package/dist/signal.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// @generated by sylphx-gen. Do not edit.
|
|
2
|
+
export { parseAttributionCookies, parseSignalAttribution, } from './signal/attribution.js';
|
|
3
|
+
export { bindCheckoutAttribution, } from './signal/binding.js';
|
|
4
|
+
export { createSignalBrowser, } from './signal/browser.js';
|
|
5
|
+
export { detectSignalRegion, resolveEffectiveConsent, } from './signal/consent.js';
|
|
6
|
+
//# sourceMappingURL=signal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signal.js","sourceRoot":"","sources":["../src/signal.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,OAAO,EAEN,uBAAuB,EACvB,sBAAsB,GAEtB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAIN,uBAAuB,GAEvB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACN,mBAAmB,GAGnB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAEN,kBAAkB,EAClB,uBAAuB,GAGvB,MAAM,qBAAqB,CAAA"}
|