@uniformdev/context 19.154.1-alpha.22 → 19.154.1-alpha.24
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 +25 -25
- package/dist/api/api.d.ts +25 -25
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +55 -14
- package/dist/index.js +56 -14
- package/dist/index.mjs +55 -14
- package/dist/{types-DqYG-dCc.d.mts → types-KWnn2ElZ.d.mts} +18 -9
- package/dist/{types-DqYG-dCc.d.ts → types-KWnn2ElZ.d.ts} +18 -9
- package/package.json +2 -2
package/dist/api/api.d.mts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { aC as paths$7, N as ManifestV2 } from '../types-KWnn2ElZ.mjs';
|
2
2
|
import 'mitt';
|
3
3
|
|
4
4
|
type LimitPolicy = <ReturnValue>(func: () => Promise<ReturnValue>) => Promise<ReturnValue>;
|
@@ -87,7 +87,7 @@ interface components$6 {
|
|
87
87
|
* & = AND
|
88
88
|
* | = OR
|
89
89
|
*
|
90
|
-
* Default is `&` if unspecified
|
90
|
+
* Default is `&` if unspecified
|
91
91
|
*
|
92
92
|
* @default &
|
93
93
|
* @enum {string}
|
@@ -114,7 +114,7 @@ interface components$6 {
|
|
114
114
|
* & = AND
|
115
115
|
* | = OR
|
116
116
|
*
|
117
|
-
* Default is `&` if unspecified
|
117
|
+
* Default is `&` if unspecified
|
118
118
|
*
|
119
119
|
* @enum {string}
|
120
120
|
*/
|
@@ -175,7 +175,7 @@ interface components$6 {
|
|
175
175
|
};
|
176
176
|
/** @description Describes a match expression on a string */
|
177
177
|
StringMatch: {
|
178
|
-
/** @description The right
|
178
|
+
/** @description The right-hand side of the match expression */
|
179
179
|
rhs: string;
|
180
180
|
/**
|
181
181
|
* @description The match operator
|
@@ -188,7 +188,7 @@ interface components$6 {
|
|
188
188
|
* @enum {string}
|
189
189
|
*/
|
190
190
|
op: "=" | "~" | "//" | "!=" | "!~" | "!//";
|
191
|
-
/** @description The case sensitivity of the match. Defaults to false if unspecified
|
191
|
+
/** @description The case sensitivity of the match. Defaults to false if unspecified */
|
192
192
|
cs?: boolean;
|
193
193
|
} | {
|
194
194
|
/**
|
@@ -202,7 +202,7 @@ interface components$6 {
|
|
202
202
|
};
|
203
203
|
/** @description Describes a match expression on a number */
|
204
204
|
NumberMatch: {
|
205
|
-
/** @description The right
|
205
|
+
/** @description The right-hand side of the match expression */
|
206
206
|
rhs: number;
|
207
207
|
/**
|
208
208
|
* @description The type of match to perform
|
@@ -215,7 +215,7 @@ interface components$6 {
|
|
215
215
|
*/
|
216
216
|
op: "=" | "<" | ">" | "!=";
|
217
217
|
};
|
218
|
-
/** @description Defines an aggregate dimension that is a grouping of other dimensions' scores; an intent or audience
|
218
|
+
/** @description Defines an aggregate dimension that is a grouping of other dimensions' scores; an intent or audience */
|
219
219
|
AggregateDimension: {
|
220
220
|
/** @description Input dimensions to the aggregate dimension */
|
221
221
|
inputs: components$6["schemas"]["AggregateDimensionInput"][];
|
@@ -229,7 +229,7 @@ interface components$6 {
|
|
229
229
|
*
|
230
230
|
* Note that creating a cycle of aggregate dimensions is allowed, however
|
231
231
|
* the final score will _ignore_ the cycled aggregate dimension in the result.
|
232
|
-
* This can be used to create mutually exclusive aggregates
|
232
|
+
* This can be used to create mutually exclusive aggregates
|
233
233
|
*/
|
234
234
|
dim: string;
|
235
235
|
/**
|
@@ -237,7 +237,7 @@ interface components$6 {
|
|
237
237
|
*
|
238
238
|
* '+' = add to the final score
|
239
239
|
* '-' = subtract from the final score
|
240
|
-
* 'c' = clear the final score (if the input dimension has any score at all, this
|
240
|
+
* 'c' = clear the final score (if the input dimension has any score at all, this aggregate will have no score regardless of other inputs)
|
241
241
|
*
|
242
242
|
* Default if unspecified: '+'
|
243
243
|
*
|
@@ -808,7 +808,7 @@ interface external$4 {
|
|
808
808
|
* & = AND
|
809
809
|
* | = OR
|
810
810
|
*
|
811
|
-
* Default is `&` if unspecified
|
811
|
+
* Default is `&` if unspecified
|
812
812
|
*
|
813
813
|
* @default &
|
814
814
|
* @enum {string}
|
@@ -835,7 +835,7 @@ interface external$4 {
|
|
835
835
|
* & = AND
|
836
836
|
* | = OR
|
837
837
|
*
|
838
|
-
* Default is `&` if unspecified
|
838
|
+
* Default is `&` if unspecified
|
839
839
|
*
|
840
840
|
* @enum {string}
|
841
841
|
*/
|
@@ -896,7 +896,7 @@ interface external$4 {
|
|
896
896
|
};
|
897
897
|
/** @description Describes a match expression on a string */
|
898
898
|
StringMatch: {
|
899
|
-
/** @description The right
|
899
|
+
/** @description The right-hand side of the match expression */
|
900
900
|
rhs: string;
|
901
901
|
/**
|
902
902
|
* @description The match operator
|
@@ -909,7 +909,7 @@ interface external$4 {
|
|
909
909
|
* @enum {string}
|
910
910
|
*/
|
911
911
|
op: "=" | "~" | "//" | "!=" | "!~" | "!//";
|
912
|
-
/** @description The case sensitivity of the match. Defaults to false if unspecified
|
912
|
+
/** @description The case sensitivity of the match. Defaults to false if unspecified */
|
913
913
|
cs?: boolean;
|
914
914
|
} | {
|
915
915
|
/**
|
@@ -923,7 +923,7 @@ interface external$4 {
|
|
923
923
|
};
|
924
924
|
/** @description Describes a match expression on a number */
|
925
925
|
NumberMatch: {
|
926
|
-
/** @description The right
|
926
|
+
/** @description The right-hand side of the match expression */
|
927
927
|
rhs: number;
|
928
928
|
/**
|
929
929
|
* @description The type of match to perform
|
@@ -936,7 +936,7 @@ interface external$4 {
|
|
936
936
|
*/
|
937
937
|
op: "=" | "<" | ">" | "!=";
|
938
938
|
};
|
939
|
-
/** @description Defines an aggregate dimension that is a grouping of other dimensions' scores; an intent or audience
|
939
|
+
/** @description Defines an aggregate dimension that is a grouping of other dimensions' scores; an intent or audience */
|
940
940
|
AggregateDimension: {
|
941
941
|
/** @description Input dimensions to the aggregate dimension */
|
942
942
|
inputs: external$4["uniform-context-types.swagger.yml"]["components"]["schemas"]["AggregateDimensionInput"][];
|
@@ -950,7 +950,7 @@ interface external$4 {
|
|
950
950
|
*
|
951
951
|
* Note that creating a cycle of aggregate dimensions is allowed, however
|
952
952
|
* the final score will _ignore_ the cycled aggregate dimension in the result.
|
953
|
-
* This can be used to create mutually exclusive aggregates
|
953
|
+
* This can be used to create mutually exclusive aggregates
|
954
954
|
*/
|
955
955
|
dim: string;
|
956
956
|
/**
|
@@ -958,7 +958,7 @@ interface external$4 {
|
|
958
958
|
*
|
959
959
|
* '+' = add to the final score
|
960
960
|
* '-' = subtract from the final score
|
961
|
-
* 'c' = clear the final score (if the input dimension has any score at all, this
|
961
|
+
* 'c' = clear the final score (if the input dimension has any score at all, this aggregate will have no score regardless of other inputs)
|
962
962
|
*
|
963
963
|
* Default if unspecified: '+'
|
964
964
|
*
|
@@ -1411,7 +1411,7 @@ interface external$1 {
|
|
1411
1411
|
* & = AND
|
1412
1412
|
* | = OR
|
1413
1413
|
*
|
1414
|
-
* Default is `&` if unspecified
|
1414
|
+
* Default is `&` if unspecified
|
1415
1415
|
*
|
1416
1416
|
* @default &
|
1417
1417
|
* @enum {string}
|
@@ -1438,7 +1438,7 @@ interface external$1 {
|
|
1438
1438
|
* & = AND
|
1439
1439
|
* | = OR
|
1440
1440
|
*
|
1441
|
-
* Default is `&` if unspecified
|
1441
|
+
* Default is `&` if unspecified
|
1442
1442
|
*
|
1443
1443
|
* @enum {string}
|
1444
1444
|
*/
|
@@ -1499,7 +1499,7 @@ interface external$1 {
|
|
1499
1499
|
};
|
1500
1500
|
/** @description Describes a match expression on a string */
|
1501
1501
|
StringMatch: {
|
1502
|
-
/** @description The right
|
1502
|
+
/** @description The right-hand side of the match expression */
|
1503
1503
|
rhs: string;
|
1504
1504
|
/**
|
1505
1505
|
* @description The match operator
|
@@ -1512,7 +1512,7 @@ interface external$1 {
|
|
1512
1512
|
* @enum {string}
|
1513
1513
|
*/
|
1514
1514
|
op: "=" | "~" | "//" | "!=" | "!~" | "!//";
|
1515
|
-
/** @description The case sensitivity of the match. Defaults to false if unspecified
|
1515
|
+
/** @description The case sensitivity of the match. Defaults to false if unspecified */
|
1516
1516
|
cs?: boolean;
|
1517
1517
|
} | {
|
1518
1518
|
/**
|
@@ -1526,7 +1526,7 @@ interface external$1 {
|
|
1526
1526
|
};
|
1527
1527
|
/** @description Describes a match expression on a number */
|
1528
1528
|
NumberMatch: {
|
1529
|
-
/** @description The right
|
1529
|
+
/** @description The right-hand side of the match expression */
|
1530
1530
|
rhs: number;
|
1531
1531
|
/**
|
1532
1532
|
* @description The type of match to perform
|
@@ -1539,7 +1539,7 @@ interface external$1 {
|
|
1539
1539
|
*/
|
1540
1540
|
op: "=" | "<" | ">" | "!=";
|
1541
1541
|
};
|
1542
|
-
/** @description Defines an aggregate dimension that is a grouping of other dimensions' scores; an intent or audience
|
1542
|
+
/** @description Defines an aggregate dimension that is a grouping of other dimensions' scores; an intent or audience */
|
1543
1543
|
AggregateDimension: {
|
1544
1544
|
/** @description Input dimensions to the aggregate dimension */
|
1545
1545
|
inputs: external$1["uniform-context-types.swagger.yml"]["components"]["schemas"]["AggregateDimensionInput"][];
|
@@ -1553,7 +1553,7 @@ interface external$1 {
|
|
1553
1553
|
*
|
1554
1554
|
* Note that creating a cycle of aggregate dimensions is allowed, however
|
1555
1555
|
* the final score will _ignore_ the cycled aggregate dimension in the result.
|
1556
|
-
* This can be used to create mutually exclusive aggregates
|
1556
|
+
* This can be used to create mutually exclusive aggregates
|
1557
1557
|
*/
|
1558
1558
|
dim: string;
|
1559
1559
|
/**
|
@@ -1561,7 +1561,7 @@ interface external$1 {
|
|
1561
1561
|
*
|
1562
1562
|
* '+' = add to the final score
|
1563
1563
|
* '-' = subtract from the final score
|
1564
|
-
* 'c' = clear the final score (if the input dimension has any score at all, this
|
1564
|
+
* 'c' = clear the final score (if the input dimension has any score at all, this aggregate will have no score regardless of other inputs)
|
1565
1565
|
*
|
1566
1566
|
* Default if unspecified: '+'
|
1567
1567
|
*
|
package/dist/api/api.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { aC as paths$7, N as ManifestV2 } from '../types-KWnn2ElZ.js';
|
2
2
|
import 'mitt';
|
3
3
|
|
4
4
|
type LimitPolicy = <ReturnValue>(func: () => Promise<ReturnValue>) => Promise<ReturnValue>;
|
@@ -87,7 +87,7 @@ interface components$6 {
|
|
87
87
|
* & = AND
|
88
88
|
* | = OR
|
89
89
|
*
|
90
|
-
* Default is `&` if unspecified
|
90
|
+
* Default is `&` if unspecified
|
91
91
|
*
|
92
92
|
* @default &
|
93
93
|
* @enum {string}
|
@@ -114,7 +114,7 @@ interface components$6 {
|
|
114
114
|
* & = AND
|
115
115
|
* | = OR
|
116
116
|
*
|
117
|
-
* Default is `&` if unspecified
|
117
|
+
* Default is `&` if unspecified
|
118
118
|
*
|
119
119
|
* @enum {string}
|
120
120
|
*/
|
@@ -175,7 +175,7 @@ interface components$6 {
|
|
175
175
|
};
|
176
176
|
/** @description Describes a match expression on a string */
|
177
177
|
StringMatch: {
|
178
|
-
/** @description The right
|
178
|
+
/** @description The right-hand side of the match expression */
|
179
179
|
rhs: string;
|
180
180
|
/**
|
181
181
|
* @description The match operator
|
@@ -188,7 +188,7 @@ interface components$6 {
|
|
188
188
|
* @enum {string}
|
189
189
|
*/
|
190
190
|
op: "=" | "~" | "//" | "!=" | "!~" | "!//";
|
191
|
-
/** @description The case sensitivity of the match. Defaults to false if unspecified
|
191
|
+
/** @description The case sensitivity of the match. Defaults to false if unspecified */
|
192
192
|
cs?: boolean;
|
193
193
|
} | {
|
194
194
|
/**
|
@@ -202,7 +202,7 @@ interface components$6 {
|
|
202
202
|
};
|
203
203
|
/** @description Describes a match expression on a number */
|
204
204
|
NumberMatch: {
|
205
|
-
/** @description The right
|
205
|
+
/** @description The right-hand side of the match expression */
|
206
206
|
rhs: number;
|
207
207
|
/**
|
208
208
|
* @description The type of match to perform
|
@@ -215,7 +215,7 @@ interface components$6 {
|
|
215
215
|
*/
|
216
216
|
op: "=" | "<" | ">" | "!=";
|
217
217
|
};
|
218
|
-
/** @description Defines an aggregate dimension that is a grouping of other dimensions' scores; an intent or audience
|
218
|
+
/** @description Defines an aggregate dimension that is a grouping of other dimensions' scores; an intent or audience */
|
219
219
|
AggregateDimension: {
|
220
220
|
/** @description Input dimensions to the aggregate dimension */
|
221
221
|
inputs: components$6["schemas"]["AggregateDimensionInput"][];
|
@@ -229,7 +229,7 @@ interface components$6 {
|
|
229
229
|
*
|
230
230
|
* Note that creating a cycle of aggregate dimensions is allowed, however
|
231
231
|
* the final score will _ignore_ the cycled aggregate dimension in the result.
|
232
|
-
* This can be used to create mutually exclusive aggregates
|
232
|
+
* This can be used to create mutually exclusive aggregates
|
233
233
|
*/
|
234
234
|
dim: string;
|
235
235
|
/**
|
@@ -237,7 +237,7 @@ interface components$6 {
|
|
237
237
|
*
|
238
238
|
* '+' = add to the final score
|
239
239
|
* '-' = subtract from the final score
|
240
|
-
* 'c' = clear the final score (if the input dimension has any score at all, this
|
240
|
+
* 'c' = clear the final score (if the input dimension has any score at all, this aggregate will have no score regardless of other inputs)
|
241
241
|
*
|
242
242
|
* Default if unspecified: '+'
|
243
243
|
*
|
@@ -808,7 +808,7 @@ interface external$4 {
|
|
808
808
|
* & = AND
|
809
809
|
* | = OR
|
810
810
|
*
|
811
|
-
* Default is `&` if unspecified
|
811
|
+
* Default is `&` if unspecified
|
812
812
|
*
|
813
813
|
* @default &
|
814
814
|
* @enum {string}
|
@@ -835,7 +835,7 @@ interface external$4 {
|
|
835
835
|
* & = AND
|
836
836
|
* | = OR
|
837
837
|
*
|
838
|
-
* Default is `&` if unspecified
|
838
|
+
* Default is `&` if unspecified
|
839
839
|
*
|
840
840
|
* @enum {string}
|
841
841
|
*/
|
@@ -896,7 +896,7 @@ interface external$4 {
|
|
896
896
|
};
|
897
897
|
/** @description Describes a match expression on a string */
|
898
898
|
StringMatch: {
|
899
|
-
/** @description The right
|
899
|
+
/** @description The right-hand side of the match expression */
|
900
900
|
rhs: string;
|
901
901
|
/**
|
902
902
|
* @description The match operator
|
@@ -909,7 +909,7 @@ interface external$4 {
|
|
909
909
|
* @enum {string}
|
910
910
|
*/
|
911
911
|
op: "=" | "~" | "//" | "!=" | "!~" | "!//";
|
912
|
-
/** @description The case sensitivity of the match. Defaults to false if unspecified
|
912
|
+
/** @description The case sensitivity of the match. Defaults to false if unspecified */
|
913
913
|
cs?: boolean;
|
914
914
|
} | {
|
915
915
|
/**
|
@@ -923,7 +923,7 @@ interface external$4 {
|
|
923
923
|
};
|
924
924
|
/** @description Describes a match expression on a number */
|
925
925
|
NumberMatch: {
|
926
|
-
/** @description The right
|
926
|
+
/** @description The right-hand side of the match expression */
|
927
927
|
rhs: number;
|
928
928
|
/**
|
929
929
|
* @description The type of match to perform
|
@@ -936,7 +936,7 @@ interface external$4 {
|
|
936
936
|
*/
|
937
937
|
op: "=" | "<" | ">" | "!=";
|
938
938
|
};
|
939
|
-
/** @description Defines an aggregate dimension that is a grouping of other dimensions' scores; an intent or audience
|
939
|
+
/** @description Defines an aggregate dimension that is a grouping of other dimensions' scores; an intent or audience */
|
940
940
|
AggregateDimension: {
|
941
941
|
/** @description Input dimensions to the aggregate dimension */
|
942
942
|
inputs: external$4["uniform-context-types.swagger.yml"]["components"]["schemas"]["AggregateDimensionInput"][];
|
@@ -950,7 +950,7 @@ interface external$4 {
|
|
950
950
|
*
|
951
951
|
* Note that creating a cycle of aggregate dimensions is allowed, however
|
952
952
|
* the final score will _ignore_ the cycled aggregate dimension in the result.
|
953
|
-
* This can be used to create mutually exclusive aggregates
|
953
|
+
* This can be used to create mutually exclusive aggregates
|
954
954
|
*/
|
955
955
|
dim: string;
|
956
956
|
/**
|
@@ -958,7 +958,7 @@ interface external$4 {
|
|
958
958
|
*
|
959
959
|
* '+' = add to the final score
|
960
960
|
* '-' = subtract from the final score
|
961
|
-
* 'c' = clear the final score (if the input dimension has any score at all, this
|
961
|
+
* 'c' = clear the final score (if the input dimension has any score at all, this aggregate will have no score regardless of other inputs)
|
962
962
|
*
|
963
963
|
* Default if unspecified: '+'
|
964
964
|
*
|
@@ -1411,7 +1411,7 @@ interface external$1 {
|
|
1411
1411
|
* & = AND
|
1412
1412
|
* | = OR
|
1413
1413
|
*
|
1414
|
-
* Default is `&` if unspecified
|
1414
|
+
* Default is `&` if unspecified
|
1415
1415
|
*
|
1416
1416
|
* @default &
|
1417
1417
|
* @enum {string}
|
@@ -1438,7 +1438,7 @@ interface external$1 {
|
|
1438
1438
|
* & = AND
|
1439
1439
|
* | = OR
|
1440
1440
|
*
|
1441
|
-
* Default is `&` if unspecified
|
1441
|
+
* Default is `&` if unspecified
|
1442
1442
|
*
|
1443
1443
|
* @enum {string}
|
1444
1444
|
*/
|
@@ -1499,7 +1499,7 @@ interface external$1 {
|
|
1499
1499
|
};
|
1500
1500
|
/** @description Describes a match expression on a string */
|
1501
1501
|
StringMatch: {
|
1502
|
-
/** @description The right
|
1502
|
+
/** @description The right-hand side of the match expression */
|
1503
1503
|
rhs: string;
|
1504
1504
|
/**
|
1505
1505
|
* @description The match operator
|
@@ -1512,7 +1512,7 @@ interface external$1 {
|
|
1512
1512
|
* @enum {string}
|
1513
1513
|
*/
|
1514
1514
|
op: "=" | "~" | "//" | "!=" | "!~" | "!//";
|
1515
|
-
/** @description The case sensitivity of the match. Defaults to false if unspecified
|
1515
|
+
/** @description The case sensitivity of the match. Defaults to false if unspecified */
|
1516
1516
|
cs?: boolean;
|
1517
1517
|
} | {
|
1518
1518
|
/**
|
@@ -1526,7 +1526,7 @@ interface external$1 {
|
|
1526
1526
|
};
|
1527
1527
|
/** @description Describes a match expression on a number */
|
1528
1528
|
NumberMatch: {
|
1529
|
-
/** @description The right
|
1529
|
+
/** @description The right-hand side of the match expression */
|
1530
1530
|
rhs: number;
|
1531
1531
|
/**
|
1532
1532
|
* @description The type of match to perform
|
@@ -1539,7 +1539,7 @@ interface external$1 {
|
|
1539
1539
|
*/
|
1540
1540
|
op: "=" | "<" | ">" | "!=";
|
1541
1541
|
};
|
1542
|
-
/** @description Defines an aggregate dimension that is a grouping of other dimensions' scores; an intent or audience
|
1542
|
+
/** @description Defines an aggregate dimension that is a grouping of other dimensions' scores; an intent or audience */
|
1543
1543
|
AggregateDimension: {
|
1544
1544
|
/** @description Input dimensions to the aggregate dimension */
|
1545
1545
|
inputs: external$1["uniform-context-types.swagger.yml"]["components"]["schemas"]["AggregateDimensionInput"][];
|
@@ -1553,7 +1553,7 @@ interface external$1 {
|
|
1553
1553
|
*
|
1554
1554
|
* Note that creating a cycle of aggregate dimensions is allowed, however
|
1555
1555
|
* the final score will _ignore_ the cycled aggregate dimension in the result.
|
1556
|
-
* This can be used to create mutually exclusive aggregates
|
1556
|
+
* This can be used to create mutually exclusive aggregates
|
1557
1557
|
*/
|
1558
1558
|
dim: string;
|
1559
1559
|
/**
|
@@ -1561,7 +1561,7 @@ interface external$1 {
|
|
1561
1561
|
*
|
1562
1562
|
* '+' = add to the final score
|
1563
1563
|
* '-' = subtract from the final score
|
1564
|
-
* 'c' = clear the final score (if the input dimension has any score at all, this
|
1564
|
+
* 'c' = clear the final score (if the input dimension has any score at all, this aggregate will have no score regardless of other inputs)
|
1565
1565
|
*
|
1566
1566
|
* Default if unspecified: '+'
|
1567
1567
|
*
|
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,
|
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-KWnn2ElZ.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-KWnn2ElZ.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,
|
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-KWnn2ElZ.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-KWnn2ElZ.js';
|
3
3
|
import Cookies from 'js-cookie';
|
4
4
|
import 'mitt';
|
5
5
|
|
package/dist/index.esm.js
CHANGED
@@ -826,11 +826,20 @@ var testVariations = ({
|
|
826
826
|
}
|
827
827
|
};
|
828
828
|
|
829
|
+
// src/storage/commands.ts
|
830
|
+
import { dequal as dequal2 } from "dequal/lite";
|
831
|
+
var areCommandsEqual = (a, b) => {
|
832
|
+
if (a.type !== b.type) {
|
833
|
+
return false;
|
834
|
+
}
|
835
|
+
return dequal2(a, b);
|
836
|
+
};
|
837
|
+
|
829
838
|
// src/storage/CookieTransitionDataStore.ts
|
830
839
|
import Cookies from "js-cookie";
|
831
840
|
|
832
841
|
// src/storage/TransitionDataStore.ts
|
833
|
-
import { dequal as
|
842
|
+
import { dequal as dequal3 } from "dequal/lite";
|
834
843
|
import mitt from "mitt";
|
835
844
|
var SERVER_STATE_ID = "__UNIFORM_DATA__";
|
836
845
|
var _data, _initialData, _mitt;
|
@@ -876,7 +885,7 @@ var TransitionDataStore = class {
|
|
876
885
|
await this.handleDelete(fromAllDevices);
|
877
886
|
}
|
878
887
|
signalAsyncDataUpdate(newScores) {
|
879
|
-
if (
|
888
|
+
if (dequal3(this.data, newScores)) {
|
880
889
|
return;
|
881
890
|
}
|
882
891
|
__privateSet(this, _data, newScores);
|
@@ -1149,7 +1158,7 @@ var emptyVisitorData = () => ({
|
|
1149
1158
|
});
|
1150
1159
|
|
1151
1160
|
// src/storage/VisitorDataStore.ts
|
1152
|
-
import { dequal as
|
1161
|
+
import { dequal as dequal4 } from "dequal/lite";
|
1153
1162
|
import mitt2 from "mitt";
|
1154
1163
|
|
1155
1164
|
// src/storage/util/applyCommandsToData.ts
|
@@ -1399,11 +1408,11 @@ replaceData_fn = function(data, quiet = false) {
|
|
1399
1408
|
onLogMessage: __privateGet(this, _options).onLogMessage
|
1400
1409
|
});
|
1401
1410
|
}
|
1402
|
-
const haveScoresChanged = !
|
1403
|
-
const haveSessionScoresChanged = !
|
1404
|
-
const haveQuirksChanged = !
|
1405
|
-
const haveTestsChanged = !
|
1406
|
-
const haveGoalsChanged = !
|
1411
|
+
const haveScoresChanged = !dequal4(oldData == null ? void 0 : oldData.visitorData.scores, data.scores);
|
1412
|
+
const haveSessionScoresChanged = !dequal4(oldData == null ? void 0 : oldData.visitorData.sessionScores, data.sessionScores);
|
1413
|
+
const haveQuirksChanged = !dequal4(oldData == null ? void 0 : oldData.visitorData.quirks, data.quirks);
|
1414
|
+
const haveTestsChanged = !dequal4(oldData == null ? void 0 : oldData.visitorData.tests, data.tests);
|
1415
|
+
const haveGoalsChanged = !dequal4(oldData == null ? void 0 : oldData.visitorData.goals, data.goals);
|
1407
1416
|
const updatedData = {
|
1408
1417
|
updated: now,
|
1409
1418
|
visitorData: data
|
@@ -1485,11 +1494,11 @@ defaultData_fn = function() {
|
|
1485
1494
|
};
|
1486
1495
|
|
1487
1496
|
// src/Context.ts
|
1488
|
-
import { dequal as
|
1497
|
+
import { dequal as dequal5 } from "dequal/lite";
|
1489
1498
|
import mitt3 from "mitt";
|
1490
1499
|
var CONTEXTUAL_EDITING_TEST_NAME = "contextual_editing_test";
|
1491
1500
|
var CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID = "contextual_editing_test_selected_variant";
|
1492
|
-
var _serverTransitionState, _scores, _state, _pzCache, _plugins, _mitt3, _emitTest, emitTest_fn, _updateGoals, updateGoals_fn, _updateComputedScores, updateComputedScores_fn, _calculateScores, calculateScores_fn;
|
1501
|
+
var _serverTransitionState, _scores, _state, _pzCache, _plugins, _commands, _mitt3, _emitTest, emitTest_fn, _updateGoals, updateGoals_fn, _updateComputedScores, updateComputedScores_fn, _calculateScores, calculateScores_fn;
|
1493
1502
|
var Context = class {
|
1494
1503
|
constructor(options) {
|
1495
1504
|
__privateAdd(this, _emitTest);
|
@@ -1502,6 +1511,7 @@ var Context = class {
|
|
1502
1511
|
__privateAdd(this, _state, void 0);
|
1503
1512
|
__privateAdd(this, _pzCache, {});
|
1504
1513
|
__privateAdd(this, _plugins, void 0);
|
1514
|
+
__privateAdd(this, _commands, void 0);
|
1505
1515
|
__privateAdd(this, _mitt3, mitt3());
|
1506
1516
|
/**
|
1507
1517
|
* Subscribe to events
|
@@ -1515,6 +1525,9 @@ var Context = class {
|
|
1515
1525
|
const { manifest, ...storageOptions } = options;
|
1516
1526
|
__privateSet(this, _state, {});
|
1517
1527
|
__privateSet(this, _plugins, options.plugins);
|
1528
|
+
if (typeof options.transitionStore !== "undefined") {
|
1529
|
+
__privateSet(this, _commands, []);
|
1530
|
+
}
|
1518
1531
|
(_a = __privateGet(this, _plugins)) == null ? void 0 : _a.forEach((plugin) => {
|
1519
1532
|
if (!plugin.logDrain) {
|
1520
1533
|
return;
|
@@ -1595,7 +1608,7 @@ var Context = class {
|
|
1595
1608
|
* will NOT result in a recomputation of signal state.
|
1596
1609
|
*/
|
1597
1610
|
async update(newData) {
|
1598
|
-
var _a, _b, _c, _d;
|
1611
|
+
var _a, _b, _c, _d, _e;
|
1599
1612
|
const commands = [];
|
1600
1613
|
const newServerSideTests = {};
|
1601
1614
|
if ((_a = __privateGet(this, _serverTransitionState)) == null ? void 0 : _a.quirks) {
|
@@ -1690,6 +1703,10 @@ var Context = class {
|
|
1690
1703
|
});
|
1691
1704
|
await this.storage.updateData(commands);
|
1692
1705
|
if (__privateGet(this, _serverTransitionState)) {
|
1706
|
+
await this.processServerCommands({
|
1707
|
+
serverCommands: __privateGet(this, _serverTransitionState).commands,
|
1708
|
+
commands
|
1709
|
+
});
|
1693
1710
|
__privateMethod(this, _updateComputedScores, updateComputedScores_fn).call(this, this.storage.data);
|
1694
1711
|
Object.entries(newServerSideTests).forEach(([testName, testVariantId]) => {
|
1695
1712
|
__privateMethod(this, _emitTest, emitTest_fn).call(this, {
|
@@ -1710,10 +1727,31 @@ var Context = class {
|
|
1710
1727
|
await plugin.update(newData);
|
1711
1728
|
}
|
1712
1729
|
}
|
1730
|
+
(_e = __privateGet(this, _commands)) == null ? void 0 : _e.push(...commands);
|
1713
1731
|
} finally {
|
1714
1732
|
__privateGet(this, _mitt3).emit("log", ["info", 2, "ENDGROUP"]);
|
1715
1733
|
}
|
1716
1734
|
}
|
1735
|
+
async processServerCommands({
|
1736
|
+
serverCommands,
|
1737
|
+
commands
|
1738
|
+
}) {
|
1739
|
+
if (!(serverCommands == null ? void 0 : serverCommands.length)) {
|
1740
|
+
return;
|
1741
|
+
}
|
1742
|
+
const notExecutedCommands = [];
|
1743
|
+
serverCommands.forEach((serverCommand) => {
|
1744
|
+
const found = commands.find((command) => {
|
1745
|
+
return areCommandsEqual(command, serverCommand);
|
1746
|
+
});
|
1747
|
+
if (!found) {
|
1748
|
+
notExecutedCommands.push(serverCommand);
|
1749
|
+
}
|
1750
|
+
});
|
1751
|
+
if (notExecutedCommands.length > 0) {
|
1752
|
+
await this.storage.updateData(notExecutedCommands);
|
1753
|
+
}
|
1754
|
+
}
|
1717
1755
|
/** use test() instead */
|
1718
1756
|
getTestVariantId(testName) {
|
1719
1757
|
var _a, _b, _c, _d;
|
@@ -1792,7 +1830,7 @@ var Context = class {
|
|
1792
1830
|
control: this.storage.data.controlGroup,
|
1793
1831
|
changed: true
|
1794
1832
|
};
|
1795
|
-
if (previousPlacement &&
|
1833
|
+
if (previousPlacement && dequal5(eventData.variantIds, previousPlacement)) {
|
1796
1834
|
eventData.changed = false;
|
1797
1835
|
}
|
1798
1836
|
__privateGet(this, _mitt3).emit("personalizationResult", eventData);
|
@@ -1826,7 +1864,8 @@ var Context = class {
|
|
1826
1864
|
quirks: this.storage.data.quirks,
|
1827
1865
|
ssv: __privateGet(this, _scores),
|
1828
1866
|
tests: {},
|
1829
|
-
personalizeVariants: this.storage.data.personalizeVariants
|
1867
|
+
personalizeVariants: this.storage.data.personalizeVariants,
|
1868
|
+
commands: __privateGet(this, _commands)
|
1830
1869
|
};
|
1831
1870
|
const allTests = this.storage.data.tests;
|
1832
1871
|
Object.entries(allTests).map(([testName, testValue]) => {
|
@@ -1855,6 +1894,7 @@ _scores = new WeakMap();
|
|
1855
1894
|
_state = new WeakMap();
|
1856
1895
|
_pzCache = new WeakMap();
|
1857
1896
|
_plugins = new WeakMap();
|
1897
|
+
_commands = new WeakMap();
|
1858
1898
|
_mitt3 = new WeakMap();
|
1859
1899
|
_emitTest = new WeakSet();
|
1860
1900
|
emitTest_fn = function(event) {
|
@@ -1870,7 +1910,7 @@ updateGoals_fn = async function(data) {
|
|
1870
1910
|
_updateComputedScores = new WeakSet();
|
1871
1911
|
updateComputedScores_fn = function(newData) {
|
1872
1912
|
const newScores = __privateMethod(this, _calculateScores, calculateScores_fn).call(this, newData);
|
1873
|
-
const newScoresHaveChanged = !
|
1913
|
+
const newScoresHaveChanged = !dequal5(newScores, __privateGet(this, _scores));
|
1874
1914
|
if (newScoresHaveChanged) {
|
1875
1915
|
__privateSet(this, _scores, newScores);
|
1876
1916
|
__privateMethod(this, _updateGoals, updateGoals_fn).call(this, {
|
@@ -2541,6 +2581,7 @@ export {
|
|
2541
2581
|
TransitionDataStore,
|
2542
2582
|
UNIFORM_DEFAULT_COOKIE_NAME,
|
2543
2583
|
VisitorDataStore,
|
2584
|
+
areCommandsEqual,
|
2544
2585
|
computeAggregateDimensions,
|
2545
2586
|
cookieEvaluator,
|
2546
2587
|
createConsoleLogDrain,
|
package/dist/index.js
CHANGED
@@ -70,6 +70,7 @@ __export(src_exports, {
|
|
70
70
|
TransitionDataStore: () => TransitionDataStore,
|
71
71
|
UNIFORM_DEFAULT_COOKIE_NAME: () => UNIFORM_DEFAULT_COOKIE_NAME,
|
72
72
|
VisitorDataStore: () => VisitorDataStore,
|
73
|
+
areCommandsEqual: () => areCommandsEqual,
|
73
74
|
computeAggregateDimensions: () => computeAggregateDimensions,
|
74
75
|
cookieEvaluator: () => cookieEvaluator,
|
75
76
|
createConsoleLogDrain: () => createConsoleLogDrain,
|
@@ -897,11 +898,20 @@ var testVariations = ({
|
|
897
898
|
}
|
898
899
|
};
|
899
900
|
|
901
|
+
// src/storage/commands.ts
|
902
|
+
var import_lite2 = require("dequal/lite");
|
903
|
+
var areCommandsEqual = (a, b) => {
|
904
|
+
if (a.type !== b.type) {
|
905
|
+
return false;
|
906
|
+
}
|
907
|
+
return (0, import_lite2.dequal)(a, b);
|
908
|
+
};
|
909
|
+
|
900
910
|
// src/storage/CookieTransitionDataStore.ts
|
901
911
|
var import_js_cookie = __toESM(require("js-cookie"));
|
902
912
|
|
903
913
|
// src/storage/TransitionDataStore.ts
|
904
|
-
var
|
914
|
+
var import_lite3 = require("dequal/lite");
|
905
915
|
var import_mitt = __toESM(require("mitt"));
|
906
916
|
var SERVER_STATE_ID = "__UNIFORM_DATA__";
|
907
917
|
var _data, _initialData, _mitt;
|
@@ -947,7 +957,7 @@ var TransitionDataStore = class {
|
|
947
957
|
await this.handleDelete(fromAllDevices);
|
948
958
|
}
|
949
959
|
signalAsyncDataUpdate(newScores) {
|
950
|
-
if ((0,
|
960
|
+
if ((0, import_lite3.dequal)(this.data, newScores)) {
|
951
961
|
return;
|
952
962
|
}
|
953
963
|
__privateSet(this, _data, newScores);
|
@@ -1220,7 +1230,7 @@ var emptyVisitorData = () => ({
|
|
1220
1230
|
});
|
1221
1231
|
|
1222
1232
|
// src/storage/VisitorDataStore.ts
|
1223
|
-
var
|
1233
|
+
var import_lite4 = require("dequal/lite");
|
1224
1234
|
var import_mitt2 = __toESM(require("mitt"));
|
1225
1235
|
|
1226
1236
|
// src/storage/util/applyCommandsToData.ts
|
@@ -1470,11 +1480,11 @@ replaceData_fn = function(data, quiet = false) {
|
|
1470
1480
|
onLogMessage: __privateGet(this, _options).onLogMessage
|
1471
1481
|
});
|
1472
1482
|
}
|
1473
|
-
const haveScoresChanged = !(0,
|
1474
|
-
const haveSessionScoresChanged = !(0,
|
1475
|
-
const haveQuirksChanged = !(0,
|
1476
|
-
const haveTestsChanged = !(0,
|
1477
|
-
const haveGoalsChanged = !(0,
|
1483
|
+
const haveScoresChanged = !(0, import_lite4.dequal)(oldData == null ? void 0 : oldData.visitorData.scores, data.scores);
|
1484
|
+
const haveSessionScoresChanged = !(0, import_lite4.dequal)(oldData == null ? void 0 : oldData.visitorData.sessionScores, data.sessionScores);
|
1485
|
+
const haveQuirksChanged = !(0, import_lite4.dequal)(oldData == null ? void 0 : oldData.visitorData.quirks, data.quirks);
|
1486
|
+
const haveTestsChanged = !(0, import_lite4.dequal)(oldData == null ? void 0 : oldData.visitorData.tests, data.tests);
|
1487
|
+
const haveGoalsChanged = !(0, import_lite4.dequal)(oldData == null ? void 0 : oldData.visitorData.goals, data.goals);
|
1478
1488
|
const updatedData = {
|
1479
1489
|
updated: now,
|
1480
1490
|
visitorData: data
|
@@ -1556,11 +1566,11 @@ defaultData_fn = function() {
|
|
1556
1566
|
};
|
1557
1567
|
|
1558
1568
|
// src/Context.ts
|
1559
|
-
var
|
1569
|
+
var import_lite5 = require("dequal/lite");
|
1560
1570
|
var import_mitt3 = __toESM(require("mitt"));
|
1561
1571
|
var CONTEXTUAL_EDITING_TEST_NAME = "contextual_editing_test";
|
1562
1572
|
var CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID = "contextual_editing_test_selected_variant";
|
1563
|
-
var _serverTransitionState, _scores, _state, _pzCache, _plugins, _mitt3, _emitTest, emitTest_fn, _updateGoals, updateGoals_fn, _updateComputedScores, updateComputedScores_fn, _calculateScores, calculateScores_fn;
|
1573
|
+
var _serverTransitionState, _scores, _state, _pzCache, _plugins, _commands, _mitt3, _emitTest, emitTest_fn, _updateGoals, updateGoals_fn, _updateComputedScores, updateComputedScores_fn, _calculateScores, calculateScores_fn;
|
1564
1574
|
var Context = class {
|
1565
1575
|
constructor(options) {
|
1566
1576
|
__privateAdd(this, _emitTest);
|
@@ -1573,6 +1583,7 @@ var Context = class {
|
|
1573
1583
|
__privateAdd(this, _state, void 0);
|
1574
1584
|
__privateAdd(this, _pzCache, {});
|
1575
1585
|
__privateAdd(this, _plugins, void 0);
|
1586
|
+
__privateAdd(this, _commands, void 0);
|
1576
1587
|
__privateAdd(this, _mitt3, (0, import_mitt3.default)());
|
1577
1588
|
/**
|
1578
1589
|
* Subscribe to events
|
@@ -1586,6 +1597,9 @@ var Context = class {
|
|
1586
1597
|
const { manifest, ...storageOptions } = options;
|
1587
1598
|
__privateSet(this, _state, {});
|
1588
1599
|
__privateSet(this, _plugins, options.plugins);
|
1600
|
+
if (typeof options.transitionStore !== "undefined") {
|
1601
|
+
__privateSet(this, _commands, []);
|
1602
|
+
}
|
1589
1603
|
(_a = __privateGet(this, _plugins)) == null ? void 0 : _a.forEach((plugin) => {
|
1590
1604
|
if (!plugin.logDrain) {
|
1591
1605
|
return;
|
@@ -1666,7 +1680,7 @@ var Context = class {
|
|
1666
1680
|
* will NOT result in a recomputation of signal state.
|
1667
1681
|
*/
|
1668
1682
|
async update(newData) {
|
1669
|
-
var _a, _b, _c, _d;
|
1683
|
+
var _a, _b, _c, _d, _e;
|
1670
1684
|
const commands = [];
|
1671
1685
|
const newServerSideTests = {};
|
1672
1686
|
if ((_a = __privateGet(this, _serverTransitionState)) == null ? void 0 : _a.quirks) {
|
@@ -1761,6 +1775,10 @@ var Context = class {
|
|
1761
1775
|
});
|
1762
1776
|
await this.storage.updateData(commands);
|
1763
1777
|
if (__privateGet(this, _serverTransitionState)) {
|
1778
|
+
await this.processServerCommands({
|
1779
|
+
serverCommands: __privateGet(this, _serverTransitionState).commands,
|
1780
|
+
commands
|
1781
|
+
});
|
1764
1782
|
__privateMethod(this, _updateComputedScores, updateComputedScores_fn).call(this, this.storage.data);
|
1765
1783
|
Object.entries(newServerSideTests).forEach(([testName, testVariantId]) => {
|
1766
1784
|
__privateMethod(this, _emitTest, emitTest_fn).call(this, {
|
@@ -1781,10 +1799,31 @@ var Context = class {
|
|
1781
1799
|
await plugin.update(newData);
|
1782
1800
|
}
|
1783
1801
|
}
|
1802
|
+
(_e = __privateGet(this, _commands)) == null ? void 0 : _e.push(...commands);
|
1784
1803
|
} finally {
|
1785
1804
|
__privateGet(this, _mitt3).emit("log", ["info", 2, "ENDGROUP"]);
|
1786
1805
|
}
|
1787
1806
|
}
|
1807
|
+
async processServerCommands({
|
1808
|
+
serverCommands,
|
1809
|
+
commands
|
1810
|
+
}) {
|
1811
|
+
if (!(serverCommands == null ? void 0 : serverCommands.length)) {
|
1812
|
+
return;
|
1813
|
+
}
|
1814
|
+
const notExecutedCommands = [];
|
1815
|
+
serverCommands.forEach((serverCommand) => {
|
1816
|
+
const found = commands.find((command) => {
|
1817
|
+
return areCommandsEqual(command, serverCommand);
|
1818
|
+
});
|
1819
|
+
if (!found) {
|
1820
|
+
notExecutedCommands.push(serverCommand);
|
1821
|
+
}
|
1822
|
+
});
|
1823
|
+
if (notExecutedCommands.length > 0) {
|
1824
|
+
await this.storage.updateData(notExecutedCommands);
|
1825
|
+
}
|
1826
|
+
}
|
1788
1827
|
/** use test() instead */
|
1789
1828
|
getTestVariantId(testName) {
|
1790
1829
|
var _a, _b, _c, _d;
|
@@ -1863,7 +1902,7 @@ var Context = class {
|
|
1863
1902
|
control: this.storage.data.controlGroup,
|
1864
1903
|
changed: true
|
1865
1904
|
};
|
1866
|
-
if (previousPlacement && (0,
|
1905
|
+
if (previousPlacement && (0, import_lite5.dequal)(eventData.variantIds, previousPlacement)) {
|
1867
1906
|
eventData.changed = false;
|
1868
1907
|
}
|
1869
1908
|
__privateGet(this, _mitt3).emit("personalizationResult", eventData);
|
@@ -1897,7 +1936,8 @@ var Context = class {
|
|
1897
1936
|
quirks: this.storage.data.quirks,
|
1898
1937
|
ssv: __privateGet(this, _scores),
|
1899
1938
|
tests: {},
|
1900
|
-
personalizeVariants: this.storage.data.personalizeVariants
|
1939
|
+
personalizeVariants: this.storage.data.personalizeVariants,
|
1940
|
+
commands: __privateGet(this, _commands)
|
1901
1941
|
};
|
1902
1942
|
const allTests = this.storage.data.tests;
|
1903
1943
|
Object.entries(allTests).map(([testName, testValue]) => {
|
@@ -1926,6 +1966,7 @@ _scores = new WeakMap();
|
|
1926
1966
|
_state = new WeakMap();
|
1927
1967
|
_pzCache = new WeakMap();
|
1928
1968
|
_plugins = new WeakMap();
|
1969
|
+
_commands = new WeakMap();
|
1929
1970
|
_mitt3 = new WeakMap();
|
1930
1971
|
_emitTest = new WeakSet();
|
1931
1972
|
emitTest_fn = function(event) {
|
@@ -1941,7 +1982,7 @@ updateGoals_fn = async function(data) {
|
|
1941
1982
|
_updateComputedScores = new WeakSet();
|
1942
1983
|
updateComputedScores_fn = function(newData) {
|
1943
1984
|
const newScores = __privateMethod(this, _calculateScores, calculateScores_fn).call(this, newData);
|
1944
|
-
const newScoresHaveChanged = !(0,
|
1985
|
+
const newScoresHaveChanged = !(0, import_lite5.dequal)(newScores, __privateGet(this, _scores));
|
1945
1986
|
if (newScoresHaveChanged) {
|
1946
1987
|
__privateSet(this, _scores, newScores);
|
1947
1988
|
__privateMethod(this, _updateGoals, updateGoals_fn).call(this, {
|
@@ -2613,6 +2654,7 @@ function parseQuickConnect(serialized) {
|
|
2613
2654
|
TransitionDataStore,
|
2614
2655
|
UNIFORM_DEFAULT_COOKIE_NAME,
|
2615
2656
|
VisitorDataStore,
|
2657
|
+
areCommandsEqual,
|
2616
2658
|
computeAggregateDimensions,
|
2617
2659
|
cookieEvaluator,
|
2618
2660
|
createConsoleLogDrain,
|
package/dist/index.mjs
CHANGED
@@ -826,11 +826,20 @@ var testVariations = ({
|
|
826
826
|
}
|
827
827
|
};
|
828
828
|
|
829
|
+
// src/storage/commands.ts
|
830
|
+
import { dequal as dequal2 } from "dequal/lite";
|
831
|
+
var areCommandsEqual = (a, b) => {
|
832
|
+
if (a.type !== b.type) {
|
833
|
+
return false;
|
834
|
+
}
|
835
|
+
return dequal2(a, b);
|
836
|
+
};
|
837
|
+
|
829
838
|
// src/storage/CookieTransitionDataStore.ts
|
830
839
|
import Cookies from "js-cookie";
|
831
840
|
|
832
841
|
// src/storage/TransitionDataStore.ts
|
833
|
-
import { dequal as
|
842
|
+
import { dequal as dequal3 } from "dequal/lite";
|
834
843
|
import mitt from "mitt";
|
835
844
|
var SERVER_STATE_ID = "__UNIFORM_DATA__";
|
836
845
|
var _data, _initialData, _mitt;
|
@@ -876,7 +885,7 @@ var TransitionDataStore = class {
|
|
876
885
|
await this.handleDelete(fromAllDevices);
|
877
886
|
}
|
878
887
|
signalAsyncDataUpdate(newScores) {
|
879
|
-
if (
|
888
|
+
if (dequal3(this.data, newScores)) {
|
880
889
|
return;
|
881
890
|
}
|
882
891
|
__privateSet(this, _data, newScores);
|
@@ -1149,7 +1158,7 @@ var emptyVisitorData = () => ({
|
|
1149
1158
|
});
|
1150
1159
|
|
1151
1160
|
// src/storage/VisitorDataStore.ts
|
1152
|
-
import { dequal as
|
1161
|
+
import { dequal as dequal4 } from "dequal/lite";
|
1153
1162
|
import mitt2 from "mitt";
|
1154
1163
|
|
1155
1164
|
// src/storage/util/applyCommandsToData.ts
|
@@ -1399,11 +1408,11 @@ replaceData_fn = function(data, quiet = false) {
|
|
1399
1408
|
onLogMessage: __privateGet(this, _options).onLogMessage
|
1400
1409
|
});
|
1401
1410
|
}
|
1402
|
-
const haveScoresChanged = !
|
1403
|
-
const haveSessionScoresChanged = !
|
1404
|
-
const haveQuirksChanged = !
|
1405
|
-
const haveTestsChanged = !
|
1406
|
-
const haveGoalsChanged = !
|
1411
|
+
const haveScoresChanged = !dequal4(oldData == null ? void 0 : oldData.visitorData.scores, data.scores);
|
1412
|
+
const haveSessionScoresChanged = !dequal4(oldData == null ? void 0 : oldData.visitorData.sessionScores, data.sessionScores);
|
1413
|
+
const haveQuirksChanged = !dequal4(oldData == null ? void 0 : oldData.visitorData.quirks, data.quirks);
|
1414
|
+
const haveTestsChanged = !dequal4(oldData == null ? void 0 : oldData.visitorData.tests, data.tests);
|
1415
|
+
const haveGoalsChanged = !dequal4(oldData == null ? void 0 : oldData.visitorData.goals, data.goals);
|
1407
1416
|
const updatedData = {
|
1408
1417
|
updated: now,
|
1409
1418
|
visitorData: data
|
@@ -1485,11 +1494,11 @@ defaultData_fn = function() {
|
|
1485
1494
|
};
|
1486
1495
|
|
1487
1496
|
// src/Context.ts
|
1488
|
-
import { dequal as
|
1497
|
+
import { dequal as dequal5 } from "dequal/lite";
|
1489
1498
|
import mitt3 from "mitt";
|
1490
1499
|
var CONTEXTUAL_EDITING_TEST_NAME = "contextual_editing_test";
|
1491
1500
|
var CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID = "contextual_editing_test_selected_variant";
|
1492
|
-
var _serverTransitionState, _scores, _state, _pzCache, _plugins, _mitt3, _emitTest, emitTest_fn, _updateGoals, updateGoals_fn, _updateComputedScores, updateComputedScores_fn, _calculateScores, calculateScores_fn;
|
1501
|
+
var _serverTransitionState, _scores, _state, _pzCache, _plugins, _commands, _mitt3, _emitTest, emitTest_fn, _updateGoals, updateGoals_fn, _updateComputedScores, updateComputedScores_fn, _calculateScores, calculateScores_fn;
|
1493
1502
|
var Context = class {
|
1494
1503
|
constructor(options) {
|
1495
1504
|
__privateAdd(this, _emitTest);
|
@@ -1502,6 +1511,7 @@ var Context = class {
|
|
1502
1511
|
__privateAdd(this, _state, void 0);
|
1503
1512
|
__privateAdd(this, _pzCache, {});
|
1504
1513
|
__privateAdd(this, _plugins, void 0);
|
1514
|
+
__privateAdd(this, _commands, void 0);
|
1505
1515
|
__privateAdd(this, _mitt3, mitt3());
|
1506
1516
|
/**
|
1507
1517
|
* Subscribe to events
|
@@ -1515,6 +1525,9 @@ var Context = class {
|
|
1515
1525
|
const { manifest, ...storageOptions } = options;
|
1516
1526
|
__privateSet(this, _state, {});
|
1517
1527
|
__privateSet(this, _plugins, options.plugins);
|
1528
|
+
if (typeof options.transitionStore !== "undefined") {
|
1529
|
+
__privateSet(this, _commands, []);
|
1530
|
+
}
|
1518
1531
|
(_a = __privateGet(this, _plugins)) == null ? void 0 : _a.forEach((plugin) => {
|
1519
1532
|
if (!plugin.logDrain) {
|
1520
1533
|
return;
|
@@ -1595,7 +1608,7 @@ var Context = class {
|
|
1595
1608
|
* will NOT result in a recomputation of signal state.
|
1596
1609
|
*/
|
1597
1610
|
async update(newData) {
|
1598
|
-
var _a, _b, _c, _d;
|
1611
|
+
var _a, _b, _c, _d, _e;
|
1599
1612
|
const commands = [];
|
1600
1613
|
const newServerSideTests = {};
|
1601
1614
|
if ((_a = __privateGet(this, _serverTransitionState)) == null ? void 0 : _a.quirks) {
|
@@ -1690,6 +1703,10 @@ var Context = class {
|
|
1690
1703
|
});
|
1691
1704
|
await this.storage.updateData(commands);
|
1692
1705
|
if (__privateGet(this, _serverTransitionState)) {
|
1706
|
+
await this.processServerCommands({
|
1707
|
+
serverCommands: __privateGet(this, _serverTransitionState).commands,
|
1708
|
+
commands
|
1709
|
+
});
|
1693
1710
|
__privateMethod(this, _updateComputedScores, updateComputedScores_fn).call(this, this.storage.data);
|
1694
1711
|
Object.entries(newServerSideTests).forEach(([testName, testVariantId]) => {
|
1695
1712
|
__privateMethod(this, _emitTest, emitTest_fn).call(this, {
|
@@ -1710,10 +1727,31 @@ var Context = class {
|
|
1710
1727
|
await plugin.update(newData);
|
1711
1728
|
}
|
1712
1729
|
}
|
1730
|
+
(_e = __privateGet(this, _commands)) == null ? void 0 : _e.push(...commands);
|
1713
1731
|
} finally {
|
1714
1732
|
__privateGet(this, _mitt3).emit("log", ["info", 2, "ENDGROUP"]);
|
1715
1733
|
}
|
1716
1734
|
}
|
1735
|
+
async processServerCommands({
|
1736
|
+
serverCommands,
|
1737
|
+
commands
|
1738
|
+
}) {
|
1739
|
+
if (!(serverCommands == null ? void 0 : serverCommands.length)) {
|
1740
|
+
return;
|
1741
|
+
}
|
1742
|
+
const notExecutedCommands = [];
|
1743
|
+
serverCommands.forEach((serverCommand) => {
|
1744
|
+
const found = commands.find((command) => {
|
1745
|
+
return areCommandsEqual(command, serverCommand);
|
1746
|
+
});
|
1747
|
+
if (!found) {
|
1748
|
+
notExecutedCommands.push(serverCommand);
|
1749
|
+
}
|
1750
|
+
});
|
1751
|
+
if (notExecutedCommands.length > 0) {
|
1752
|
+
await this.storage.updateData(notExecutedCommands);
|
1753
|
+
}
|
1754
|
+
}
|
1717
1755
|
/** use test() instead */
|
1718
1756
|
getTestVariantId(testName) {
|
1719
1757
|
var _a, _b, _c, _d;
|
@@ -1792,7 +1830,7 @@ var Context = class {
|
|
1792
1830
|
control: this.storage.data.controlGroup,
|
1793
1831
|
changed: true
|
1794
1832
|
};
|
1795
|
-
if (previousPlacement &&
|
1833
|
+
if (previousPlacement && dequal5(eventData.variantIds, previousPlacement)) {
|
1796
1834
|
eventData.changed = false;
|
1797
1835
|
}
|
1798
1836
|
__privateGet(this, _mitt3).emit("personalizationResult", eventData);
|
@@ -1826,7 +1864,8 @@ var Context = class {
|
|
1826
1864
|
quirks: this.storage.data.quirks,
|
1827
1865
|
ssv: __privateGet(this, _scores),
|
1828
1866
|
tests: {},
|
1829
|
-
personalizeVariants: this.storage.data.personalizeVariants
|
1867
|
+
personalizeVariants: this.storage.data.personalizeVariants,
|
1868
|
+
commands: __privateGet(this, _commands)
|
1830
1869
|
};
|
1831
1870
|
const allTests = this.storage.data.tests;
|
1832
1871
|
Object.entries(allTests).map(([testName, testValue]) => {
|
@@ -1855,6 +1894,7 @@ _scores = new WeakMap();
|
|
1855
1894
|
_state = new WeakMap();
|
1856
1895
|
_pzCache = new WeakMap();
|
1857
1896
|
_plugins = new WeakMap();
|
1897
|
+
_commands = new WeakMap();
|
1858
1898
|
_mitt3 = new WeakMap();
|
1859
1899
|
_emitTest = new WeakSet();
|
1860
1900
|
emitTest_fn = function(event) {
|
@@ -1870,7 +1910,7 @@ updateGoals_fn = async function(data) {
|
|
1870
1910
|
_updateComputedScores = new WeakSet();
|
1871
1911
|
updateComputedScores_fn = function(newData) {
|
1872
1912
|
const newScores = __privateMethod(this, _calculateScores, calculateScores_fn).call(this, newData);
|
1873
|
-
const newScoresHaveChanged = !
|
1913
|
+
const newScoresHaveChanged = !dequal5(newScores, __privateGet(this, _scores));
|
1874
1914
|
if (newScoresHaveChanged) {
|
1875
1915
|
__privateSet(this, _scores, newScores);
|
1876
1916
|
__privateMethod(this, _updateGoals, updateGoals_fn).call(this, {
|
@@ -2541,6 +2581,7 @@ export {
|
|
2541
2581
|
TransitionDataStore,
|
2542
2582
|
UNIFORM_DEFAULT_COOKIE_NAME,
|
2543
2583
|
VisitorDataStore,
|
2584
|
+
areCommandsEqual,
|
2544
2585
|
computeAggregateDimensions,
|
2545
2586
|
cookieEvaluator,
|
2546
2587
|
createConsoleLogDrain,
|
@@ -158,6 +158,7 @@ type SetPersonalizeVariantControlCommand = StorageCommand<'setpersonalizecontrol
|
|
158
158
|
index: number;
|
159
159
|
control: boolean;
|
160
160
|
}>;
|
161
|
+
declare const areCommandsEqual: (a: StorageCommands, b: StorageCommands) => boolean;
|
161
162
|
|
162
163
|
type TransitionDataStoreOptions = {
|
163
164
|
initialData?: Partial<VisitorData>;
|
@@ -169,6 +170,10 @@ type ServerToClientTransitionState = Pick<Partial<VisitorData>, 'quirks' | 'test
|
|
169
170
|
* recomputation.
|
170
171
|
*/
|
171
172
|
ssv?: ScoreVector;
|
173
|
+
/**
|
174
|
+
* Storage commands that the server
|
175
|
+
*/
|
176
|
+
commands?: StorageCommands[];
|
172
177
|
};
|
173
178
|
declare const SERVER_STATE_ID = "__UNIFORM_DATA__";
|
174
179
|
type TransitionDataStoreEvents = {
|
@@ -528,7 +533,7 @@ interface external {
|
|
528
533
|
* & = AND
|
529
534
|
* | = OR
|
530
535
|
*
|
531
|
-
* Default is `&` if unspecified
|
536
|
+
* Default is `&` if unspecified
|
532
537
|
*
|
533
538
|
* @default &
|
534
539
|
* @enum {string}
|
@@ -555,7 +560,7 @@ interface external {
|
|
555
560
|
* & = AND
|
556
561
|
* | = OR
|
557
562
|
*
|
558
|
-
* Default is `&` if unspecified
|
563
|
+
* Default is `&` if unspecified
|
559
564
|
*
|
560
565
|
* @enum {string}
|
561
566
|
*/
|
@@ -616,7 +621,7 @@ interface external {
|
|
616
621
|
};
|
617
622
|
/** @description Describes a match expression on a string */
|
618
623
|
StringMatch: {
|
619
|
-
/** @description The right
|
624
|
+
/** @description The right-hand side of the match expression */
|
620
625
|
rhs: string;
|
621
626
|
/**
|
622
627
|
* @description The match operator
|
@@ -629,7 +634,7 @@ interface external {
|
|
629
634
|
* @enum {string}
|
630
635
|
*/
|
631
636
|
op: "=" | "~" | "//" | "!=" | "!~" | "!//";
|
632
|
-
/** @description The case sensitivity of the match. Defaults to false if unspecified
|
637
|
+
/** @description The case sensitivity of the match. Defaults to false if unspecified */
|
633
638
|
cs?: boolean;
|
634
639
|
} | {
|
635
640
|
/**
|
@@ -643,7 +648,7 @@ interface external {
|
|
643
648
|
};
|
644
649
|
/** @description Describes a match expression on a number */
|
645
650
|
NumberMatch: {
|
646
|
-
/** @description The right
|
651
|
+
/** @description The right-hand side of the match expression */
|
647
652
|
rhs: number;
|
648
653
|
/**
|
649
654
|
* @description The type of match to perform
|
@@ -656,7 +661,7 @@ interface external {
|
|
656
661
|
*/
|
657
662
|
op: "=" | "<" | ">" | "!=";
|
658
663
|
};
|
659
|
-
/** @description Defines an aggregate dimension that is a grouping of other dimensions' scores; an intent or audience
|
664
|
+
/** @description Defines an aggregate dimension that is a grouping of other dimensions' scores; an intent or audience */
|
660
665
|
AggregateDimension: {
|
661
666
|
/** @description Input dimensions to the aggregate dimension */
|
662
667
|
inputs: external["uniform-context-types.swagger.yml"]["components"]["schemas"]["AggregateDimensionInput"][];
|
@@ -670,7 +675,7 @@ interface external {
|
|
670
675
|
*
|
671
676
|
* Note that creating a cycle of aggregate dimensions is allowed, however
|
672
677
|
* the final score will _ignore_ the cycled aggregate dimension in the result.
|
673
|
-
* This can be used to create mutually exclusive aggregates
|
678
|
+
* This can be used to create mutually exclusive aggregates
|
674
679
|
*/
|
675
680
|
dim: string;
|
676
681
|
/**
|
@@ -678,7 +683,7 @@ interface external {
|
|
678
683
|
*
|
679
684
|
* '+' = add to the final score
|
680
685
|
* '-' = subtract from the final score
|
681
|
-
* 'c' = clear the final score (if the input dimension has any score at all, this
|
686
|
+
* 'c' = clear the final score (if the input dimension has any score at all, this aggregate will have no score regardless of other inputs)
|
682
687
|
*
|
683
688
|
* Default if unspecified: '+'
|
684
689
|
*
|
@@ -1112,6 +1117,10 @@ declare class Context implements ContextInstance {
|
|
1112
1117
|
* will NOT result in a recomputation of signal state.
|
1113
1118
|
*/
|
1114
1119
|
update(newData: Partial<ContextState>): Promise<void>;
|
1120
|
+
processServerCommands({ serverCommands, commands, }: {
|
1121
|
+
serverCommands: StorageCommands[] | undefined;
|
1122
|
+
commands: StorageCommands[];
|
1123
|
+
}): Promise<void>;
|
1115
1124
|
/** use test() instead */
|
1116
1125
|
getTestVariantId(testName: string): string | null | undefined;
|
1117
1126
|
/** use test() instead */
|
@@ -1207,4 +1216,4 @@ declare global {
|
|
1207
1216
|
}
|
1208
1217
|
}
|
1209
1218
|
|
1210
|
-
export { type TestOptions as $, type AggregateDimension as A, type MessageFunc as B, type ContextPlugin as C, type DecayFunction as D, type LogMessageSingle as E, type LogMessageGroup as F, ManifestInstance as G, GroupCriteriaEvaluator as H, type CriteriaEvaluatorResult as I, type CriteriaEvaluatorParameters as J, type SignalData as K, type LogDrain as L, type MessageCategory as M, type ManifestV2 as N, type OutputSeverity as O, type PersonalizationEvent as P, type PersonalizationManifest as Q, type Signal as R, type ScoreVector as S, TransitionDataStore as T, type SignalCriteriaGroup as U, type VisitorData as V, type SignalCriteria as W, type EnrichmentCategory as X, type NumberMatch as Y, type TestDefinition as Z, type AggregateDimensionInput as _, type StorageCommands as a, testVariations as a0, type DimensionMatch as a1, type PersonalizeOptions as a2, personalizeVariations as a3, type BehaviorTag as a4, type PersonalizedVariant as a5, type PersonalizedResult as a6, type TestVariant as a7, type TestResult as a8, type StorageCommand as a9, type
|
1219
|
+
export { type TestOptions as $, type AggregateDimension as A, type MessageFunc as B, type ContextPlugin as C, type DecayFunction as D, type LogMessageSingle as E, type LogMessageGroup as F, ManifestInstance as G, GroupCriteriaEvaluator as H, type CriteriaEvaluatorResult as I, type CriteriaEvaluatorParameters as J, type SignalData as K, type LogDrain as L, type MessageCategory as M, type ManifestV2 as N, type OutputSeverity as O, type PersonalizationEvent as P, type PersonalizationManifest as Q, type Signal as R, type ScoreVector as S, TransitionDataStore as T, type SignalCriteriaGroup as U, type VisitorData as V, type SignalCriteria as W, type EnrichmentCategory as X, type NumberMatch as Y, type TestDefinition as Z, type AggregateDimensionInput as _, type StorageCommands as a, testVariations as a0, type DimensionMatch as a1, type PersonalizeOptions as a2, personalizeVariations as a3, type BehaviorTag as a4, type PersonalizedVariant as a5, type PersonalizedResult as a6, type TestVariant as a7, type TestResult as a8, type StorageCommand as a9, type ContextStateUpdate as aA, type GoalStateUpdate as aB, type paths as aC, type SetGoalCommand as aa, type ModifyScoreCommand as ab, type ModifySessionScoreCommand as ac, type SetConsentCommand as ad, type SetQuirkCommand as ae, type SetTestCommand as af, type IdentifyCommand as ag, type SetControlGroupCommand as ah, type SetPersonalizeVariantControlCommand as ai, areCommandsEqual as aj, type ServerToClientTransitionState as ak, SERVER_STATE_ID as al, type TransitionDataStoreEvents as am, type DecayOptions as an, type VisitorDataStoreOptions as ao, type VisitorDataStoreEvents as ap, VisitorDataStore as aq, type Quirks as ar, type Tests as as, type Goals as at, type EnrichmentData as au, type PersonalizeControlVariant as av, type PersonalizeVariants as aw, type EventData as ax, emptyVisitorData as ay, type ContextState as az, type TransitionDataStoreOptions as b, type CriteriaEvaluator as c, type StringMatch as d, type VariantMatchCriteria as e, type LogMessage as f, type DevToolsEvents as g, CONTEXTUAL_EDITING_TEST_NAME as h, CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID as i, type ContextOptions as j, type TestEvent as k, type ContextEvents as l, type ContextInstance as m, Context as n, type DevToolsUiVersion as o, type DevToolsState as p, type DevToolsActions as q, type DevToolsEvent as r, type DevToolsLogEvent as s, type DevToolsDataEvent as t, type DevToolsHelloEvent as u, type DevToolsUpdateEvent as v, type DevToolsRawCommandsEvent as w, type DevToolsForgetEvent as x, type LogMessages as y, type Severity as z };
|
@@ -158,6 +158,7 @@ type SetPersonalizeVariantControlCommand = StorageCommand<'setpersonalizecontrol
|
|
158
158
|
index: number;
|
159
159
|
control: boolean;
|
160
160
|
}>;
|
161
|
+
declare const areCommandsEqual: (a: StorageCommands, b: StorageCommands) => boolean;
|
161
162
|
|
162
163
|
type TransitionDataStoreOptions = {
|
163
164
|
initialData?: Partial<VisitorData>;
|
@@ -169,6 +170,10 @@ type ServerToClientTransitionState = Pick<Partial<VisitorData>, 'quirks' | 'test
|
|
169
170
|
* recomputation.
|
170
171
|
*/
|
171
172
|
ssv?: ScoreVector;
|
173
|
+
/**
|
174
|
+
* Storage commands that the server
|
175
|
+
*/
|
176
|
+
commands?: StorageCommands[];
|
172
177
|
};
|
173
178
|
declare const SERVER_STATE_ID = "__UNIFORM_DATA__";
|
174
179
|
type TransitionDataStoreEvents = {
|
@@ -528,7 +533,7 @@ interface external {
|
|
528
533
|
* & = AND
|
529
534
|
* | = OR
|
530
535
|
*
|
531
|
-
* Default is `&` if unspecified
|
536
|
+
* Default is `&` if unspecified
|
532
537
|
*
|
533
538
|
* @default &
|
534
539
|
* @enum {string}
|
@@ -555,7 +560,7 @@ interface external {
|
|
555
560
|
* & = AND
|
556
561
|
* | = OR
|
557
562
|
*
|
558
|
-
* Default is `&` if unspecified
|
563
|
+
* Default is `&` if unspecified
|
559
564
|
*
|
560
565
|
* @enum {string}
|
561
566
|
*/
|
@@ -616,7 +621,7 @@ interface external {
|
|
616
621
|
};
|
617
622
|
/** @description Describes a match expression on a string */
|
618
623
|
StringMatch: {
|
619
|
-
/** @description The right
|
624
|
+
/** @description The right-hand side of the match expression */
|
620
625
|
rhs: string;
|
621
626
|
/**
|
622
627
|
* @description The match operator
|
@@ -629,7 +634,7 @@ interface external {
|
|
629
634
|
* @enum {string}
|
630
635
|
*/
|
631
636
|
op: "=" | "~" | "//" | "!=" | "!~" | "!//";
|
632
|
-
/** @description The case sensitivity of the match. Defaults to false if unspecified
|
637
|
+
/** @description The case sensitivity of the match. Defaults to false if unspecified */
|
633
638
|
cs?: boolean;
|
634
639
|
} | {
|
635
640
|
/**
|
@@ -643,7 +648,7 @@ interface external {
|
|
643
648
|
};
|
644
649
|
/** @description Describes a match expression on a number */
|
645
650
|
NumberMatch: {
|
646
|
-
/** @description The right
|
651
|
+
/** @description The right-hand side of the match expression */
|
647
652
|
rhs: number;
|
648
653
|
/**
|
649
654
|
* @description The type of match to perform
|
@@ -656,7 +661,7 @@ interface external {
|
|
656
661
|
*/
|
657
662
|
op: "=" | "<" | ">" | "!=";
|
658
663
|
};
|
659
|
-
/** @description Defines an aggregate dimension that is a grouping of other dimensions' scores; an intent or audience
|
664
|
+
/** @description Defines an aggregate dimension that is a grouping of other dimensions' scores; an intent or audience */
|
660
665
|
AggregateDimension: {
|
661
666
|
/** @description Input dimensions to the aggregate dimension */
|
662
667
|
inputs: external["uniform-context-types.swagger.yml"]["components"]["schemas"]["AggregateDimensionInput"][];
|
@@ -670,7 +675,7 @@ interface external {
|
|
670
675
|
*
|
671
676
|
* Note that creating a cycle of aggregate dimensions is allowed, however
|
672
677
|
* the final score will _ignore_ the cycled aggregate dimension in the result.
|
673
|
-
* This can be used to create mutually exclusive aggregates
|
678
|
+
* This can be used to create mutually exclusive aggregates
|
674
679
|
*/
|
675
680
|
dim: string;
|
676
681
|
/**
|
@@ -678,7 +683,7 @@ interface external {
|
|
678
683
|
*
|
679
684
|
* '+' = add to the final score
|
680
685
|
* '-' = subtract from the final score
|
681
|
-
* 'c' = clear the final score (if the input dimension has any score at all, this
|
686
|
+
* 'c' = clear the final score (if the input dimension has any score at all, this aggregate will have no score regardless of other inputs)
|
682
687
|
*
|
683
688
|
* Default if unspecified: '+'
|
684
689
|
*
|
@@ -1112,6 +1117,10 @@ declare class Context implements ContextInstance {
|
|
1112
1117
|
* will NOT result in a recomputation of signal state.
|
1113
1118
|
*/
|
1114
1119
|
update(newData: Partial<ContextState>): Promise<void>;
|
1120
|
+
processServerCommands({ serverCommands, commands, }: {
|
1121
|
+
serverCommands: StorageCommands[] | undefined;
|
1122
|
+
commands: StorageCommands[];
|
1123
|
+
}): Promise<void>;
|
1115
1124
|
/** use test() instead */
|
1116
1125
|
getTestVariantId(testName: string): string | null | undefined;
|
1117
1126
|
/** use test() instead */
|
@@ -1207,4 +1216,4 @@ declare global {
|
|
1207
1216
|
}
|
1208
1217
|
}
|
1209
1218
|
|
1210
|
-
export { type TestOptions as $, type AggregateDimension as A, type MessageFunc as B, type ContextPlugin as C, type DecayFunction as D, type LogMessageSingle as E, type LogMessageGroup as F, ManifestInstance as G, GroupCriteriaEvaluator as H, type CriteriaEvaluatorResult as I, type CriteriaEvaluatorParameters as J, type SignalData as K, type LogDrain as L, type MessageCategory as M, type ManifestV2 as N, type OutputSeverity as O, type PersonalizationEvent as P, type PersonalizationManifest as Q, type Signal as R, type ScoreVector as S, TransitionDataStore as T, type SignalCriteriaGroup as U, type VisitorData as V, type SignalCriteria as W, type EnrichmentCategory as X, type NumberMatch as Y, type TestDefinition as Z, type AggregateDimensionInput as _, type StorageCommands as a, testVariations as a0, type DimensionMatch as a1, type PersonalizeOptions as a2, personalizeVariations as a3, type BehaviorTag as a4, type PersonalizedVariant as a5, type PersonalizedResult as a6, type TestVariant as a7, type TestResult as a8, type StorageCommand as a9, type
|
1219
|
+
export { type TestOptions as $, type AggregateDimension as A, type MessageFunc as B, type ContextPlugin as C, type DecayFunction as D, type LogMessageSingle as E, type LogMessageGroup as F, ManifestInstance as G, GroupCriteriaEvaluator as H, type CriteriaEvaluatorResult as I, type CriteriaEvaluatorParameters as J, type SignalData as K, type LogDrain as L, type MessageCategory as M, type ManifestV2 as N, type OutputSeverity as O, type PersonalizationEvent as P, type PersonalizationManifest as Q, type Signal as R, type ScoreVector as S, TransitionDataStore as T, type SignalCriteriaGroup as U, type VisitorData as V, type SignalCriteria as W, type EnrichmentCategory as X, type NumberMatch as Y, type TestDefinition as Z, type AggregateDimensionInput as _, type StorageCommands as a, testVariations as a0, type DimensionMatch as a1, type PersonalizeOptions as a2, personalizeVariations as a3, type BehaviorTag as a4, type PersonalizedVariant as a5, type PersonalizedResult as a6, type TestVariant as a7, type TestResult as a8, type StorageCommand as a9, type ContextStateUpdate as aA, type GoalStateUpdate as aB, type paths as aC, type SetGoalCommand as aa, type ModifyScoreCommand as ab, type ModifySessionScoreCommand as ac, type SetConsentCommand as ad, type SetQuirkCommand as ae, type SetTestCommand as af, type IdentifyCommand as ag, type SetControlGroupCommand as ah, type SetPersonalizeVariantControlCommand as ai, areCommandsEqual as aj, type ServerToClientTransitionState as ak, SERVER_STATE_ID as al, type TransitionDataStoreEvents as am, type DecayOptions as an, type VisitorDataStoreOptions as ao, type VisitorDataStoreEvents as ap, VisitorDataStore as aq, type Quirks as ar, type Tests as as, type Goals as at, type EnrichmentData as au, type PersonalizeControlVariant as av, type PersonalizeVariants as aw, type EventData as ax, emptyVisitorData as ay, type ContextState as az, type TransitionDataStoreOptions as b, type CriteriaEvaluator as c, type StringMatch as d, type VariantMatchCriteria as e, type LogMessage as f, type DevToolsEvents as g, CONTEXTUAL_EDITING_TEST_NAME as h, CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID as i, type ContextOptions as j, type TestEvent as k, type ContextEvents as l, type ContextInstance as m, Context as n, type DevToolsUiVersion as o, type DevToolsState as p, type DevToolsActions as q, type DevToolsEvent as r, type DevToolsLogEvent as s, type DevToolsDataEvent as t, type DevToolsHelloEvent as u, type DevToolsUpdateEvent as v, type DevToolsRawCommandsEvent as w, type DevToolsForgetEvent as x, type LogMessages as y, type Severity as z };
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@uniformdev/context",
|
3
|
-
"version": "19.154.1-alpha.
|
3
|
+
"version": "19.154.1-alpha.24+6b5f73fb09",
|
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": "6b5f73fb09a0f75fb549cdc6ed754da016b7b345"
|
72
72
|
}
|