@schibsted/pulse-sdk 8.0.0-rc.7 → 8.0.0-rc.8
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 +7 -21
- package/dist/cjs/builders/experiments.js +1 -0
- package/dist/cjs/version.js +1 -1
- package/dist/ejs/Tracker.js +8 -22
- package/dist/ejs/builders/experiments.js +1 -1
- package/dist/ejs/version.js +1 -1
- package/dist/types/Tracker.d.ts +1 -15
- package/dist/types/builders/experiments.d.ts +1 -0
- package/dist/types/index.d.ts +0 -1
- package/dist/types/version.d.ts +1 -1
- package/node_modules/@schibsted/tpaas-event-builder/dist/cjs/builders.js +49 -47
- package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/builders.js +49 -47
- package/node_modules/@schibsted/tpaas-event-builder/dist/index.d.ts +42 -36
- package/node_modules/@schibsted/tpaas-event-builder/package.json +1 -0
- package/node_modules/@schibsted/tpaas-schemas/dist/cjs/constants.js +56 -56
- package/node_modules/@schibsted/tpaas-schemas/dist/cjs/index.js +1 -0
- package/node_modules/@schibsted/tpaas-schemas/dist/cjs/types.js +2 -0
- package/node_modules/@schibsted/tpaas-schemas/dist/ejs/constants.js +56 -56
- package/node_modules/@schibsted/tpaas-schemas/dist/ejs/index.js +1 -0
- package/node_modules/@schibsted/tpaas-schemas/dist/ejs/types.js +1 -0
- package/node_modules/@schibsted/tpaas-schemas/dist/index.d.ts +109 -61
- package/package.json +3 -3
|
@@ -22,8 +22,10 @@ import { builder as utmBuilder } from './builders/utm';
|
|
|
22
22
|
* @param dependencies {TpaasEventBuilderDependencies}
|
|
23
23
|
* @private
|
|
24
24
|
*/
|
|
25
|
-
export const getCommonBuildersOutput = (createdAt,
|
|
26
|
-
|
|
25
|
+
export const getCommonBuildersOutput = (createdAt, dependencies, input) => {
|
|
26
|
+
const { autoTrackerVersion, isHybrid, version, environmentId, jwe, user, consents, providerId, pageviewId, currentPage, } = dependencies;
|
|
27
|
+
const { experiments } = input;
|
|
28
|
+
return merge(trackerBuilder(autoTrackerVersion, isHybrid, version), timeBuilder(createdAt), sessionBuilder(createdAt), deviceBuilder(environmentId, jwe), userBuilder(user), baseEventBuilder(), consentsBuilder(consents), providerBuilder(providerId), pageInfoBuilder(currentPage), pageviewIdBuilder(pageviewId), utmBuilder(), referrerBuilder(), catalogVersionBuilder(), experimentsBuilder(dependencies.experiments, experiments));
|
|
27
29
|
};
|
|
28
30
|
// there's a bug in the ts-deepmerge library that doesn't properly resolve merging optionals with required properties
|
|
29
31
|
// due to this, we need to do 2 things:
|
|
@@ -60,84 +62,84 @@ export function buildAnonymousViewUIElementEvent(input, dependencies) {
|
|
|
60
62
|
// #endregion
|
|
61
63
|
// #region View Event Builders
|
|
62
64
|
export function buildViewArticleEvent(input, dependencies) {
|
|
63
|
-
return merge(normalizePageInput(input), ViewArticle, getCommonBuildersOutput(new Date(), dependencies), navigationTypeBuilder(input.page?.navigationType)
|
|
65
|
+
return merge(normalizePageInput(input), ViewArticle, getCommonBuildersOutput(new Date(), dependencies, input), navigationTypeBuilder(input.page?.navigationType));
|
|
64
66
|
}
|
|
65
67
|
export function buildViewAudioPageEvent(input, dependencies) {
|
|
66
|
-
return merge(normalizePageInput(input), ViewAudioPage, getCommonBuildersOutput(new Date(), dependencies
|
|
68
|
+
return merge(normalizePageInput(input), ViewAudioPage, getCommonBuildersOutput(new Date(), dependencies, input), navigationTypeBuilder(input.page?.navigationType));
|
|
67
69
|
}
|
|
68
70
|
export function buildViewErrorEvent(input, dependencies) {
|
|
69
|
-
return merge(normalizePageInput(input), ViewError, getCommonBuildersOutput(new Date(), dependencies), navigationTypeBuilder(input.page?.navigationType)
|
|
71
|
+
return merge(normalizePageInput(input), ViewError, getCommonBuildersOutput(new Date(), dependencies, input), navigationTypeBuilder(input.page?.navigationType));
|
|
70
72
|
}
|
|
71
73
|
export function buildViewFrontpageEvent(input, dependencies) {
|
|
72
|
-
return merge(normalizePageInput(input), ViewFrontpage, getCommonBuildersOutput(new Date(), dependencies
|
|
74
|
+
return merge(normalizePageInput(input), ViewFrontpage, getCommonBuildersOutput(new Date(), dependencies, input), navigationTypeBuilder(input.page?.navigationType));
|
|
73
75
|
}
|
|
74
76
|
export function buildViewLandingpageEvent(input, dependencies) {
|
|
75
|
-
return merge(normalizePageInput(input), ViewLandingpage, getCommonBuildersOutput(new Date(), dependencies), navigationTypeBuilder(input.page?.navigationType)
|
|
77
|
+
return merge(normalizePageInput(input), ViewLandingpage, getCommonBuildersOutput(new Date(), dependencies, input), navigationTypeBuilder(input.page?.navigationType));
|
|
76
78
|
}
|
|
77
79
|
export function buildViewListingEvent(input, dependencies) {
|
|
78
|
-
return merge(normalizePageInput(input), ViewListing, getCommonBuildersOutput(new Date(), dependencies), navigationTypeBuilder(input.page?.navigationType)
|
|
80
|
+
return merge(normalizePageInput(input), ViewListing, getCommonBuildersOutput(new Date(), dependencies, input), navigationTypeBuilder(input.page?.navigationType));
|
|
79
81
|
}
|
|
80
82
|
export function buildViewLockedArticleEvent(input, dependencies) {
|
|
81
|
-
return merge(normalizePageInput(input), ViewLockedArticle, getCommonBuildersOutput(new Date(), dependencies), navigationTypeBuilder(input.page?.navigationType)
|
|
83
|
+
return merge(normalizePageInput(input), ViewLockedArticle, getCommonBuildersOutput(new Date(), dependencies, input), navigationTypeBuilder(input.page?.navigationType));
|
|
82
84
|
}
|
|
83
85
|
export function buildViewLockedAudioPageEvent(input, dependencies) {
|
|
84
|
-
return merge(normalizePageInput(input), ViewLockedAudioPage, getCommonBuildersOutput(new Date(), dependencies), navigationTypeBuilder(input.page?.navigationType)
|
|
86
|
+
return merge(normalizePageInput(input), ViewLockedAudioPage, getCommonBuildersOutput(new Date(), dependencies, input), navigationTypeBuilder(input.page?.navigationType));
|
|
85
87
|
}
|
|
86
88
|
export function buildViewLockedVideoPageEvent(input, dependencies) {
|
|
87
|
-
return merge(normalizePageInput(input), ViewLockedVideoPage, getCommonBuildersOutput(new Date(), dependencies), navigationTypeBuilder(input.page?.navigationType)
|
|
89
|
+
return merge(normalizePageInput(input), ViewLockedVideoPage, getCommonBuildersOutput(new Date(), dependencies, input), navigationTypeBuilder(input.page?.navigationType));
|
|
88
90
|
}
|
|
89
91
|
export function buildLeaveLockedVideoPageEvent(input, dependencies) {
|
|
90
|
-
return merge(normalizePageInput(input), LeaveLockedVideoPage, getCommonBuildersOutput(new Date(), dependencies), navigationTypeBuilder(input.page?.navigationType));
|
|
92
|
+
return merge(normalizePageInput(input), LeaveLockedVideoPage, getCommonBuildersOutput(new Date(), dependencies, input), navigationTypeBuilder(input.page?.navigationType));
|
|
91
93
|
}
|
|
92
94
|
export function buildViewPageEvent(input, dependencies) {
|
|
93
|
-
return merge(normalizePageInput(input), ViewPage, getCommonBuildersOutput(new Date(), dependencies
|
|
95
|
+
return merge(normalizePageInput(input), ViewPage, getCommonBuildersOutput(new Date(), dependencies, input), navigationTypeBuilder(input.page?.navigationType));
|
|
94
96
|
}
|
|
95
97
|
export function buildViewSportsPageEvent(input, dependencies) {
|
|
96
|
-
return merge(normalizePageInput(input), ViewSportsPage, getCommonBuildersOutput(new Date(), dependencies
|
|
98
|
+
return merge(normalizePageInput(input), ViewSportsPage, getCommonBuildersOutput(new Date(), dependencies, input), navigationTypeBuilder(input.page?.navigationType));
|
|
97
99
|
}
|
|
98
100
|
export function buildViewTitleEvent(input, dependencies) {
|
|
99
|
-
return merge(normalizePageInput(input), ViewTitle, getCommonBuildersOutput(new Date(), dependencies
|
|
101
|
+
return merge(normalizePageInput(input), ViewTitle, getCommonBuildersOutput(new Date(), dependencies, input), navigationTypeBuilder(input.page?.navigationType));
|
|
100
102
|
}
|
|
101
103
|
export function buildViewVideoPageEvent(input, dependencies) {
|
|
102
|
-
return merge(normalizePageInput(input), ViewVideoPage, getCommonBuildersOutput(new Date(), dependencies
|
|
104
|
+
return merge(normalizePageInput(input), ViewVideoPage, getCommonBuildersOutput(new Date(), dependencies, input), navigationTypeBuilder(input.page?.navigationType));
|
|
103
105
|
}
|
|
104
106
|
export function buildViewWeatherEvent(input, dependencies) {
|
|
105
|
-
return merge(normalizePageInput(input), ViewWeather, getCommonBuildersOutput(new Date(), dependencies
|
|
107
|
+
return merge(normalizePageInput(input), ViewWeather, getCommonBuildersOutput(new Date(), dependencies, input), navigationTypeBuilder(input.page?.navigationType));
|
|
106
108
|
}
|
|
107
109
|
// #endregion
|
|
108
110
|
// #region Leave Event Builders
|
|
109
111
|
export function buildLeaveArticleEvent(input, dependencies) {
|
|
110
|
-
return merge(normalizePageInput(input), LeaveArticle, getCommonBuildersOutput(new Date(), dependencies), navigationTypeBuilder(input.page?.navigationType)
|
|
112
|
+
return merge(normalizePageInput(input), LeaveArticle, getCommonBuildersOutput(new Date(), dependencies, input), navigationTypeBuilder(input.page?.navigationType));
|
|
111
113
|
}
|
|
112
114
|
export function buildLeaveAudioPageEvent(input, dependencies) {
|
|
113
|
-
return merge(normalizePageInput(input), LeaveAudioPage, getCommonBuildersOutput(new Date(), dependencies), navigationTypeBuilder(input.page?.navigationType));
|
|
115
|
+
return merge(normalizePageInput(input), LeaveAudioPage, getCommonBuildersOutput(new Date(), dependencies, input), navigationTypeBuilder(input.page?.navigationType));
|
|
114
116
|
}
|
|
115
117
|
export function buildLeaveErrorEvent(input, dependencies) {
|
|
116
|
-
return merge(normalizePageInput(input), LeaveError, getCommonBuildersOutput(new Date(), dependencies), navigationTypeBuilder(input.page?.navigationType)
|
|
118
|
+
return merge(normalizePageInput(input), LeaveError, getCommonBuildersOutput(new Date(), dependencies, input), navigationTypeBuilder(input.page?.navigationType));
|
|
117
119
|
}
|
|
118
120
|
export function buildLeaveFrontpageEvent(input, dependencies) {
|
|
119
|
-
return merge(normalizePageInput(input), LeaveFrontpage, getCommonBuildersOutput(new Date(), dependencies), navigationTypeBuilder(input.page?.navigationType)
|
|
121
|
+
return merge(normalizePageInput(input), LeaveFrontpage, getCommonBuildersOutput(new Date(), dependencies, input), navigationTypeBuilder(input.page?.navigationType));
|
|
120
122
|
}
|
|
121
123
|
export function buildLeaveLandingpageEvent(input, dependencies) {
|
|
122
|
-
return merge(normalizePageInput(input), LeaveLandingpage, getCommonBuildersOutput(new Date(), dependencies), navigationTypeBuilder(input.page?.navigationType)
|
|
124
|
+
return merge(normalizePageInput(input), LeaveLandingpage, getCommonBuildersOutput(new Date(), dependencies, input), navigationTypeBuilder(input.page?.navigationType));
|
|
123
125
|
}
|
|
124
126
|
export function buildLeaveListingEvent(input, dependencies) {
|
|
125
|
-
return merge(normalizePageInput(input), LeaveListing, getCommonBuildersOutput(new Date(), dependencies), navigationTypeBuilder(input.page?.navigationType)
|
|
127
|
+
return merge(normalizePageInput(input), LeaveListing, getCommonBuildersOutput(new Date(), dependencies, input), navigationTypeBuilder(input.page?.navigationType));
|
|
126
128
|
}
|
|
127
129
|
export function buildLeaveLockedArticleEvent(input, dependencies) {
|
|
128
|
-
return merge(normalizePageInput(input), LeaveLockedArticle, getCommonBuildersOutput(new Date(), dependencies), navigationTypeBuilder(input.page?.navigationType)
|
|
130
|
+
return merge(normalizePageInput(input), LeaveLockedArticle, getCommonBuildersOutput(new Date(), dependencies, input), navigationTypeBuilder(input.page?.navigationType));
|
|
129
131
|
}
|
|
130
132
|
export function buildLeaveLockedAudioPageEvent(input, dependencies) {
|
|
131
|
-
return merge(normalizePageInput(input), LeaveLockedAudioPage, getCommonBuildersOutput(new Date(), dependencies), navigationTypeBuilder(input.page?.navigationType));
|
|
133
|
+
return merge(normalizePageInput(input), LeaveLockedAudioPage, getCommonBuildersOutput(new Date(), dependencies, input), navigationTypeBuilder(input.page?.navigationType));
|
|
132
134
|
}
|
|
133
135
|
export function buildLeavePageEvent(input, dependencies) {
|
|
134
|
-
return merge(normalizePageInput(input), LeavePage, getCommonBuildersOutput(new Date(), dependencies), navigationTypeBuilder(input.page?.navigationType)
|
|
136
|
+
return merge(normalizePageInput(input), LeavePage, getCommonBuildersOutput(new Date(), dependencies, input), navigationTypeBuilder(input.page?.navigationType));
|
|
135
137
|
}
|
|
136
138
|
export function buildLeaveSportsPageEvent(input, dependencies) {
|
|
137
|
-
return merge(normalizePageInput(input), LeaveSportsPage, getCommonBuildersOutput(new Date(), dependencies), navigationTypeBuilder(input.page?.navigationType)
|
|
139
|
+
return merge(normalizePageInput(input), LeaveSportsPage, getCommonBuildersOutput(new Date(), dependencies, input), navigationTypeBuilder(input.page?.navigationType));
|
|
138
140
|
}
|
|
139
141
|
export function buildLeaveVideoPageEvent(input, dependencies) {
|
|
140
|
-
return merge(normalizePageInput(input), LeaveVideoPage, getCommonBuildersOutput(new Date(), dependencies), navigationTypeBuilder(input.page?.navigationType));
|
|
142
|
+
return merge(normalizePageInput(input), LeaveVideoPage, getCommonBuildersOutput(new Date(), dependencies, input), navigationTypeBuilder(input.page?.navigationType));
|
|
141
143
|
}
|
|
142
144
|
export function buildLeaveWeatherEvent(input, dependencies) {
|
|
143
145
|
const createdAt = new Date();
|
|
@@ -147,64 +149,64 @@ export function buildLeaveWeatherEvent(input, dependencies) {
|
|
|
147
149
|
// #endregion
|
|
148
150
|
// #region Engagement Event Builders
|
|
149
151
|
export function buildEngagementAudioEvent(input, dependencies) {
|
|
150
|
-
return merge(normalizePageInput(input), EngagementAudio, getCommonBuildersOutput(new Date(), dependencies
|
|
152
|
+
return merge(normalizePageInput(input), EngagementAudio, getCommonBuildersOutput(new Date(), dependencies, input));
|
|
151
153
|
}
|
|
152
154
|
export function buildEngagementFormEvent(input, dependencies) {
|
|
153
|
-
return merge(normalizePageInput(input), EngagementForm, getCommonBuildersOutput(new Date(), dependencies
|
|
155
|
+
return merge(normalizePageInput(input), EngagementForm, getCommonBuildersOutput(new Date(), dependencies, input));
|
|
154
156
|
}
|
|
155
157
|
export function buildEngagementOfferEvent(input, dependencies) {
|
|
156
|
-
return merge(normalizePageInput(input), EngagementOffer, getCommonBuildersOutput(new Date(), dependencies
|
|
158
|
+
return merge(normalizePageInput(input), EngagementOffer, getCommonBuildersOutput(new Date(), dependencies, input));
|
|
157
159
|
}
|
|
158
160
|
export function buildEngagementTeaserEvent(input, dependencies) {
|
|
159
|
-
return merge(normalizePageInput(input), EngagementTeaser, getCommonBuildersOutput(new Date(), dependencies
|
|
161
|
+
return merge(normalizePageInput(input), EngagementTeaser, getCommonBuildersOutput(new Date(), dependencies, input));
|
|
160
162
|
}
|
|
161
163
|
export function buildEngagementUIElementEvent(input, dependencies) {
|
|
162
|
-
return merge(normalizePageInput(input), EngagementUIElement, getCommonBuildersOutput(new Date(), dependencies
|
|
164
|
+
return merge(normalizePageInput(input), EngagementUIElement, getCommonBuildersOutput(new Date(), dependencies, input));
|
|
163
165
|
}
|
|
164
166
|
export function buildEngagementVideoEvent(input, dependencies) {
|
|
165
|
-
return merge(normalizePageInput(input), EngagementVideo, getCommonBuildersOutput(new Date(), dependencies
|
|
167
|
+
return merge(normalizePageInput(input), EngagementVideo, getCommonBuildersOutput(new Date(), dependencies, input));
|
|
166
168
|
}
|
|
167
169
|
export function buildEngagementVideoAdEvent(input, dependencies) {
|
|
168
|
-
return merge(normalizePageInput(input), EngagementVideoAd, getCommonBuildersOutput(new Date(), dependencies
|
|
170
|
+
return merge(normalizePageInput(input), EngagementVideoAd, getCommonBuildersOutput(new Date(), dependencies, input));
|
|
169
171
|
}
|
|
170
172
|
export function buildEngagementWidgetEvent(input, dependencies) {
|
|
171
|
-
return merge(normalizePageInput(input), EngagementWidget, getCommonBuildersOutput(new Date(), dependencies
|
|
173
|
+
return merge(normalizePageInput(input), EngagementWidget, getCommonBuildersOutput(new Date(), dependencies, input));
|
|
172
174
|
}
|
|
173
175
|
// #endregion
|
|
174
176
|
// #region Health Event Builders
|
|
175
177
|
export function buildCompletedHealthActionEvent(input, dependencies) {
|
|
176
|
-
return merge(normalizePageInput(input), CompletedHealthAction, getCommonBuildersOutput(new Date(), dependencies
|
|
178
|
+
return merge(normalizePageInput(input), CompletedHealthAction, getCommonBuildersOutput(new Date(), dependencies, input));
|
|
177
179
|
}
|
|
178
180
|
export function buildEngagementHealthUIElementEvent(input, dependencies) {
|
|
179
|
-
return merge(normalizePageInput(input), EngagementHealthUIElement, getCommonBuildersOutput(new Date(), dependencies));
|
|
181
|
+
return merge(normalizePageInput(input), EngagementHealthUIElement, getCommonBuildersOutput(new Date(), dependencies, input));
|
|
180
182
|
}
|
|
181
183
|
export function buildViewHealthPageEvent(input, dependencies) {
|
|
182
|
-
return merge(normalizePageInput(input), ViewHealthPage, getCommonBuildersOutput(new Date(), dependencies), navigationTypeBuilder(input.page?.navigationType));
|
|
184
|
+
return merge(normalizePageInput(input), ViewHealthPage, getCommonBuildersOutput(new Date(), dependencies, input), navigationTypeBuilder(input.page?.navigationType));
|
|
183
185
|
}
|
|
184
186
|
export function buildImpressionHealthUIElementEvent(input, dependencies) {
|
|
185
|
-
return merge(normalizePageInput(input), ImpressionHealthUIElement, getCommonBuildersOutput(new Date(), dependencies));
|
|
187
|
+
return merge(normalizePageInput(input), ImpressionHealthUIElement, getCommonBuildersOutput(new Date(), dependencies, input));
|
|
186
188
|
}
|
|
187
189
|
// #endregion
|
|
188
190
|
// #region Impression Event Builders
|
|
189
191
|
export function buildImpressionAdSlotEvent(input, dependencies) {
|
|
190
|
-
return merge(normalizePageInput(input), ImpressionAdSlot, getCommonBuildersOutput(new Date(), dependencies
|
|
192
|
+
return merge(normalizePageInput(input), ImpressionAdSlot, getCommonBuildersOutput(new Date(), dependencies, input));
|
|
191
193
|
}
|
|
192
194
|
export function buildImpressionFormEvent(input, dependencies) {
|
|
193
|
-
return merge(normalizePageInput(input), ImpressionForm, getCommonBuildersOutput(new Date(), dependencies
|
|
195
|
+
return merge(normalizePageInput(input), ImpressionForm, getCommonBuildersOutput(new Date(), dependencies, input));
|
|
194
196
|
}
|
|
195
197
|
export function buildImpressionOfferEvent(input, dependencies) {
|
|
196
|
-
return merge(normalizePageInput(input), ImpressionOffer, getCommonBuildersOutput(new Date(), dependencies
|
|
198
|
+
return merge(normalizePageInput(input), ImpressionOffer, getCommonBuildersOutput(new Date(), dependencies, input));
|
|
197
199
|
}
|
|
198
200
|
export function buildImpressionPlayerEvent(input, dependencies) {
|
|
199
|
-
return merge(normalizePageInput(input), ImpressionPlayer, getCommonBuildersOutput(new Date(), dependencies
|
|
201
|
+
return merge(normalizePageInput(input), ImpressionPlayer, getCommonBuildersOutput(new Date(), dependencies, input));
|
|
200
202
|
}
|
|
201
203
|
export function buildImpressionTeaserEvent(input, dependencies) {
|
|
202
|
-
return merge(normalizePageInput(input), ImpressionTeaser, getCommonBuildersOutput(new Date(), dependencies
|
|
204
|
+
return merge(normalizePageInput(input), ImpressionTeaser, getCommonBuildersOutput(new Date(), dependencies, input));
|
|
203
205
|
}
|
|
204
206
|
export function buildImpressionUIElementEvent(input, dependencies) {
|
|
205
|
-
return merge(normalizePageInput(input), ImpressionUIElement, getCommonBuildersOutput(new Date(), dependencies
|
|
207
|
+
return merge(normalizePageInput(input), ImpressionUIElement, getCommonBuildersOutput(new Date(), dependencies, input));
|
|
206
208
|
}
|
|
207
209
|
export function buildImpressionWidgetEvent(input, dependencies) {
|
|
208
|
-
return merge(normalizePageInput(input), ImpressionWidget, getCommonBuildersOutput(new Date(), dependencies
|
|
210
|
+
return merge(normalizePageInput(input), ImpressionWidget, getCommonBuildersOutput(new Date(), dependencies, input));
|
|
209
211
|
}
|
|
210
212
|
// #endregion
|
|
@@ -316,6 +316,7 @@ interface ICancelSubscription {
|
|
|
316
316
|
/**
|
|
317
317
|
* The environmentId.
|
|
318
318
|
* @pattern ^[0-9a-fA-F-]+$
|
|
319
|
+
* @example "42401e1f-7e04-4b73-8bed-1ceffc0ed8cc"
|
|
319
320
|
*/
|
|
320
321
|
environmentId: string;
|
|
321
322
|
};
|
|
@@ -539,14 +540,17 @@ interface IChangePushNotificationSettings {
|
|
|
539
540
|
interface IHealthOrigin {
|
|
540
541
|
/**
|
|
541
542
|
* The specific UI element or component that navigated to this page.
|
|
543
|
+
* @example "logging_hq_button"
|
|
542
544
|
*/
|
|
543
545
|
content?: string;
|
|
544
546
|
/**
|
|
545
547
|
* The feature area that navigated to this page
|
|
548
|
+
* @example "meal_logging"
|
|
546
549
|
*/
|
|
547
550
|
feature?: string;
|
|
548
551
|
/**
|
|
549
552
|
* The origin name / place that the user navigated from.
|
|
553
|
+
* @example "logbook"
|
|
550
554
|
*/
|
|
551
555
|
name?: string;
|
|
552
556
|
}
|
|
@@ -2662,6 +2666,7 @@ interface IInternalAccessDecision {
|
|
|
2662
2666
|
deviceType?: "Desktop" | "Mobile" | "Tablet" | "SmartTv" | "Other";
|
|
2663
2667
|
/**
|
|
2664
2668
|
* The environment ID.
|
|
2669
|
+
* @example "42401e1f-7e04-4b73-8bed-1ceffc0ed8cc"
|
|
2665
2670
|
*/
|
|
2666
2671
|
environmentId: string;
|
|
2667
2672
|
/**
|
|
@@ -2684,7 +2689,7 @@ interface IInternalAccessDecision {
|
|
|
2684
2689
|
eventType: "Internal";
|
|
2685
2690
|
experiments?: IExperiments;
|
|
2686
2691
|
object: {
|
|
2687
|
-
arm
|
|
2692
|
+
arm?: {
|
|
2688
2693
|
/**
|
|
2689
2694
|
* Unique ID of the experimental arm the user is assigned to.
|
|
2690
2695
|
*/
|
|
@@ -2741,7 +2746,7 @@ interface IInternalAccessDecision {
|
|
|
2741
2746
|
* Categorization of how the decision was made.
|
|
2742
2747
|
*/
|
|
2743
2748
|
decisionType: "Policy" | "Replay" | "Fallback";
|
|
2744
|
-
episode
|
|
2749
|
+
episode?: {
|
|
2745
2750
|
/**
|
|
2746
2751
|
* End time of the episode in UTC.
|
|
2747
2752
|
* @format date-time
|
|
@@ -2757,6 +2762,10 @@ interface IInternalAccessDecision {
|
|
|
2757
2762
|
*/
|
|
2758
2763
|
startAt: string;
|
|
2759
2764
|
};
|
|
2765
|
+
/**
|
|
2766
|
+
* Internal Decision System error that caused the fallback.
|
|
2767
|
+
*/
|
|
2768
|
+
fallbackReason?: "EngineTimeout" | "EpisodeReadError" | "EpisodeWriteError" | "RequestCountError" | "ArmReadError" | "ArmWriteError";
|
|
2760
2769
|
/**
|
|
2761
2770
|
* The type of the object.
|
|
2762
2771
|
*/
|
|
@@ -3413,9 +3422,8 @@ interface ILeaveListing {
|
|
|
3413
3422
|
itemsTotal: number;
|
|
3414
3423
|
/**
|
|
3415
3424
|
* The type of listing page, e.g. 'tag', 'section' etc.
|
|
3416
|
-
* @pattern Tag,Story,Section,Search,Author,Other
|
|
3417
3425
|
*/
|
|
3418
|
-
listingType:
|
|
3426
|
+
listingType: "Tag" | "Story" | "Section" | "Search" | "Author" | "Other";
|
|
3419
3427
|
/**
|
|
3420
3428
|
* The unique ID of this page.
|
|
3421
3429
|
*/
|
|
@@ -4191,6 +4199,7 @@ interface IPurchaseSubscription {
|
|
|
4191
4199
|
/**
|
|
4192
4200
|
* The environmentId.
|
|
4193
4201
|
* @pattern ^[0-9a-fA-F-]+$
|
|
4202
|
+
* @example "42401e1f-7e04-4b73-8bed-1ceffc0ed8cc"
|
|
4194
4203
|
*/
|
|
4195
4204
|
environmentId?: string;
|
|
4196
4205
|
};
|
|
@@ -4285,6 +4294,7 @@ interface IPurchaseSubscription {
|
|
|
4285
4294
|
utm?: IUtmTags;
|
|
4286
4295
|
/**
|
|
4287
4296
|
* The session ID on a partner domain (set via query parameter), else the current session ID. This value is used to connect cross-domain events such as behavior events to purchase events.
|
|
4297
|
+
* @example "079bc17a-4ee8-42ab-a29f-2fbba4cd403f"
|
|
4288
4298
|
*/
|
|
4289
4299
|
xDomainId?: string;
|
|
4290
4300
|
};
|
|
@@ -5527,30 +5537,6 @@ interface IViewWeather {
|
|
|
5527
5537
|
user?: IUser;
|
|
5528
5538
|
}
|
|
5529
5539
|
type ITpaasEvent = IAnonymousViewUIElement | ICancelSubscription | IChangePushNotificationSettings | ICompletedHealthAction | IEngagementAudio | IEngagementForm | IEngagementHealthUIElement | IEngagementNotification | IEngagementOffer | IEngagementTeaser | IEngagementUIElement | IEngagementVideo | IEngagementVideoAd | IEngagementWidget | IImpressionAdSlot | IImpressionForm | IImpressionHealthUIElement | IImpressionNotification | IImpressionOffer | IImpressionPlayer | IImpressionTeaser | IImpressionUIElement | IImpressionWidget | IInternalAccessDecision | IInternalProbe | ILaunchApp | ILeaveArticle | ILeaveAudioPage | ILeaveError | ILeaveFrontpage | ILeaveLandingpage | ILeaveListing | ILeaveLockedArticle | ILeaveLockedAudioPage | ILeaveLockedVideoPage | ILeavePage | ILeaveSportsPage | ILeaveVideoPage | ILeaveWeather | IPurchaseSubscription | IViewArticle | IViewAudioPage | IViewError | IViewFrontpage | IViewHealthPage | IViewLandingpage | IViewListing | IViewLockedArticle | IViewLockedAudioPage | IViewLockedVideoPage | IViewPage | IViewSportsPage | IViewTitle | IViewVideoPage | IViewWeather;
|
|
5530
|
-
type UserParams = Pick<IUser, "hasAnySubscription" | "region"> & {
|
|
5531
|
-
id: string;
|
|
5532
|
-
realm: string;
|
|
5533
|
-
};
|
|
5534
|
-
/**
|
|
5535
|
-
* @private
|
|
5536
|
-
*
|
|
5537
|
-
* @privateRemarks
|
|
5538
|
-
* These can be different from one event type to another, depending on the builders used by that event type.
|
|
5539
|
-
* However, for now, we use the same dependencies for all event types. let's make it more complex only if needed.
|
|
5540
|
-
*/
|
|
5541
|
-
export interface TpaasEventBuilderDependencies {
|
|
5542
|
-
user?: UserParams;
|
|
5543
|
-
autoTrackerVersion: ITracker["autoTrackerVersion"];
|
|
5544
|
-
version: ITracker["version"];
|
|
5545
|
-
isHybrid: ITracker["isHybrid"];
|
|
5546
|
-
consents?: IConsents;
|
|
5547
|
-
providerId: IProvider["providerId"];
|
|
5548
|
-
environmentId: IDevice["environmentId"];
|
|
5549
|
-
jwe: IDevice["jweIds"];
|
|
5550
|
-
pageviewId: string;
|
|
5551
|
-
experiments?: IExperiments;
|
|
5552
|
-
currentPage?: IPageRef;
|
|
5553
|
-
}
|
|
5554
5540
|
type OmittedProperties = "user" | "eventId" | "consents" | "device" | "time" | "tracker" | "session" | "eventType" | "schema" | "object.objectType" | "isAnonymous" | "provider.providerId" | "provider.providerSdrn" | "page.pageviewId" | "page.utm" | "page.info" | "page.referrer.url" | "catalogVersion";
|
|
5555
5541
|
type DeepOmit<T, K extends string> = T extends readonly unknown[] ? T : T extends object ? {
|
|
5556
5542
|
[P in keyof T as P extends K ? never : P]: DeepOmit<T[P], K extends `${Exclude<P, symbol>}.${infer R}` ? R : never>;
|
|
@@ -5574,25 +5560,44 @@ type OptionalNavigationType<T> = T extends {
|
|
|
5574
5560
|
navigationType?: N;
|
|
5575
5561
|
};
|
|
5576
5562
|
} : T;
|
|
5563
|
+
type WithOptionalPage<T> = T extends TpaasOptionalPageSchemas ? Omit<T, "page"> & {
|
|
5564
|
+
page?: T["page"];
|
|
5565
|
+
} : T;
|
|
5566
|
+
type TpaasOptionalPageSchemas = IAnonymousViewUIElement | ICompletedHealthAction | IEngagementAudio | IEngagementForm | IEngagementHealthUIElement | IEngagementOffer | IEngagementTeaser | IEngagementUIElement | IEngagementVideo | IEngagementVideoAd | IEngagementWidget | IImpressionAdSlot | IImpressionForm | IImpressionHealthUIElement | IImpressionOffer | IImpressionPlayer | IImpressionTeaser | IImpressionUIElement | IImpressionWidget | ILeaveAudioPage | ILeaveError | ILeaveFrontpage | ILeaveLandingpage | ILeaveListing | ILeaveLockedAudioPage | ILeaveLockedVideoPage | ILeavePage | ILeaveSportsPage | ILeaveVideoPage | ILeaveWeather | IViewAudioPage | IViewError | IViewFrontpage | IViewHealthPage | IViewLandingpage | IViewListing | IViewLockedAudioPage | IViewLockedVideoPage | IViewPage | IViewSportsPage | IViewTitle | IViewVideoPage | IViewWeather;
|
|
5567
|
+
type InputParams<T extends ITpaasEvent> = DeepOmit<OptionalNavigationType<WithOptionalPage<T>>, OmittedProperties>;
|
|
5568
|
+
type UserParams = Pick<IUser, "hasAnySubscription" | "region"> & {
|
|
5569
|
+
id: string;
|
|
5570
|
+
realm: string;
|
|
5571
|
+
};
|
|
5577
5572
|
/**
|
|
5578
|
-
* InputParams is a utility type that omits certain properties from a given type T.
|
|
5579
|
-
* @param T - The type from which properties will be omitted.
|
|
5580
5573
|
* @private
|
|
5581
5574
|
*
|
|
5582
5575
|
* @privateRemarks
|
|
5576
|
+
* These can be different from one event type to another, depending on the builders used by that event type.
|
|
5577
|
+
* However, for now, we use the same dependencies for all event types. let's make it more complex only if needed.
|
|
5583
5578
|
*/
|
|
5584
|
-
export
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5579
|
+
export interface TpaasEventBuilderDependencies {
|
|
5580
|
+
user?: UserParams;
|
|
5581
|
+
autoTrackerVersion: ITracker["autoTrackerVersion"];
|
|
5582
|
+
version: ITracker["version"];
|
|
5583
|
+
isHybrid: ITracker["isHybrid"];
|
|
5584
|
+
consents?: IConsents;
|
|
5585
|
+
providerId: IProvider["providerId"];
|
|
5586
|
+
environmentId: IDevice["environmentId"];
|
|
5587
|
+
jwe: IDevice["jweIds"];
|
|
5588
|
+
pageviewId: string;
|
|
5589
|
+
experiments?: IExperiments;
|
|
5590
|
+
currentPage?: IPageRef;
|
|
5591
|
+
}
|
|
5589
5592
|
/**
|
|
5590
5593
|
* Common builders output to be merged into all events
|
|
5591
5594
|
* @param createdAt
|
|
5592
5595
|
* @param dependencies {TpaasEventBuilderDependencies}
|
|
5593
5596
|
* @private
|
|
5594
5597
|
*/
|
|
5595
|
-
export declare const getCommonBuildersOutput: (createdAt: Date,
|
|
5598
|
+
export declare const getCommonBuildersOutput: (createdAt: Date, dependencies: TpaasEventBuilderDependencies, input: InputParams<Extract<ITpaasEvent, {
|
|
5599
|
+
experiments?: IExperiments;
|
|
5600
|
+
}>>) => {
|
|
5596
5601
|
time: {
|
|
5597
5602
|
createdAt: string;
|
|
5598
5603
|
publishedAt: string | undefined;
|
|
@@ -5647,6 +5652,7 @@ export declare const getCommonBuildersOutput: (createdAt: Date, { autoTrackerVer
|
|
|
5647
5652
|
trackerType: "JS" | "IOS" | "Android" | "Backend";
|
|
5648
5653
|
};
|
|
5649
5654
|
catalogVersion: string;
|
|
5655
|
+
experiments: IExperiments | undefined;
|
|
5650
5656
|
provider: {
|
|
5651
5657
|
providerId: string;
|
|
5652
5658
|
providerSdrn: string;
|