@uniformdev/context 19.190.1-alpha.3 → 19.190.1-alpha.7
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/api/api.d.mts +1 -1
- package/dist/api/api.d.ts +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +12 -3
- package/dist/index.js +12 -3
- package/dist/index.mjs +12 -3
- package/dist/{types-o4ZU_qKY.d.mts → types-gG_D1dEo.d.mts} +7 -0
- package/dist/{types-o4ZU_qKY.d.ts → types-gG_D1dEo.d.ts} +7 -0
- package/package.json +2 -2
package/dist/api/api.d.mts
CHANGED
package/dist/api/api.d.ts
CHANGED
package/dist/index.d.mts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { O as OutputSeverity, L as LogDrain, C as ContextPlugin, S as ScoreVector, A as AggregateDimension, T as TransitionDataStore, a as StorageCommands, V as VisitorData, b as TransitionDataStoreOptions, D as DecayFunction, c as CriteriaEvaluator, d as StringMatch, e as VariantMatchCriteria, f as LogMessage, g as DevToolsEvents } from './types-
|
2
|
-
export { _ as AggregateDimensionInput, a4 as BehaviorTag, h as CONTEXTUAL_EDITING_TEST_NAME, i as CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID, n as Context, l as ContextEvents, m as ContextInstance, j as ContextOptions, az as ContextState, aA as ContextStateUpdate, J as CriteriaEvaluatorParameters, I as CriteriaEvaluatorResult, an as DecayOptions, q as DevToolsActions, t as DevToolsDataEvent, r as DevToolsEvent, x as DevToolsForgetEvent, u as DevToolsHelloEvent, s as DevToolsLogEvent, w as DevToolsRawCommandsEvent, p as DevToolsState, o as DevToolsUiVersion, v as DevToolsUpdateEvent, a1 as DimensionMatch, X as EnrichmentCategory, au as EnrichmentData, ax as EventData, aB as GoalStateUpdate, at as Goals, H as GroupCriteriaEvaluator, ag as IdentifyCommand, F as LogMessageGroup, E as LogMessageSingle, y as LogMessages, G as ManifestInstance, N as ManifestV2, M as MessageCategory, B as MessageFunc, ab as ModifyScoreCommand, ac as ModifySessionScoreCommand, Y as NumberMatch, P as PersonalizationEvent, Q as PersonalizationManifest, av as PersonalizeControlVariant, a2 as PersonalizeOptions, aw as PersonalizeVariants, a6 as PersonalizedResult, a5 as PersonalizedVariant, ar as Quirks, al as SERVER_STATE_ID, ak as ServerToClientTransitionState, ad as SetConsentCommand, ah as SetControlGroupCommand, aa as SetGoalCommand, ai as SetPersonalizeVariantControlCommand, ae as SetQuirkCommand, af as SetTestCommand, z as Severity, R as Signal, W as SignalCriteria, U as SignalCriteriaGroup, K as SignalData, a9 as StorageCommand, Z as TestDefinition, k as TestEvent, $ as TestOptions, a8 as TestResult, a7 as TestVariant, as as Tests, am as TransitionDataStoreEvents, aq as VisitorDataStore, ap as VisitorDataStoreEvents, ao as VisitorDataStoreOptions, aj as areCommandsEqual, ay as emptyVisitorData, a3 as personalizeVariations, a0 as testVariations } from './types-
|
1
|
+
import { O as OutputSeverity, L as LogDrain, C as ContextPlugin, S as ScoreVector, A as AggregateDimension, T as TransitionDataStore, a as StorageCommands, V as VisitorData, b as TransitionDataStoreOptions, D as DecayFunction, c as CriteriaEvaluator, d as StringMatch, e as VariantMatchCriteria, f as LogMessage, g as DevToolsEvents } from './types-gG_D1dEo.mjs';
|
2
|
+
export { _ as AggregateDimensionInput, a4 as BehaviorTag, h as CONTEXTUAL_EDITING_TEST_NAME, i as CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID, n as Context, l as ContextEvents, m as ContextInstance, j as ContextOptions, az as ContextState, aA as ContextStateUpdate, J as CriteriaEvaluatorParameters, I as CriteriaEvaluatorResult, an as DecayOptions, q as DevToolsActions, t as DevToolsDataEvent, r as DevToolsEvent, x as DevToolsForgetEvent, u as DevToolsHelloEvent, s as DevToolsLogEvent, w as DevToolsRawCommandsEvent, p as DevToolsState, o as DevToolsUiVersion, v as DevToolsUpdateEvent, a1 as DimensionMatch, X as EnrichmentCategory, au as EnrichmentData, ax as EventData, aB as GoalStateUpdate, at as Goals, H as GroupCriteriaEvaluator, ag as IdentifyCommand, F as LogMessageGroup, E as LogMessageSingle, y as LogMessages, G as ManifestInstance, N as ManifestV2, M as MessageCategory, B as MessageFunc, ab as ModifyScoreCommand, ac as ModifySessionScoreCommand, Y as NumberMatch, P as PersonalizationEvent, Q as PersonalizationManifest, av as PersonalizeControlVariant, a2 as PersonalizeOptions, aw as PersonalizeVariants, a6 as PersonalizedResult, a5 as PersonalizedVariant, ar as Quirks, al as SERVER_STATE_ID, ak as ServerToClientTransitionState, ad as SetConsentCommand, ah as SetControlGroupCommand, aa as SetGoalCommand, ai as SetPersonalizeVariantControlCommand, ae as SetQuirkCommand, af as SetTestCommand, z as Severity, R as Signal, W as SignalCriteria, U as SignalCriteriaGroup, K as SignalData, a9 as StorageCommand, Z as TestDefinition, k as TestEvent, $ as TestOptions, a8 as TestResult, a7 as TestVariant, as as Tests, am as TransitionDataStoreEvents, aq as VisitorDataStore, ap as VisitorDataStoreEvents, ao as VisitorDataStoreOptions, aj as areCommandsEqual, ay as emptyVisitorData, a3 as personalizeVariations, a0 as testVariations } from './types-gG_D1dEo.mjs';
|
3
3
|
import Cookies from 'js-cookie';
|
4
4
|
import 'mitt';
|
5
5
|
|
package/dist/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { O as OutputSeverity, L as LogDrain, C as ContextPlugin, S as ScoreVector, A as AggregateDimension, T as TransitionDataStore, a as StorageCommands, V as VisitorData, b as TransitionDataStoreOptions, D as DecayFunction, c as CriteriaEvaluator, d as StringMatch, e as VariantMatchCriteria, f as LogMessage, g as DevToolsEvents } from './types-
|
2
|
-
export { _ as AggregateDimensionInput, a4 as BehaviorTag, h as CONTEXTUAL_EDITING_TEST_NAME, i as CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID, n as Context, l as ContextEvents, m as ContextInstance, j as ContextOptions, az as ContextState, aA as ContextStateUpdate, J as CriteriaEvaluatorParameters, I as CriteriaEvaluatorResult, an as DecayOptions, q as DevToolsActions, t as DevToolsDataEvent, r as DevToolsEvent, x as DevToolsForgetEvent, u as DevToolsHelloEvent, s as DevToolsLogEvent, w as DevToolsRawCommandsEvent, p as DevToolsState, o as DevToolsUiVersion, v as DevToolsUpdateEvent, a1 as DimensionMatch, X as EnrichmentCategory, au as EnrichmentData, ax as EventData, aB as GoalStateUpdate, at as Goals, H as GroupCriteriaEvaluator, ag as IdentifyCommand, F as LogMessageGroup, E as LogMessageSingle, y as LogMessages, G as ManifestInstance, N as ManifestV2, M as MessageCategory, B as MessageFunc, ab as ModifyScoreCommand, ac as ModifySessionScoreCommand, Y as NumberMatch, P as PersonalizationEvent, Q as PersonalizationManifest, av as PersonalizeControlVariant, a2 as PersonalizeOptions, aw as PersonalizeVariants, a6 as PersonalizedResult, a5 as PersonalizedVariant, ar as Quirks, al as SERVER_STATE_ID, ak as ServerToClientTransitionState, ad as SetConsentCommand, ah as SetControlGroupCommand, aa as SetGoalCommand, ai as SetPersonalizeVariantControlCommand, ae as SetQuirkCommand, af as SetTestCommand, z as Severity, R as Signal, W as SignalCriteria, U as SignalCriteriaGroup, K as SignalData, a9 as StorageCommand, Z as TestDefinition, k as TestEvent, $ as TestOptions, a8 as TestResult, a7 as TestVariant, as as Tests, am as TransitionDataStoreEvents, aq as VisitorDataStore, ap as VisitorDataStoreEvents, ao as VisitorDataStoreOptions, aj as areCommandsEqual, ay as emptyVisitorData, a3 as personalizeVariations, a0 as testVariations } from './types-
|
1
|
+
import { O as OutputSeverity, L as LogDrain, C as ContextPlugin, S as ScoreVector, A as AggregateDimension, T as TransitionDataStore, a as StorageCommands, V as VisitorData, b as TransitionDataStoreOptions, D as DecayFunction, c as CriteriaEvaluator, d as StringMatch, e as VariantMatchCriteria, f as LogMessage, g as DevToolsEvents } from './types-gG_D1dEo.js';
|
2
|
+
export { _ as AggregateDimensionInput, a4 as BehaviorTag, h as CONTEXTUAL_EDITING_TEST_NAME, i as CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID, n as Context, l as ContextEvents, m as ContextInstance, j as ContextOptions, az as ContextState, aA as ContextStateUpdate, J as CriteriaEvaluatorParameters, I as CriteriaEvaluatorResult, an as DecayOptions, q as DevToolsActions, t as DevToolsDataEvent, r as DevToolsEvent, x as DevToolsForgetEvent, u as DevToolsHelloEvent, s as DevToolsLogEvent, w as DevToolsRawCommandsEvent, p as DevToolsState, o as DevToolsUiVersion, v as DevToolsUpdateEvent, a1 as DimensionMatch, X as EnrichmentCategory, au as EnrichmentData, ax as EventData, aB as GoalStateUpdate, at as Goals, H as GroupCriteriaEvaluator, ag as IdentifyCommand, F as LogMessageGroup, E as LogMessageSingle, y as LogMessages, G as ManifestInstance, N as ManifestV2, M as MessageCategory, B as MessageFunc, ab as ModifyScoreCommand, ac as ModifySessionScoreCommand, Y as NumberMatch, P as PersonalizationEvent, Q as PersonalizationManifest, av as PersonalizeControlVariant, a2 as PersonalizeOptions, aw as PersonalizeVariants, a6 as PersonalizedResult, a5 as PersonalizedVariant, ar as Quirks, al as SERVER_STATE_ID, ak as ServerToClientTransitionState, ad as SetConsentCommand, ah as SetControlGroupCommand, aa as SetGoalCommand, ai as SetPersonalizeVariantControlCommand, ae as SetQuirkCommand, af as SetTestCommand, z as Severity, R as Signal, W as SignalCriteria, U as SignalCriteriaGroup, K as SignalData, a9 as StorageCommand, Z as TestDefinition, k as TestEvent, $ as TestOptions, a8 as TestResult, a7 as TestVariant, as as Tests, am as TransitionDataStoreEvents, aq as VisitorDataStore, ap as VisitorDataStoreEvents, ao as VisitorDataStoreOptions, aj as areCommandsEqual, ay as emptyVisitorData, a3 as personalizeVariations, a0 as testVariations } from './types-gG_D1dEo.js';
|
3
3
|
import Cookies from 'js-cookie';
|
4
4
|
import 'mitt';
|
5
5
|
|
package/dist/index.esm.js
CHANGED
@@ -653,9 +653,11 @@ function personalizeVariations({
|
|
653
653
|
try {
|
654
654
|
const variantMatches = [];
|
655
655
|
const defaultVariants = [];
|
656
|
+
const needsConsent = context.requireConsentForPersonalization;
|
657
|
+
const canEvaluate = !needsConsent || context.storage.data.consent;
|
656
658
|
for (const variant of variations) {
|
657
659
|
if ((_a = variant.pz) == null ? void 0 : _a.crit.length) {
|
658
|
-
if (variantMatches.length !== take && evaluateVariantMatch(variant.id, variant.pz, context.scores, onLogMessage)) {
|
660
|
+
if (canEvaluate && variantMatches.length !== take && evaluateVariantMatch(variant.id, variant.pz, context.scores, onLogMessage)) {
|
659
661
|
variantMatches.push(variant);
|
660
662
|
}
|
661
663
|
} else {
|
@@ -1213,7 +1215,8 @@ var LocalStorage = class {
|
|
1213
1215
|
this.partitionKey = partitionKey;
|
1214
1216
|
__privateAdd(this, _LocalStorage_instances);
|
1215
1217
|
__publicField(this, "inMemoryFallback", {});
|
1216
|
-
|
1218
|
+
// deno implements localStorage in netlify edge workers, must also check if document is present.
|
1219
|
+
__publicField(this, "hasLocalStorageObject", typeof document !== "undefined" && typeof localStorage !== "undefined");
|
1217
1220
|
}
|
1218
1221
|
get(key) {
|
1219
1222
|
const keyValue = __privateMethod(this, _LocalStorage_instances, key_fn).call(this, key);
|
@@ -1467,7 +1470,7 @@ import { dequal as dequal5 } from "dequal/lite";
|
|
1467
1470
|
import mitt3 from "mitt";
|
1468
1471
|
var CONTEXTUAL_EDITING_TEST_NAME = "contextual_editing_test";
|
1469
1472
|
var CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID = "contextual_editing_test_selected_variant";
|
1470
|
-
var _serverTransitionState, _scores, _state, _pzCache, _plugins, _commands, _mitt3, _Context_instances, emitTest_fn, updateGoals_fn, updateComputedScores_fn, calculateScores_fn;
|
1473
|
+
var _serverTransitionState, _scores, _state, _pzCache, _plugins, _commands, _requireConsentForPersonalization, _mitt3, _Context_instances, emitTest_fn, updateGoals_fn, updateComputedScores_fn, calculateScores_fn;
|
1471
1474
|
var Context = class {
|
1472
1475
|
constructor(options) {
|
1473
1476
|
__privateAdd(this, _Context_instances);
|
@@ -1478,6 +1481,7 @@ var Context = class {
|
|
1478
1481
|
__privateAdd(this, _pzCache, {});
|
1479
1482
|
__privateAdd(this, _plugins);
|
1480
1483
|
__privateAdd(this, _commands);
|
1484
|
+
__privateAdd(this, _requireConsentForPersonalization);
|
1481
1485
|
__privateAdd(this, _mitt3, mitt3());
|
1482
1486
|
/**
|
1483
1487
|
* Subscribe to events
|
@@ -1491,6 +1495,7 @@ var Context = class {
|
|
1491
1495
|
const { manifest, ...storageOptions } = options;
|
1492
1496
|
__privateSet(this, _state, {});
|
1493
1497
|
__privateSet(this, _plugins, options.plugins);
|
1498
|
+
__privateSet(this, _requireConsentForPersonalization, options.requireConsentForPersonalization);
|
1494
1499
|
if (typeof options.transitionStore !== "undefined") {
|
1495
1500
|
__privateSet(this, _commands, []);
|
1496
1501
|
}
|
@@ -1567,6 +1572,9 @@ var Context = class {
|
|
1567
1572
|
var _a, _b;
|
1568
1573
|
return (_b = (_a = __privateGet(this, _serverTransitionState)) == null ? void 0 : _a.quirks) != null ? _b : this.storage.data.quirks;
|
1569
1574
|
}
|
1575
|
+
get requireConsentForPersonalization() {
|
1576
|
+
return __privateGet(this, _requireConsentForPersonalization);
|
1577
|
+
}
|
1570
1578
|
/**
|
1571
1579
|
* Updates the Context with new data of any sort, such as
|
1572
1580
|
* new URLs, cookies, quirks, and enrichments.
|
@@ -1864,6 +1872,7 @@ _state = new WeakMap();
|
|
1864
1872
|
_pzCache = new WeakMap();
|
1865
1873
|
_plugins = new WeakMap();
|
1866
1874
|
_commands = new WeakMap();
|
1875
|
+
_requireConsentForPersonalization = new WeakMap();
|
1867
1876
|
_mitt3 = new WeakMap();
|
1868
1877
|
_Context_instances = new WeakSet();
|
1869
1878
|
emitTest_fn = function(event) {
|
package/dist/index.js
CHANGED
@@ -737,9 +737,11 @@ function personalizeVariations({
|
|
737
737
|
try {
|
738
738
|
const variantMatches = [];
|
739
739
|
const defaultVariants = [];
|
740
|
+
const needsConsent = context.requireConsentForPersonalization;
|
741
|
+
const canEvaluate = !needsConsent || context.storage.data.consent;
|
740
742
|
for (const variant of variations) {
|
741
743
|
if ((_a = variant.pz) == null ? void 0 : _a.crit.length) {
|
742
|
-
if (variantMatches.length !== take && evaluateVariantMatch(variant.id, variant.pz, context.scores, onLogMessage)) {
|
744
|
+
if (canEvaluate && variantMatches.length !== take && evaluateVariantMatch(variant.id, variant.pz, context.scores, onLogMessage)) {
|
743
745
|
variantMatches.push(variant);
|
744
746
|
}
|
745
747
|
} else {
|
@@ -1297,7 +1299,8 @@ var LocalStorage = class {
|
|
1297
1299
|
this.partitionKey = partitionKey;
|
1298
1300
|
__privateAdd(this, _LocalStorage_instances);
|
1299
1301
|
__publicField(this, "inMemoryFallback", {});
|
1300
|
-
|
1302
|
+
// deno implements localStorage in netlify edge workers, must also check if document is present.
|
1303
|
+
__publicField(this, "hasLocalStorageObject", typeof document !== "undefined" && typeof localStorage !== "undefined");
|
1301
1304
|
}
|
1302
1305
|
get(key) {
|
1303
1306
|
const keyValue = __privateMethod(this, _LocalStorage_instances, key_fn).call(this, key);
|
@@ -1551,7 +1554,7 @@ var import_lite5 = require("dequal/lite");
|
|
1551
1554
|
var import_mitt3 = __toESM(require("mitt"));
|
1552
1555
|
var CONTEXTUAL_EDITING_TEST_NAME = "contextual_editing_test";
|
1553
1556
|
var CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID = "contextual_editing_test_selected_variant";
|
1554
|
-
var _serverTransitionState, _scores, _state, _pzCache, _plugins, _commands, _mitt3, _Context_instances, emitTest_fn, updateGoals_fn, updateComputedScores_fn, calculateScores_fn;
|
1557
|
+
var _serverTransitionState, _scores, _state, _pzCache, _plugins, _commands, _requireConsentForPersonalization, _mitt3, _Context_instances, emitTest_fn, updateGoals_fn, updateComputedScores_fn, calculateScores_fn;
|
1555
1558
|
var Context = class {
|
1556
1559
|
constructor(options) {
|
1557
1560
|
__privateAdd(this, _Context_instances);
|
@@ -1562,6 +1565,7 @@ var Context = class {
|
|
1562
1565
|
__privateAdd(this, _pzCache, {});
|
1563
1566
|
__privateAdd(this, _plugins);
|
1564
1567
|
__privateAdd(this, _commands);
|
1568
|
+
__privateAdd(this, _requireConsentForPersonalization);
|
1565
1569
|
__privateAdd(this, _mitt3, (0, import_mitt3.default)());
|
1566
1570
|
/**
|
1567
1571
|
* Subscribe to events
|
@@ -1575,6 +1579,7 @@ var Context = class {
|
|
1575
1579
|
const { manifest, ...storageOptions } = options;
|
1576
1580
|
__privateSet(this, _state, {});
|
1577
1581
|
__privateSet(this, _plugins, options.plugins);
|
1582
|
+
__privateSet(this, _requireConsentForPersonalization, options.requireConsentForPersonalization);
|
1578
1583
|
if (typeof options.transitionStore !== "undefined") {
|
1579
1584
|
__privateSet(this, _commands, []);
|
1580
1585
|
}
|
@@ -1651,6 +1656,9 @@ var Context = class {
|
|
1651
1656
|
var _a, _b;
|
1652
1657
|
return (_b = (_a = __privateGet(this, _serverTransitionState)) == null ? void 0 : _a.quirks) != null ? _b : this.storage.data.quirks;
|
1653
1658
|
}
|
1659
|
+
get requireConsentForPersonalization() {
|
1660
|
+
return __privateGet(this, _requireConsentForPersonalization);
|
1661
|
+
}
|
1654
1662
|
/**
|
1655
1663
|
* Updates the Context with new data of any sort, such as
|
1656
1664
|
* new URLs, cookies, quirks, and enrichments.
|
@@ -1948,6 +1956,7 @@ _state = new WeakMap();
|
|
1948
1956
|
_pzCache = new WeakMap();
|
1949
1957
|
_plugins = new WeakMap();
|
1950
1958
|
_commands = new WeakMap();
|
1959
|
+
_requireConsentForPersonalization = new WeakMap();
|
1951
1960
|
_mitt3 = new WeakMap();
|
1952
1961
|
_Context_instances = new WeakSet();
|
1953
1962
|
emitTest_fn = function(event) {
|
package/dist/index.mjs
CHANGED
@@ -653,9 +653,11 @@ function personalizeVariations({
|
|
653
653
|
try {
|
654
654
|
const variantMatches = [];
|
655
655
|
const defaultVariants = [];
|
656
|
+
const needsConsent = context.requireConsentForPersonalization;
|
657
|
+
const canEvaluate = !needsConsent || context.storage.data.consent;
|
656
658
|
for (const variant of variations) {
|
657
659
|
if ((_a = variant.pz) == null ? void 0 : _a.crit.length) {
|
658
|
-
if (variantMatches.length !== take && evaluateVariantMatch(variant.id, variant.pz, context.scores, onLogMessage)) {
|
660
|
+
if (canEvaluate && variantMatches.length !== take && evaluateVariantMatch(variant.id, variant.pz, context.scores, onLogMessage)) {
|
659
661
|
variantMatches.push(variant);
|
660
662
|
}
|
661
663
|
} else {
|
@@ -1213,7 +1215,8 @@ var LocalStorage = class {
|
|
1213
1215
|
this.partitionKey = partitionKey;
|
1214
1216
|
__privateAdd(this, _LocalStorage_instances);
|
1215
1217
|
__publicField(this, "inMemoryFallback", {});
|
1216
|
-
|
1218
|
+
// deno implements localStorage in netlify edge workers, must also check if document is present.
|
1219
|
+
__publicField(this, "hasLocalStorageObject", typeof document !== "undefined" && typeof localStorage !== "undefined");
|
1217
1220
|
}
|
1218
1221
|
get(key) {
|
1219
1222
|
const keyValue = __privateMethod(this, _LocalStorage_instances, key_fn).call(this, key);
|
@@ -1467,7 +1470,7 @@ import { dequal as dequal5 } from "dequal/lite";
|
|
1467
1470
|
import mitt3 from "mitt";
|
1468
1471
|
var CONTEXTUAL_EDITING_TEST_NAME = "contextual_editing_test";
|
1469
1472
|
var CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID = "contextual_editing_test_selected_variant";
|
1470
|
-
var _serverTransitionState, _scores, _state, _pzCache, _plugins, _commands, _mitt3, _Context_instances, emitTest_fn, updateGoals_fn, updateComputedScores_fn, calculateScores_fn;
|
1473
|
+
var _serverTransitionState, _scores, _state, _pzCache, _plugins, _commands, _requireConsentForPersonalization, _mitt3, _Context_instances, emitTest_fn, updateGoals_fn, updateComputedScores_fn, calculateScores_fn;
|
1471
1474
|
var Context = class {
|
1472
1475
|
constructor(options) {
|
1473
1476
|
__privateAdd(this, _Context_instances);
|
@@ -1478,6 +1481,7 @@ var Context = class {
|
|
1478
1481
|
__privateAdd(this, _pzCache, {});
|
1479
1482
|
__privateAdd(this, _plugins);
|
1480
1483
|
__privateAdd(this, _commands);
|
1484
|
+
__privateAdd(this, _requireConsentForPersonalization);
|
1481
1485
|
__privateAdd(this, _mitt3, mitt3());
|
1482
1486
|
/**
|
1483
1487
|
* Subscribe to events
|
@@ -1491,6 +1495,7 @@ var Context = class {
|
|
1491
1495
|
const { manifest, ...storageOptions } = options;
|
1492
1496
|
__privateSet(this, _state, {});
|
1493
1497
|
__privateSet(this, _plugins, options.plugins);
|
1498
|
+
__privateSet(this, _requireConsentForPersonalization, options.requireConsentForPersonalization);
|
1494
1499
|
if (typeof options.transitionStore !== "undefined") {
|
1495
1500
|
__privateSet(this, _commands, []);
|
1496
1501
|
}
|
@@ -1567,6 +1572,9 @@ var Context = class {
|
|
1567
1572
|
var _a, _b;
|
1568
1573
|
return (_b = (_a = __privateGet(this, _serverTransitionState)) == null ? void 0 : _a.quirks) != null ? _b : this.storage.data.quirks;
|
1569
1574
|
}
|
1575
|
+
get requireConsentForPersonalization() {
|
1576
|
+
return __privateGet(this, _requireConsentForPersonalization);
|
1577
|
+
}
|
1570
1578
|
/**
|
1571
1579
|
* Updates the Context with new data of any sort, such as
|
1572
1580
|
* new URLs, cookies, quirks, and enrichments.
|
@@ -1864,6 +1872,7 @@ _state = new WeakMap();
|
|
1864
1872
|
_pzCache = new WeakMap();
|
1865
1873
|
_plugins = new WeakMap();
|
1866
1874
|
_commands = new WeakMap();
|
1875
|
+
_requireConsentForPersonalization = new WeakMap();
|
1867
1876
|
_mitt3 = new WeakMap();
|
1868
1877
|
_Context_instances = new WeakSet();
|
1869
1878
|
emitTest_fn = function(event) {
|
@@ -1021,6 +1021,12 @@ type ContextOptions = {
|
|
1021
1021
|
* only - don't call scores, update, etc on it. If you need to call these methods immediately, attach your plugin after initialisation.
|
1022
1022
|
*/
|
1023
1023
|
plugins?: Array<ContextPlugin>;
|
1024
|
+
/**
|
1025
|
+
* Only show personalizations if the visitor has given consent.
|
1026
|
+
* `false (default)`: personalization can run in memory without visitor granting storage consent
|
1027
|
+
* `true`: personalization is not run at all unless storage consent is given
|
1028
|
+
*/
|
1029
|
+
requireConsentForPersonalization?: boolean;
|
1024
1030
|
} & Omit<VisitorDataStoreOptions, 'manifest' | 'onServerTransitionScoresReceived'>;
|
1025
1031
|
/** Emitted when a personalization runs */
|
1026
1032
|
type PersonalizationEvent = {
|
@@ -1105,6 +1111,7 @@ declare class Context implements ContextInstance {
|
|
1105
1111
|
get scores(): Readonly<ScoreVector>;
|
1106
1112
|
/** Gets the current visitor's quirks values. */
|
1107
1113
|
get quirks(): Readonly<Quirks>;
|
1114
|
+
get requireConsentForPersonalization(): boolean | undefined;
|
1108
1115
|
/**
|
1109
1116
|
* Subscribe to events
|
1110
1117
|
*/
|
@@ -1021,6 +1021,12 @@ type ContextOptions = {
|
|
1021
1021
|
* only - don't call scores, update, etc on it. If you need to call these methods immediately, attach your plugin after initialisation.
|
1022
1022
|
*/
|
1023
1023
|
plugins?: Array<ContextPlugin>;
|
1024
|
+
/**
|
1025
|
+
* Only show personalizations if the visitor has given consent.
|
1026
|
+
* `false (default)`: personalization can run in memory without visitor granting storage consent
|
1027
|
+
* `true`: personalization is not run at all unless storage consent is given
|
1028
|
+
*/
|
1029
|
+
requireConsentForPersonalization?: boolean;
|
1024
1030
|
} & Omit<VisitorDataStoreOptions, 'manifest' | 'onServerTransitionScoresReceived'>;
|
1025
1031
|
/** Emitted when a personalization runs */
|
1026
1032
|
type PersonalizationEvent = {
|
@@ -1105,6 +1111,7 @@ declare class Context implements ContextInstance {
|
|
1105
1111
|
get scores(): Readonly<ScoreVector>;
|
1106
1112
|
/** Gets the current visitor's quirks values. */
|
1107
1113
|
get quirks(): Readonly<Quirks>;
|
1114
|
+
get requireConsentForPersonalization(): boolean | undefined;
|
1108
1115
|
/**
|
1109
1116
|
* Subscribe to events
|
1110
1117
|
*/
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@uniformdev/context",
|
3
|
-
"version": "19.190.1-alpha.
|
3
|
+
"version": "19.190.1-alpha.7+ac0e3943b6",
|
4
4
|
"description": "Uniform Context core package",
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
6
6
|
"main": "./dist/index.js",
|
@@ -68,5 +68,5 @@
|
|
68
68
|
"publishConfig": {
|
69
69
|
"access": "public"
|
70
70
|
},
|
71
|
-
"gitHead": "
|
71
|
+
"gitHead": "ac0e3943b6b1b02b6076f3edf1337b65932f6ed5"
|
72
72
|
}
|