@uniformdev/context 20.6.2-alpha.11 → 20.7.1-alpha.102
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/LICENSE.txt +1 -1
- package/dist/api/api.d.mts +10 -1
- package/dist/api/api.d.ts +10 -1
- package/dist/api/api.js +8 -2
- package/dist/api/api.mjs +8 -2
- package/dist/index.d.mts +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.esm.js +122 -55
- package/dist/index.js +123 -55
- package/dist/index.mjs +122 -55
- package/dist/{types-CzIkFCDD.d.mts → types-HcKr1VVF.d.mts} +66 -3
- package/dist/{types-CzIkFCDD.d.ts → types-HcKr1VVF.d.ts} +66 -3
- package/package.json +11 -7
package/LICENSE.txt
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
©
|
|
1
|
+
© 2025 Uniform Systems, Inc. All Rights Reserved.
|
|
2
2
|
See details of Uniform Systems, Inc. Master Subscription Agreement here: https://uniform.dev/eula
|
package/dist/api/api.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aJ as paths$7, $ as ManifestV2 } from '../types-HcKr1VVF.mjs';
|
|
2
2
|
import 'mitt';
|
|
3
3
|
|
|
4
4
|
type LimitPolicy = <ReturnValue>(func: () => Promise<ReturnValue>) => Promise<ReturnValue>;
|
|
@@ -43,6 +43,13 @@ declare class ApiClient<TOptions extends ClientOptions = ClientOptions> {
|
|
|
43
43
|
/** Whether to expect a JSON response or not */
|
|
44
44
|
expectNoContent?: boolean;
|
|
45
45
|
}): Promise<TResponse>;
|
|
46
|
+
protected apiClientWithResponse<TResponse>(fetchUri: URL, options?: RequestInit & {
|
|
47
|
+
/** Whether to expect a JSON response or not */
|
|
48
|
+
expectNoContent?: boolean;
|
|
49
|
+
}): Promise<{
|
|
50
|
+
response: Response;
|
|
51
|
+
body: TResponse;
|
|
52
|
+
}>;
|
|
46
53
|
protected createUrl(path: string, queryParams?: Record<string, string | boolean | undefined | null | number | Array<string | boolean | number>>, hostOverride?: string): URL;
|
|
47
54
|
private ensureApiHost;
|
|
48
55
|
private static getRequestId;
|
|
@@ -954,6 +961,8 @@ interface components$3 {
|
|
|
954
961
|
subcategory?: string;
|
|
955
962
|
/** @description The dimension's name (without category) */
|
|
956
963
|
name: string;
|
|
964
|
+
/** @description Optional description of the dimension */
|
|
965
|
+
description?: string;
|
|
957
966
|
/** @description The minimum score possible for the dimension */
|
|
958
967
|
min: number;
|
|
959
968
|
/** @description The maximum score possible for the dimension */
|
package/dist/api/api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aJ as paths$7, $ as ManifestV2 } from '../types-HcKr1VVF.js';
|
|
2
2
|
import 'mitt';
|
|
3
3
|
|
|
4
4
|
type LimitPolicy = <ReturnValue>(func: () => Promise<ReturnValue>) => Promise<ReturnValue>;
|
|
@@ -43,6 +43,13 @@ declare class ApiClient<TOptions extends ClientOptions = ClientOptions> {
|
|
|
43
43
|
/** Whether to expect a JSON response or not */
|
|
44
44
|
expectNoContent?: boolean;
|
|
45
45
|
}): Promise<TResponse>;
|
|
46
|
+
protected apiClientWithResponse<TResponse>(fetchUri: URL, options?: RequestInit & {
|
|
47
|
+
/** Whether to expect a JSON response or not */
|
|
48
|
+
expectNoContent?: boolean;
|
|
49
|
+
}): Promise<{
|
|
50
|
+
response: Response;
|
|
51
|
+
body: TResponse;
|
|
52
|
+
}>;
|
|
46
53
|
protected createUrl(path: string, queryParams?: Record<string, string | boolean | undefined | null | number | Array<string | boolean | number>>, hostOverride?: string): URL;
|
|
47
54
|
private ensureApiHost;
|
|
48
55
|
private static getRequestId;
|
|
@@ -954,6 +961,8 @@ interface components$3 {
|
|
|
954
961
|
subcategory?: string;
|
|
955
962
|
/** @description The dimension's name (without category) */
|
|
956
963
|
name: string;
|
|
964
|
+
/** @description Optional description of the dimension */
|
|
965
|
+
description?: string;
|
|
957
966
|
/** @description The minimum score possible for the dimension */
|
|
958
967
|
min: number;
|
|
959
968
|
/** @description The maximum score possible for the dimension */
|
package/dist/api/api.js
CHANGED
|
@@ -123,6 +123,9 @@ var ApiClient = class _ApiClient {
|
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
125
|
async apiClient(fetchUri, options) {
|
|
126
|
+
return (await this.apiClientWithResponse(fetchUri, options)).body;
|
|
127
|
+
}
|
|
128
|
+
async apiClientWithResponse(fetchUri, options) {
|
|
126
129
|
return this.options.limitPolicy(async () => {
|
|
127
130
|
var _a;
|
|
128
131
|
const coreHeaders = this.options.apiKey ? {
|
|
@@ -170,9 +173,12 @@ var ApiClient = class _ApiClient {
|
|
|
170
173
|
);
|
|
171
174
|
}
|
|
172
175
|
if (options == null ? void 0 : options.expectNoContent) {
|
|
173
|
-
return null;
|
|
176
|
+
return { response: apiResponse, body: null };
|
|
174
177
|
}
|
|
175
|
-
return
|
|
178
|
+
return {
|
|
179
|
+
response: apiResponse,
|
|
180
|
+
body: await apiResponse.json()
|
|
181
|
+
};
|
|
176
182
|
});
|
|
177
183
|
}
|
|
178
184
|
createUrl(path, queryParams, hostOverride) {
|
package/dist/api/api.mjs
CHANGED
|
@@ -58,6 +58,9 @@ var ApiClient = class _ApiClient {
|
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
async apiClient(fetchUri, options) {
|
|
61
|
+
return (await this.apiClientWithResponse(fetchUri, options)).body;
|
|
62
|
+
}
|
|
63
|
+
async apiClientWithResponse(fetchUri, options) {
|
|
61
64
|
return this.options.limitPolicy(async () => {
|
|
62
65
|
var _a;
|
|
63
66
|
const coreHeaders = this.options.apiKey ? {
|
|
@@ -105,9 +108,12 @@ var ApiClient = class _ApiClient {
|
|
|
105
108
|
);
|
|
106
109
|
}
|
|
107
110
|
if (options == null ? void 0 : options.expectNoContent) {
|
|
108
|
-
return null;
|
|
111
|
+
return { response: apiResponse, body: null };
|
|
109
112
|
}
|
|
110
|
-
return
|
|
113
|
+
return {
|
|
114
|
+
response: apiResponse,
|
|
115
|
+
body: await apiResponse.json()
|
|
116
|
+
};
|
|
111
117
|
});
|
|
112
118
|
}
|
|
113
119
|
createUrl(path, queryParams, hostOverride) {
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as OutputSeverity, L as LogDrain, C as ContextPlugin, S as ScoreVector, A as AggregateDimension, T as TransitionDataStore, a as StorageCommands, V as VisitorData, Q as Quirks, b as TransitionDataStoreOptions, D as DecayFunction, c as CriteriaEvaluator, d as StringMatch, e as VariantMatchCriteria, f as LogMessage, P as PersonalizedVariant, g as PersonalizeOptions, h as Context, i as PersonalizedResult, j as VariationMatchDimensionCriteria, k as PersonalizationSelectionAlgorithmOptions, l as DevToolsEvents } from './types-
|
|
2
|
-
export { a7 as AggregateDimensionInput, ad as BehaviorTag, m as CONTEXTUAL_EDITING_TEST_NAME, n as CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID, u as ContextEvents, v as ContextInstance, q 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, Q as Quirks, b as TransitionDataStoreOptions, D as DecayFunction, c as CriteriaEvaluator, d as StringMatch, e as VariantMatchCriteria, f as LogMessage, P as PersonalizedVariant, g as PersonalizeOptions, h as Context, i as PersonalizedResult, j as VariationMatchDimensionCriteria, k as PersonalizationSelectionAlgorithmOptions, l as DevToolsEvents } from './types-HcKr1VVF.mjs';
|
|
2
|
+
export { a7 as AggregateDimensionInput, ad as BehaviorTag, m as CONTEXTUAL_EDITING_TEST_NAME, n as CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID, aF as CompositionMetadata, u as ContextEvents, v as ContextInstance, q as ContextOptions, aG as ContextState, aH as ContextStateUpdate, Z as CriteriaEvaluatorParameters, Y as CriteriaEvaluatorResult, au as DecayOptions, y as DevToolsActions, E as DevToolsDataEvent, z as DevToolsEvent, I as DevToolsForgetEvent, F as DevToolsHelloEvent, B as DevToolsLogEvent, H as DevToolsRawCommandsEvent, x as DevToolsState, w as DevToolsUiVersion, G as DevToolsUpdateEvent, ab as DimensionMatch, a4 as EnrichmentCategory, aA as EnrichmentData, aD as EventData, aI as GoalStateUpdate, az as Goals, X as GroupCriteriaEvaluator, an as IdentifyCommand, U as LogMessageGroup, R as LogMessageSingle, J as LogMessages, W as ManifestInstance, $ as ManifestV2, M as MessageCategory, N as MessageFunc, ai as ModifyScoreCommand, aj as ModifySessionScoreCommand, a5 as NumberMatch, s as PersonalizationEvent, r as PersonalizationEventVariantId, a0 as PersonalizationManifest, o as PersonalizationSelectionAlgorithm, p as PersonalizationSelectionAlgorithms, aB as PersonalizeControlVariant, aC as PersonalizeVariants, ac as QuirkMatch, as as SERVER_STATE_ID, ar as ServerToClientTransitionState, ak as SetConsentCommand, ao as SetControlGroupCommand, ah as SetGoalCommand, ap as SetPersonalizeVariantControlCommand, al as SetQuirkCommand, am as SetTestCommand, K as Severity, a1 as Signal, a3 as SignalCriteria, a2 as SignalCriteriaGroup, _ as SignalData, ag as StorageCommand, a6 as TestDefinition, t as TestEvent, a8 as TestOptions, af as TestResult, ae as TestVariant, ay as Tests, at as TransitionDataStoreEvents, aa as VariationMatchMetadata, ax as VisitorDataStore, aw as VisitorDataStoreEvents, av as VisitorDataStoreOptions, aq as areCommandsEqual, aE as emptyVisitorData, a9 as testVariations } from './types-HcKr1VVF.mjs';
|
|
3
3
|
import Cookies from 'js-cookie';
|
|
4
4
|
import 'mitt';
|
|
5
5
|
|
|
@@ -72,6 +72,7 @@ declare class CookieTransitionDataStore extends TransitionDataStore {
|
|
|
72
72
|
declare const TYPE_SEP = "~";
|
|
73
73
|
declare const PAIR_SEP = "!";
|
|
74
74
|
declare const KV_SEP = "-";
|
|
75
|
+
declare const QUIRK_KV_SEP = "=";
|
|
75
76
|
declare const QUIRK_SEP = "!!";
|
|
76
77
|
declare function parseScoreCookie(cookieValue: string | undefined, quirkCookieValue?: string): Partial<VisitorData> | undefined;
|
|
77
78
|
declare function parseQuirkCookie(quirkCookieValue: string): Quirks;
|
|
@@ -229,9 +230,13 @@ type InsightsEndpoint = {
|
|
|
229
230
|
apiKey?: string;
|
|
230
231
|
projectId?: string;
|
|
231
232
|
};
|
|
233
|
+
|
|
232
234
|
type EnableUniformInsightsOptions = {
|
|
233
235
|
endpoint: InsightsEndpoint;
|
|
234
236
|
};
|
|
237
|
+
/**
|
|
238
|
+
* @deprecated Use `import { enableUniformInsights } from '@uniformdev/insights'` instead
|
|
239
|
+
*/
|
|
235
240
|
declare const enableUniformInsights: (options: EnableUniformInsightsOptions) => ContextPlugin;
|
|
236
241
|
|
|
237
242
|
type QuickConnectConfig = {
|
|
@@ -242,4 +247,4 @@ type QuickConnectConfig = {
|
|
|
242
247
|
declare function serializeQuickConnect(config: QuickConnectConfig): string;
|
|
243
248
|
declare function parseQuickConnect(serialized: string): Required<QuickConnectConfig>;
|
|
244
249
|
|
|
245
|
-
export { AggregateDimension, type ConsoleDebugLogDrainOptions, Context, type ContextDevToolOptions, ContextPlugin, CookieTransitionDataStore, type CookieTransitionDataStoreOptions, CriteriaEvaluator, DecayFunction, DevToolsEvents, ENR_SEPARATOR, EdgeNodeTagName, type EdgePersonalizeComponentOptions, type EdgeTestComponentOptions, EdgeTransitionDataStore, type EdgeTransitionDataStoreOptions, type EnableUniformInsightsOptions, KV_SEP, type LinearDecayOptions, LogDrain, LogMessage, OutputSeverity, PAIR_SEP, PersonalizationSelectionAlgorithmOptions, PersonalizeOptions, PersonalizedResult, PersonalizedVariant, QUIRK_SEP, type QuickConnectConfig, Quirks, STRONGEST_SCORE_PERSONALIZATION_ALGORITHM, ScoreVector, ScriptType, StorageCommands, StringMatch, TOP_DOWN_CRITERIA_PERSONALIZATION_ALGORITHM, TYPE_SEP, TransitionDataStore, TransitionDataStoreOptions, UNIFORM_DEFAULT_COOKIE_NAME, UNIFORM_DEFAULT_QUIRK_COOKIE_NAME, VariantMatchCriteria, VariationMatchDimensionCriteria, 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, personalizeVariations, queryStringEvaluator, quirkEvaluator, serializeCookie, serializeCookieType, serializePersonalizeVariants, serializeQuickConnect, serializeQuirks, strongestScorePersonalizationSelectionAlgorithm, topDownCriteriaPersonalizationSelectionAlgorithm };
|
|
250
|
+
export { AggregateDimension, type ConsoleDebugLogDrainOptions, Context, type ContextDevToolOptions, ContextPlugin, CookieTransitionDataStore, type CookieTransitionDataStoreOptions, CriteriaEvaluator, DecayFunction, DevToolsEvents, ENR_SEPARATOR, EdgeNodeTagName, type EdgePersonalizeComponentOptions, type EdgeTestComponentOptions, EdgeTransitionDataStore, type EdgeTransitionDataStoreOptions, type EnableUniformInsightsOptions, KV_SEP, type LinearDecayOptions, LogDrain, LogMessage, OutputSeverity, PAIR_SEP, PersonalizationSelectionAlgorithmOptions, PersonalizeOptions, PersonalizedResult, PersonalizedVariant, QUIRK_KV_SEP, QUIRK_SEP, type QuickConnectConfig, Quirks, STRONGEST_SCORE_PERSONALIZATION_ALGORITHM, ScoreVector, ScriptType, StorageCommands, StringMatch, TOP_DOWN_CRITERIA_PERSONALIZATION_ALGORITHM, TYPE_SEP, TransitionDataStore, TransitionDataStoreOptions, UNIFORM_DEFAULT_COOKIE_NAME, UNIFORM_DEFAULT_QUIRK_COOKIE_NAME, VariantMatchCriteria, VariationMatchDimensionCriteria, 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, personalizeVariations, queryStringEvaluator, quirkEvaluator, serializeCookie, serializeCookieType, serializePersonalizeVariants, serializeQuickConnect, serializeQuirks, strongestScorePersonalizationSelectionAlgorithm, topDownCriteriaPersonalizationSelectionAlgorithm };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as OutputSeverity, L as LogDrain, C as ContextPlugin, S as ScoreVector, A as AggregateDimension, T as TransitionDataStore, a as StorageCommands, V as VisitorData, Q as Quirks, b as TransitionDataStoreOptions, D as DecayFunction, c as CriteriaEvaluator, d as StringMatch, e as VariantMatchCriteria, f as LogMessage, P as PersonalizedVariant, g as PersonalizeOptions, h as Context, i as PersonalizedResult, j as VariationMatchDimensionCriteria, k as PersonalizationSelectionAlgorithmOptions, l as DevToolsEvents } from './types-
|
|
2
|
-
export { a7 as AggregateDimensionInput, ad as BehaviorTag, m as CONTEXTUAL_EDITING_TEST_NAME, n as CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID, u as ContextEvents, v as ContextInstance, q 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, Q as Quirks, b as TransitionDataStoreOptions, D as DecayFunction, c as CriteriaEvaluator, d as StringMatch, e as VariantMatchCriteria, f as LogMessage, P as PersonalizedVariant, g as PersonalizeOptions, h as Context, i as PersonalizedResult, j as VariationMatchDimensionCriteria, k as PersonalizationSelectionAlgorithmOptions, l as DevToolsEvents } from './types-HcKr1VVF.js';
|
|
2
|
+
export { a7 as AggregateDimensionInput, ad as BehaviorTag, m as CONTEXTUAL_EDITING_TEST_NAME, n as CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID, aF as CompositionMetadata, u as ContextEvents, v as ContextInstance, q as ContextOptions, aG as ContextState, aH as ContextStateUpdate, Z as CriteriaEvaluatorParameters, Y as CriteriaEvaluatorResult, au as DecayOptions, y as DevToolsActions, E as DevToolsDataEvent, z as DevToolsEvent, I as DevToolsForgetEvent, F as DevToolsHelloEvent, B as DevToolsLogEvent, H as DevToolsRawCommandsEvent, x as DevToolsState, w as DevToolsUiVersion, G as DevToolsUpdateEvent, ab as DimensionMatch, a4 as EnrichmentCategory, aA as EnrichmentData, aD as EventData, aI as GoalStateUpdate, az as Goals, X as GroupCriteriaEvaluator, an as IdentifyCommand, U as LogMessageGroup, R as LogMessageSingle, J as LogMessages, W as ManifestInstance, $ as ManifestV2, M as MessageCategory, N as MessageFunc, ai as ModifyScoreCommand, aj as ModifySessionScoreCommand, a5 as NumberMatch, s as PersonalizationEvent, r as PersonalizationEventVariantId, a0 as PersonalizationManifest, o as PersonalizationSelectionAlgorithm, p as PersonalizationSelectionAlgorithms, aB as PersonalizeControlVariant, aC as PersonalizeVariants, ac as QuirkMatch, as as SERVER_STATE_ID, ar as ServerToClientTransitionState, ak as SetConsentCommand, ao as SetControlGroupCommand, ah as SetGoalCommand, ap as SetPersonalizeVariantControlCommand, al as SetQuirkCommand, am as SetTestCommand, K as Severity, a1 as Signal, a3 as SignalCriteria, a2 as SignalCriteriaGroup, _ as SignalData, ag as StorageCommand, a6 as TestDefinition, t as TestEvent, a8 as TestOptions, af as TestResult, ae as TestVariant, ay as Tests, at as TransitionDataStoreEvents, aa as VariationMatchMetadata, ax as VisitorDataStore, aw as VisitorDataStoreEvents, av as VisitorDataStoreOptions, aq as areCommandsEqual, aE as emptyVisitorData, a9 as testVariations } from './types-HcKr1VVF.js';
|
|
3
3
|
import Cookies from 'js-cookie';
|
|
4
4
|
import 'mitt';
|
|
5
5
|
|
|
@@ -72,6 +72,7 @@ declare class CookieTransitionDataStore extends TransitionDataStore {
|
|
|
72
72
|
declare const TYPE_SEP = "~";
|
|
73
73
|
declare const PAIR_SEP = "!";
|
|
74
74
|
declare const KV_SEP = "-";
|
|
75
|
+
declare const QUIRK_KV_SEP = "=";
|
|
75
76
|
declare const QUIRK_SEP = "!!";
|
|
76
77
|
declare function parseScoreCookie(cookieValue: string | undefined, quirkCookieValue?: string): Partial<VisitorData> | undefined;
|
|
77
78
|
declare function parseQuirkCookie(quirkCookieValue: string): Quirks;
|
|
@@ -229,9 +230,13 @@ type InsightsEndpoint = {
|
|
|
229
230
|
apiKey?: string;
|
|
230
231
|
projectId?: string;
|
|
231
232
|
};
|
|
233
|
+
|
|
232
234
|
type EnableUniformInsightsOptions = {
|
|
233
235
|
endpoint: InsightsEndpoint;
|
|
234
236
|
};
|
|
237
|
+
/**
|
|
238
|
+
* @deprecated Use `import { enableUniformInsights } from '@uniformdev/insights'` instead
|
|
239
|
+
*/
|
|
235
240
|
declare const enableUniformInsights: (options: EnableUniformInsightsOptions) => ContextPlugin;
|
|
236
241
|
|
|
237
242
|
type QuickConnectConfig = {
|
|
@@ -242,4 +247,4 @@ type QuickConnectConfig = {
|
|
|
242
247
|
declare function serializeQuickConnect(config: QuickConnectConfig): string;
|
|
243
248
|
declare function parseQuickConnect(serialized: string): Required<QuickConnectConfig>;
|
|
244
249
|
|
|
245
|
-
export { AggregateDimension, type ConsoleDebugLogDrainOptions, Context, type ContextDevToolOptions, ContextPlugin, CookieTransitionDataStore, type CookieTransitionDataStoreOptions, CriteriaEvaluator, DecayFunction, DevToolsEvents, ENR_SEPARATOR, EdgeNodeTagName, type EdgePersonalizeComponentOptions, type EdgeTestComponentOptions, EdgeTransitionDataStore, type EdgeTransitionDataStoreOptions, type EnableUniformInsightsOptions, KV_SEP, type LinearDecayOptions, LogDrain, LogMessage, OutputSeverity, PAIR_SEP, PersonalizationSelectionAlgorithmOptions, PersonalizeOptions, PersonalizedResult, PersonalizedVariant, QUIRK_SEP, type QuickConnectConfig, Quirks, STRONGEST_SCORE_PERSONALIZATION_ALGORITHM, ScoreVector, ScriptType, StorageCommands, StringMatch, TOP_DOWN_CRITERIA_PERSONALIZATION_ALGORITHM, TYPE_SEP, TransitionDataStore, TransitionDataStoreOptions, UNIFORM_DEFAULT_COOKIE_NAME, UNIFORM_DEFAULT_QUIRK_COOKIE_NAME, VariantMatchCriteria, VariationMatchDimensionCriteria, 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, personalizeVariations, queryStringEvaluator, quirkEvaluator, serializeCookie, serializeCookieType, serializePersonalizeVariants, serializeQuickConnect, serializeQuirks, strongestScorePersonalizationSelectionAlgorithm, topDownCriteriaPersonalizationSelectionAlgorithm };
|
|
250
|
+
export { AggregateDimension, type ConsoleDebugLogDrainOptions, Context, type ContextDevToolOptions, ContextPlugin, CookieTransitionDataStore, type CookieTransitionDataStoreOptions, CriteriaEvaluator, DecayFunction, DevToolsEvents, ENR_SEPARATOR, EdgeNodeTagName, type EdgePersonalizeComponentOptions, type EdgeTestComponentOptions, EdgeTransitionDataStore, type EdgeTransitionDataStoreOptions, type EnableUniformInsightsOptions, KV_SEP, type LinearDecayOptions, LogDrain, LogMessage, OutputSeverity, PAIR_SEP, PersonalizationSelectionAlgorithmOptions, PersonalizeOptions, PersonalizedResult, PersonalizedVariant, QUIRK_KV_SEP, QUIRK_SEP, type QuickConnectConfig, Quirks, STRONGEST_SCORE_PERSONALIZATION_ALGORITHM, ScoreVector, ScriptType, StorageCommands, StringMatch, TOP_DOWN_CRITERIA_PERSONALIZATION_ALGORITHM, TYPE_SEP, TransitionDataStore, TransitionDataStoreOptions, UNIFORM_DEFAULT_COOKIE_NAME, UNIFORM_DEFAULT_QUIRK_COOKIE_NAME, VariantMatchCriteria, VariationMatchDimensionCriteria, 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, personalizeVariations, queryStringEvaluator, quirkEvaluator, serializeCookie, serializeCookieType, serializePersonalizeVariants, serializeQuickConnect, serializeQuirks, strongestScorePersonalizationSelectionAlgorithm, topDownCriteriaPersonalizationSelectionAlgorithm };
|
package/dist/index.esm.js
CHANGED
|
@@ -227,6 +227,10 @@ var ManifestInstance = class {
|
|
|
227
227
|
}
|
|
228
228
|
return (_d = (_c = __privateGet(this, _mf).pz) == null ? void 0 : _c.enr) == null ? void 0 : _d[scoreKey.substring(0, enrichmentIndex)];
|
|
229
229
|
}
|
|
230
|
+
getAggregateDimensionByKey(scoreKey) {
|
|
231
|
+
var _a, _b;
|
|
232
|
+
return (_b = (_a = __privateGet(this, _mf).pz) == null ? void 0 : _a.agg) == null ? void 0 : _b[scoreKey];
|
|
233
|
+
}
|
|
230
234
|
};
|
|
231
235
|
_mf = new WeakMap();
|
|
232
236
|
_signalInstances = new WeakMap();
|
|
@@ -796,6 +800,7 @@ function strongestScorePersonalizationSelectionAlgorithm({
|
|
|
796
800
|
const needsConsentToPersonalize = context.requireConsentForPersonalization;
|
|
797
801
|
const isInGlobalControlGroup = (_a = context.storage.data.controlGroup) != null ? _a : false;
|
|
798
802
|
const personalizationAllowed = !needsConsentToPersonalize || context.storage.data.consent;
|
|
803
|
+
let originalIndex = 0;
|
|
799
804
|
for (const variation of variations) {
|
|
800
805
|
const isInvalidFormat = variation.pz && typeof variation.pz !== "object";
|
|
801
806
|
let validVariation;
|
|
@@ -813,12 +818,19 @@ function strongestScorePersonalizationSelectionAlgorithm({
|
|
|
813
818
|
if (score === void 0 || score <= 0) {
|
|
814
819
|
continue;
|
|
815
820
|
}
|
|
816
|
-
variationMatches.push({ variation: validVariation, score });
|
|
821
|
+
variationMatches.push({ variation: validVariation, score, originalIndex });
|
|
822
|
+
originalIndex++;
|
|
817
823
|
} else {
|
|
818
824
|
defaultVariations.push(validVariation);
|
|
819
825
|
}
|
|
820
826
|
}
|
|
821
|
-
variationMatches.sort((a, b) =>
|
|
827
|
+
variationMatches.sort((a, b) => {
|
|
828
|
+
const scoreComparison = b.score - a.score;
|
|
829
|
+
if (scoreComparison === 0) {
|
|
830
|
+
return a.originalIndex - b.originalIndex;
|
|
831
|
+
}
|
|
832
|
+
return scoreComparison;
|
|
833
|
+
});
|
|
822
834
|
const result = [];
|
|
823
835
|
for (let i = 0; i < variationMatches.length; i++) {
|
|
824
836
|
const variationMatch = variationMatches[i];
|
|
@@ -917,11 +929,11 @@ var testVariations = ({
|
|
|
917
929
|
}
|
|
918
930
|
if (!selectedVariant) {
|
|
919
931
|
const distributions = normalizeVariationDistributions(variations);
|
|
920
|
-
const random = Math.
|
|
932
|
+
const random = Math.random() * 100;
|
|
921
933
|
let distributionOffset = 0;
|
|
922
934
|
selectedVariant = variations.find((variant, index) => {
|
|
923
935
|
const distribution = distributions[index];
|
|
924
|
-
if (
|
|
936
|
+
if (random >= distributionOffset && random < distributionOffset + distribution) {
|
|
925
937
|
return variant;
|
|
926
938
|
}
|
|
927
939
|
distributionOffset += distribution;
|
|
@@ -933,6 +945,9 @@ var testVariations = ({
|
|
|
933
945
|
}
|
|
934
946
|
if (selectedVariant) {
|
|
935
947
|
onLogMessage == null ? void 0 : onLogMessage(["info", 404, selectedVariant.id]);
|
|
948
|
+
if (selectedVariant.control === void 0) {
|
|
949
|
+
selectedVariant.control = variations.findIndex((variation) => variation.id === selectedVariantId) === 0;
|
|
950
|
+
}
|
|
936
951
|
}
|
|
937
952
|
return {
|
|
938
953
|
result: selectedVariant,
|
|
@@ -1114,6 +1129,7 @@ _quirksEnabled = new WeakMap();
|
|
|
1114
1129
|
var TYPE_SEP = "~";
|
|
1115
1130
|
var PAIR_SEP = "!";
|
|
1116
1131
|
var KV_SEP = "-";
|
|
1132
|
+
var QUIRK_KV_SEP = "=";
|
|
1117
1133
|
var QUIRK_SEP = "!!";
|
|
1118
1134
|
function parseScoreCookie(cookieValue, quirkCookieValue) {
|
|
1119
1135
|
if (!cookieValue) return;
|
|
@@ -1137,7 +1153,7 @@ function parseScoreCookie(cookieValue, quirkCookieValue) {
|
|
|
1137
1153
|
function parseQuirkCookie(quirkCookieValue) {
|
|
1138
1154
|
const pairs = quirkCookieValue.split(QUIRK_SEP);
|
|
1139
1155
|
const splitPairs = pairs.map((pair) => {
|
|
1140
|
-
const sep = pair.indexOf(
|
|
1156
|
+
const sep = pair.indexOf(QUIRK_KV_SEP);
|
|
1141
1157
|
if (sep === -1) {
|
|
1142
1158
|
return void 0;
|
|
1143
1159
|
}
|
|
@@ -1238,7 +1254,7 @@ function serializeCookieType(type) {
|
|
|
1238
1254
|
return Object.entries(type).map((kv) => kv.join(KV_SEP)).join(PAIR_SEP);
|
|
1239
1255
|
}
|
|
1240
1256
|
function serializeQuirks(quirks) {
|
|
1241
|
-
return Object.entries(quirks).map((kv) => kv.join(
|
|
1257
|
+
return Object.entries(quirks).map((kv) => kv.join(QUIRK_KV_SEP)).join(QUIRK_SEP);
|
|
1242
1258
|
}
|
|
1243
1259
|
|
|
1244
1260
|
// src/storage/EdgeTransitionDataStore.ts
|
|
@@ -1729,6 +1745,9 @@ var Context = class {
|
|
|
1729
1745
|
__privateSet(this, _scores, state.ssv);
|
|
1730
1746
|
__privateGet(this, _mitt3).emit("log", ["debug", 130, state]);
|
|
1731
1747
|
}
|
|
1748
|
+
if (state.compositionMetadata) {
|
|
1749
|
+
__privateGet(this, _state).compositionMetadata = state.compositionMetadata;
|
|
1750
|
+
}
|
|
1732
1751
|
},
|
|
1733
1752
|
onLogMessage: (message) => __privateGet(this, _mitt3).emit("log", message)
|
|
1734
1753
|
});
|
|
@@ -1881,10 +1900,16 @@ var Context = class {
|
|
|
1881
1900
|
scores: __privateGet(this, _serverTransitionState) ? __privateMethod(this, _Context_instances, calculateScores_fn).call(this, this.storage.data) : __privateGet(this, _scores)
|
|
1882
1901
|
})
|
|
1883
1902
|
);
|
|
1903
|
+
const previousCompositionMetadata = __privateGet(this, _state).compositionMetadata;
|
|
1884
1904
|
__privateSet(this, _state, {
|
|
1885
1905
|
...__privateGet(this, _state),
|
|
1886
1906
|
...newData
|
|
1887
1907
|
});
|
|
1908
|
+
if (newData.compositionMetadata && // deep equal is not too bad, as we only have 1 level of depth in dynamic inputs
|
|
1909
|
+
!dequal5(previousCompositionMetadata, __privateGet(this, _state).compositionMetadata)) {
|
|
1910
|
+
__privateGet(this, _mitt3).emit("canvasDataUpdated", __privateGet(this, _state).compositionMetadata);
|
|
1911
|
+
__privateGet(this, _state).compositionMetadata = newData.compositionMetadata;
|
|
1912
|
+
}
|
|
1888
1913
|
await this.storage.updateData(commands);
|
|
1889
1914
|
if (__privateGet(this, _serverTransitionState)) {
|
|
1890
1915
|
await this.processServerCommands({
|
|
@@ -1896,7 +1921,9 @@ var Context = class {
|
|
|
1896
1921
|
__privateMethod(this, _Context_instances, emitTest_fn).call(this, {
|
|
1897
1922
|
name: testName,
|
|
1898
1923
|
variantId: testVariantId,
|
|
1899
|
-
variantAssigned: true
|
|
1924
|
+
variantAssigned: true,
|
|
1925
|
+
control: false,
|
|
1926
|
+
compositionMetadata: void 0
|
|
1900
1927
|
});
|
|
1901
1928
|
});
|
|
1902
1929
|
const haveQuirksChanged = __privateGet(this, _serverTransitionState) && !dequal5(__privateGet(this, _serverTransitionState).quirks, this.storage.data.quirks);
|
|
@@ -1912,7 +1939,7 @@ var Context = class {
|
|
|
1912
1939
|
if (!plugin.update) {
|
|
1913
1940
|
continue;
|
|
1914
1941
|
}
|
|
1915
|
-
await plugin.update(newData);
|
|
1942
|
+
await plugin.update(newData, __privateGet(this, _scores));
|
|
1916
1943
|
}
|
|
1917
1944
|
}
|
|
1918
1945
|
(_e = __privateGet(this, _commands)) == null ? void 0 : _e.push(...commands);
|
|
@@ -1978,7 +2005,7 @@ var Context = class {
|
|
|
1978
2005
|
}
|
|
1979
2006
|
/** Executes an A/B test with a given set of variants, showing the visitor's assigned variant (or selecting one to assign, if none is set yet) */
|
|
1980
2007
|
test(options) {
|
|
1981
|
-
var _a, _b, _c;
|
|
2008
|
+
var _a, _b, _c, _d, _e;
|
|
1982
2009
|
if (options.name === CONTEXTUAL_EDITING_TEST_NAME) {
|
|
1983
2010
|
const selectedVariant = (_a = options.variations.find((variant) => variant.id === CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID)) != null ? _a : options.variations.at(-1);
|
|
1984
2011
|
const value2 = {
|
|
@@ -1995,7 +2022,9 @@ var Context = class {
|
|
|
1995
2022
|
__privateMethod(this, _Context_instances, emitTest_fn).call(this, {
|
|
1996
2023
|
name: options.name,
|
|
1997
2024
|
variantId: (_c = (_b = value.result) == null ? void 0 : _b.id) != null ? _c : void 0,
|
|
1998
|
-
variantAssigned: value.variantAssigned
|
|
2025
|
+
variantAssigned: value.variantAssigned,
|
|
2026
|
+
control: (_e = (_d = value.result) == null ? void 0 : _d.control) != null ? _e : false,
|
|
2027
|
+
compositionMetadata: options.compositionMetadata
|
|
1999
2028
|
});
|
|
2000
2029
|
return value;
|
|
2001
2030
|
}
|
|
@@ -2024,7 +2053,8 @@ var Context = class {
|
|
|
2024
2053
|
control: variation.control
|
|
2025
2054
|
})),
|
|
2026
2055
|
control: this.storage.data.controlGroup,
|
|
2027
|
-
changed: true
|
|
2056
|
+
changed: true,
|
|
2057
|
+
compositionMetadata: options.compositionMetadata
|
|
2028
2058
|
};
|
|
2029
2059
|
if (previousPlacement && dequal5(eventData.variantIds, previousPlacement)) {
|
|
2030
2060
|
eventData.changed = false;
|
|
@@ -2038,7 +2068,10 @@ var Context = class {
|
|
|
2038
2068
|
* @param fromAllDevices for an identified user, whether to delete all their data (for the entire account) - true, or data for this device (sign out) - false
|
|
2039
2069
|
*/
|
|
2040
2070
|
async forget(fromAllDevices) {
|
|
2041
|
-
|
|
2071
|
+
const previousCompositionMetadata = __privateGet(this, _state).compositionMetadata;
|
|
2072
|
+
__privateSet(this, _state, {
|
|
2073
|
+
compositionMetadata: previousCompositionMetadata
|
|
2074
|
+
});
|
|
2042
2075
|
if (__privateGet(this, _plugins)) {
|
|
2043
2076
|
for (let i = 0; i < __privateGet(this, _plugins).length; i++) {
|
|
2044
2077
|
const plugin = __privateGet(this, _plugins)[i];
|
|
@@ -2061,7 +2094,8 @@ var Context = class {
|
|
|
2061
2094
|
ssv: __privateGet(this, _scores),
|
|
2062
2095
|
tests: {},
|
|
2063
2096
|
personalizeVariants: this.storage.data.personalizeVariants,
|
|
2064
|
-
commands: __privateGet(this, _commands)
|
|
2097
|
+
commands: __privateGet(this, _commands),
|
|
2098
|
+
compositionMetadata: __privateGet(this, _state).compositionMetadata
|
|
2065
2099
|
};
|
|
2066
2100
|
const allTests = this.storage.data.tests;
|
|
2067
2101
|
Object.entries(allTests).map(([testName, testValue]) => {
|
|
@@ -2084,6 +2118,27 @@ var Context = class {
|
|
|
2084
2118
|
__privateGet(this, _pzCache)[event.name] = event.variantIds;
|
|
2085
2119
|
__privateGet(this, _mitt3).emit("personalizationResult", event);
|
|
2086
2120
|
}
|
|
2121
|
+
/**
|
|
2122
|
+
* Gets the current canvas data
|
|
2123
|
+
*/
|
|
2124
|
+
getCompositionMetadata() {
|
|
2125
|
+
return __privateGet(this, _state).compositionMetadata;
|
|
2126
|
+
}
|
|
2127
|
+
/**
|
|
2128
|
+
* Updates the canvas data and emits a canvasDataUpdated event
|
|
2129
|
+
*/
|
|
2130
|
+
async updateCompositionMetadata(newData) {
|
|
2131
|
+
const currentCanvas = __privateGet(this, _state).compositionMetadata || {};
|
|
2132
|
+
const updatedCanvas = { ...currentCanvas, ...newData };
|
|
2133
|
+
if (!dequal5(currentCanvas, updatedCanvas)) {
|
|
2134
|
+
__privateSet(this, _state, {
|
|
2135
|
+
...__privateGet(this, _state),
|
|
2136
|
+
compositionMetadata: updatedCanvas
|
|
2137
|
+
});
|
|
2138
|
+
__privateGet(this, _mitt3).emit("canvasDataUpdated", updatedCanvas);
|
|
2139
|
+
__privateGet(this, _mitt3).emit("log", ["info", 4, "Canvas data updated"]);
|
|
2140
|
+
}
|
|
2141
|
+
}
|
|
2087
2142
|
};
|
|
2088
2143
|
_personalizationSelectionAlgorithms = new WeakMap();
|
|
2089
2144
|
_serverTransitionState = new WeakMap();
|
|
@@ -2248,8 +2303,31 @@ var ScriptType = /* @__PURE__ */ ((ScriptType2) => {
|
|
|
2248
2303
|
})(ScriptType || {});
|
|
2249
2304
|
var EdgeNodeTagName = "nesitag";
|
|
2250
2305
|
|
|
2251
|
-
// src/insights/
|
|
2252
|
-
|
|
2306
|
+
// src/insights/storage.ts
|
|
2307
|
+
var createInsightsStorage = () => {
|
|
2308
|
+
const STORAGE_KEY2 = "ufin";
|
|
2309
|
+
return {
|
|
2310
|
+
get: () => {
|
|
2311
|
+
const data = localStorage.getItem(STORAGE_KEY2);
|
|
2312
|
+
if (!data) {
|
|
2313
|
+
return;
|
|
2314
|
+
}
|
|
2315
|
+
return JSON.parse(data);
|
|
2316
|
+
},
|
|
2317
|
+
set: (data) => {
|
|
2318
|
+
const toSet = {
|
|
2319
|
+
...data,
|
|
2320
|
+
updated: Date.now()
|
|
2321
|
+
};
|
|
2322
|
+
localStorage.setItem(STORAGE_KEY2, JSON.stringify(toSet));
|
|
2323
|
+
},
|
|
2324
|
+
clear: () => {
|
|
2325
|
+
localStorage.removeItem(STORAGE_KEY2);
|
|
2326
|
+
}
|
|
2327
|
+
};
|
|
2328
|
+
};
|
|
2329
|
+
|
|
2330
|
+
// src/insights/types.ts
|
|
2253
2331
|
var getBasePayload = () => {
|
|
2254
2332
|
const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
2255
2333
|
const locale = navigator.languages && navigator.languages.length ? navigator.languages[0] : navigator.userLanguage || navigator.language || navigator.browserLanguage || "en";
|
|
@@ -2262,13 +2340,34 @@ var getBasePayload = () => {
|
|
|
2262
2340
|
href: window.location.href
|
|
2263
2341
|
};
|
|
2264
2342
|
};
|
|
2343
|
+
var generateVisitorId = () => {
|
|
2344
|
+
return `visitor_${generalRandomId()}`;
|
|
2345
|
+
};
|
|
2346
|
+
var generateSessionId = () => {
|
|
2347
|
+
return `session_${generalRandomId()}`;
|
|
2348
|
+
};
|
|
2349
|
+
var generatePageId = () => {
|
|
2350
|
+
return `page_${generalRandomId()}`;
|
|
2351
|
+
};
|
|
2352
|
+
var generalRandomId = () => {
|
|
2353
|
+
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
|
|
2354
|
+
const id = crypto.randomUUID();
|
|
2355
|
+
return id.replaceAll("-", "").toLowerCase();
|
|
2356
|
+
}
|
|
2357
|
+
return Math.random().toString(32).substring(2);
|
|
2358
|
+
};
|
|
2359
|
+
|
|
2360
|
+
// src/insights/v1.ts
|
|
2265
2361
|
var createInsightsClient = ({ endpoint }) => {
|
|
2266
2362
|
let endpointUrl;
|
|
2267
2363
|
const apiKey = endpoint.apiKey;
|
|
2268
2364
|
const projectId = endpoint.projectId;
|
|
2269
2365
|
if (endpoint.type === "api") {
|
|
2270
2366
|
const url = new URL(endpoint.host);
|
|
2271
|
-
url.pathname =
|
|
2367
|
+
url.pathname = `/v0/events`;
|
|
2368
|
+
if (endpoint.host.includes("tinybird.co")) {
|
|
2369
|
+
url.pathname = "/v0/events";
|
|
2370
|
+
}
|
|
2272
2371
|
url.searchParams.set("name", "analytics_events");
|
|
2273
2372
|
endpointUrl = url.toString();
|
|
2274
2373
|
} else {
|
|
@@ -2398,38 +2497,7 @@ var createInsightsClient = ({ endpoint }) => {
|
|
|
2398
2497
|
}
|
|
2399
2498
|
};
|
|
2400
2499
|
};
|
|
2401
|
-
var
|
|
2402
|
-
const STORAGE_KEY2 = "ufin";
|
|
2403
|
-
return {
|
|
2404
|
-
get: () => {
|
|
2405
|
-
const data = localStorage.getItem(STORAGE_KEY2);
|
|
2406
|
-
if (!data) {
|
|
2407
|
-
return;
|
|
2408
|
-
}
|
|
2409
|
-
return JSON.parse(data);
|
|
2410
|
-
},
|
|
2411
|
-
set: (data) => {
|
|
2412
|
-
const toSet = {
|
|
2413
|
-
...data,
|
|
2414
|
-
updated: Date.now()
|
|
2415
|
-
};
|
|
2416
|
-
localStorage.setItem(STORAGE_KEY2, JSON.stringify(toSet));
|
|
2417
|
-
},
|
|
2418
|
-
clear: () => {
|
|
2419
|
-
localStorage.removeItem(STORAGE_KEY2);
|
|
2420
|
-
}
|
|
2421
|
-
};
|
|
2422
|
-
};
|
|
2423
|
-
var generateVisitorId = () => {
|
|
2424
|
-
return `visitor_${generalRandomId()}`;
|
|
2425
|
-
};
|
|
2426
|
-
var generateSessionId = () => {
|
|
2427
|
-
return `session_${generalRandomId()}`;
|
|
2428
|
-
};
|
|
2429
|
-
var generatePageId = () => {
|
|
2430
|
-
return `page_${generalRandomId()}`;
|
|
2431
|
-
};
|
|
2432
|
-
var createInsights = ({
|
|
2500
|
+
var createInsightsV1 = ({
|
|
2433
2501
|
endpoint,
|
|
2434
2502
|
sessionDurationSeconds = 30 * 60
|
|
2435
2503
|
}) => {
|
|
@@ -2530,8 +2598,10 @@ var createInsights = ({
|
|
|
2530
2598
|
}
|
|
2531
2599
|
};
|
|
2532
2600
|
};
|
|
2601
|
+
|
|
2602
|
+
// src/insights/index.ts
|
|
2533
2603
|
var enableUniformInsights = (options) => {
|
|
2534
|
-
const insights =
|
|
2604
|
+
const insights = createInsightsV1({
|
|
2535
2605
|
endpoint: options.endpoint
|
|
2536
2606
|
});
|
|
2537
2607
|
let previousUrl = void 0;
|
|
@@ -2577,8 +2647,8 @@ var enableUniformInsights = (options) => {
|
|
|
2577
2647
|
};
|
|
2578
2648
|
},
|
|
2579
2649
|
update: (context) => {
|
|
2580
|
-
if (context.url && context.url !== previousUrl) {
|
|
2581
|
-
previousUrl = context.url;
|
|
2650
|
+
if (context.url && context.url.toString() !== previousUrl) {
|
|
2651
|
+
previousUrl = context.url.toString();
|
|
2582
2652
|
insights.pageHit();
|
|
2583
2653
|
}
|
|
2584
2654
|
},
|
|
@@ -2587,10 +2657,6 @@ var enableUniformInsights = (options) => {
|
|
|
2587
2657
|
}
|
|
2588
2658
|
};
|
|
2589
2659
|
};
|
|
2590
|
-
var generalRandomId = () => {
|
|
2591
|
-
const id = v4();
|
|
2592
|
-
return id.replaceAll("-", "").toLowerCase();
|
|
2593
|
-
};
|
|
2594
2660
|
|
|
2595
2661
|
// src/logging/enableConsoleLogDrain.ts
|
|
2596
2662
|
import rfdc2 from "rfdc";
|
|
@@ -2787,6 +2853,7 @@ export {
|
|
|
2787
2853
|
KV_SEP,
|
|
2788
2854
|
ManifestInstance,
|
|
2789
2855
|
PAIR_SEP,
|
|
2856
|
+
QUIRK_KV_SEP,
|
|
2790
2857
|
QUIRK_SEP,
|
|
2791
2858
|
SERVER_STATE_ID,
|
|
2792
2859
|
STRONGEST_SCORE_PERSONALIZATION_ALGORITHM,
|