@uniformdev/context 19.213.0 → 19.213.1-alpha.1

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,4 +1,4 @@
1
- import { aC as paths$7, N as ManifestV2 } from '../types-CqKOO0nP.mjs';
1
+ import { aC as paths$7, N as ManifestV2 } from '../types-EJl31yuP.mjs';
2
2
  import 'mitt';
3
3
 
4
4
  type LimitPolicy = <ReturnValue>(func: () => Promise<ReturnValue>) => Promise<ReturnValue>;
package/dist/api/api.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { aC as paths$7, N as ManifestV2 } from '../types-CqKOO0nP.js';
1
+ import { aC as paths$7, N as ManifestV2 } from '../types-EJl31yuP.js';
2
2
  import 'mitt';
3
3
 
4
4
  type LimitPolicy = <ReturnValue>(func: () => Promise<ReturnValue>) => Promise<ReturnValue>;
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, Q as Quirks, b as TransitionDataStoreOptions, D as DecayFunction, c as CriteriaEvaluator, d as StringMatch, e as VariantMatchCriteria, f as LogMessage, g as DevToolsEvents } from './types-CqKOO0nP.mjs';
2
- export { $ as AggregateDimensionInput, a5 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, ao 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, a2 as DimensionMatch, Y as EnrichmentCategory, au as EnrichmentData, ax as EventData, aB as GoalStateUpdate, at as Goals, H as GroupCriteriaEvaluator, ah as IdentifyCommand, F as LogMessageGroup, E as LogMessageSingle, y as LogMessages, G as ManifestInstance, N as ManifestV2, M as MessageCategory, B as MessageFunc, ac as ModifyScoreCommand, ad as ModifySessionScoreCommand, Z as NumberMatch, P as PersonalizationEvent, R as PersonalizationManifest, av as PersonalizeControlVariant, a3 as PersonalizeOptions, aw as PersonalizeVariants, a7 as PersonalizedResult, a6 as PersonalizedVariant, am as SERVER_STATE_ID, al as ServerToClientTransitionState, ae as SetConsentCommand, ai as SetControlGroupCommand, ab as SetGoalCommand, aj as SetPersonalizeVariantControlCommand, af as SetQuirkCommand, ag as SetTestCommand, z as Severity, U as Signal, X as SignalCriteria, W as SignalCriteriaGroup, K as SignalData, aa as StorageCommand, _ as TestDefinition, k as TestEvent, a0 as TestOptions, a9 as TestResult, a8 as TestVariant, as as Tests, an as TransitionDataStoreEvents, ar as VisitorDataStore, aq as VisitorDataStoreEvents, ap as VisitorDataStoreOptions, ak as areCommandsEqual, ay as emptyVisitorData, a4 as personalizeVariations, a1 as testVariations } from './types-CqKOO0nP.mjs';
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, Q as Quirks, b as TransitionDataStoreOptions, D as DecayFunction, c as CriteriaEvaluator, d as StringMatch, e as VariantMatchCriteria, f as LogMessage, g as DevToolsEvents } from './types-EJl31yuP.mjs';
2
+ export { $ as AggregateDimensionInput, a5 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, ao 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, a2 as DimensionMatch, Y as EnrichmentCategory, au as EnrichmentData, ax as EventData, aB as GoalStateUpdate, at as Goals, H as GroupCriteriaEvaluator, ah as IdentifyCommand, F as LogMessageGroup, E as LogMessageSingle, y as LogMessages, G as ManifestInstance, N as ManifestV2, M as MessageCategory, B as MessageFunc, ac as ModifyScoreCommand, ad as ModifySessionScoreCommand, Z as NumberMatch, P as PersonalizationEvent, R as PersonalizationManifest, av as PersonalizeControlVariant, a3 as PersonalizeOptions, aw as PersonalizeVariants, a7 as PersonalizedResult, a6 as PersonalizedVariant, am as SERVER_STATE_ID, al as ServerToClientTransitionState, ae as SetConsentCommand, ai as SetControlGroupCommand, ab as SetGoalCommand, aj as SetPersonalizeVariantControlCommand, af as SetQuirkCommand, ag as SetTestCommand, z as Severity, U as Signal, X as SignalCriteria, W as SignalCriteriaGroup, K as SignalData, aa as StorageCommand, _ as TestDefinition, k as TestEvent, a0 as TestOptions, a9 as TestResult, a8 as TestVariant, as as Tests, an as TransitionDataStoreEvents, ar as VisitorDataStore, aq as VisitorDataStoreEvents, ap as VisitorDataStoreOptions, ak as areCommandsEqual, ay as emptyVisitorData, a4 as personalizeVariations, a1 as testVariations } from './types-EJl31yuP.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, Q as Quirks, b as TransitionDataStoreOptions, D as DecayFunction, c as CriteriaEvaluator, d as StringMatch, e as VariantMatchCriteria, f as LogMessage, g as DevToolsEvents } from './types-CqKOO0nP.js';
2
- export { $ as AggregateDimensionInput, a5 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, ao 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, a2 as DimensionMatch, Y as EnrichmentCategory, au as EnrichmentData, ax as EventData, aB as GoalStateUpdate, at as Goals, H as GroupCriteriaEvaluator, ah as IdentifyCommand, F as LogMessageGroup, E as LogMessageSingle, y as LogMessages, G as ManifestInstance, N as ManifestV2, M as MessageCategory, B as MessageFunc, ac as ModifyScoreCommand, ad as ModifySessionScoreCommand, Z as NumberMatch, P as PersonalizationEvent, R as PersonalizationManifest, av as PersonalizeControlVariant, a3 as PersonalizeOptions, aw as PersonalizeVariants, a7 as PersonalizedResult, a6 as PersonalizedVariant, am as SERVER_STATE_ID, al as ServerToClientTransitionState, ae as SetConsentCommand, ai as SetControlGroupCommand, ab as SetGoalCommand, aj as SetPersonalizeVariantControlCommand, af as SetQuirkCommand, ag as SetTestCommand, z as Severity, U as Signal, X as SignalCriteria, W as SignalCriteriaGroup, K as SignalData, aa as StorageCommand, _ as TestDefinition, k as TestEvent, a0 as TestOptions, a9 as TestResult, a8 as TestVariant, as as Tests, an as TransitionDataStoreEvents, ar as VisitorDataStore, aq as VisitorDataStoreEvents, ap as VisitorDataStoreOptions, ak as areCommandsEqual, ay as emptyVisitorData, a4 as personalizeVariations, a1 as testVariations } from './types-CqKOO0nP.js';
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, Q as Quirks, b as TransitionDataStoreOptions, D as DecayFunction, c as CriteriaEvaluator, d as StringMatch, e as VariantMatchCriteria, f as LogMessage, g as DevToolsEvents } from './types-EJl31yuP.js';
2
+ export { $ as AggregateDimensionInput, a5 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, ao 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, a2 as DimensionMatch, Y as EnrichmentCategory, au as EnrichmentData, ax as EventData, aB as GoalStateUpdate, at as Goals, H as GroupCriteriaEvaluator, ah as IdentifyCommand, F as LogMessageGroup, E as LogMessageSingle, y as LogMessages, G as ManifestInstance, N as ManifestV2, M as MessageCategory, B as MessageFunc, ac as ModifyScoreCommand, ad as ModifySessionScoreCommand, Z as NumberMatch, P as PersonalizationEvent, R as PersonalizationManifest, av as PersonalizeControlVariant, a3 as PersonalizeOptions, aw as PersonalizeVariants, a7 as PersonalizedResult, a6 as PersonalizedVariant, am as SERVER_STATE_ID, al as ServerToClientTransitionState, ae as SetConsentCommand, ai as SetControlGroupCommand, ab as SetGoalCommand, aj as SetPersonalizeVariantControlCommand, af as SetQuirkCommand, ag as SetTestCommand, z as Severity, U as Signal, X as SignalCriteria, W as SignalCriteriaGroup, K as SignalData, aa as StorageCommand, _ as TestDefinition, k as TestEvent, a0 as TestOptions, a9 as TestResult, a8 as TestVariant, as as Tests, an as TransitionDataStoreEvents, ar as VisitorDataStore, aq as VisitorDataStoreEvents, ap as VisitorDataStoreOptions, ak as areCommandsEqual, ay as emptyVisitorData, a4 as personalizeVariations, a1 as testVariations } from './types-EJl31yuP.js';
3
3
  import Cookies from 'js-cookie';
