@uniformdev/context 19.195.1-alpha.3 → 19.195.1-alpha.4
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 +3 -1
- package/dist/api/api.d.ts +3 -1
- package/dist/api/api.js +2 -1
- package/dist/api/api.mjs +2 -1
- package/dist/index.d.mts +25 -5
- package/dist/index.d.ts +25 -5
- package/dist/index.esm.js +50 -4
- package/dist/index.js +54 -4
- package/dist/index.mjs +50 -4
- package/dist/{types-WXZBuJXL.d.mts → types-BKQBqXvS.d.mts} +1 -1
- package/dist/{types-WXZBuJXL.d.ts → types-BKQBqXvS.d.ts} +1 -1
- package/package.json +2 -2
package/dist/api/api.d.mts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { aC as paths$7, N as ManifestV2 } from '../types-
|
1
|
+
import { aC as paths$7, N as ManifestV2 } from '../types-BKQBqXvS.mjs';
|
2
2
|
import 'mitt';
|
3
3
|
|
4
4
|
type LimitPolicy = <ReturnValue>(func: () => Promise<ReturnValue>) => Promise<ReturnValue>;
|
@@ -22,6 +22,8 @@ type ClientOptions = {
|
|
22
22
|
limitPolicy?: LimitPolicy;
|
23
23
|
/** Specify whether caching is disabled. */
|
24
24
|
bypassCache?: boolean;
|
25
|
+
/** Specify a signal to abort requests. */
|
26
|
+
signal?: AbortSignal;
|
25
27
|
};
|
26
28
|
type ExceptProject<T> = Omit<T, 'projectId'>;
|
27
29
|
declare class ApiClientError extends Error {
|
package/dist/api/api.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { aC as paths$7, N as ManifestV2 } from '../types-
|
1
|
+
import { aC as paths$7, N as ManifestV2 } from '../types-BKQBqXvS.js';
|
2
2
|
import 'mitt';
|
3
3
|
|
4
4
|
type LimitPolicy = <ReturnValue>(func: () => Promise<ReturnValue>) => Promise<ReturnValue>;
|
@@ -22,6 +22,8 @@ type ClientOptions = {
|
|
22
22
|
limitPolicy?: LimitPolicy;
|
23
23
|
/** Specify whether caching is disabled. */
|
24
24
|
bypassCache?: boolean;
|
25
|
+
/** Specify a signal to abort requests. */
|
26
|
+
signal?: AbortSignal;
|
25
27
|
};
|
26
28
|
type ExceptProject<T> = Omit<T, 'projectId'>;
|
27
29
|
declare class ApiClientError extends Error {
|
package/dist/api/api.js
CHANGED
@@ -133,9 +133,10 @@ var ApiClient = class _ApiClient {
|
|
133
133
|
if (this.options.bypassCache) {
|
134
134
|
coreHeaders["x-bypass-cache"] = "true";
|
135
135
|
}
|
136
|
-
const { fetch: fetch2 } = this.options;
|
136
|
+
const { fetch: fetch2, signal } = this.options;
|
137
137
|
const callApi = () => fetch2(fetchUri.toString(), {
|
138
138
|
...options,
|
139
|
+
signal,
|
139
140
|
headers: {
|
140
141
|
...options == null ? void 0 : options.headers,
|
141
142
|
...coreHeaders
|
package/dist/api/api.mjs
CHANGED
@@ -68,9 +68,10 @@ var ApiClient = class _ApiClient {
|
|
68
68
|
if (this.options.bypassCache) {
|
69
69
|
coreHeaders["x-bypass-cache"] = "true";
|
70
70
|
}
|
71
|
-
const { fetch: fetch2 } = this.options;
|
71
|
+
const { fetch: fetch2, signal } = this.options;
|
72
72
|
const callApi = () => fetch2(fetchUri.toString(), {
|
73
73
|
...options,
|
74
|
+
signal,
|
74
75
|
headers: {
|
75
76
|
...options == null ? void 0 : options.headers,
|
76
77
|
...coreHeaders
|
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 {
|
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-BKQBqXvS.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-BKQBqXvS.mjs';
|
3
3
|
import Cookies from 'js-cookie';
|
4
4
|
import 'mitt';
|
5
5
|
|
@@ -27,11 +27,27 @@ type CookieTransitionDataStoreOptions = {
|
|
27
27
|
* IMPORTANT: If not passed, the transition store will not have any effect during SSR.
|
28
28
|
*/
|
29
29
|
serverCookieValue?: string;
|
30
|
+
/**
|
31
|
+
* @deprecated
|
32
|
+
* The value of the quirk cookie during server-side rendering.
|
33
|
+
*/
|
34
|
+
quirkCookieValue?: string;
|
35
|
+
/**
|
36
|
+
* @deprecated
|
37
|
+
* Whether to enable the experimental quirks feature.
|
38
|
+
*/
|
39
|
+
experimental_quirksEnabled?: boolean;
|
30
40
|
/**
|
31
41
|
* The name of the cookie to store client-to-server score information in.
|
32
42
|
* Defaults to UNIFORM_DEFAULT_COOKIE_NAME if not set.
|
33
43
|
*/
|
34
44
|
cookieName?: string;
|
45
|
+
/**
|
46
|
+
* @deprecated
|
47
|
+
* The name of the cookie to store quirks in.
|
48
|
+
* Defaults to UNIFORM_DEFAULT_QUIRK_COOKIE_NAME if not set.
|
49
|
+
*/
|
50
|
+
quirkCookieName?: string;
|
35
51
|
/**
|
36
52
|
* Attributes to set on the transfer cookie.
|
37
53
|
* Persistence is not necessary, because the data is only used for temporary transition;
|
@@ -40,20 +56,23 @@ type CookieTransitionDataStoreOptions = {
|
|
40
56
|
cookieAttributes?: Cookies.CookieAttributes;
|
41
57
|
};
|
42
58
|
declare const UNIFORM_DEFAULT_COOKIE_NAME = "ufvd";
|
59
|
+
declare const UNIFORM_DEFAULT_QUIRK_COOKIE_NAME = "ufvdqk";
|
43
60
|
/**
|
44
61
|
* Handles client-to-server score handoff using an encoded cookie with the visitor score vector.
|
45
62
|
* NOTE: forget me is not supported when on the server side.
|
46
63
|
*/
|
47
64
|
declare class CookieTransitionDataStore extends TransitionDataStore {
|
48
65
|
#private;
|
49
|
-
constructor({ serverCookieValue, cookieName, cookieAttributes, }: CookieTransitionDataStoreOptions);
|
66
|
+
constructor({ serverCookieValue, experimental_quirksEnabled, quirkCookieValue, quirkCookieName, cookieName, cookieAttributes, }: CookieTransitionDataStoreOptions);
|
50
67
|
handleDelete(): Promise<void>;
|
51
68
|
handleUpdateData(_: StorageCommands[], computedValue: VisitorData): Promise<void>;
|
52
69
|
}
|
53
70
|
declare const TYPE_SEP = "~";
|
54
71
|
declare const PAIR_SEP = "!";
|
55
72
|
declare const KV_SEP = "-";
|
56
|
-
declare
|
73
|
+
declare const QUIRK_SEP = "!!";
|
74
|
+
declare function parseScoreCookie(cookieValue: string | undefined, quirkCookieValue?: string): Partial<VisitorData> | undefined;
|
75
|
+
declare function parseQuirkCookie(quirkCookieValue: string): Quirks;
|
57
76
|
declare function parseCookieScores(type: string | undefined): Record<string, string>;
|
58
77
|
declare function parseCookieType(type: string | undefined): Record<string, string>;
|
59
78
|
declare function decodeCookieType(type: Record<string, string>): Record<string, number>;
|
@@ -62,6 +81,7 @@ declare function serializePersonalizeVariants({ personalizeVariants, }: Pick<Vis
|
|
62
81
|
declare function decodePersonalizeVariants(data: string | undefined): VisitorData['personalizeVariants'];
|
63
82
|
declare function encodeCookieType(type: Record<string, number>): Record<string, string>;
|
64
83
|
declare function serializeCookieType(type: Record<string, string>): string;
|
84
|
+
declare function serializeQuirks(quirks: Quirks): string;
|
65
85
|
|
66
86
|
type EdgeTransitionDataStoreOptions = TransitionDataStoreOptions & {
|
67
87
|
serverCookieValue?: string;
|
@@ -189,4 +209,4 @@ type QuickConnectConfig = {
|
|
189
209
|
declare function serializeQuickConnect(config: QuickConnectConfig): string;
|
190
210
|
declare function parseQuickConnect(serialized: string): Required<QuickConnectConfig>;
|
191
211
|
|
192
|
-
export { AggregateDimension, type ConsoleDebugLogDrainOptions, type ContextDevToolOptions, ContextPlugin, CookieTransitionDataStore, type CookieTransitionDataStoreOptions, CriteriaEvaluator, DecayFunction, DevToolsEvents, EdgeNodeTagName, type EdgePersonalizeComponentOptions, type EdgeTestComponentOptions, EdgeTransitionDataStore, type EdgeTransitionDataStoreOptions, type EnableUniformInsightsOptions, KV_SEP, type LinearDecayOptions, LogDrain, LogMessage, OutputSeverity, PAIR_SEP, type QuickConnectConfig, ScoreVector, ScriptType, StorageCommands, StringMatch, TYPE_SEP, TransitionDataStore, TransitionDataStoreOptions, UNIFORM_DEFAULT_COOKIE_NAME, VariantMatchCriteria, VisitorData, computeAggregateDimensions, cookieEvaluator, createConsoleLogDrain, createDebugConsoleLogDrain, createLinearDecay, currentPageEvaluator, decodeCookieType, decodePersonalizeVariants, enableConsoleLogDrain, enableContextDevTools, enableDebugConsoleLogDrain, enableUniformInsights, encodeCookieType, evaluateVariantMatch, eventEvaluator, explainStringMatch, explainStringMatchCriteria, getEnrichmentVectorKey, isStringMatch, pageViewCountDimension, pageViewCountEvaluator, parseCookieScores, parseCookieType, parseQuickConnect, parseScoreCookie, queryStringEvaluator, quirkEvaluator, serializeCookie, serializeCookieType, serializePersonalizeVariants, serializeQuickConnect };
|
212
|
+
export { AggregateDimension, type ConsoleDebugLogDrainOptions, type ContextDevToolOptions, ContextPlugin, CookieTransitionDataStore, type CookieTransitionDataStoreOptions, CriteriaEvaluator, DecayFunction, DevToolsEvents, EdgeNodeTagName, type EdgePersonalizeComponentOptions, type EdgeTestComponentOptions, EdgeTransitionDataStore, type EdgeTransitionDataStoreOptions, type EnableUniformInsightsOptions, KV_SEP, type LinearDecayOptions, LogDrain, LogMessage, OutputSeverity, PAIR_SEP, QUIRK_SEP, type QuickConnectConfig, Quirks, ScoreVector, ScriptType, StorageCommands, StringMatch, TYPE_SEP, TransitionDataStore, TransitionDataStoreOptions, UNIFORM_DEFAULT_COOKIE_NAME, UNIFORM_DEFAULT_QUIRK_COOKIE_NAME, VariantMatchCriteria, VisitorData, computeAggregateDimensions, cookieEvaluator, createConsoleLogDrain, createDebugConsoleLogDrain, createLinearDecay, currentPageEvaluator, decodeCookieType, decodePersonalizeVariants, enableConsoleLogDrain, enableContextDevTools, enableDebugConsoleLogDrain, enableUniformInsights, encodeCookieType, evaluateVariantMatch, eventEvaluator, explainStringMatch, explainStringMatchCriteria, getEnrichmentVectorKey, isStringMatch, pageViewCountDimension, pageViewCountEvaluator, parseCookieScores, parseCookieType, parseQuickConnect, parseQuirkCookie, parseScoreCookie, queryStringEvaluator, quirkEvaluator, serializeCookie, serializeCookieType, serializePersonalizeVariants, serializeQuickConnect, serializeQuirks };
|
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 {
|
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-BKQBqXvS.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-BKQBqXvS.js';
|
3
3
|
import Cookies from 'js-cookie';
|
4
4
|
import 'mitt';
|
5
5
|
|
@@ -27,11 +27,27 @@ type CookieTransitionDataStoreOptions = {
|
|
27
27
|
* IMPORTANT: If not passed, the transition store will not have any effect during SSR.
|
28
28
|
*/
|
29
29
|
serverCookieValue?: string;
|
30
|
+
/**
|
31
|
+
* @deprecated
|
32
|
+
* The value of the quirk cookie during server-side rendering.
|
33
|
+
*/
|
34
|
+
quirkCookieValue?: string;
|
35
|
+
/**
|
36
|
+
* @deprecated
|
37
|
+
* Whether to enable the experimental quirks feature.
|
38
|
+
*/
|
39
|
+
experimental_quirksEnabled?: boolean;
|
30
40
|
/**
|
31
41
|
* The name of the cookie to store client-to-server score information in.
|
32
42
|
* Defaults to UNIFORM_DEFAULT_COOKIE_NAME if not set.
|
33
43
|
*/
|
34
44
|
cookieName?: string;
|
45
|
+
/**
|
46
|
+
* @deprecated
|
47
|
+
* The name of the cookie to store quirks in.
|
48
|
+
* Defaults to UNIFORM_DEFAULT_QUIRK_COOKIE_NAME if not set.
|
49
|
+
*/
|
50
|
+
quirkCookieName?: string;
|
35
51
|
/**
|
36
52
|
* Attributes to set on the transfer cookie.
|
37
53
|
* Persistence is not necessary, because the data is only used for temporary transition;
|
@@ -40,20 +56,23 @@ type CookieTransitionDataStoreOptions = {
|
|
40
56
|
cookieAttributes?: Cookies.CookieAttributes;
|
41
57
|
};
|
42
58
|
declare const UNIFORM_DEFAULT_COOKIE_NAME = "ufvd";
|
59
|
+
declare const UNIFORM_DEFAULT_QUIRK_COOKIE_NAME = "ufvdqk";
|
43
60
|
/**
|
44
61
|
* Handles client-to-server score handoff using an encoded cookie with the visitor score vector.
|
45
62
|
* NOTE: forget me is not supported when on the server side.
|
46
63
|
*/
|
47
64
|
declare class CookieTransitionDataStore extends TransitionDataStore {
|
48
65
|
#private;
|
49
|
-
constructor({ serverCookieValue, cookieName, cookieAttributes, }: CookieTransitionDataStoreOptions);
|
66
|
+
constructor({ serverCookieValue, experimental_quirksEnabled, quirkCookieValue, quirkCookieName, cookieName, cookieAttributes, }: CookieTransitionDataStoreOptions);
|
50
67
|
handleDelete(): Promise<void>;
|
51
68
|
handleUpdateData(_: StorageCommands[], computedValue: VisitorData): Promise<void>;
|
52
69
|
}
|
53
70
|
declare const TYPE_SEP = "~";
|
54
71
|
declare const PAIR_SEP = "!";
|
55
72
|
declare const KV_SEP = "-";
|
56
|
-
declare
|
73
|
+
declare const QUIRK_SEP = "!!";
|
74
|
+
declare function parseScoreCookie(cookieValue: string | undefined, quirkCookieValue?: string): Partial<VisitorData> | undefined;
|
75
|
+
declare function parseQuirkCookie(quirkCookieValue: string): Quirks;
|
57
76
|
declare function parseCookieScores(type: string | undefined): Record<string, string>;
|
58
77
|
declare function parseCookieType(type: string | undefined): Record<string, string>;
|
59
78
|
declare function decodeCookieType(type: Record<string, string>): Record<string, number>;
|
@@ -62,6 +81,7 @@ declare function serializePersonalizeVariants({ personalizeVariants, }: Pick<Vis
|
|
62
81
|
declare function decodePersonalizeVariants(data: string | undefined): VisitorData['personalizeVariants'];
|
63
82
|
declare function encodeCookieType(type: Record<string, number>): Record<string, string>;
|
64
83
|
declare function serializeCookieType(type: Record<string, string>): string;
|
84
|
+
declare function serializeQuirks(quirks: Quirks): string;
|
65
85
|
|
66
86
|
type EdgeTransitionDataStoreOptions = TransitionDataStoreOptions & {
|
67
87
|
serverCookieValue?: string;
|
@@ -189,4 +209,4 @@ type QuickConnectConfig = {
|
|
189
209
|
declare function serializeQuickConnect(config: QuickConnectConfig): string;
|
190
210
|
declare function parseQuickConnect(serialized: string): Required<QuickConnectConfig>;
|
191
211
|
|
192
|
-
export { AggregateDimension, type ConsoleDebugLogDrainOptions, type ContextDevToolOptions, ContextPlugin, CookieTransitionDataStore, type CookieTransitionDataStoreOptions, CriteriaEvaluator, DecayFunction, DevToolsEvents, EdgeNodeTagName, type EdgePersonalizeComponentOptions, type EdgeTestComponentOptions, EdgeTransitionDataStore, type EdgeTransitionDataStoreOptions, type EnableUniformInsightsOptions, KV_SEP, type LinearDecayOptions, LogDrain, LogMessage, OutputSeverity, PAIR_SEP, type QuickConnectConfig, ScoreVector, ScriptType, StorageCommands, StringMatch, TYPE_SEP, TransitionDataStore, TransitionDataStoreOptions, UNIFORM_DEFAULT_COOKIE_NAME, VariantMatchCriteria, VisitorData, computeAggregateDimensions, cookieEvaluator, createConsoleLogDrain, createDebugConsoleLogDrain, createLinearDecay, currentPageEvaluator, decodeCookieType, decodePersonalizeVariants, enableConsoleLogDrain, enableContextDevTools, enableDebugConsoleLogDrain, enableUniformInsights, encodeCookieType, evaluateVariantMatch, eventEvaluator, explainStringMatch, explainStringMatchCriteria, getEnrichmentVectorKey, isStringMatch, pageViewCountDimension, pageViewCountEvaluator, parseCookieScores, parseCookieType, parseQuickConnect, parseScoreCookie, queryStringEvaluator, quirkEvaluator, serializeCookie, serializeCookieType, serializePersonalizeVariants, serializeQuickConnect };
|
212
|
+
export { AggregateDimension, type ConsoleDebugLogDrainOptions, type ContextDevToolOptions, ContextPlugin, CookieTransitionDataStore, type CookieTransitionDataStoreOptions, CriteriaEvaluator, DecayFunction, DevToolsEvents, EdgeNodeTagName, type EdgePersonalizeComponentOptions, type EdgeTestComponentOptions, EdgeTransitionDataStore, type EdgeTransitionDataStoreOptions, type EnableUniformInsightsOptions, KV_SEP, type LinearDecayOptions, LogDrain, LogMessage, OutputSeverity, PAIR_SEP, QUIRK_SEP, type QuickConnectConfig, Quirks, ScoreVector, ScriptType, StorageCommands, StringMatch, TYPE_SEP, TransitionDataStore, TransitionDataStoreOptions, UNIFORM_DEFAULT_COOKIE_NAME, UNIFORM_DEFAULT_QUIRK_COOKIE_NAME, VariantMatchCriteria, VisitorData, computeAggregateDimensions, cookieEvaluator, createConsoleLogDrain, createDebugConsoleLogDrain, createLinearDecay, currentPageEvaluator, decodeCookieType, decodePersonalizeVariants, enableConsoleLogDrain, enableContextDevTools, enableDebugConsoleLogDrain, enableUniformInsights, encodeCookieType, evaluateVariantMatch, eventEvaluator, explainStringMatch, explainStringMatchCriteria, getEnrichmentVectorKey, isStringMatch, pageViewCountDimension, pageViewCountEvaluator, parseCookieScores, parseCookieType, parseQuickConnect, parseQuirkCookie, parseScoreCookie, queryStringEvaluator, quirkEvaluator, serializeCookie, serializeCookieType, serializePersonalizeVariants, serializeQuickConnect, serializeQuirks };
|
package/dist/index.esm.js
CHANGED
@@ -917,20 +917,28 @@ var bton = (base64) => {
|
|
917
917
|
// src/storage/CookieTransitionDataStore.ts
|
918
918
|
var ssr = typeof document === "undefined";
|
919
919
|
var UNIFORM_DEFAULT_COOKIE_NAME = "ufvd";
|
920
|
-
var
|
920
|
+
var UNIFORM_DEFAULT_QUIRK_COOKIE_NAME = `ufvdqk`;
|
921
|
+
var _cookieName, _quirkCookieName, _cookieAttributes, _quirksEnabled;
|
921
922
|
var CookieTransitionDataStore = class extends TransitionDataStore {
|
922
923
|
constructor({
|
923
924
|
serverCookieValue,
|
925
|
+
experimental_quirksEnabled,
|
926
|
+
quirkCookieValue,
|
927
|
+
quirkCookieName = UNIFORM_DEFAULT_QUIRK_COOKIE_NAME,
|
924
928
|
cookieName = UNIFORM_DEFAULT_COOKIE_NAME,
|
925
929
|
cookieAttributes = { sameSite: "lax" }
|
926
930
|
}) {
|
927
931
|
super({
|
928
|
-
initialData: ssr ? parseScoreCookie(serverCookieValue) : void 0
|
932
|
+
initialData: ssr ? parseScoreCookie(serverCookieValue, experimental_quirksEnabled ? quirkCookieValue : void 0) : void 0
|
929
933
|
});
|
930
934
|
__privateAdd(this, _cookieName);
|
935
|
+
__privateAdd(this, _quirkCookieName);
|
931
936
|
__privateAdd(this, _cookieAttributes);
|
937
|
+
__privateAdd(this, _quirksEnabled);
|
932
938
|
__privateSet(this, _cookieName, cookieName);
|
933
939
|
__privateSet(this, _cookieAttributes, cookieAttributes);
|
940
|
+
__privateSet(this, _quirkCookieName, quirkCookieName);
|
941
|
+
__privateSet(this, _quirksEnabled, experimental_quirksEnabled || false);
|
934
942
|
}
|
935
943
|
handleDelete() {
|
936
944
|
if (ssr) return Promise.resolve();
|
@@ -941,17 +949,27 @@ var CookieTransitionDataStore = class extends TransitionDataStore {
|
|
941
949
|
if (ssr) return;
|
942
950
|
if (computedValue.consent) {
|
943
951
|
Cookies.set(__privateGet(this, _cookieName), serializeCookie(computedValue), __privateGet(this, _cookieAttributes));
|
952
|
+
if (__privateGet(this, _quirksEnabled) && Object.keys(computedValue.quirks || {}).length) {
|
953
|
+
const quirkCookieValue = serializeQuirks(computedValue.quirks || {});
|
954
|
+
Cookies.set(__privateGet(this, _quirkCookieName), quirkCookieValue, __privateGet(this, _cookieAttributes));
|
955
|
+
}
|
944
956
|
} else {
|
945
957
|
Cookies.remove(__privateGet(this, _cookieName));
|
958
|
+
if (__privateGet(this, _quirksEnabled)) {
|
959
|
+
Cookies.remove(__privateGet(this, _quirkCookieName));
|
960
|
+
}
|
946
961
|
}
|
947
962
|
}
|
948
963
|
};
|
949
964
|
_cookieName = new WeakMap();
|
965
|
+
_quirkCookieName = new WeakMap();
|
950
966
|
_cookieAttributes = new WeakMap();
|
967
|
+
_quirksEnabled = new WeakMap();
|
951
968
|
var TYPE_SEP = "~";
|
952
969
|
var PAIR_SEP = "!";
|
953
970
|
var KV_SEP = "-";
|
954
|
-
|
971
|
+
var QUIRK_SEP = "!!";
|
972
|
+
function parseScoreCookie(cookieValue, quirkCookieValue) {
|
955
973
|
if (!cookieValue) return;
|
956
974
|
const types = cookieValue.split(TYPE_SEP);
|
957
975
|
if (types.length > 5) return;
|
@@ -965,8 +983,30 @@ function parseScoreCookie(cookieValue) {
|
|
965
983
|
controlGroup: controlGroup === "1",
|
966
984
|
personalizeVariants: decodePersonalizeVariants(personalizeVariants)
|
967
985
|
};
|
986
|
+
if (quirkCookieValue) {
|
987
|
+
data.quirks = parseQuirkCookie(quirkCookieValue);
|
988
|
+
}
|
968
989
|
return data;
|
969
990
|
}
|
991
|
+
function parseQuirkCookie(quirkCookieValue) {
|
992
|
+
const pairs = quirkCookieValue.split(QUIRK_SEP);
|
993
|
+
const splitPairs = pairs.map((pair) => {
|
994
|
+
const sep = pair.indexOf(KV_SEP);
|
995
|
+
if (sep === -1) {
|
996
|
+
return void 0;
|
997
|
+
}
|
998
|
+
return [pair.slice(0, sep), pair.slice(sep + 1)];
|
999
|
+
});
|
1000
|
+
const areAllPairsValid = splitPairs.every((pair) => pair !== void 0);
|
1001
|
+
if (!areAllPairsValid) {
|
1002
|
+
return {};
|
1003
|
+
}
|
1004
|
+
return splitPairs.reduce((acc, cur) => {
|
1005
|
+
const [key, value] = cur;
|
1006
|
+
acc[key] = value;
|
1007
|
+
return acc;
|
1008
|
+
}, {});
|
1009
|
+
}
|
970
1010
|
function parseCookieScores(type) {
|
971
1011
|
if (!type) {
|
972
1012
|
return {};
|
@@ -1051,6 +1091,9 @@ function encodeCookieType(type) {
|
|
1051
1091
|
function serializeCookieType(type) {
|
1052
1092
|
return Object.entries(type).map((kv) => kv.join(KV_SEP)).join(PAIR_SEP);
|
1053
1093
|
}
|
1094
|
+
function serializeQuirks(quirks) {
|
1095
|
+
return Object.entries(quirks).map((kv) => kv.join(KV_SEP)).join(QUIRK_SEP);
|
1096
|
+
}
|
1054
1097
|
|
1055
1098
|
// src/storage/EdgeTransitionDataStore.ts
|
1056
1099
|
var _EdgeTransitionDataStore_instances, fetchData_fn;
|
@@ -2247,7 +2290,6 @@ var createInsights = ({
|
|
2247
2290
|
},
|
2248
2291
|
testResult: (result) => {
|
2249
2292
|
if (!storageData) {
|
2250
|
-
console.error("Insights not initialized");
|
2251
2293
|
return;
|
2252
2294
|
}
|
2253
2295
|
client.testResult({
|
@@ -2551,11 +2593,13 @@ export {
|
|
2551
2593
|
KV_SEP,
|
2552
2594
|
ManifestInstance,
|
2553
2595
|
PAIR_SEP,
|
2596
|
+
QUIRK_SEP,
|
2554
2597
|
SERVER_STATE_ID,
|
2555
2598
|
ScriptType,
|
2556
2599
|
TYPE_SEP,
|
2557
2600
|
TransitionDataStore,
|
2558
2601
|
UNIFORM_DEFAULT_COOKIE_NAME,
|
2602
|
+
UNIFORM_DEFAULT_QUIRK_COOKIE_NAME,
|
2559
2603
|
VisitorDataStore,
|
2560
2604
|
areCommandsEqual,
|
2561
2605
|
computeAggregateDimensions,
|
@@ -2583,6 +2627,7 @@ export {
|
|
2583
2627
|
parseCookieScores,
|
2584
2628
|
parseCookieType,
|
2585
2629
|
parseQuickConnect,
|
2630
|
+
parseQuirkCookie,
|
2586
2631
|
parseScoreCookie,
|
2587
2632
|
personalizeVariations,
|
2588
2633
|
queryStringEvaluator,
|
@@ -2591,5 +2636,6 @@ export {
|
|
2591
2636
|
serializeCookieType,
|
2592
2637
|
serializePersonalizeVariants,
|
2593
2638
|
serializeQuickConnect,
|
2639
|
+
serializeQuirks,
|
2594
2640
|
testVariations
|
2595
2641
|
};
|
package/dist/index.js
CHANGED
@@ -50,11 +50,13 @@ __export(src_exports, {
|
|
50
50
|
KV_SEP: () => KV_SEP,
|
51
51
|
ManifestInstance: () => ManifestInstance,
|
52
52
|
PAIR_SEP: () => PAIR_SEP,
|
53
|
+
QUIRK_SEP: () => QUIRK_SEP,
|
53
54
|
SERVER_STATE_ID: () => SERVER_STATE_ID,
|
54
55
|
ScriptType: () => ScriptType,
|
55
56
|
TYPE_SEP: () => TYPE_SEP,
|
56
57
|
TransitionDataStore: () => TransitionDataStore,
|
57
58
|
UNIFORM_DEFAULT_COOKIE_NAME: () => UNIFORM_DEFAULT_COOKIE_NAME,
|
59
|
+
UNIFORM_DEFAULT_QUIRK_COOKIE_NAME: () => UNIFORM_DEFAULT_QUIRK_COOKIE_NAME,
|
58
60
|
VisitorDataStore: () => VisitorDataStore,
|
59
61
|
areCommandsEqual: () => areCommandsEqual,
|
60
62
|
computeAggregateDimensions: () => computeAggregateDimensions,
|
@@ -82,6 +84,7 @@ __export(src_exports, {
|
|
82
84
|
parseCookieScores: () => parseCookieScores,
|
83
85
|
parseCookieType: () => parseCookieType,
|
84
86
|
parseQuickConnect: () => parseQuickConnect,
|
87
|
+
parseQuirkCookie: () => parseQuirkCookie,
|
85
88
|
parseScoreCookie: () => parseScoreCookie,
|
86
89
|
personalizeVariations: () => personalizeVariations,
|
87
90
|
queryStringEvaluator: () => queryStringEvaluator,
|
@@ -90,6 +93,7 @@ __export(src_exports, {
|
|
90
93
|
serializeCookieType: () => serializeCookieType,
|
91
94
|
serializePersonalizeVariants: () => serializePersonalizeVariants,
|
92
95
|
serializeQuickConnect: () => serializeQuickConnect,
|
96
|
+
serializeQuirks: () => serializeQuirks,
|
93
97
|
testVariations: () => testVariations
|
94
98
|
});
|
95
99
|
module.exports = __toCommonJS(src_exports);
|
@@ -1001,20 +1005,28 @@ var bton = (base64) => {
|
|
1001
1005
|
// src/storage/CookieTransitionDataStore.ts
|
1002
1006
|
var ssr = typeof document === "undefined";
|
1003
1007
|
var UNIFORM_DEFAULT_COOKIE_NAME = "ufvd";
|
1004
|
-
var
|
1008
|
+
var UNIFORM_DEFAULT_QUIRK_COOKIE_NAME = `ufvdqk`;
|
1009
|
+
var _cookieName, _quirkCookieName, _cookieAttributes, _quirksEnabled;
|
1005
1010
|
var CookieTransitionDataStore = class extends TransitionDataStore {
|
1006
1011
|
constructor({
|
1007
1012
|
serverCookieValue,
|
1013
|
+
experimental_quirksEnabled,
|
1014
|
+
quirkCookieValue,
|
1015
|
+
quirkCookieName = UNIFORM_DEFAULT_QUIRK_COOKIE_NAME,
|
1008
1016
|
cookieName = UNIFORM_DEFAULT_COOKIE_NAME,
|
1009
1017
|
cookieAttributes = { sameSite: "lax" }
|
1010
1018
|
}) {
|
1011
1019
|
super({
|
1012
|
-
initialData: ssr ? parseScoreCookie(serverCookieValue) : void 0
|
1020
|
+
initialData: ssr ? parseScoreCookie(serverCookieValue, experimental_quirksEnabled ? quirkCookieValue : void 0) : void 0
|
1013
1021
|
});
|
1014
1022
|
__privateAdd(this, _cookieName);
|
1023
|
+
__privateAdd(this, _quirkCookieName);
|
1015
1024
|
__privateAdd(this, _cookieAttributes);
|
1025
|
+
__privateAdd(this, _quirksEnabled);
|
1016
1026
|
__privateSet(this, _cookieName, cookieName);
|
1017
1027
|
__privateSet(this, _cookieAttributes, cookieAttributes);
|
1028
|
+
__privateSet(this, _quirkCookieName, quirkCookieName);
|
1029
|
+
__privateSet(this, _quirksEnabled, experimental_quirksEnabled || false);
|
1018
1030
|
}
|
1019
1031
|
handleDelete() {
|
1020
1032
|
if (ssr) return Promise.resolve();
|
@@ -1025,17 +1037,27 @@ var CookieTransitionDataStore = class extends TransitionDataStore {
|
|
1025
1037
|
if (ssr) return;
|
1026
1038
|
if (computedValue.consent) {
|
1027
1039
|
import_js_cookie.default.set(__privateGet(this, _cookieName), serializeCookie(computedValue), __privateGet(this, _cookieAttributes));
|
1040
|
+
if (__privateGet(this, _quirksEnabled) && Object.keys(computedValue.quirks || {}).length) {
|
1041
|
+
const quirkCookieValue = serializeQuirks(computedValue.quirks || {});
|
1042
|
+
import_js_cookie.default.set(__privateGet(this, _quirkCookieName), quirkCookieValue, __privateGet(this, _cookieAttributes));
|
1043
|
+
}
|
1028
1044
|
} else {
|
1029
1045
|
import_js_cookie.default.remove(__privateGet(this, _cookieName));
|
1046
|
+
if (__privateGet(this, _quirksEnabled)) {
|
1047
|
+
import_js_cookie.default.remove(__privateGet(this, _quirkCookieName));
|
1048
|
+
}
|
1030
1049
|
}
|
1031
1050
|
}
|
1032
1051
|
};
|
1033
1052
|
_cookieName = new WeakMap();
|
1053
|
+
_quirkCookieName = new WeakMap();
|
1034
1054
|
_cookieAttributes = new WeakMap();
|
1055
|
+
_quirksEnabled = new WeakMap();
|
1035
1056
|
var TYPE_SEP = "~";
|
1036
1057
|
var PAIR_SEP = "!";
|
1037
1058
|
var KV_SEP = "-";
|
1038
|
-
|
1059
|
+
var QUIRK_SEP = "!!";
|
1060
|
+
function parseScoreCookie(cookieValue, quirkCookieValue) {
|
1039
1061
|
if (!cookieValue) return;
|
1040
1062
|
const types = cookieValue.split(TYPE_SEP);
|
1041
1063
|
if (types.length > 5) return;
|
@@ -1049,8 +1071,30 @@ function parseScoreCookie(cookieValue) {
|
|
1049
1071
|
controlGroup: controlGroup === "1",
|
1050
1072
|
personalizeVariants: decodePersonalizeVariants(personalizeVariants)
|
1051
1073
|
};
|
1074
|
+
if (quirkCookieValue) {
|
1075
|
+
data.quirks = parseQuirkCookie(quirkCookieValue);
|
1076
|
+
}
|
1052
1077
|
return data;
|
1053
1078
|
}
|
1079
|
+
function parseQuirkCookie(quirkCookieValue) {
|
1080
|
+
const pairs = quirkCookieValue.split(QUIRK_SEP);
|
1081
|
+
const splitPairs = pairs.map((pair) => {
|
1082
|
+
const sep = pair.indexOf(KV_SEP);
|
1083
|
+
if (sep === -1) {
|
1084
|
+
return void 0;
|
1085
|
+
}
|
1086
|
+
return [pair.slice(0, sep), pair.slice(sep + 1)];
|
1087
|
+
});
|
1088
|
+
const areAllPairsValid = splitPairs.every((pair) => pair !== void 0);
|
1089
|
+
if (!areAllPairsValid) {
|
1090
|
+
return {};
|
1091
|
+
}
|
1092
|
+
return splitPairs.reduce((acc, cur) => {
|
1093
|
+
const [key, value] = cur;
|
1094
|
+
acc[key] = value;
|
1095
|
+
return acc;
|
1096
|
+
}, {});
|
1097
|
+
}
|
1054
1098
|
function parseCookieScores(type) {
|
1055
1099
|
if (!type) {
|
1056
1100
|
return {};
|
@@ -1135,6 +1179,9 @@ function encodeCookieType(type) {
|
|
1135
1179
|
function serializeCookieType(type) {
|
1136
1180
|
return Object.entries(type).map((kv) => kv.join(KV_SEP)).join(PAIR_SEP);
|
1137
1181
|
}
|
1182
|
+
function serializeQuirks(quirks) {
|
1183
|
+
return Object.entries(quirks).map((kv) => kv.join(KV_SEP)).join(QUIRK_SEP);
|
1184
|
+
}
|
1138
1185
|
|
1139
1186
|
// src/storage/EdgeTransitionDataStore.ts
|
1140
1187
|
var _EdgeTransitionDataStore_instances, fetchData_fn;
|
@@ -2331,7 +2378,6 @@ var createInsights = ({
|
|
2331
2378
|
},
|
2332
2379
|
testResult: (result) => {
|
2333
2380
|
if (!storageData) {
|
2334
|
-
console.error("Insights not initialized");
|
2335
2381
|
return;
|
2336
2382
|
}
|
2337
2383
|
client.testResult({
|
@@ -2636,11 +2682,13 @@ function parseQuickConnect(serialized) {
|
|
2636
2682
|
KV_SEP,
|
2637
2683
|
ManifestInstance,
|
2638
2684
|
PAIR_SEP,
|
2685
|
+
QUIRK_SEP,
|
2639
2686
|
SERVER_STATE_ID,
|
2640
2687
|
ScriptType,
|
2641
2688
|
TYPE_SEP,
|
2642
2689
|
TransitionDataStore,
|
2643
2690
|
UNIFORM_DEFAULT_COOKIE_NAME,
|
2691
|
+
UNIFORM_DEFAULT_QUIRK_COOKIE_NAME,
|
2644
2692
|
VisitorDataStore,
|
2645
2693
|
areCommandsEqual,
|
2646
2694
|
computeAggregateDimensions,
|
@@ -2668,6 +2716,7 @@ function parseQuickConnect(serialized) {
|
|
2668
2716
|
parseCookieScores,
|
2669
2717
|
parseCookieType,
|
2670
2718
|
parseQuickConnect,
|
2719
|
+
parseQuirkCookie,
|
2671
2720
|
parseScoreCookie,
|
2672
2721
|
personalizeVariations,
|
2673
2722
|
queryStringEvaluator,
|
@@ -2676,5 +2725,6 @@ function parseQuickConnect(serialized) {
|
|
2676
2725
|
serializeCookieType,
|
2677
2726
|
serializePersonalizeVariants,
|
2678
2727
|
serializeQuickConnect,
|
2728
|
+
serializeQuirks,
|
2679
2729
|
testVariations
|
2680
2730
|
});
|
package/dist/index.mjs
CHANGED
@@ -917,20 +917,28 @@ var bton = (base64) => {
|
|
917
917
|
// src/storage/CookieTransitionDataStore.ts
|
918
918
|
var ssr = typeof document === "undefined";
|
919
919
|
var UNIFORM_DEFAULT_COOKIE_NAME = "ufvd";
|
920
|
-
var
|
920
|
+
var UNIFORM_DEFAULT_QUIRK_COOKIE_NAME = `ufvdqk`;
|
921
|
+
var _cookieName, _quirkCookieName, _cookieAttributes, _quirksEnabled;
|
921
922
|
var CookieTransitionDataStore = class extends TransitionDataStore {
|
922
923
|
constructor({
|
923
924
|
serverCookieValue,
|
925
|
+
experimental_quirksEnabled,
|
926
|
+
quirkCookieValue,
|
927
|
+
quirkCookieName = UNIFORM_DEFAULT_QUIRK_COOKIE_NAME,
|
924
928
|
cookieName = UNIFORM_DEFAULT_COOKIE_NAME,
|
925
929
|
cookieAttributes = { sameSite: "lax" }
|
926
930
|
}) {
|
927
931
|
super({
|
928
|
-
initialData: ssr ? parseScoreCookie(serverCookieValue) : void 0
|
932
|
+
initialData: ssr ? parseScoreCookie(serverCookieValue, experimental_quirksEnabled ? quirkCookieValue : void 0) : void 0
|
929
933
|
});
|
930
934
|
__privateAdd(this, _cookieName);
|
935
|
+
__privateAdd(this, _quirkCookieName);
|
931
936
|
__privateAdd(this, _cookieAttributes);
|
937
|
+
__privateAdd(this, _quirksEnabled);
|
932
938
|
__privateSet(this, _cookieName, cookieName);
|
933
939
|
__privateSet(this, _cookieAttributes, cookieAttributes);
|
940
|
+
__privateSet(this, _quirkCookieName, quirkCookieName);
|
941
|
+
__privateSet(this, _quirksEnabled, experimental_quirksEnabled || false);
|
934
942
|
}
|
935
943
|
handleDelete() {
|
936
944
|
if (ssr) return Promise.resolve();
|
@@ -941,17 +949,27 @@ var CookieTransitionDataStore = class extends TransitionDataStore {
|
|
941
949
|
if (ssr) return;
|
942
950
|
if (computedValue.consent) {
|
943
951
|
Cookies.set(__privateGet(this, _cookieName), serializeCookie(computedValue), __privateGet(this, _cookieAttributes));
|
952
|
+
if (__privateGet(this, _quirksEnabled) && Object.keys(computedValue.quirks || {}).length) {
|
953
|
+
const quirkCookieValue = serializeQuirks(computedValue.quirks || {});
|
954
|
+
Cookies.set(__privateGet(this, _quirkCookieName), quirkCookieValue, __privateGet(this, _cookieAttributes));
|
955
|
+
}
|
944
956
|
} else {
|
945
957
|
Cookies.remove(__privateGet(this, _cookieName));
|
958
|
+
if (__privateGet(this, _quirksEnabled)) {
|
959
|
+
Cookies.remove(__privateGet(this, _quirkCookieName));
|
960
|
+
}
|
946
961
|
}
|
947
962
|
}
|
948
963
|
};
|
949
964
|
_cookieName = new WeakMap();
|
965
|
+
_quirkCookieName = new WeakMap();
|
950
966
|
_cookieAttributes = new WeakMap();
|
967
|
+
_quirksEnabled = new WeakMap();
|
951
968
|
var TYPE_SEP = "~";
|
952
969
|
var PAIR_SEP = "!";
|
953
970
|
var KV_SEP = "-";
|
954
|
-
|
971
|
+
var QUIRK_SEP = "!!";
|
972
|
+
function parseScoreCookie(cookieValue, quirkCookieValue) {
|
955
973
|
if (!cookieValue) return;
|
956
974
|
const types = cookieValue.split(TYPE_SEP);
|
957
975
|
if (types.length > 5) return;
|
@@ -965,8 +983,30 @@ function parseScoreCookie(cookieValue) {
|
|
965
983
|
controlGroup: controlGroup === "1",
|
966
984
|
personalizeVariants: decodePersonalizeVariants(personalizeVariants)
|
967
985
|
};
|
986
|
+
if (quirkCookieValue) {
|
987
|
+
data.quirks = parseQuirkCookie(quirkCookieValue);
|
988
|
+
}
|
968
989
|
return data;
|
969
990
|
}
|
991
|
+
function parseQuirkCookie(quirkCookieValue) {
|
992
|
+
const pairs = quirkCookieValue.split(QUIRK_SEP);
|
993
|
+
const splitPairs = pairs.map((pair) => {
|
994
|
+
const sep = pair.indexOf(KV_SEP);
|
995
|
+
if (sep === -1) {
|
996
|
+
return void 0;
|
997
|
+
}
|
998
|
+
return [pair.slice(0, sep), pair.slice(sep + 1)];
|
999
|
+
});
|
1000
|
+
const areAllPairsValid = splitPairs.every((pair) => pair !== void 0);
|
1001
|
+
if (!areAllPairsValid) {
|
1002
|
+
return {};
|
1003
|
+
}
|
1004
|
+
return splitPairs.reduce((acc, cur) => {
|
1005
|
+
const [key, value] = cur;
|
1006
|
+
acc[key] = value;
|
1007
|
+
return acc;
|
1008
|
+
}, {});
|
1009
|
+
}
|
970
1010
|
function parseCookieScores(type) {
|
971
1011
|
if (!type) {
|
972
1012
|
return {};
|
@@ -1051,6 +1091,9 @@ function encodeCookieType(type) {
|
|
1051
1091
|
function serializeCookieType(type) {
|
1052
1092
|
return Object.entries(type).map((kv) => kv.join(KV_SEP)).join(PAIR_SEP);
|
1053
1093
|
}
|
1094
|
+
function serializeQuirks(quirks) {
|
1095
|
+
return Object.entries(quirks).map((kv) => kv.join(KV_SEP)).join(QUIRK_SEP);
|
1096
|
+
}
|
1054
1097
|
|
1055
1098
|
// src/storage/EdgeTransitionDataStore.ts
|
1056
1099
|
var _EdgeTransitionDataStore_instances, fetchData_fn;
|
@@ -2247,7 +2290,6 @@ var createInsights = ({
|
|
2247
2290
|
},
|
2248
2291
|
testResult: (result) => {
|
2249
2292
|
if (!storageData) {
|
2250
|
-
console.error("Insights not initialized");
|
2251
2293
|
return;
|
2252
2294
|
}
|
2253
2295
|
client.testResult({
|
@@ -2551,11 +2593,13 @@ export {
|
|
2551
2593
|
KV_SEP,
|
2552
2594
|
ManifestInstance,
|
2553
2595
|
PAIR_SEP,
|
2596
|
+
QUIRK_SEP,
|
2554
2597
|
SERVER_STATE_ID,
|
2555
2598
|
ScriptType,
|
2556
2599
|
TYPE_SEP,
|
2557
2600
|
TransitionDataStore,
|
2558
2601
|
UNIFORM_DEFAULT_COOKIE_NAME,
|
2602
|
+
UNIFORM_DEFAULT_QUIRK_COOKIE_NAME,
|
2559
2603
|
VisitorDataStore,
|
2560
2604
|
areCommandsEqual,
|
2561
2605
|
computeAggregateDimensions,
|
@@ -2583,6 +2627,7 @@ export {
|
|
2583
2627
|
parseCookieScores,
|
2584
2628
|
parseCookieType,
|
2585
2629
|
parseQuickConnect,
|
2630
|
+
parseQuirkCookie,
|
2586
2631
|
parseScoreCookie,
|
2587
2632
|
personalizeVariations,
|
2588
2633
|
queryStringEvaluator,
|
@@ -2591,5 +2636,6 @@ export {
|
|
2591
2636
|
serializeCookieType,
|
2592
2637
|
serializePersonalizeVariants,
|
2593
2638
|
serializeQuickConnect,
|
2639
|
+
serializeQuirks,
|
2594
2640
|
testVariations
|
2595
2641
|
};
|
@@ -1252,4 +1252,4 @@ declare global {
|
|
1252
1252
|
}
|
1253
1253
|
}
|
1254
1254
|
|
1255
|
-
export { type
|
1255
|
+
export { type AggregateDimensionInput 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 Quirks as Q, type PersonalizationManifest as R, type ScoreVector as S, TransitionDataStore as T, type Signal as U, type VisitorData as V, type SignalCriteriaGroup as W, type SignalCriteria as X, type EnrichmentCategory as Y, type NumberMatch as Z, type TestDefinition as _, type StorageCommands as a, type TestOptions as a0, testVariations as a1, type DimensionMatch as a2, type PersonalizeOptions as a3, personalizeVariations as a4, type BehaviorTag as a5, type PersonalizedVariant as a6, type PersonalizedResult as a7, type TestVariant as a8, type TestResult as a9, type ContextStateUpdate as aA, type GoalStateUpdate as aB, type paths as aC, type StorageCommand as aa, type SetGoalCommand as ab, type ModifyScoreCommand as ac, type ModifySessionScoreCommand as ad, type SetConsentCommand as ae, type SetQuirkCommand as af, type SetTestCommand as ag, type IdentifyCommand as ah, type SetControlGroupCommand as ai, type SetPersonalizeVariantControlCommand as aj, areCommandsEqual as ak, type ServerToClientTransitionState as al, SERVER_STATE_ID as am, type TransitionDataStoreEvents as an, type DecayOptions as ao, type VisitorDataStoreOptions as ap, type VisitorDataStoreEvents as aq, VisitorDataStore 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 };
|
@@ -1252,4 +1252,4 @@ declare global {
|
|
1252
1252
|
}
|
1253
1253
|
}
|
1254
1254
|
|
1255
|
-
export { type
|
1255
|
+
export { type AggregateDimensionInput 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 Quirks as Q, type PersonalizationManifest as R, type ScoreVector as S, TransitionDataStore as T, type Signal as U, type VisitorData as V, type SignalCriteriaGroup as W, type SignalCriteria as X, type EnrichmentCategory as Y, type NumberMatch as Z, type TestDefinition as _, type StorageCommands as a, type TestOptions as a0, testVariations as a1, type DimensionMatch as a2, type PersonalizeOptions as a3, personalizeVariations as a4, type BehaviorTag as a5, type PersonalizedVariant as a6, type PersonalizedResult as a7, type TestVariant as a8, type TestResult as a9, type ContextStateUpdate as aA, type GoalStateUpdate as aB, type paths as aC, type StorageCommand as aa, type SetGoalCommand as ab, type ModifyScoreCommand as ac, type ModifySessionScoreCommand as ad, type SetConsentCommand as ae, type SetQuirkCommand as af, type SetTestCommand as ag, type IdentifyCommand as ah, type SetControlGroupCommand as ai, type SetPersonalizeVariantControlCommand as aj, areCommandsEqual as ak, type ServerToClientTransitionState as al, SERVER_STATE_ID as am, type TransitionDataStoreEvents as an, type DecayOptions as ao, type VisitorDataStoreOptions as ap, type VisitorDataStoreEvents as aq, VisitorDataStore 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.195.1-alpha.
|
3
|
+
"version": "19.195.1-alpha.4+11d080e0d7",
|
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": "11d080e0d7c11a3285ae4ceb725816012760786d"
|
72
72
|
}
|