@schibsted/pulse-sdk 8.0.0-rc.13 → 8.0.0-rc.15
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/cjs/Tracker.js +40 -0
- package/dist/cjs/leaveTrackingTpaas/index.js +18 -6
- package/dist/cjs/tpaas-builders/builders/device.js +1 -1
- package/dist/cjs/tpaas-builders/builders/trackerBuilder.js +2 -1
- package/dist/cjs/tpaas-builders/builders.js +18 -6
- package/dist/cjs/tpaas-schemas/constants.js +75 -51
- package/dist/cjs/tracker-proxy/consts.js +3 -0
- package/dist/cjs/version.js +1 -1
- package/dist/ejs/Tracker.js +41 -1
- package/dist/ejs/leaveTrackingTpaas/index.js +18 -6
- package/dist/ejs/tpaas-builders/builders/device.js +1 -1
- package/dist/ejs/tpaas-builders/builders/trackerBuilder.js +2 -1
- package/dist/ejs/tpaas-builders/builders.js +16 -7
- package/dist/ejs/tpaas-schemas/constants.js +73 -49
- package/dist/ejs/tracker-proxy/consts.js +3 -0
- package/dist/ejs/version.js +1 -1
- package/dist/types/Tracker.d.ts +16 -1
- package/dist/types/builders/consents.d.ts +2 -2
- package/dist/types/builders/device-node.d.ts +2 -2
- package/dist/types/builders/events-anonymous-node.d.ts +4 -4
- package/dist/types/builders/events-node.d.ts +5 -5
- package/dist/types/builders/objects/objects-anonymous-node.d.ts +1 -1
- package/dist/types/builders/objects/objects-node.d.ts +1 -1
- package/dist/types/builders/origin-node.d.ts +1 -1
- package/dist/types/cis-sync/storage/pulseStorage.d.ts +8 -4
- package/dist/types/config.d.ts +1 -1
- package/dist/types/tpaas-builders/builders/device.d.ts +1 -1
- package/dist/types/tpaas-builders/builders/experiments.d.ts +1 -1
- package/dist/types/tpaas-builders/builders/navigationType.d.ts +2 -2
- package/dist/types/tpaas-builders/builders/pageviewId.d.ts +1 -1
- package/dist/types/tpaas-builders/builders/trackerBuilder.d.ts +1 -1
- package/dist/types/tpaas-builders/builders/user.d.ts +1 -1
- package/dist/types/tpaas-builders/builders.d.ts +43 -39
- package/dist/types/tpaas-builders/index.d.ts +1 -1
- package/dist/types/tpaas-builders/types.d.ts +2 -0
- package/dist/types/tpaas-schemas/constants.d.ts +196 -174
- package/dist/types/tpaas-schemas/types/ITpaasEvent.d.ts +6 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementAffiliate.d.ts +138 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementAudio.d.ts +0 -6
- package/dist/types/tpaas-schemas/types/schemas/IEngagementTeaser.d.ts +9 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementTvModule.d.ts +130 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementUIElement.d.ts +4 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementVideo.d.ts +1 -7
- package/dist/types/tpaas-schemas/types/schemas/IImpressionAffiliate.d.ts +136 -0
- package/dist/types/tpaas-schemas/types/schemas/IImpressionForm.d.ts +2 -2
- package/dist/types/tpaas-schemas/types/schemas/IImpressionTeaser.d.ts +9 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeaveArticle.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/schemas/ILeaveAudioPage.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/schemas/ILeaveFrontpage.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/schemas/ILeaveListing.d.ts +10 -1
- package/dist/types/tpaas-schemas/types/schemas/ILeaveLockedArticle.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/schemas/ILeaveLockedAudioPage.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/schemas/ILeaveLockedVideoPage.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/schemas/ILeaveVideoPage.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/schemas/IViewArticle.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/schemas/IViewAudioPage.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/schemas/IViewFrontpage.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/schemas/IViewListing.d.ts +10 -1
- package/dist/types/tpaas-schemas/types/schemas/IViewLockedArticle.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/schemas/IViewLockedAudioPage.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/schemas/IViewLockedVideoPage.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/schemas/IViewVideoPage.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/schemas/index.d.ts +3 -0
- package/dist/types/tpaas-schemas/types/templates/IDevice.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/templates/IPageRef.d.ts +3 -1
- package/dist/types/tpaas-schemas/types/templates/IProvider.d.ts +1 -1
- package/dist/types/tpaas-schemas/types/templates/ITracker.d.ts +4 -0
- package/dist/types/tpaas-schemas/types/templates/IUtmTags.d.ts +0 -2
- package/dist/types/tpaas-schemas/types.d.ts +3 -3
- package/dist/types/tracker-proxy/consts.d.ts +2 -2
- package/dist/types/version.d.ts +1 -1
- package/dist/types/wrapper/types/event.d.ts +1 -1
- package/package.json +8 -7
package/dist/cjs/Tracker.js
CHANGED
|
@@ -114,6 +114,17 @@ const anonymousEvents = {
|
|
|
114
114
|
function getAnonymousEventBuilder(name) {
|
|
115
115
|
return name in anonymousEvents ? anonymousEvents[name] : anonymousEvents.trackerEvent;
|
|
116
116
|
}
|
|
117
|
+
// This looks overkill, but a mapping feels safer than doing string operations (capitalize) with javascript
|
|
118
|
+
const mapDeployStageToTpaasStage = (deployStage) => {
|
|
119
|
+
switch (deployStage) {
|
|
120
|
+
case 'dev':
|
|
121
|
+
return 'Dev';
|
|
122
|
+
case 'pre':
|
|
123
|
+
return 'Pre';
|
|
124
|
+
case 'pro':
|
|
125
|
+
return 'Pro';
|
|
126
|
+
}
|
|
127
|
+
};
|
|
117
128
|
/**
|
|
118
129
|
* Determines if the SDK is running in a Hybrid (WebView) environment.
|
|
119
130
|
*
|
|
@@ -524,6 +535,7 @@ class Tracker {
|
|
|
524
535
|
providerGroup: this.state.provider?.group,
|
|
525
536
|
component: this.state.component,
|
|
526
537
|
componentVersion: this.state.componentVersion,
|
|
538
|
+
routingStage: mapDeployStageToTpaasStage(this.state.deployStageTpaas),
|
|
527
539
|
experiments,
|
|
528
540
|
currentPageReferrer,
|
|
529
541
|
};
|
|
@@ -608,6 +620,7 @@ class Tracker {
|
|
|
608
620
|
component: this.state.component,
|
|
609
621
|
componentVersion: this.state.componentVersion,
|
|
610
622
|
pageviewId: this.state.pageViewId,
|
|
623
|
+
routingStage: mapDeployStageToTpaasStage(this.state.deployStageTpaas),
|
|
611
624
|
currentPage,
|
|
612
625
|
currentPageReferrer,
|
|
613
626
|
experiments,
|
|
@@ -1108,6 +1121,15 @@ class Tracker {
|
|
|
1108
1121
|
const event = (0, tpaas_builders_1.buildImpressionAdSlotEvent)(input, dependencies);
|
|
1109
1122
|
return this.sendTpaasEvent(event);
|
|
1110
1123
|
}
|
|
1124
|
+
/**
|
|
1125
|
+
* @param input
|
|
1126
|
+
* @category TPaaS Tracking
|
|
1127
|
+
*/
|
|
1128
|
+
async trackImpressionAffiliate(input) {
|
|
1129
|
+
const dependencies = await this.prepareTpaasEvent();
|
|
1130
|
+
const event = (0, tpaas_builders_1.buildImpressionAffiliateEvent)(input, dependencies);
|
|
1131
|
+
return this.sendTpaasEvent(event);
|
|
1132
|
+
}
|
|
1111
1133
|
/**
|
|
1112
1134
|
* @param input
|
|
1113
1135
|
* @category TPaaS Tracking
|
|
@@ -1522,6 +1544,15 @@ class Tracker {
|
|
|
1522
1544
|
const event = (0, tpaas_builders_1.buildLeaveWeatherEvent)(input, dependencies);
|
|
1523
1545
|
return this.sendTpaasEvent(event);
|
|
1524
1546
|
}
|
|
1547
|
+
/**
|
|
1548
|
+
* @param input
|
|
1549
|
+
* @category TPaaS Tracking
|
|
1550
|
+
*/
|
|
1551
|
+
async trackEngagementAffiliate(input) {
|
|
1552
|
+
const dependencies = await this.prepareTpaasEvent();
|
|
1553
|
+
const event = (0, tpaas_builders_1.buildEngagementAffiliateEvent)(input, dependencies);
|
|
1554
|
+
return this.sendTpaasEvent(event);
|
|
1555
|
+
}
|
|
1525
1556
|
/**
|
|
1526
1557
|
* @param input
|
|
1527
1558
|
* @category TPaaS Tracking
|
|
@@ -1558,6 +1589,15 @@ class Tracker {
|
|
|
1558
1589
|
const event = (0, tpaas_builders_1.buildEngagementTeaserEvent)(input, dependencies);
|
|
1559
1590
|
return this.sendTpaasEvent(event);
|
|
1560
1591
|
}
|
|
1592
|
+
/**
|
|
1593
|
+
* @param input
|
|
1594
|
+
* @category TPaaS Tracking
|
|
1595
|
+
*/
|
|
1596
|
+
async trackEngagementTvModule(input) {
|
|
1597
|
+
const dependencies = await this.prepareTpaasEvent();
|
|
1598
|
+
const event = (0, tpaas_builders_1.buildEngagementTvModuleEvent)(input, dependencies);
|
|
1599
|
+
return this.sendTpaasEvent(event);
|
|
1600
|
+
}
|
|
1561
1601
|
/**
|
|
1562
1602
|
* @param input
|
|
1563
1603
|
* @category TPaaS Tracking
|
|
@@ -57,7 +57,8 @@ let activityListeners = [];
|
|
|
57
57
|
let resizeObserver = null;
|
|
58
58
|
let throttledUpdateFn = (0, utils_1.throttle)(() => undefined, 0);
|
|
59
59
|
let durationStartTime = 0;
|
|
60
|
-
let
|
|
60
|
+
let previousActivityTime = 0;
|
|
61
|
+
let activityDurationMs = 0;
|
|
61
62
|
let currentLeaveEvent = (0, constants_1.DEFAULT_PAGE_LEAVE_EVENT)();
|
|
62
63
|
let additionalHeightBuilder;
|
|
63
64
|
/**
|
|
@@ -90,8 +91,9 @@ function addTpaasLeaveTracking({ objectElement, pageElement, schema, objectResiz
|
|
|
90
91
|
additionalHeightBuilder = heightBuilder;
|
|
91
92
|
addTpaasLeaveListeners();
|
|
92
93
|
addUpdateEventListeners(objectDomElement, pageDomElement, objectResizable);
|
|
93
|
-
|
|
94
|
+
previousActivityTime = resetTime();
|
|
94
95
|
durationStartTime = resetTime();
|
|
96
|
+
activityDurationMs = 0;
|
|
95
97
|
currentLeaveSchema = schema;
|
|
96
98
|
currentTrackMethod = trackMethod;
|
|
97
99
|
logger.debug('addLeaveTracking:after:state', currentLeaveEvent);
|
|
@@ -184,7 +186,8 @@ function removeUpdateEventListeners() {
|
|
|
184
186
|
const resetEventDefaults = () => {
|
|
185
187
|
currentLeaveEvent = (0, constants_1.DEFAULT_PAGE_LEAVE_EVENT)();
|
|
186
188
|
durationStartTime = resetTime();
|
|
187
|
-
|
|
189
|
+
previousActivityTime = resetTime();
|
|
190
|
+
activityDurationMs = 0;
|
|
188
191
|
};
|
|
189
192
|
const resetTpaasViewedContent = () => {
|
|
190
193
|
currentLeaveEvent = (0, constants_1.DEFAULT_PAGE_LEAVE_EVENT)();
|
|
@@ -223,11 +226,13 @@ function getTpaasLeaveObject() {
|
|
|
223
226
|
const endTime = Date.now();
|
|
224
227
|
// TPaaS leave event requires duration/activity to be at least 1ms, otherwise the event is rejected
|
|
225
228
|
// also, in practice, it's almost impossible to have an activity or duration of 0ms
|
|
229
|
+
// We don't call increaseActivityDuration here because it's possible to call getTpaasLeaveObject multiple times
|
|
230
|
+
// without any activity events in between, which would incorrectly increase the activity duration.
|
|
226
231
|
const durationMs = Math.max(endTime - durationStartTime, 1);
|
|
227
|
-
const
|
|
232
|
+
const lastActivityDuration = calculateActivityGap(endTime);
|
|
228
233
|
const leave = {
|
|
229
234
|
durationMs,
|
|
230
|
-
activityDurationMs,
|
|
235
|
+
activityDurationMs: Math.max(activityDurationMs + lastActivityDuration, 1),
|
|
231
236
|
...currentLeaveEvent,
|
|
232
237
|
};
|
|
233
238
|
logger.debug('trackTpaasLeave: event', leave);
|
|
@@ -314,9 +319,16 @@ function addUpdateActivityDurationListeners() {
|
|
|
314
319
|
types_1.BrowserEvents.TOUCHSTART,
|
|
315
320
|
];
|
|
316
321
|
activityListeners = addEventListeners(activityEvents, () => {
|
|
317
|
-
|
|
322
|
+
increaseActivityDuration(Date.now());
|
|
318
323
|
}, { passive: true });
|
|
319
324
|
}
|
|
325
|
+
function calculateActivityGap(activityEndTime) {
|
|
326
|
+
return Math.min(activityEndTime - previousActivityTime, constants_1.ACTIVITY_DURATION_LIMIT_MS);
|
|
327
|
+
}
|
|
328
|
+
function increaseActivityDuration(activityEndTime) {
|
|
329
|
+
activityDurationMs += calculateActivityGap(activityEndTime);
|
|
330
|
+
previousActivityTime = resetTime();
|
|
331
|
+
}
|
|
320
332
|
/*
|
|
321
333
|
Add listeners to a set of browser events.
|
|
322
334
|
*/
|
|
@@ -139,7 +139,7 @@ function getOperatingSystem(uaParser) {
|
|
|
139
139
|
if (osName.includes('windows')) {
|
|
140
140
|
return 'Windows';
|
|
141
141
|
}
|
|
142
|
-
if (osName.includes('macos')) {
|
|
142
|
+
if (osName.includes('macos') || osName.includes('mac os')) {
|
|
143
143
|
return 'Mac';
|
|
144
144
|
}
|
|
145
145
|
if (osName.includes('android')) {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.builder = void 0;
|
|
4
|
-
const builder = (autoTrackerVersion, isHybrid, version) => {
|
|
4
|
+
const builder = ({ autoTrackerVersion, isHybrid, routingStage, version, }) => {
|
|
5
5
|
return {
|
|
6
6
|
tracker: {
|
|
7
7
|
autoTrackerVersion,
|
|
8
8
|
isAutoTracker: !!autoTrackerVersion,
|
|
9
9
|
isHybrid,
|
|
10
|
+
routingStage,
|
|
10
11
|
trackerType: 'JS',
|
|
11
12
|
version,
|
|
12
13
|
},
|
|
@@ -29,10 +29,12 @@ exports.buildLeavePageEvent = buildLeavePageEvent;
|
|
|
29
29
|
exports.buildLeaveSportsPageEvent = buildLeaveSportsPageEvent;
|
|
30
30
|
exports.buildLeaveVideoPageEvent = buildLeaveVideoPageEvent;
|
|
31
31
|
exports.buildLeaveWeatherEvent = buildLeaveWeatherEvent;
|
|
32
|
+
exports.buildEngagementAffiliateEvent = buildEngagementAffiliateEvent;
|
|
32
33
|
exports.buildEngagementAudioEvent = buildEngagementAudioEvent;
|
|
33
34
|
exports.buildEngagementFormEvent = buildEngagementFormEvent;
|
|
34
35
|
exports.buildEngagementOfferEvent = buildEngagementOfferEvent;
|
|
35
36
|
exports.buildEngagementTeaserEvent = buildEngagementTeaserEvent;
|
|
37
|
+
exports.buildEngagementTvModuleEvent = buildEngagementTvModuleEvent;
|
|
36
38
|
exports.buildEngagementUIElementEvent = buildEngagementUIElementEvent;
|
|
37
39
|
exports.buildEngagementVideoEvent = buildEngagementVideoEvent;
|
|
38
40
|
exports.buildEngagementVideoAdEvent = buildEngagementVideoAdEvent;
|
|
@@ -42,6 +44,7 @@ exports.buildEngagementHealthUIElementEvent = buildEngagementHealthUIElementEven
|
|
|
42
44
|
exports.buildViewHealthPageEvent = buildViewHealthPageEvent;
|
|
43
45
|
exports.buildImpressionHealthUIElementEvent = buildImpressionHealthUIElementEvent;
|
|
44
46
|
exports.buildImpressionAdSlotEvent = buildImpressionAdSlotEvent;
|
|
47
|
+
exports.buildImpressionAffiliateEvent = buildImpressionAffiliateEvent;
|
|
45
48
|
exports.buildImpressionFormEvent = buildImpressionFormEvent;
|
|
46
49
|
exports.buildImpressionOfferEvent = buildImpressionOfferEvent;
|
|
47
50
|
exports.buildImpressionPlayerEvent = buildImpressionPlayerEvent;
|
|
@@ -73,9 +76,9 @@ const utm_1 = require("./builders/utm");
|
|
|
73
76
|
* @private
|
|
74
77
|
*/
|
|
75
78
|
const getCommonBuildersOutput = (createdAt, dependencies, input) => {
|
|
76
|
-
const { autoTrackerVersion, isHybrid, version, environmentId, jwe, user, consents, providerId, providerName, providerGroup, component, componentVersion, pageviewId, currentPage, currentPageReferrer, } = dependencies;
|
|
79
|
+
const { autoTrackerVersion, isHybrid, version, environmentId, jwe, user, consents, providerId, providerName, providerGroup, component, componentVersion, pageviewId, currentPage, currentPageReferrer, routingStage, } = dependencies;
|
|
77
80
|
const { experiments } = input;
|
|
78
|
-
return (0, ts_deepmerge_1.merge)((0, trackerBuilder_1.builder)(autoTrackerVersion, isHybrid, version), (0, time_1.builder)(createdAt), (0, session_1.builder)(createdAt), (0, device_1.builder)(environmentId, jwe), (0, user_1.builder)(user), (0, baseEvent_1.builder)(), (0, consents_1.builder)(consents), (0, provider_1.builder)(providerId, component, componentVersion, providerName, providerGroup), (0, pageInfo_1.builder)(currentPage), (0, pageviewId_1.builder)(pageviewId), (0, utm_1.builder)(), (0, referrer_1.builder)(currentPageReferrer), (0, catalogVersion_1.builder)(), (0, experiments_1.builder)(dependencies.experiments, experiments));
|
|
81
|
+
return (0, ts_deepmerge_1.merge)((0, trackerBuilder_1.builder)({ autoTrackerVersion, isHybrid, version, routingStage }), (0, time_1.builder)(createdAt), (0, session_1.builder)(createdAt), (0, device_1.builder)(environmentId, jwe), (0, user_1.builder)(user), (0, baseEvent_1.builder)(), (0, consents_1.builder)(consents), (0, provider_1.builder)(providerId, component, componentVersion, providerName, providerGroup), (0, pageInfo_1.builder)(currentPage), (0, pageviewId_1.builder)(pageviewId), (0, utm_1.builder)(), (0, referrer_1.builder)(currentPageReferrer), (0, catalogVersion_1.builder)(), (0, experiments_1.builder)(dependencies.experiments, experiments));
|
|
79
82
|
};
|
|
80
83
|
exports.getCommonBuildersOutput = getCommonBuildersOutput;
|
|
81
84
|
// there's a bug in the ts-deepmerge library that doesn't properly resolve merging optionals with required properties
|
|
@@ -107,8 +110,8 @@ const normalizePageInput = (input) => {
|
|
|
107
110
|
// #region AnonymousView Event Builders
|
|
108
111
|
function buildAnonymousViewUIElementEvent(input, dependencies) {
|
|
109
112
|
const createdAt = new Date();
|
|
110
|
-
const { autoTrackerVersion, isHybrid, version, pageviewId, providerId, providerName, providerGroup, component, componentVersion, currentPageReferrer, } = dependencies;
|
|
111
|
-
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.AnonymousViewUIElement, (0, baseEvent_1.builder)(), (0, trackerBuilder_1.builder)(autoTrackerVersion, isHybrid, version), (0, time_1.builder)(createdAt), (0, pageviewId_1.builder)(pageviewId), (0, utm_1.builder)(), (0, anonymous_1.builder)(), (0, provider_1.builder)(providerId, component, componentVersion, providerName, providerGroup), (0, referrer_1.builder)(currentPageReferrer), (0, experiments_1.builder)(dependencies.experiments, input.experiments), (0, catalogVersion_1.builder)(), normalizePageInput(input));
|
|
113
|
+
const { autoTrackerVersion, isHybrid, version, pageviewId, providerId, providerName, providerGroup, component, componentVersion, currentPageReferrer, routingStage, } = dependencies;
|
|
114
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.AnonymousViewUIElement, (0, baseEvent_1.builder)(), (0, trackerBuilder_1.builder)({ autoTrackerVersion, isHybrid, version, routingStage }), (0, time_1.builder)(createdAt), (0, pageviewId_1.builder)(pageviewId), (0, utm_1.builder)(), (0, anonymous_1.builder)(), (0, provider_1.builder)(providerId, component, componentVersion, providerName, providerGroup), (0, referrer_1.builder)(currentPageReferrer), (0, experiments_1.builder)(dependencies.experiments, input.experiments), (0, catalogVersion_1.builder)(), normalizePageInput(input));
|
|
112
115
|
}
|
|
113
116
|
// #endregion
|
|
114
117
|
// #region View Event Builders
|
|
@@ -194,11 +197,14 @@ function buildLeaveVideoPageEvent(input, dependencies) {
|
|
|
194
197
|
}
|
|
195
198
|
function buildLeaveWeatherEvent(input, dependencies) {
|
|
196
199
|
const createdAt = new Date();
|
|
197
|
-
const { autoTrackerVersion, isHybrid, version, providerId, providerName, providerGroup, component, componentVersion, user, experiments, } = dependencies;
|
|
198
|
-
return (0, ts_deepmerge_1.merge)(normalizePageInput(input), tpaas_schemas_1.LeaveWeather, (0, time_1.builder)(createdAt), (0, trackerBuilder_1.builder)(autoTrackerVersion, isHybrid, version), (0, baseEvent_1.builder)(), (0, provider_1.builder)(providerId, component, componentVersion, providerName, providerGroup), (0, user_1.builder)(user), (0, experiments_1.builder)(experiments, input.experiments), (0, consents_1.builder)(dependencies.consents), (0, device_1.builder)(dependencies.environmentId, dependencies.jwe), (0, catalogVersion_1.builder)(), (0, navigationType_1.builder)(input.page?.navigationType), (0, pageviewId_1.builder)(dependencies.pageviewId), (0, pageInfo_1.builder)(dependencies.currentPage), (0, referrer_1.builder)(dependencies.currentPageReferrer));
|
|
200
|
+
const { autoTrackerVersion, isHybrid, version, providerId, providerName, providerGroup, component, componentVersion, user, experiments, routingStage, } = dependencies;
|
|
201
|
+
return (0, ts_deepmerge_1.merge)(normalizePageInput(input), tpaas_schemas_1.LeaveWeather, (0, time_1.builder)(createdAt), (0, trackerBuilder_1.builder)({ autoTrackerVersion, isHybrid, version, routingStage }), (0, baseEvent_1.builder)(), (0, provider_1.builder)(providerId, component, componentVersion, providerName, providerGroup), (0, user_1.builder)(user), (0, experiments_1.builder)(experiments, input.experiments), (0, consents_1.builder)(dependencies.consents), (0, device_1.builder)(dependencies.environmentId, dependencies.jwe), (0, catalogVersion_1.builder)(), (0, navigationType_1.builder)(input.page?.navigationType), (0, pageviewId_1.builder)(dependencies.pageviewId), (0, pageInfo_1.builder)(dependencies.currentPage), (0, referrer_1.builder)(dependencies.currentPageReferrer));
|
|
199
202
|
}
|
|
200
203
|
// #endregion
|
|
201
204
|
// #region Engagement Event Builders
|
|
205
|
+
function buildEngagementAffiliateEvent(input, dependencies) {
|
|
206
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.EngagementAffiliate, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input));
|
|
207
|
+
}
|
|
202
208
|
function buildEngagementAudioEvent(input, dependencies) {
|
|
203
209
|
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.EngagementAudio, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input));
|
|
204
210
|
}
|
|
@@ -211,6 +217,9 @@ function buildEngagementOfferEvent(input, dependencies) {
|
|
|
211
217
|
function buildEngagementTeaserEvent(input, dependencies) {
|
|
212
218
|
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.EngagementTeaser, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input));
|
|
213
219
|
}
|
|
220
|
+
function buildEngagementTvModuleEvent(input, dependencies) {
|
|
221
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.EngagementTvModule, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input));
|
|
222
|
+
}
|
|
214
223
|
function buildEngagementUIElementEvent(input, dependencies) {
|
|
215
224
|
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.EngagementUIElement, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input));
|
|
216
225
|
}
|
|
@@ -242,6 +251,9 @@ function buildImpressionHealthUIElementEvent(input, dependencies) {
|
|
|
242
251
|
function buildImpressionAdSlotEvent(input, dependencies) {
|
|
243
252
|
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ImpressionAdSlot, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input));
|
|
244
253
|
}
|
|
254
|
+
function buildImpressionAffiliateEvent(input, dependencies) {
|
|
255
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ImpressionAffiliate, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input));
|
|
256
|
+
}
|
|
245
257
|
function buildImpressionFormEvent(input, dependencies) {
|
|
246
258
|
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ImpressionForm, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input));
|
|
247
259
|
}
|