4
4
  import 'mitt';
5
5
 
package/dist/index.esm.js CHANGED
@@ -1622,7 +1622,9 @@ var Context = class {
1622
1622
  * Updates the Context with new data of any sort, such as
1623
1623
  * new URLs, cookies, quirks, and enrichments.
1624
1624
  *
1625
- * Only properties that are set in the data parameter will be updated.
1625
+ * Only properties that are set in the data parameter will be updated,
1626
+ * for example if passing `url` but not `cookies`, the last known state of cookies will be preserved.
1627
+ *
1626
1628
  * Properties that do not result in a changed state,
1627
1629
  * i.e. pushing the same URL or cookies as before,
1628
1630
  * will NOT result in a recomputation of signal state.
@@ -1706,9 +1708,13 @@ var Context = class {
1706
1708
  }
1707
1709
  });
1708
1710
  }
1711
+ const effectiveNewStateForSignalComputation = {
1712
+ ...__privateGet(this, _state),
1713
+ ...newData
1714
+ };
1709
1715
  commands.push(
1710
1716
  ...this.manifest.computeSignals({
1711
- state: newData,
1717
+ state: effectiveNewStateForSignalComputation,
1712
1718
  previousState: __privateGet(this, _state),
1713
1719
  visitor: this.storage.data,
1714
1720
  // re-compute using scores from storage instead of the current scores since
package/dist/index.js CHANGED
@@ -1711,7 +1711,9 @@ var Context = class {
1711
1711
  * Updates the Context with new data of any sort, such as
1712
1712
  * new URLs, cookies, quirks, and enrichments.
1713
1713
  *
1714
- * Only properties that are set in the data parameter will be updated.
1714
+ * Only properties that are set in the data parameter will be updated,
1715
+ * for example if passing `url` but not `cookies`, the last known state of cookies will be preserved.
1716
+ *
1715
1717
  * Properties that do not result in a changed state,
1716
1718
  * i.e. pushing the same URL or cookies as before,
1717
1719
  * will NOT result in a recomputation of signal state.
@@ -1795,9 +1797,13 @@ var Context = class {
1795
1797
  }
1796
1798
  });
1797
1799
  }
1800
+ const effectiveNewStateForSignalComputation = {
1801
+ ...__privateGet(this, _state),
1802
+ ...newData
1803
+ };
1798
1804
  commands.push(
1799
1805
  ...this.manifest.computeSignals({
1800
- state: newData,
1806
+ state: effectiveNewStateForSignalComputation,
1801
1807
  previousState: __privateGet(this, _state),
1802
1808
  visitor: this.storage.data,
1803
1809
  // re-compute using scores from storage instead of the current scores since
package/dist/index.mjs CHANGED
@@ -1622,7 +1622,9 @@ var Context = class {
1622
1622
  * Updates the Context with new data of any sort, such as
1623
1623
  * new URLs, cookies, quirks, and enrichments.
1624
1624
  *
1625
- * Only properties that are set in the data parameter will be updated.
1625
+ * Only properties that are set in the data parameter will be updated,
1626
+ * for example if passing `url` but not `cookies`, the last known state of cookies will be preserved.
1627
+ *
1626
1628
  * Properties that do not result in a changed state,
1627
1629
  * i.e. pushing the same URL or cookies as before,
1628
1630
  * will NOT result in a recomputation of signal state.
@@ -1706,9 +1708,13 @@ var Context = class {
1706
1708
  }
1707
1709
  });
1708
1710
  }
1711
+ const effectiveNewStateForSignalComputation = {
1712
+ ...__privateGet(this, _state),
1713
+ ...newData
1714
+ };
1709
1715
  commands.push(
1710
1716
  ...this.manifest.computeSignals({
1711
- state: newData,
1717
+ state: effectiveNewStateForSignalComputation,
1712
1718
  previousState: __privateGet(this, _state),
1713
1719
  visitor: this.storage.data,
1714
1720
  // re-compute using scores from storage instead of the current scores since
@@ -87,9 +87,13 @@ type ContextState = {
87
87
  events: EventData[];
88
88
  };
89
89
  type ContextStateUpdate = {
90
+ /** The new effective state of the visitor after this state update is applied */
90
91
  state: Partial<ContextState>;
92
+ /** The last state of the visitor before this state update */
91
93
  previousState: Partial<ContextState>;
94
+ /** The visitor we are updating */
92
95
  visitor: VisitorData;
96
+ /** The visitor's scores before this state update */
93
97
  scores: ScoreVector;
94
98
  };
95
99
  type GoalStateUpdate = {
@@ -1149,7 +1153,9 @@ declare class Context implements ContextInstance {
1149
1153
  * Updates the Context with new data of any sort, such as
1150
1154
  * new URLs, cookies, quirks, and enrichments.
1151
1155
  *
1152
- * Only properties that are set in the data parameter will be updated.
1156
+ * Only properties that are set in the data parameter will be updated,
1157
+ * for example if passing `url` but not `cookies`, the last known state of cookies will be preserved.
1158
+ *
1153
1159
  * Properties that do not result in a changed state,
1154
1160
  * i.e. pushing the same URL or cookies as before,
1155
1161
  * will NOT result in a recomputation of signal state.
@@ -87,9 +87,13 @@ type ContextState = {
87
87
  events: EventData[];
88
88
  };
89
89
  type ContextStateUpdate = {
90
+ /** The new effective state of the visitor after this state update is applied */
90
91
  state: Partial<ContextState>;
92
+ /** The last state of the visitor before this state update */
91
93
  previousState: Partial<ContextState>;
94
+ /** The visitor we are updating */
92
95
  visitor: VisitorData;
96
+ /** The visitor's scores before this state update */
93
97
  scores: ScoreVector;
94
98
  };
95
99
  type GoalStateUpdate = {
@@ -1149,7 +1153,9 @@ declare class Context implements ContextInstance {
1149
1153
  * Updates the Context with new data of any sort, such as
1150
1154
  * new URLs, cookies, quirks, and enrichments.
1151
1155
  *
1152
- * Only properties that are set in the data parameter will be updated.
1156
+ * Only properties that are set in the data parameter will be updated,
1157
+ * for example if passing `url` but not `cookies`, the last known state of cookies will be preserved.
1158
+ *
1153
1159
  * Properties that do not result in a changed state,
1154
1160
  * i.e. pushing the same URL or cookies as before,
1155
1161
  * will NOT result in a recomputation of signal state.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/context",
3
- "version": "19.213.0",
3
+ "version": "19.213.1-alpha.1+483dbf1bb7",
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": "40002f511096dd24a7d2a7793d3bbdc05b32c2fb"
71
+ "gitHead": "483dbf1bb7d5e56e95e1ed273da5fc577ad9d37b"
72
72
  }