@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.
@@ -1,70 +1,44 @@
1
1
  /**
2
- * The consent gate — DL #218.
2
+ * The consent gate — DL #218 (revised).
3
3
  *
4
- * Every BI, telemetry and analytics emitter in web5 goes through `transmit()`
5
- * instead of calling its transport directly. The gate exists because the
6
- * consent signal resolves *after* the events that need it: Shopify's consent
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
- * Two independent unlocks, and they do not compose as a plain "either/or":
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
- * | consent | engaged | result |
14
- * |-----------|---------|---------------------------------|
15
- * | granted | either | transmit |
16
- * | unknown | no | hold in the buffer |
17
- * | unknown | yes | transmit, and flush what's held |
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
- * Denied outranks engaged. A visitor who refused analytics in the banner does
21
- * not re-enable tracking by typing a question.
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 ConsentPurpose, type ConsentSnapshot } from './types';
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 an event for `purpose` may go on the wire right now.
32
- *
33
- * `necessary` is always allowed. For everything else: explicit consent wins in
34
- * both directions, and engagement resolves only the `unknown` case.
35
- */
36
- export declare const mayTransmit: (purpose: ConsentPurpose) => boolean;
37
- /**
38
- * The single entry point for anything that would put a request on the wire.
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 transmit: (purpose: ConsentPurpose, send: () => void, label?: string) => void;
34
+ export declare const mayPersistToken: () => boolean;
44
35
  /**
45
- * The visitor did something deliberate — submitted a prompt — so the session
46
- * may be measured even though no CMP has answered.
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;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,eAAe,EAErB,MAAM,SAAS,CAAC;AA6BjB,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,eAAe,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,KAAK,QAAQ,GAAG,MAAM,IAAI,CAAC;AAQ3B,QAAA,IAAI,mBAAmB,QAAI,CAAC;AA4B5B;;;;;GAKG;AACH,eAAO,MAAM,WAAW,YAAa,cAAc,KAAG,OAYrD,CAAC;AAiDF;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,YACV,cAAc,QACjB,MAAM,IAAI,qBAEf,IAmBF,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,kBAAkB,QAAO,IAWrC,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,aAAa,QAAO,OAA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type ConsentState, type ConsentPurpose, type GatedPurpose, type ConsentSnapshot, type ConsentProvider, UNKNOWN_CONSENT, } from './types';
2
- export { type GateView, transmit, mayTransmit, unlockOnUserAction, isUserEngaged, mayPersistIdentity, getConsentSnapshot, getGateView, subscribeToConsent, installConsentProvider, getInstalledProviderName, setConsentBufferLimit, getConsentGateStats, resetConsentGateForTests, } from './consentGate';
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,KAAK,QAAQ,EACb,QAAQ,EACR,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,sBAAsB,EACtB,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,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"}
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
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AMN"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wix/web5-core",
3
3
  "license": "MIT",
4
- "version": "1.63.44",
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": "a8f9d2f5f65d9049ad197fd47d3e47c6852fe450be81c0e67de91d7e"
103
+ "falconPackageHash": "66d02251395d1958f52f669009563c0b5205283f3a5c75f958279223"
104
104
  }