@wix/web5-core 1.63.44 → 1.63.45
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/dist/cjs/index.js +4 -12
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/privacy/consentGate.js +32 -178
- package/dist/cjs/privacy/consentGate.js.map +1 -1
- package/dist/cjs/privacy/index.js +2 -9
- package/dist/cjs/privacy/index.js.map +1 -1
- package/dist/cjs/utils/analyticsEvents.js +16 -37
- package/dist/cjs/utils/analyticsEvents.js.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/privacy/consentGate.js +30 -173
- package/dist/esm/privacy/consentGate.js.map +1 -1
- package/dist/esm/privacy/index.js +1 -1
- package/dist/esm/privacy/index.js.map +1 -1
- package/dist/esm/utils/analyticsEvents.js +16 -36
- package/dist/esm/utils/analyticsEvents.js.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/privacy/consentGate.d.ts +28 -61
- package/dist/types/privacy/consentGate.d.ts.map +1 -1
- package/dist/types/privacy/index.d.ts +1 -1
- package/dist/types/privacy/index.d.ts.map +1 -1
- package/dist/types/utils/analyticsEvents.d.ts +0 -10
- package/dist/types/utils/analyticsEvents.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,70 +1,44 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The consent gate — DL #218.
|
|
2
|
+
* The consent gate — DL #218 (revised).
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* API is not on the page by default and has to be requested, and the fedops
|
|
8
|
-
* app-load pair fires inside that window. A boolean checked at each call site
|
|
9
|
-
* can only ever drop an event that is already in flight; the gate can hold it.
|
|
4
|
+
* Legal cleared analytics/BI transmission to need no consent gate, so the old
|
|
5
|
+
* `transmit()` + buffer machinery is gone. What analytics emitters used to route
|
|
6
|
+
* through the gate now goes straight to the wire.
|
|
10
7
|
*
|
|
11
|
-
*
|
|
8
|
+
* Analytics AND performance telemetry both go straight to the wire now, so there
|
|
9
|
+
* is nothing left to "transmit"-gate. What remains is the consent SIGNAL —
|
|
10
|
+
* snapshot, engagement, provider — behind a single predicate:
|
|
12
11
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* | denied | yes | still nothing |
|
|
12
|
+
* - `mayPersistToken()` — whether the visitor's OAuth token may be written to
|
|
13
|
+
* localStorage. Persisting the token persists a cross-visit visitor identity
|
|
14
|
+
* (its refresh token), which is the one thing consent still governs. Truth
|
|
15
|
+
* table: granted → yes; denied → never; unknown → only once the visitor
|
|
16
|
+
* engaged.
|
|
19
17
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* Engagement (`unlockOnUserAction`, fired when the visitor submits a prompt)
|
|
19
|
+
* resolves the `unknown` case — typing a question is a reason to remember this
|
|
20
|
+
* visitor for the session — but it never overrides a `denied`.
|
|
22
21
|
*/
|
|
23
|
-
import { type ConsentProvider, type
|
|
24
|
-
export interface GateView {
|
|
25
|
-
consent: ConsentSnapshot;
|
|
26
|
-
engaged: boolean;
|
|
27
|
-
}
|
|
22
|
+
import { type ConsentProvider, type ConsentSnapshot } from './types';
|
|
28
23
|
type Listener = () => void;
|
|
29
|
-
declare let droppedFromOverflow: number;
|
|
30
24
|
/**
|
|
31
|
-
* Whether
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* Allowed → sent now. Refused → dropped. Not yet known → held until an unlock
|
|
41
|
-
* settles it, or discarded with the page.
|
|
25
|
+
* Whether the visitor's OAuth token may be persisted to `localStorage`.
|
|
26
|
+
*
|
|
27
|
+
* Persisting the token persists a cross-visit visitor identity (the refresh
|
|
28
|
+
* token re-identifies the visitor on their next visit), so it answers to
|
|
29
|
+
* consent — the one thing that still does. Explicit consent wins in both
|
|
30
|
+
* directions; engagement resolves only the `unknown` case. The token still
|
|
31
|
+
* lives in memory for the session regardless — only the write to storage is
|
|
32
|
+
* gated.
|
|
42
33
|
*/
|
|
43
|
-
export declare const
|
|
34
|
+
export declare const mayPersistToken: () => boolean;
|
|
44
35
|
/**
|
|
45
|
-
* The visitor did something deliberate — submitted a prompt — so
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* This is the unlock that keeps web5 measurable at all: on a Shopify store
|
|
49
|
-
* with no privacy configuration the consent API never loads, consent stays
|
|
50
|
-
* `unknown` forever, and without this every store would report nothing.
|
|
51
|
-
*
|
|
52
|
-
* It unlocks **transmission only**. Persistent identity stays gated on real
|
|
53
|
-
* consent (see `mayPersistIdentity`) — typing a question is a reason to
|
|
54
|
-
* measure the session, not a reason to persist an identifier across visits.
|
|
55
|
-
* It also cannot override a `denied`.
|
|
36
|
+
* The visitor did something deliberate — submitted a prompt — so we may remember
|
|
37
|
+
* them for the session even though no CMP has answered. Unlocks the `unknown`
|
|
38
|
+
* case only; it cannot override a `denied`.
|
|
56
39
|
*/
|
|
57
40
|
export declare const unlockOnUserAction: () => void;
|
|
58
|
-
/** Whether the visitor has taken the deliberate action that unlocks the session. */
|
|
59
|
-
export declare const isUserEngaged: () => boolean;
|
|
60
|
-
/**
|
|
61
|
-
* Persistent, cross-visit storage of a visitor identifier requires real
|
|
62
|
-
* consent — engagement is deliberately not enough.
|
|
63
|
-
*/
|
|
64
|
-
export declare const mayPersistIdentity: () => boolean;
|
|
65
41
|
export declare const getConsentSnapshot: () => ConsentSnapshot;
|
|
66
|
-
/** Referentially stable between changes, for `useSyncExternalStore`. */
|
|
67
|
-
export declare const getGateView: () => GateView;
|
|
68
42
|
export declare const subscribeToConsent: (listener: Listener) => (() => void);
|
|
69
43
|
/**
|
|
70
44
|
* Install the host's provider. Reads its current state immediately, *then*
|
|
@@ -73,13 +47,6 @@ export declare const subscribeToConsent: (listener: Listener) => (() => void);
|
|
|
73
47
|
* subscribing alone would leave the gate permanently at `unknown`.
|
|
74
48
|
*/
|
|
75
49
|
export declare const installConsentProvider: (next: ConsentProvider) => void;
|
|
76
|
-
export declare const getInstalledProviderName: () => string | null;
|
|
77
|
-
export declare const setConsentBufferLimit: (limit: number) => void;
|
|
78
|
-
/** Diagnostics only — how much the gate is holding, and what it had to drop. */
|
|
79
|
-
export declare const getConsentGateStats: () => {
|
|
80
|
-
held: number;
|
|
81
|
-
droppedFromOverflow: number;
|
|
82
|
-
};
|
|
83
50
|
export declare const resetConsentGateForTests: () => void;
|
|
84
51
|
export {};
|
|
85
52
|
//# sourceMappingURL=consentGate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consentGate.d.ts","sourceRoot":"","sources":["../../../src/privacy/consentGate.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"consentGate.d.ts","sourceRoot":"","sources":["../../../src/privacy/consentGate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,eAAe,EACrB,MAAM,SAAS,CAAC;AAejB,KAAK,QAAQ,GAAG,MAAM,IAAI,CAAC;AAkB3B;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,QAAO,OASlC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,QAAO,IAOrC,CAAC;AAEF,eAAO,MAAM,kBAAkB,QAAO,eAA2B,CAAC;AAElE,eAAO,MAAM,kBAAkB,aAAc,QAAQ,KAAG,CAAC,MAAM,IAAI,CAKlE,CAAC;AAeF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,SAAU,eAAe,KAAG,IAM9D,CAAC;AAEF,eAAO,MAAM,wBAAwB,QAAO,IAM3C,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { type ConsentState, type ConsentPurpose, type GatedPurpose, type ConsentSnapshot, type ConsentProvider, UNKNOWN_CONSENT, } from './types';
|
|
2
|
-
export {
|
|
2
|
+
export { unlockOnUserAction, mayPersistToken, getConsentSnapshot, subscribeToConsent, installConsentProvider, resetConsentGateForTests, } from './consentGate';
|
|
3
3
|
export { detectConsentProvider, initConsentGate } from './detectProvider';
|
|
4
4
|
export { CONSENT_OVERRIDE_KEY, CONSENT_OVERRIDE_QUERY_PARAM, getConsentOverride, setConsentOverride, } from './consentOverride';
|
|
5
5
|
export { createShopifyConsentProvider, isShopifyHost, } from './providers/shopifyProvider';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/privacy/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,eAAe,GAChB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/privacy/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,eAAe,GAChB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAE1E,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,4BAA4B,EAC5B,aAAa,GACd,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,6BAA6B,EAC7B,cAAc,GACf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,KAAK,gBAAgB,EACrB,mBAAmB,EACnB,iCAAiC,EACjC,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,kCAAkC,CAAC"}
|
|
@@ -6,16 +6,6 @@ declare global {
|
|
|
6
6
|
OnetrustActiveGroups?: string;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
-
/**
|
|
10
|
-
* Whether analytics may go on the wire right now.
|
|
11
|
-
*
|
|
12
|
-
* DL #218: this used to read OneTrust directly and return `true` when OneTrust
|
|
13
|
-
* was absent, which on a Shopify storefront — where no host loads OneTrust —
|
|
14
|
-
* meant unconditional default-allow. It now defers to the consent gate, which
|
|
15
|
-
* reads whichever CMP the host actually has and, in the absence of any answer,
|
|
16
|
-
* holds until the visitor does something deliberate.
|
|
17
|
-
*/
|
|
18
|
-
export declare function hasAnalyticsConsent(): boolean;
|
|
19
9
|
/**
|
|
20
10
|
* Universal event dispatch: auto-detects GTM vs standalone gtag.js.
|
|
21
11
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyticsEvents.d.ts","sourceRoot":"","sources":["../../../src/utils/analyticsEvents.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"analyticsEvents.d.ts","sourceRoot":"","sources":["../../../src/utils/analyticsEvents.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;QACtC,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;QACpC,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7C,oBAAoB,CAAC,EAAE,MAAM,CAAC;KAC/B;CACF;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,SAAS,EAAE,MAAM,EACjB,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GACnC,IAAI,CAoBN;AAED,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,GAAG,MAAM,EAC3B,UAAU,EAAE,MAAM,GACjB,IAAI,CAKN;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,EAC1C,QAAQ,CAAC,EAAE,MAAM,GAChB,IAAI,CAMN;AAED,wBAAgB,SAAS,CACvB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,YAAY,CAAC,EAAE,MAAM,GACpB,IAAI,CAMN;AAED,wBAAgB,QAAQ,CACtB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,UAAU,GAAG,UAAU,GAChC,IAAI,CAMN;AAED,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,QAAQ,CAAC;AAExD,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,oBAAoB,EAC5B,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACf,IAAI,CAMN"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/web5-core",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.63.
|
|
4
|
+
"version": "1.63.45",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "tsachis",
|
|
7
7
|
"email": "tsachis@wix.com"
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
"wallaby": {
|
|
101
101
|
"autoDetect": true
|
|
102
102
|
},
|
|
103
|
-
"falconPackageHash": "
|
|
103
|
+
"falconPackageHash": "66d02251395d1958f52f669009563c0b5205283f3a5c75f958279223"
|
|
104
104
|
}
|