@guardian/ophan-tracker-js 4.0.2 → 5.0.0
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/NPM-dist/adblock-detection.js +17 -11
- package/NPM-dist/adblock-detection.js.map +1 -0
- package/NPM-dist/attention.js +32 -19
- package/NPM-dist/attention.js.map +1 -0
- package/NPM-dist/campaign.js +6 -2
- package/NPM-dist/campaign.js.map +1 -0
- package/NPM-dist/click-path-capture.js +5 -2
- package/NPM-dist/click-path-capture.js.map +1 -0
- package/NPM-dist/components.js +1 -0
- package/NPM-dist/components.js.map +1 -0
- package/NPM-dist/contribution.js +1 -0
- package/NPM-dist/contribution.js.map +1 -0
- package/NPM-dist/core.js +40 -10
- package/NPM-dist/core.js.map +1 -0
- package/NPM-dist/embed.js +1 -0
- package/NPM-dist/embed.js.map +1 -0
- package/NPM-dist/fb-instant.js +1 -0
- package/NPM-dist/fb-instant.js.map +1 -0
- package/NPM-dist/heatmap.js +4 -0
- package/NPM-dist/heatmap.js.map +1 -0
- package/NPM-dist/holidays.js +1 -0
- package/NPM-dist/holidays.js.map +1 -0
- package/NPM-dist/http-status.js +1 -0
- package/NPM-dist/http-status.js.map +1 -0
- package/NPM-dist/iframe-tracking.js +16 -3
- package/NPM-dist/iframe-tracking.js.map +1 -0
- package/NPM-dist/index.js +285 -0
- package/NPM-dist/index.js.map +1 -0
- package/NPM-dist/interactive.js +1 -0
- package/NPM-dist/interactive.js.map +1 -0
- package/NPM-dist/jobs-courses.js +1 -0
- package/NPM-dist/jobs-courses.js.map +1 -0
- package/NPM-dist/jobs.js +1 -0
- package/NPM-dist/jobs.js.map +1 -0
- package/NPM-dist/membership.js +1 -0
- package/NPM-dist/membership.js.map +1 -0
- package/NPM-dist/ng.js +10 -33
- package/NPM-dist/ng.js.map +1 -0
- package/NPM-dist/perf.js +3 -2
- package/NPM-dist/perf.js.map +1 -0
- package/NPM-dist/privatebrowsing.js +1 -0
- package/NPM-dist/privatebrowsing.js.map +1 -0
- package/NPM-dist/r2.js +8 -4
- package/NPM-dist/r2.js.map +1 -0
- package/NPM-dist/smart-news.js +10 -3
- package/NPM-dist/smart-news.js.map +1 -0
- package/NPM-dist/tests/attention.test.js +1 -0
- package/NPM-dist/tests/attention.test.js.map +1 -0
- package/NPM-dist/tests/click-path-capture.test.js +1 -0
- package/NPM-dist/tests/click-path-capture.test.js.map +1 -0
- package/NPM-dist/tests/components.test.js +1 -0
- package/NPM-dist/tests/components.test.js.map +1 -0
- package/NPM-dist/tests/core.test.js +1 -0
- package/NPM-dist/tests/core.test.js.map +1 -0
- package/NPM-dist/tests/heatmap.test.js +1 -0
- package/NPM-dist/tests/heatmap.test.js.map +1 -0
- package/NPM-dist/tests/index.test.js +18 -0
- package/NPM-dist/tests/index.test.js.map +1 -0
- package/NPM-dist/tests/transmit.test.js +1 -0
- package/NPM-dist/tests/transmit.test.js.map +1 -0
- package/NPM-dist/transmit.js +23 -5
- package/NPM-dist/transmit.js.map +1 -0
- package/NPM-dist/types/abtest.js +1 -0
- package/NPM-dist/types/abtest.js.map +1 -0
- package/NPM-dist/types/adblock-detection.d.ts +1 -0
- package/NPM-dist/types/adblock-detection.d.ts.map +1 -0
- package/NPM-dist/types/attention.d.ts +1 -0
- package/NPM-dist/types/attention.d.ts.map +1 -0
- package/NPM-dist/types/campaign.d.ts +1 -0
- package/NPM-dist/types/campaign.d.ts.map +1 -0
- package/NPM-dist/types/click-path-capture.d.ts +1 -0
- package/NPM-dist/types/click-path-capture.d.ts.map +1 -0
- package/NPM-dist/types/component-event.js +1 -0
- package/NPM-dist/types/component-event.js.map +1 -0
- package/NPM-dist/types/component-type.js +1 -0
- package/NPM-dist/types/component-type.js.map +1 -0
- package/NPM-dist/types/components.d.ts +1 -0
- package/NPM-dist/types/components.d.ts.map +1 -0
- package/NPM-dist/types/consent.js +1 -0
- package/NPM-dist/types/consent.js.map +1 -0
- package/NPM-dist/types/contribution.d.ts +2 -1
- package/NPM-dist/types/contribution.d.ts.map +1 -0
- package/NPM-dist/types/core.d.ts +1 -0
- package/NPM-dist/types/core.d.ts.map +1 -0
- package/NPM-dist/types/embed.d.ts +2 -1
- package/NPM-dist/types/embed.d.ts.map +1 -0
- package/NPM-dist/types/event.js +1 -0
- package/NPM-dist/types/event.js.map +1 -0
- package/NPM-dist/types/fb-instant.d.ts +1 -0
- package/NPM-dist/types/fb-instant.d.ts.map +1 -0
- package/NPM-dist/types/heatmap.d.ts +1 -0
- package/NPM-dist/types/heatmap.d.ts.map +1 -0
- package/NPM-dist/types/holidays.d.ts +2 -1
- package/NPM-dist/types/holidays.d.ts.map +1 -0
- package/NPM-dist/types/http-status.d.ts +1 -0
- package/NPM-dist/types/http-status.d.ts.map +1 -0
- package/NPM-dist/types/iframe-tracking.d.ts +1 -0
- package/NPM-dist/types/iframe-tracking.d.ts.map +1 -0
- package/NPM-dist/types/index.d.ts +199 -0
- package/NPM-dist/types/index.d.ts.map +1 -0
- package/NPM-dist/types/inpageclick.js +1 -0
- package/NPM-dist/types/inpageclick.js.map +1 -0
- package/NPM-dist/types/interaction.js +1 -0
- package/NPM-dist/types/interaction.js.map +1 -0
- package/NPM-dist/types/interactive.d.ts +1 -0
- package/NPM-dist/types/interactive.d.ts.map +1 -0
- package/NPM-dist/types/jobs-courses.d.ts +2 -1
- package/NPM-dist/types/jobs-courses.d.ts.map +1 -0
- package/NPM-dist/types/jobs.d.ts +2 -1
- package/NPM-dist/types/jobs.d.ts.map +1 -0
- package/NPM-dist/types/link.js +1 -0
- package/NPM-dist/types/link.js.map +1 -0
- package/NPM-dist/types/media.js +1 -0
- package/NPM-dist/types/media.js.map +1 -0
- package/NPM-dist/types/membership.d.ts +2 -1
- package/NPM-dist/types/membership.d.ts.map +1 -0
- package/NPM-dist/types/ng.d.ts +2 -13
- package/NPM-dist/types/ng.d.ts.map +1 -0
- package/NPM-dist/types/perf.d.ts +2 -1
- package/NPM-dist/types/perf.d.ts.map +1 -0
- package/NPM-dist/types/platform.js +1 -0
- package/NPM-dist/types/platform.js.map +1 -0
- package/NPM-dist/types/printproduct.js +1 -0
- package/NPM-dist/types/printproduct.js.map +1 -0
- package/NPM-dist/types/privatebrowsing.d.ts +1 -0
- package/NPM-dist/types/privatebrowsing.d.ts.map +1 -0
- package/NPM-dist/types/product.js +1 -0
- package/NPM-dist/types/product.js.map +1 -0
- package/NPM-dist/types/r2.d.ts +1 -0
- package/NPM-dist/types/r2.d.ts.map +1 -0
- package/NPM-dist/types/smart-news.d.ts +2 -1
- package/NPM-dist/types/smart-news.d.ts.map +1 -0
- package/NPM-dist/types/subscription.js +1 -0
- package/NPM-dist/types/subscription.js.map +1 -0
- package/NPM-dist/types/tests/attention.test.d.ts +1 -0
- package/NPM-dist/types/tests/attention.test.d.ts.map +1 -0
- package/NPM-dist/types/tests/click-path-capture.test.d.ts +1 -0
- package/NPM-dist/types/tests/click-path-capture.test.d.ts.map +1 -0
- package/NPM-dist/types/tests/components.test.d.ts +1 -0
- package/NPM-dist/types/tests/components.test.d.ts.map +1 -0
- package/NPM-dist/types/tests/core.test.d.ts +1 -0
- package/NPM-dist/types/tests/core.test.d.ts.map +1 -0
- package/NPM-dist/types/tests/heatmap.test.d.ts +1 -0
- package/NPM-dist/types/tests/heatmap.test.d.ts.map +1 -0
- package/NPM-dist/types/tests/index.test.d.ts +2 -0
- package/NPM-dist/types/tests/index.test.d.ts.map +1 -0
- package/NPM-dist/types/tests/transmit.test.d.ts +1 -0
- package/NPM-dist/types/tests/transmit.test.d.ts.map +1 -0
- package/NPM-dist/types/transmit.d.ts +1 -0
- package/NPM-dist/types/transmit.d.ts.map +1 -0
- package/NPM-dist/types/types/abtest.d.ts +1 -0
- package/NPM-dist/types/types/abtest.d.ts.map +1 -0
- package/NPM-dist/types/types/component-event.d.ts +15 -0
- package/NPM-dist/types/types/component-event.d.ts.map +1 -0
- package/NPM-dist/types/types/component-type.d.ts +7 -0
- package/NPM-dist/types/types/component-type.d.ts.map +1 -0
- package/NPM-dist/types/types/consent.d.ts +1 -0
- package/NPM-dist/types/types/consent.d.ts.map +1 -0
- package/NPM-dist/types/types/event.d.ts +11 -0
- package/NPM-dist/types/types/event.d.ts.map +1 -0
- package/NPM-dist/types/types/inpageclick.d.ts +1 -0
- package/NPM-dist/types/types/inpageclick.d.ts.map +1 -0
- package/NPM-dist/types/types/interaction.d.ts +1 -0
- package/NPM-dist/types/types/interaction.d.ts.map +1 -0
- package/NPM-dist/types/types/link.d.ts +1 -0
- package/NPM-dist/types/types/link.d.ts.map +1 -0
- package/NPM-dist/types/types/media.d.ts +1 -0
- package/NPM-dist/types/types/media.d.ts.map +1 -0
- package/NPM-dist/types/types/platform.d.ts +1 -0
- package/NPM-dist/types/types/platform.d.ts.map +1 -0
- package/NPM-dist/types/types/printproduct.d.ts +1 -0
- package/NPM-dist/types/types/printproduct.d.ts.map +1 -0
- package/NPM-dist/types/types/product.d.ts +7 -0
- package/NPM-dist/types/types/product.d.ts.map +1 -0
- package/NPM-dist/types/types/subscription.d.ts +1 -0
- package/NPM-dist/types/types/subscription.d.ts.map +1 -0
- package/NPM-dist/types/vendor/adBlockDetectionLib.d.ts +3 -1
- package/NPM-dist/types/vendor/adBlockDetectionLib.d.ts.map +1 -0
- package/NPM-dist/types/visibility.d.ts +2 -1
- package/NPM-dist/types/visibility.d.ts.map +1 -0
- package/NPM-dist/types/witness.d.ts +2 -1
- package/NPM-dist/types/witness.d.ts.map +1 -0
- package/NPM-dist/vendor/adBlockDetectionLib.js +19 -6
- package/NPM-dist/vendor/adBlockDetectionLib.js.map +1 -0
- package/NPM-dist/visibility.js +14 -5
- package/NPM-dist/visibility.js.map +1 -0
- package/NPM-dist/witness.js +1 -0
- package/NPM-dist/witness.js.map +1 -0
- package/package.json +12 -26
- package/readme.md +112 -53
- package/src/index.ts +360 -0
- package/src/ng.ts +33 -0
- package/src/transmit.ts +176 -0
- package/src/types/abtest.ts +45 -0
- package/src/types/component-event.ts +121 -0
- package/src/types/component-type.ts +70 -0
- package/src/types/consent.ts +49 -0
- package/src/types/event.ts +116 -0
- package/src/types/inpageclick.ts +13 -0
- package/src/types/interaction.ts +19 -0
- package/src/types/link.ts +14 -0
- package/src/types/media.ts +184 -0
- package/src/types/platform.ts +32 -0
- package/src/types/printproduct.ts +53 -0
- package/src/types/product.ts +72 -0
- package/src/types/subscription.ts +70 -0
- package/NPM-dist/manage-my-account.js +0 -46
- package/NPM-dist/support.js +0 -45
- package/NPM-dist/types/manage-my-account.d.ts +0 -28
- package/NPM-dist/types/support.d.ts +0 -28
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
export type TVideoEventType =
|
|
2
|
+
/**
|
|
3
|
+
* The media has been requested.
|
|
4
|
+
* Currently, it appears this event is only received for pre-roll videos.
|
|
5
|
+
*/
|
|
6
|
+
| "video:content:request"
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The media is ready to play.
|
|
10
|
+
*/
|
|
11
|
+
| "video:content:ready"
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The media has started playing.
|
|
15
|
+
*/
|
|
16
|
+
| "video:content:play"
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The media has played a quarter of the way through.
|
|
20
|
+
* Currently, it appears that pre-roll videos do not send this event.
|
|
21
|
+
*/
|
|
22
|
+
| "video:content:25"
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The media has played half way though.
|
|
26
|
+
* Currently, it appears that pre-roll videos do not send this event.
|
|
27
|
+
*/
|
|
28
|
+
| "video:content:50"
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The media has played three quarters of the way though.
|
|
32
|
+
* Currently, it appears that pre-roll videos do not send this event.
|
|
33
|
+
*/
|
|
34
|
+
| "video:content:75"
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The media has played to the end.
|
|
38
|
+
* NB: "END" is a reserved word in thrift apparently
|
|
39
|
+
*/
|
|
40
|
+
| "video:content:end"
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The media has been paused before the end.
|
|
44
|
+
**/
|
|
45
|
+
| "video:content:pause"
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The media player has resumed playing from a paused state.
|
|
49
|
+
**/
|
|
50
|
+
| "video:content:resume"
|
|
51
|
+
| "video:content:skip"
|
|
52
|
+
| "video:content:cued"
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The media has been muted.
|
|
56
|
+
*/
|
|
57
|
+
| "video:content:mute"
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* The media has been unmuted.
|
|
61
|
+
*/
|
|
62
|
+
| "video:content:unmute"
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The media has been displayed in fullscreen mode.
|
|
66
|
+
*/
|
|
67
|
+
| "video:content:enter_fullscreen"
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The media has left fullscreen mode.
|
|
71
|
+
*/
|
|
72
|
+
| "video:content:exit_fullscreen"
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* The media player has been displayed on the screen.
|
|
76
|
+
* This is separate to the media being played, but may coincide if the player autoplays.
|
|
77
|
+
*/
|
|
78
|
+
| "video:content:view";
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Details about media playback progress
|
|
82
|
+
* Note: currently only guardian-hosted videos are reported.
|
|
83
|
+
*/
|
|
84
|
+
export interface AudioEvent {
|
|
85
|
+
/**
|
|
86
|
+
* The id of the media asset, e.g. gu-audio-454297906
|
|
87
|
+
* This matches up with the media id within the content api.
|
|
88
|
+
*/
|
|
89
|
+
id: string;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* The event type.
|
|
93
|
+
*/
|
|
94
|
+
eventType: TAudioEventType;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export type TAudioEventType =
|
|
98
|
+
/**
|
|
99
|
+
* The media has been requested.
|
|
100
|
+
* Currently, it appears this event is only received for pre-roll videos.
|
|
101
|
+
*/
|
|
102
|
+
| "audio:content:request"
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The media is ready to play.
|
|
106
|
+
*/
|
|
107
|
+
| "audio:content:ready"
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* The media has started playing.
|
|
111
|
+
*/
|
|
112
|
+
| "audio:content:play"
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* The media has played a quarter of the way through.
|
|
116
|
+
* Currently, it appears that pre-roll videos do not send this event.
|
|
117
|
+
*/
|
|
118
|
+
| "audio:content:25"
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* The media has played half way though.
|
|
122
|
+
* Currently, it appears that pre-roll videos do not send this event.
|
|
123
|
+
*/
|
|
124
|
+
| "audio:content:50"
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* The media has played three quarters of the way though.
|
|
128
|
+
* Currently, it appears that pre-roll videos do not send this event.
|
|
129
|
+
*/
|
|
130
|
+
| "audio:content:75"
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* The media has played to the end.
|
|
134
|
+
* NB: "END" is a reserved word in thrift apparently
|
|
135
|
+
*/
|
|
136
|
+
| "audio:content:end"
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* The media has been paused before the end.
|
|
140
|
+
**/
|
|
141
|
+
| "audio:content:pause"
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* The media has been muted.
|
|
145
|
+
*/
|
|
146
|
+
| "audio:content:mute"
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* The media has been unmuted.
|
|
150
|
+
*/
|
|
151
|
+
| "audio:content:unmute"
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* The media has been displayed in fullscreen mode.
|
|
155
|
+
*/
|
|
156
|
+
| "audio:content:enter_fullscreen"
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* The media has left fullscreen mode.
|
|
160
|
+
*/
|
|
161
|
+
| "audio:content:exit_fullscreen"
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* The media player has been displayed on the screen.
|
|
165
|
+
* This is separate to the media being played, but may coincide if the player autoplays.
|
|
166
|
+
*/
|
|
167
|
+
| "audio:content:view";
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Details about media playback progress
|
|
171
|
+
* Note: currently only guardian-hosted videos are reported.
|
|
172
|
+
*/
|
|
173
|
+
export interface VideoEvent {
|
|
174
|
+
/**
|
|
175
|
+
* The id of the media asset, e.g. gu-video-454297906
|
|
176
|
+
* This matches up with the media id within the content api.
|
|
177
|
+
*/
|
|
178
|
+
id: string;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* The event type.
|
|
182
|
+
*/
|
|
183
|
+
eventType: TVideoEventType;
|
|
184
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The platform that served this request to the reader.
|
|
3
|
+
**/
|
|
4
|
+
export type TPlatform =
|
|
5
|
+
| "r2"
|
|
6
|
+
| "next-gen"
|
|
7
|
+
| "ios-native-app"
|
|
8
|
+
| "android-native-app"
|
|
9
|
+
/**
|
|
10
|
+
* Served as a result of embedding a media item on a third party site.
|
|
11
|
+
* Note therefore you should not typically include this as a guardian
|
|
12
|
+
* "page view".
|
|
13
|
+
**/
|
|
14
|
+
| "embed"
|
|
15
|
+
| "membership"
|
|
16
|
+
| "facebook-instant-article"
|
|
17
|
+
/* https://www.ampproject.org/ */
|
|
18
|
+
| "amp"
|
|
19
|
+
| "witness"
|
|
20
|
+
| "jobs"
|
|
21
|
+
| "contribution"
|
|
22
|
+
| "yahoo"
|
|
23
|
+
| "amazon-echo"
|
|
24
|
+
| "apple-news"
|
|
25
|
+
| "windows-native-app"
|
|
26
|
+
| "scribd"
|
|
27
|
+
| "support"
|
|
28
|
+
| "subscribe"
|
|
29
|
+
| "manage-my-account"
|
|
30
|
+
| "smart-news"
|
|
31
|
+
/* also called "The Daily Edition" and other names */
|
|
32
|
+
| "editions";
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Differentiates between the (many) different types of print product
|
|
3
|
+
**/
|
|
4
|
+
export type TPrintProduct =
|
|
5
|
+
| "voucher-saturday"
|
|
6
|
+
| "voucher-saturday-plus"
|
|
7
|
+
| "voucher-weekly-and-saturday"
|
|
8
|
+
| "voucher-weekly-and-saturday-plus"
|
|
9
|
+
| "voucher-sunday"
|
|
10
|
+
| "voucher-sunday-plus"
|
|
11
|
+
/**
|
|
12
|
+
* DEPRECATED DO NOT USE
|
|
13
|
+
* This enum has a spelling mistake. Use VOUCHER_WEEKEND (27) instead
|
|
14
|
+
**/
|
|
15
|
+
| "voucher-weekend" // Original: VOUCER_WEEKEND - Corrected spelling and adapted to TS syntax
|
|
16
|
+
/**
|
|
17
|
+
* DEPRECATED DO NOT USE
|
|
18
|
+
* This enum has a spelling mistake. Use VOUCHER_WEEKEND_PLUS (28) instead
|
|
19
|
+
**/
|
|
20
|
+
| "voucher-weekend-plus" // Original: VOUCER_WEEKEND_PLUS - Corrected spelling and adapted to TS syntax
|
|
21
|
+
| "voucher-sixday"
|
|
22
|
+
| "voucher-sixday-plus"
|
|
23
|
+
| "voucher-everyday"
|
|
24
|
+
| "voucher-everyday-plus"
|
|
25
|
+
| "home-delivery-saturday"
|
|
26
|
+
| "home-delivery-saturday-plus"
|
|
27
|
+
| "home-delivery-weekly-and-saturday"
|
|
28
|
+
| "home-delivery-weekly-and-saturday-plus"
|
|
29
|
+
| "home-delivery-sunday"
|
|
30
|
+
| "home-delivery-sunday-plus"
|
|
31
|
+
| "home-delivery-weekend"
|
|
32
|
+
| "home-delivery-weekend-plus"
|
|
33
|
+
| "home-delivery-sixday"
|
|
34
|
+
| "home-delivery-sixday-plus"
|
|
35
|
+
| "home-delivery-everyday"
|
|
36
|
+
| "home-delivery-everyday-plus"
|
|
37
|
+
| "guardian-weekly"
|
|
38
|
+
| "guardian-weekly-plus";
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Extra parameters only applicable to print products
|
|
42
|
+
*/
|
|
43
|
+
export interface PrintOptions {
|
|
44
|
+
/**
|
|
45
|
+
* Differentiates between the (many) different types of print product
|
|
46
|
+
*/
|
|
47
|
+
product: TPrintProduct;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The delivery country of the print subscription
|
|
51
|
+
*/
|
|
52
|
+
deliveryCountryCode: string;
|
|
53
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Guardian product associated with an acquisition or subscription component.
|
|
3
|
+
*
|
|
4
|
+
* Product values are intentionally constrained because they are used for
|
|
5
|
+
* downstream reporting. Additions should be coordinated with the Ophan model.
|
|
6
|
+
*/
|
|
7
|
+
export type Product =
|
|
8
|
+
/**
|
|
9
|
+
* A one-off contribution
|
|
10
|
+
*/
|
|
11
|
+
| "CONTRIBUTION"
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A recurring contribution
|
|
15
|
+
*/
|
|
16
|
+
| "RECURRING_CONTRIBUTION"
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A Membership Supporter signup
|
|
20
|
+
*/
|
|
21
|
+
| "MEMBERSHIP_SUPPORTER"
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* A Membership Patron signup
|
|
25
|
+
*/
|
|
26
|
+
| "MEMBERSHIP_PATRON"
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A Membership Partner signup
|
|
30
|
+
*/
|
|
31
|
+
| "MEMBERSHIP_PARTNER"
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* A digital subscription
|
|
35
|
+
*/
|
|
36
|
+
| "DIGITAL_SUBSCRIPTION"
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* DEPRECATED DO NOT USE
|
|
40
|
+
*/
|
|
41
|
+
| "PAPER_SUBSCRIPTION_EVERYDAY"
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* DEPRECATED DO NOT USE
|
|
45
|
+
*/
|
|
46
|
+
| "PAPER_SUBSCRIPTION_SIXDAY"
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* DEPRECATED DO NOT USE
|
|
50
|
+
*/
|
|
51
|
+
| "PAPER_SUBSCRIPTION_WEEKEND"
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* DEPRECATED DO NOT USE
|
|
55
|
+
*/
|
|
56
|
+
| "PAPER_SUBSCRIPTION_SUNDAY"
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* A paper subscription
|
|
60
|
+
*/
|
|
61
|
+
| "PRINT_SUBSCRIPTION"
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* An app premium tier signup
|
|
65
|
+
*/
|
|
66
|
+
| "APP_PREMIUM_TIER"
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Supporter plus tier.
|
|
70
|
+
*/
|
|
71
|
+
| "GUARDIAN_PATRON"
|
|
72
|
+
| "SUPPORTER_PLUS";
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What type of subscription the user has (or had) for the app
|
|
3
|
+
*/
|
|
4
|
+
export type TSubscriptionType =
|
|
5
|
+
/**
|
|
6
|
+
* No subscription in place, and no previous record of a subscription on this device.
|
|
7
|
+
*/
|
|
8
|
+
| 1 // FREE
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* User has an active subscription via the device's store.
|
|
12
|
+
*
|
|
13
|
+
* In json, "play" or "apple" are supported as synonyms of this value.
|
|
14
|
+
*/
|
|
15
|
+
| 2 // STORE
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* User has an active subscription as part of a print bundle.
|
|
19
|
+
*/
|
|
20
|
+
| 4 // PRINT
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* No subscription in place, but user did previously have a subscription via the
|
|
24
|
+
* device's store which is now expired.
|
|
25
|
+
*
|
|
26
|
+
* In json, "play:expired" and "apple:expired" are supported as synonyms of this value.
|
|
27
|
+
*/
|
|
28
|
+
| 3 // FREE_WITH_EXPIRED_STORE
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* No subscription in place, but user did previously have a subscription as
|
|
32
|
+
* part of a print bundle which is now expired.
|
|
33
|
+
*
|
|
34
|
+
* In json, "print:expired" is supported as a synonym of this value.
|
|
35
|
+
*/
|
|
36
|
+
| 5 // FREE_WITH_EXPIRED_PRINT
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* User has an active digital pack subscription.
|
|
40
|
+
*/
|
|
41
|
+
| 6; // DIGITAL_PACK
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* What tier of membership the user is currently part of.
|
|
45
|
+
*/
|
|
46
|
+
export type TMembershipTier =
|
|
47
|
+
/**
|
|
48
|
+
* The user is a friend.
|
|
49
|
+
*/
|
|
50
|
+
| 1 // FRIEND
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The user is a Guardian employee.
|
|
54
|
+
*/
|
|
55
|
+
| 2 // STAFF
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The user is a supporter.
|
|
59
|
+
*/
|
|
60
|
+
| 3 // SUPPORTER
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The user is a partner.
|
|
64
|
+
*/
|
|
65
|
+
| 4 // PARTNER
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The user is a patron.
|
|
69
|
+
*/
|
|
70
|
+
| 5; // PATRON
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
// Generated by CoffeeScript 2.7.0
|
|
2
|
-
import core from './core.js';
|
|
3
|
-
import transmit from './transmit.js';
|
|
4
|
-
import attention from './attention.js';
|
|
5
|
-
import visibility from './visibility.js';
|
|
6
|
-
import './click-path-capture.js';
|
|
7
|
-
import './perf.js';
|
|
8
|
-
import './campaign.js';
|
|
9
|
-
export const init = () => {
|
|
10
|
-
core.init('manage-my-account');
|
|
11
|
-
if (window.addEventListener) {
|
|
12
|
-
attention.init(visibility);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
export const sendInitialEvent = (url = location.href, referrer = document.referrer) => {
|
|
16
|
-
try {
|
|
17
|
-
transmit.bumpViewId();
|
|
18
|
-
core.sendInitialEvent(null, url, referrer);
|
|
19
|
-
}
|
|
20
|
-
catch (error) {
|
|
21
|
-
console.log(error);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
const exports = {
|
|
25
|
-
init,
|
|
26
|
-
sendInitialEvent,
|
|
27
|
-
record: transmit.sendMore,
|
|
28
|
-
get viewId() { return transmit.viewId; },
|
|
29
|
-
};
|
|
30
|
-
export default exports;
|
|
31
|
-
// Named exports for convenience
|
|
32
|
-
export const record = exports.record;
|
|
33
|
-
export const viewId = exports.viewId;
|
|
34
|
-
// Type exports
|
|
35
|
-
export * from './types/abtest.js';
|
|
36
|
-
export * from './types/subscription.js';
|
|
37
|
-
export * from './types/interaction.js';
|
|
38
|
-
export * from './types/inpageclick.js';
|
|
39
|
-
export * from './types/printproduct.js';
|
|
40
|
-
export * from './types/product.js';
|
|
41
|
-
export * from './types/platform.js';
|
|
42
|
-
export * from './types/media.js';
|
|
43
|
-
export * from './types/consent.js';
|
|
44
|
-
export * from './types/component-type.js';
|
|
45
|
-
export * from './types/component-event.js';
|
|
46
|
-
export * from './types/event.js';
|
package/NPM-dist/support.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import core from './core.js';
|
|
2
|
-
import transmit from './transmit.js';
|
|
3
|
-
import attention from './attention.js';
|
|
4
|
-
import visibility from './visibility.js';
|
|
5
|
-
import './click-path-capture.js';
|
|
6
|
-
import './perf.js';
|
|
7
|
-
import './campaign.js';
|
|
8
|
-
export const init = () => {
|
|
9
|
-
core.init('support');
|
|
10
|
-
if (window.addEventListener) {
|
|
11
|
-
attention.init(visibility);
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
export const sendInitialEvent = (url = location.href, referrer = document.referrer) => {
|
|
15
|
-
try {
|
|
16
|
-
transmit.bumpViewId();
|
|
17
|
-
core.sendInitialEvent(null, url, referrer);
|
|
18
|
-
}
|
|
19
|
-
catch (error) {
|
|
20
|
-
console.log(error);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
const supportExports = {
|
|
24
|
-
init,
|
|
25
|
-
sendInitialEvent,
|
|
26
|
-
record: transmit.sendMore,
|
|
27
|
-
get viewId() { return transmit.viewId; },
|
|
28
|
-
};
|
|
29
|
-
export default supportExports;
|
|
30
|
-
// Named exports for convenience
|
|
31
|
-
export const record = supportExports.record;
|
|
32
|
-
export const viewId = supportExports.viewId;
|
|
33
|
-
// Type exports
|
|
34
|
-
export * from './types/abtest.js';
|
|
35
|
-
export * from './types/subscription.js';
|
|
36
|
-
export * from './types/interaction.js';
|
|
37
|
-
export * from './types/inpageclick.js';
|
|
38
|
-
export * from './types/printproduct.js';
|
|
39
|
-
export * from './types/product.js';
|
|
40
|
-
export * from './types/platform.js';
|
|
41
|
-
export * from './types/media.js';
|
|
42
|
-
export * from './types/consent.js';
|
|
43
|
-
export * from './types/component-type.js';
|
|
44
|
-
export * from './types/component-event.js';
|
|
45
|
-
export * from './types/event.js';
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import './click-path-capture.js';
|
|
2
|
-
import './perf.js';
|
|
3
|
-
import './campaign.js';
|
|
4
|
-
import { EventPayload } from './types/event.js';
|
|
5
|
-
export declare const init: () => void;
|
|
6
|
-
export declare const sendInitialEvent: (url?: string, referrer?: string) => void;
|
|
7
|
-
interface MMAExports {
|
|
8
|
-
init: () => void;
|
|
9
|
-
sendInitialEvent: (url?: string, referrer?: string) => void;
|
|
10
|
-
record: (event: EventPayload, callback?: () => void) => void;
|
|
11
|
-
viewId: string;
|
|
12
|
-
}
|
|
13
|
-
declare const exports: MMAExports;
|
|
14
|
-
export default exports;
|
|
15
|
-
export declare const record: (event: EventPayload, callback?: () => void) => void;
|
|
16
|
-
export declare const viewId: string;
|
|
17
|
-
export * from './types/abtest.js';
|
|
18
|
-
export * from './types/subscription.js';
|
|
19
|
-
export * from './types/interaction.js';
|
|
20
|
-
export * from './types/inpageclick.js';
|
|
21
|
-
export * from './types/printproduct.js';
|
|
22
|
-
export * from './types/product.js';
|
|
23
|
-
export * from './types/platform.js';
|
|
24
|
-
export * from './types/media.js';
|
|
25
|
-
export * from './types/consent.js';
|
|
26
|
-
export * from './types/component-type.js';
|
|
27
|
-
export * from './types/component-event.js';
|
|
28
|
-
export * from './types/event.js';
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import './click-path-capture.js';
|
|
2
|
-
import './perf.js';
|
|
3
|
-
import './campaign.js';
|
|
4
|
-
import { EventPayload } from './types/event.js';
|
|
5
|
-
export declare const init: () => void;
|
|
6
|
-
export declare const sendInitialEvent: (url?: string, referrer?: string) => void;
|
|
7
|
-
interface SupportExports {
|
|
8
|
-
init: () => void;
|
|
9
|
-
sendInitialEvent: (url?: string, referrer?: string) => void;
|
|
10
|
-
record: (event: EventPayload, callback?: () => void) => void;
|
|
11
|
-
viewId: string;
|
|
12
|
-
}
|
|
13
|
-
declare const supportExports: SupportExports;
|
|
14
|
-
export default supportExports;
|
|
15
|
-
export declare const record: (event: EventPayload, callback?: () => void) => void;
|
|
16
|
-
export declare const viewId: string;
|
|
17
|
-
export * from './types/abtest.js';
|
|
18
|
-
export * from './types/subscription.js';
|
|
19
|
-
export * from './types/interaction.js';
|
|
20
|
-
export * from './types/inpageclick.js';
|
|
21
|
-
export * from './types/printproduct.js';
|
|
22
|
-
export * from './types/product.js';
|
|
23
|
-
export * from './types/platform.js';
|
|
24
|
-
export * from './types/media.js';
|
|
25
|
-
export * from './types/consent.js';
|
|
26
|
-
export * from './types/component-type.js';
|
|
27
|
-
export * from './types/component-event.js';
|
|
28
|
-
export * from './types/event.js';
|