@schibsted/pulse-sdk 8.0.0-rc.2 → 8.0.0-rc.20

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.
Files changed (390) hide show
  1. package/dist/cjs/Tracker.js +578 -303
  2. package/dist/cjs/app-integration.js +3 -3
  3. package/dist/cjs/builders/actor.js +6 -6
  4. package/dist/cjs/builders/consents.js +8 -8
  5. package/dist/cjs/builders/device-browser.js +8 -8
  6. package/dist/cjs/builders/device-node.js +3 -3
  7. package/dist/cjs/builders/events-anonymous-node.js +3 -3
  8. package/dist/cjs/builders/events-node.js +7 -7
  9. package/dist/cjs/builders/experimentMetadata.js +2 -2
  10. package/dist/cjs/builders/experiments.js +1 -0
  11. package/dist/cjs/builders/objects/objects-anonymous-browser.js +2 -2
  12. package/dist/cjs/builders/objects/objects-anonymous-node.js +9 -9
  13. package/dist/cjs/builders/objects/objects-browser.js +2 -2
  14. package/dist/cjs/builders/objects/objects-node.js +10 -10
  15. package/dist/cjs/builders/objects/utils.js +3 -3
  16. package/dist/cjs/builders/origin-browser.js +2 -2
  17. package/dist/cjs/builders/origin-node.js +4 -4
  18. package/dist/cjs/builders/session-browser.js +6 -5
  19. package/dist/cjs/cis-sync/cis-browser.js +219 -0
  20. package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/cjs/cis-sync}/cis.js +0 -1
  21. package/dist/cjs/cis-sync/eventEmitter.js +37 -0
  22. package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/cjs/cis-sync}/index.js +0 -1
  23. package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/cjs/cis-sync}/pulse-cookie.js +53 -63
  24. package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/cjs/cis-sync}/storage/pulseStorage.js +28 -21
  25. package/dist/cjs/cis-sync/storage/storage.js +24 -0
  26. package/dist/cjs/createPulseTracker.js +4 -4
  27. package/dist/cjs/identity/actor.js +20 -8
  28. package/dist/cjs/identity/advertising.js +1 -1
  29. package/dist/cjs/identity/cis.js +7 -6
  30. package/dist/cjs/index.js +3 -3
  31. package/dist/cjs/leaveTracking/index.js +10 -10
  32. package/dist/cjs/leaveTrackingTpaas/constants.js +2 -7
  33. package/dist/cjs/leaveTrackingTpaas/index.js +70 -46
  34. package/dist/cjs/network-browser.js +3 -3
  35. package/dist/cjs/remoteConfig/index.js +5 -5
  36. package/dist/cjs/tpaas-builders/builders/catalogVersion.js +9 -0
  37. package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/device.js +11 -5
  38. package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/navigationType.js +2 -3
  39. package/dist/cjs/tpaas-builders/builders/pageContent.js +7 -0
  40. package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/pageInfo.js +2 -2
  41. package/dist/cjs/tpaas-builders/builders/pageSports.js +7 -0
  42. package/dist/cjs/tpaas-builders/builders/provider.js +19 -0
  43. package/dist/cjs/tpaas-builders/builders/referrer.js +17 -0
  44. package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/session.js +23 -20
  45. package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/trackerBuilder.js +2 -3
  46. package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/user.js +1 -1
  47. package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/utm.js +3 -3
  48. package/dist/cjs/tpaas-builders/builders.js +339 -0
  49. package/dist/cjs/tpaas-builders/guards.js +7 -0
  50. package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/index.js +3 -0
  51. package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/cjs/tpaas-builders}/types.js +0 -1
  52. package/{node_modules/@schibsted/tpaas-schemas/dist/cjs → dist/cjs/tpaas-schemas}/constants.js +193 -155
  53. package/{node_modules/@schibsted/tpaas-schemas/dist/cjs → dist/cjs/tpaas-schemas}/index.js +1 -0
  54. package/dist/cjs/tpaas-schemas/types.js +2 -0
  55. package/dist/cjs/tracker-proxy/consts.js +29 -6
  56. package/dist/cjs/tracker-proxy/proxy-provider.js +2 -2
  57. package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/index.js +4 -1
  58. package/dist/cjs/utils/xDomainId.js +15 -0
  59. package/dist/cjs/version.js +1 -1
  60. package/dist/cjs/visibility-observer/index.js +9 -7
  61. package/dist/cjs/wrapper/types/event.js +5 -0
  62. package/dist/cjs/wrapper/utils/map-page-to-page-ref.js +13 -0
  63. package/dist/ejs/Tracker.js +510 -235
  64. package/dist/ejs/app-integration.js +1 -1
  65. package/dist/ejs/builders/actor.js +3 -3
  66. package/dist/ejs/builders/consents.js +4 -4
  67. package/dist/ejs/builders/device-browser.js +2 -2
  68. package/dist/ejs/builders/device-node.js +1 -1
  69. package/dist/ejs/builders/events-anonymous-node.js +1 -1
  70. package/dist/ejs/builders/events-node.js +4 -4
  71. package/dist/ejs/builders/experimentMetadata.js +1 -1
  72. package/dist/ejs/builders/experiments.js +1 -1
  73. package/dist/ejs/builders/objects/objects-anonymous-browser.js +1 -1
  74. package/dist/ejs/builders/objects/objects-anonymous-node.js +1 -1
  75. package/dist/ejs/builders/objects/objects-browser.js +1 -1
  76. package/dist/ejs/builders/objects/objects-node.js +1 -1
  77. package/dist/ejs/builders/objects/utils.js +1 -1
  78. package/dist/ejs/builders/origin-browser.js +1 -1
  79. package/dist/ejs/builders/origin-node.js +1 -1
  80. package/dist/ejs/builders/session-browser.js +2 -1
  81. package/{node_modules/@schibsted/pulse-cis-sync/dist/ejs → dist/ejs/cis-sync}/cis-browser.js +17 -4
  82. package/{node_modules/@schibsted/pulse-cis-sync/dist/ejs → dist/ejs/cis-sync}/cis.js +0 -1
  83. package/{node_modules/@schibsted/pulse-cis-sync/dist/ejs → dist/ejs/cis-sync}/eventEmitter.js +0 -1
  84. package/{node_modules/@schibsted/pulse-cis-sync/dist/ejs → dist/ejs/cis-sync}/index.js +0 -1
  85. package/{node_modules/@schibsted/pulse-cis-sync/dist/ejs → dist/ejs/cis-sync}/pulse-cookie.js +1 -2
  86. package/{node_modules/@schibsted/pulse-cis-sync/dist/ejs → dist/ejs/cis-sync}/storage/pulseStorage.js +12 -4
  87. package/{node_modules/@schibsted/pulse-cis-sync/dist/ejs → dist/ejs/cis-sync}/storage/storage.js +6 -2
  88. package/dist/ejs/createPulseTracker.js +1 -1
  89. package/dist/ejs/identity/actor.js +21 -9
  90. package/dist/ejs/identity/advertising.js +1 -1
  91. package/dist/ejs/identity/cis.js +4 -3
  92. package/dist/ejs/index.js +4 -3
  93. package/dist/ejs/leaveTracking/index.js +1 -1
  94. package/dist/ejs/leaveTrackingTpaas/constants.js +1 -5
  95. package/dist/ejs/leaveTrackingTpaas/index.js +65 -41
  96. package/dist/ejs/network-browser.js +1 -1
  97. package/dist/ejs/remoteConfig/index.js +1 -1
  98. package/dist/ejs/tpaas-builders/builders/catalogVersion.js +6 -0
  99. package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/device.js +10 -4
  100. package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/navigationType.js +2 -3
  101. package/dist/ejs/tpaas-builders/builders/pageContent.js +3 -0
  102. package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/pageInfo.js +1 -1
  103. package/dist/ejs/tpaas-builders/builders/pageSports.js +3 -0
  104. package/dist/ejs/tpaas-builders/builders/provider.js +16 -0
  105. package/dist/ejs/tpaas-builders/builders/referrer.js +13 -0
  106. package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/session.js +18 -15
  107. package/dist/ejs/tpaas-builders/builders/trackerBuilder.js +10 -0
  108. package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/user.js +1 -1
  109. package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/utm.js +2 -2
  110. package/dist/ejs/tpaas-builders/builders.js +271 -0
  111. package/dist/ejs/tpaas-builders/guards.js +4 -0
  112. package/dist/ejs/tpaas-builders/index.js +2 -0
  113. package/{node_modules/@schibsted/tpaas-schemas/dist/ejs → dist/ejs/tpaas-schemas}/constants.js +191 -153
  114. package/{node_modules/@schibsted/tpaas-schemas/dist/ejs → dist/ejs/tpaas-schemas}/index.js +1 -0
  115. package/dist/ejs/tpaas-schemas/types.js +1 -0
  116. package/dist/ejs/tracker-proxy/consts.js +29 -6
  117. package/dist/ejs/tracker-proxy/proxy-provider.js +1 -1
  118. package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/index.js +1 -0
  119. package/dist/ejs/utils/xDomainId.js +11 -0
  120. package/dist/ejs/version.js +1 -1
  121. package/dist/ejs/visibility-observer/index.js +9 -7
  122. package/dist/ejs/wrapper/types/event.js +4 -1
  123. package/dist/ejs/wrapper/utils/map-page-to-page-ref.js +10 -0
  124. package/dist/types/Tracker.d.ts +178 -77
  125. package/dist/types/builders/actor.d.ts +3 -2
  126. package/dist/types/builders/consents.d.ts +3 -3
  127. package/dist/types/builders/device-node.d.ts +2 -2
  128. package/dist/types/builders/events-anonymous-node.d.ts +4 -4
  129. package/dist/types/builders/events-node.d.ts +5 -5
  130. package/dist/types/builders/experiments.d.ts +1 -0
  131. package/dist/types/builders/index.d.ts +1 -1
  132. package/dist/types/builders/objects/objects-anonymous-node.d.ts +1 -1
  133. package/dist/types/builders/objects/objects-node.d.ts +1 -1
  134. package/dist/types/builders/origin-node.d.ts +1 -1
  135. package/dist/types/builders/session-browser.d.ts +1 -0
  136. package/{node_modules/@schibsted/pulse-cis-sync/dist/types → dist/types/cis-sync}/cis-browser.d.ts +1 -0
  137. package/{node_modules/@schibsted/pulse-cis-sync/dist/types → dist/types/cis-sync}/storage/pulseStorage.d.ts +12 -4
  138. package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/types/cis-sync}/storage/storage.d.ts +2 -1
  139. package/dist/types/config.d.ts +1 -1
  140. package/dist/types/createPulseTracker.d.ts +1 -1
  141. package/dist/types/identity/actor.d.ts +3 -3
  142. package/dist/types/identity/advertising.d.ts +2 -2
  143. package/dist/types/identity/cis.d.ts +4 -4
  144. package/dist/types/index.d.ts +7 -8
  145. package/dist/types/leaveTrackingTpaas/constants.d.ts +1 -5
  146. package/dist/types/leaveTrackingTpaas/index.d.ts +6 -6
  147. package/dist/types/leaveTrackingTpaas/types.d.ts +2 -10
  148. package/dist/types/tpaas-builders/builders/anonymous.d.ts +3 -0
  149. package/dist/types/tpaas-builders/builders/baseEvent.d.ts +3 -0
  150. package/dist/types/tpaas-builders/builders/catalogVersion.d.ts +3 -0
  151. package/dist/types/tpaas-builders/builders/consents.d.ts +5 -0
  152. package/dist/types/tpaas-builders/builders/device.d.ts +5 -0
  153. package/dist/types/tpaas-builders/builders/experiments.d.ts +9 -0
  154. package/dist/types/tpaas-builders/builders/navigationType.d.ts +6 -0
  155. package/dist/types/tpaas-builders/builders/pageContent.d.ts +6 -0
  156. package/dist/types/tpaas-builders/builders/pageInfo.d.ts +6 -0
  157. package/dist/types/tpaas-builders/builders/pageSports.d.ts +6 -0
  158. package/dist/types/tpaas-builders/builders/pageviewId.d.ts +6 -0
  159. package/dist/types/tpaas-builders/builders/provider.d.ts +5 -0
  160. package/dist/types/tpaas-builders/builders/referrer.d.ts +6 -0
  161. package/dist/types/tpaas-builders/builders/session.d.ts +15 -0
  162. package/dist/types/tpaas-builders/builders/time.d.ts +4 -0
  163. package/dist/types/tpaas-builders/builders/trackerBuilder.d.ts +5 -0
  164. package/dist/types/tpaas-builders/builders/user.d.ts +5 -0
  165. package/dist/types/tpaas-builders/builders/utm.d.ts +6 -0
  166. package/dist/types/tpaas-builders/builders.d.ts +141 -0
  167. package/dist/types/tpaas-builders/guards.d.ts +2 -0
  168. package/dist/types/tpaas-builders/index.d.ts +3 -0
  169. package/dist/types/tpaas-builders/types.d.ts +36 -0
  170. package/dist/types/tpaas-schemas/constants.d.ts +478 -0
  171. package/dist/types/tpaas-schemas/index.d.ts +5 -0
  172. package/dist/types/tpaas-schemas/types/ITpaasEvent.d.ts +132 -0
  173. package/dist/types/tpaas-schemas/types/schemas/IAnonymousViewUIElement.d.ts +58 -0
  174. package/dist/types/tpaas-schemas/types/schemas/ICompletedHealthAction.d.ts +139 -0
  175. package/dist/types/tpaas-schemas/types/schemas/IEngagementAd.d.ts +117 -0
  176. package/dist/types/tpaas-schemas/types/schemas/IEngagementAffiliate.d.ts +144 -0
  177. package/dist/types/tpaas-schemas/types/schemas/IEngagementAudio.d.ts +209 -0
  178. package/dist/types/tpaas-schemas/types/schemas/IEngagementForm.d.ts +111 -0
  179. package/dist/types/tpaas-schemas/types/schemas/IEngagementHealthUIElement.d.ts +133 -0
  180. package/dist/types/tpaas-schemas/types/schemas/IEngagementOffer.d.ts +107 -0
  181. package/dist/types/tpaas-schemas/types/schemas/IEngagementSchoolUIElement.d.ts +107 -0
  182. package/dist/types/tpaas-schemas/types/schemas/IEngagementSportsUIElement.d.ts +157 -0
  183. package/dist/types/tpaas-schemas/types/schemas/IEngagementTeaser.d.ts +114 -0
  184. package/dist/types/tpaas-schemas/types/schemas/IEngagementTvModule.d.ts +130 -0
  185. package/dist/types/tpaas-schemas/types/schemas/IEngagementTvSearch.d.ts +142 -0
  186. package/dist/types/tpaas-schemas/types/schemas/IEngagementUIElement.d.ts +105 -0
  187. package/dist/types/tpaas-schemas/types/schemas/IEngagementVideo.d.ts +234 -0
  188. package/dist/types/tpaas-schemas/types/schemas/IEngagementVideoAd.d.ts +145 -0
  189. package/dist/types/tpaas-schemas/types/schemas/IEngagementWidget.d.ts +91 -0
  190. package/dist/types/tpaas-schemas/types/schemas/IHeartbeatCommercialArticle.d.ts +96 -0
  191. package/dist/types/tpaas-schemas/types/schemas/IImpressionAd.d.ts +115 -0
  192. package/dist/types/tpaas-schemas/types/schemas/IImpressionAdSlot.d.ts +89 -0
  193. package/dist/types/tpaas-schemas/types/schemas/IImpressionAffiliate.d.ts +142 -0
  194. package/dist/types/tpaas-schemas/types/schemas/IImpressionForm.d.ts +113 -0
  195. package/dist/types/tpaas-schemas/types/schemas/IImpressionHealthUIElement.d.ts +138 -0
  196. package/dist/types/tpaas-schemas/types/schemas/IImpressionOffer.d.ts +109 -0
  197. package/dist/types/tpaas-schemas/types/schemas/IImpressionPlayer.d.ts +108 -0
  198. package/dist/types/tpaas-schemas/types/schemas/IImpressionSchoolUIElement.d.ts +109 -0
  199. package/dist/types/tpaas-schemas/types/schemas/IImpressionSportsUIElement.d.ts +159 -0
  200. package/dist/types/tpaas-schemas/types/schemas/IImpressionTeaser.d.ts +112 -0
  201. package/dist/types/tpaas-schemas/types/schemas/IImpressionUIElement.d.ts +107 -0
  202. package/dist/types/tpaas-schemas/types/schemas/IImpressionWidget.d.ts +89 -0
  203. package/dist/types/tpaas-schemas/types/schemas/ILeaveArticle.d.ts +133 -0
  204. package/dist/types/tpaas-schemas/types/schemas/ILeaveAudioPage.d.ts +88 -0
  205. package/dist/types/tpaas-schemas/types/schemas/ILeaveError.d.ts +95 -0
  206. package/dist/types/tpaas-schemas/types/schemas/ILeaveFrontpage.d.ts +83 -0
  207. package/dist/types/tpaas-schemas/types/schemas/ILeaveLandingpage.d.ts +90 -0
  208. package/dist/types/tpaas-schemas/types/schemas/ILeaveListing.d.ts +123 -0
  209. package/dist/types/tpaas-schemas/types/schemas/ILeaveLockedArticle.d.ts +139 -0
  210. package/dist/types/tpaas-schemas/types/schemas/ILeaveLockedAudioPage.d.ts +97 -0
  211. package/dist/types/tpaas-schemas/types/schemas/ILeaveLockedPage.d.ts +90 -0
  212. package/dist/types/tpaas-schemas/types/schemas/ILeaveLockedVideoPage.d.ts +97 -0
  213. package/dist/types/tpaas-schemas/types/schemas/ILeavePage.d.ts +82 -0
  214. package/dist/types/tpaas-schemas/types/schemas/ILeaveSchoolPage.d.ts +84 -0
  215. package/dist/types/tpaas-schemas/types/schemas/ILeaveSportsPage.d.ts +137 -0
  216. package/dist/types/tpaas-schemas/types/schemas/ILeaveVideoPage.d.ts +91 -0
  217. package/dist/types/tpaas-schemas/types/schemas/ILeaveWeather.d.ts +94 -0
  218. package/dist/types/tpaas-schemas/types/schemas/ILoadAd.d.ts +119 -0
  219. package/dist/types/tpaas-schemas/types/schemas/IRequestAd.d.ts +95 -0
  220. package/dist/types/tpaas-schemas/types/schemas/IViewArticle.d.ts +133 -0
  221. package/dist/types/tpaas-schemas/types/schemas/IViewAudioPage.d.ts +87 -0
  222. package/dist/types/tpaas-schemas/types/schemas/IViewError.d.ts +90 -0
  223. package/dist/types/tpaas-schemas/types/schemas/IViewFrontpage.d.ts +80 -0
  224. package/dist/types/tpaas-schemas/types/schemas/IViewHealthPage.d.ts +119 -0
  225. package/dist/types/tpaas-schemas/types/schemas/IViewLandingpage.d.ts +76 -0
  226. package/dist/types/tpaas-schemas/types/schemas/IViewListing.d.ts +118 -0
  227. package/dist/types/tpaas-schemas/types/schemas/IViewLockedArticle.d.ts +139 -0
  228. package/dist/types/tpaas-schemas/types/schemas/IViewLockedAudioPage.d.ts +95 -0
  229. package/dist/types/tpaas-schemas/types/schemas/IViewLockedPage.d.ts +94 -0
  230. package/dist/types/tpaas-schemas/types/schemas/IViewLockedVideoPage.d.ts +95 -0
  231. package/dist/types/tpaas-schemas/types/schemas/IViewPage.d.ts +86 -0
  232. package/dist/types/tpaas-schemas/types/schemas/IViewSchoolPage.d.ts +88 -0
  233. package/dist/types/tpaas-schemas/types/schemas/IViewSportsPage.d.ts +135 -0
  234. package/dist/types/tpaas-schemas/types/schemas/IViewTitle.d.ts +92 -0
  235. package/dist/types/tpaas-schemas/types/schemas/IViewVideoPage.d.ts +87 -0
  236. package/dist/types/tpaas-schemas/types/schemas/IViewWeather.d.ts +94 -0
  237. package/dist/types/tpaas-schemas/types/schemas/index.d.ts +64 -0
  238. package/dist/types/tpaas-schemas/types/templates/IBranded.d.ts +42 -0
  239. package/dist/types/tpaas-schemas/types/templates/IConsents.d.ts +34 -0
  240. package/dist/types/tpaas-schemas/types/templates/IContent.d.ts +56 -0
  241. package/dist/types/tpaas-schemas/types/templates/IDevice.d.ts +62 -0
  242. package/dist/types/tpaas-schemas/types/templates/IEngagement.d.ts +21 -0
  243. package/dist/types/tpaas-schemas/types/templates/IExperiments.d.ts +35 -0
  244. package/dist/types/tpaas-schemas/types/templates/IHealthFood.d.ts +55 -0
  245. package/dist/types/tpaas-schemas/types/templates/IHealthOrigin.d.ts +27 -0
  246. package/dist/types/tpaas-schemas/types/templates/IHealthPhysicalActivity.d.ts +36 -0
  247. package/dist/types/tpaas-schemas/types/templates/IHealthTraining.d.ts +74 -0
  248. package/dist/types/tpaas-schemas/types/templates/IHealthUserData.d.ts +25 -0
  249. package/dist/types/tpaas-schemas/types/templates/ILeave.d.ts +54 -0
  250. package/dist/types/tpaas-schemas/types/templates/ILeaveAudio.d.ts +37 -0
  251. package/dist/types/tpaas-schemas/types/templates/ILeaveStories.d.ts +34 -0
  252. package/dist/types/tpaas-schemas/types/templates/ILocation.d.ts +21 -0
  253. package/dist/types/tpaas-schemas/types/templates/IMetrics.d.ts +32 -0
  254. package/dist/types/tpaas-schemas/types/templates/IPageRef.d.ts +46 -0
  255. package/dist/types/tpaas-schemas/types/templates/IPlacement.d.ts +45 -0
  256. package/dist/types/tpaas-schemas/types/templates/IProvider.d.ts +73 -0
  257. package/dist/types/tpaas-schemas/types/templates/ISchool.d.ts +74 -0
  258. package/dist/types/tpaas-schemas/types/templates/ISession.d.ts +33 -0
  259. package/dist/types/tpaas-schemas/types/templates/ISports.d.ts +98 -0
  260. package/dist/types/tpaas-schemas/types/templates/ISportsUserFeatures.d.ts +28 -0
  261. package/dist/types/tpaas-schemas/types/templates/ITime.d.ts +32 -0
  262. package/dist/types/tpaas-schemas/types/templates/ITracker.d.ts +37 -0
  263. package/dist/types/tpaas-schemas/types/templates/IUser.d.ts +34 -0
  264. package/dist/types/tpaas-schemas/types/templates/IUtmTags.d.ts +38 -0
  265. package/dist/types/tpaas-schemas/types/templates/index.d.ts +27 -0
  266. package/dist/types/tpaas-schemas/types.d.ts +42 -0
  267. package/dist/types/tracker-proxy/consts.d.ts +2 -2
  268. package/dist/types/types.d.ts +19 -13
  269. package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/index.d.ts +1 -0
  270. package/dist/types/utils/xDomainId.d.ts +2 -0
  271. package/dist/types/version.d.ts +1 -1
  272. package/dist/types/visibility-observer/index.d.ts +6 -1
  273. package/dist/types/wrapper/engagement/ui-element/types.d.ts +1 -1
  274. package/dist/types/wrapper/types/base-event.d.ts +1 -1
  275. package/dist/types/wrapper/types/event.d.ts +4 -2
  276. package/dist/types/wrapper/types/utils.d.ts +1 -1
  277. package/dist/types/wrapper/utils/map-page-to-page-ref.d.ts +3 -0
  278. package/dist/types/wrapper/view/article/types.d.ts +1 -1
  279. package/dist/types/wrapper/view/frontpage/types.d.ts +1 -1
  280. package/dist/types/wrapper/view/listing/types.d.ts +1 -1
  281. package/dist/types/wrapper/view/loginposter/types.d.ts +1 -1
  282. package/dist/types/wrapper/view/page/types.d.ts +1 -1
  283. package/dist/types/wrapper/view/salesposter/types.d.ts +1 -1
  284. package/dist/types/wrapper/view/ui-element/types.d.ts +1 -1
  285. package/package.json +21 -20
  286. package/dist/cjs/Tracker.test-d.js +0 -76
  287. package/dist/ejs/Tracker.test-d.js +0 -71
  288. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/cis-browser.d.ts +0 -26
  289. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/cis-browser.js +0 -273
  290. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/cis-browser.js.map +0 -1
  291. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/cis.js.map +0 -1
  292. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/eventEmitter.js +0 -39
  293. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/eventEmitter.js.map +0 -1
  294. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/index.js.map +0 -1
  295. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/pulse-cookie.js.map +0 -1
  296. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/storage/pulseStorage.d.ts +0 -36
  297. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/storage/pulseStorage.js.map +0 -1
  298. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/storage/storage.js +0 -21
  299. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/storage/storage.js.map +0 -1
  300. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/types.js.map +0 -1
  301. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/cis-browser.d.ts +0 -26
  302. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/cis-browser.js.map +0 -1
  303. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/cis.d.ts +0 -10
  304. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/cis.js.map +0 -1
  305. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/eventEmitter.d.ts +0 -14
  306. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/eventEmitter.js.map +0 -1
  307. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/index.d.ts +0 -4
  308. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/index.js.map +0 -1
  309. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/pulse-cookie.d.ts +0 -55
  310. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/pulse-cookie.js.map +0 -1
  311. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/storage/pulseStorage.d.ts +0 -36
  312. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/storage/pulseStorage.js.map +0 -1
  313. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/storage/storage.d.ts +0 -6
  314. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/storage/storage.js.map +0 -1
  315. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/types.d.ts +0 -24
  316. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/types.js +0 -2
  317. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/types.js.map +0 -1
  318. package/node_modules/@schibsted/pulse-cis-sync/dist/types/cis.d.ts +0 -10
  319. package/node_modules/@schibsted/pulse-cis-sync/dist/types/eventEmitter.d.ts +0 -14
  320. package/node_modules/@schibsted/pulse-cis-sync/dist/types/index.d.ts +0 -4
  321. package/node_modules/@schibsted/pulse-cis-sync/dist/types/pulse-cookie.d.ts +0 -55
  322. package/node_modules/@schibsted/pulse-cis-sync/dist/types/storage/storage.d.ts +0 -6
  323. package/node_modules/@schibsted/pulse-cis-sync/dist/types/types.d.ts +0 -24
  324. package/node_modules/@schibsted/pulse-cis-sync/package.json +0 -44
  325. package/node_modules/@schibsted/pulse-utils/package.json +0 -36
  326. package/node_modules/@schibsted/tpaas-event-builder/dist/cjs/builders/provider.js +0 -12
  327. package/node_modules/@schibsted/tpaas-event-builder/dist/cjs/builders/referrer.js +0 -19
  328. package/node_modules/@schibsted/tpaas-event-builder/dist/cjs/builders.js +0 -272
  329. package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/builders/provider.js +0 -9
  330. package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/builders/referrer.js +0 -15
  331. package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/builders/trackerBuilder.js +0 -11
  332. package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/builders.js +0 -215
  333. package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/index.js +0 -1
  334. package/node_modules/@schibsted/tpaas-event-builder/dist/index.d.ts +0 -5403
  335. package/node_modules/@schibsted/tpaas-event-builder/package.json +0 -40
  336. package/node_modules/@schibsted/tpaas-schemas/dist/index.d.ts +0 -6176
  337. package/node_modules/@schibsted/tpaas-schemas/package.json +0 -35
  338. /package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/cis-sync}/types.js +0 -0
  339. /package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/anonymous.js +0 -0
  340. /package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/baseEvent.js +0 -0
  341. /package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/consents.js +0 -0
  342. /package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/experiments.js +0 -0
  343. /package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/pageviewId.js +0 -0
  344. /package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/time.js +0 -0
  345. /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/cookie-config.js +0 -0
  346. /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/cookie.js +0 -0
  347. /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/events.js +0 -0
  348. /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/get.js +0 -0
  349. /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/getRootDomain.js +0 -0
  350. /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/merge.js +0 -0
  351. /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/objects.js +0 -0
  352. /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/omit.js +0 -0
  353. /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/randomString.js +0 -0
  354. /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/throttle.js +0 -0
  355. /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/webApi.js +0 -0
  356. /package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/cis-sync}/types.js +0 -0
  357. /package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/anonymous.js +0 -0
  358. /package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/baseEvent.js +0 -0
  359. /package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/consents.js +0 -0
  360. /package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/experiments.js +0 -0
  361. /package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/pageviewId.js +0 -0
  362. /package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/time.js +0 -0
  363. /package/dist/{types/Tracker.test-d.d.ts → ejs/tpaas-builders/types.js} +0 -0
  364. /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/cookie-config.js +0 -0
  365. /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/cookie.js +0 -0
  366. /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/events.js +0 -0
  367. /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/get.js +0 -0
  368. /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/getRootDomain.js +0 -0
  369. /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/merge.js +0 -0
  370. /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/objects.js +0 -0
  371. /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/omit.js +0 -0
  372. /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/randomString.js +0 -0
  373. /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/throttle.js +0 -0
  374. /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/webApi.js +0 -0
  375. /package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/types/cis-sync}/cis.d.ts +0 -0
  376. /package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/types/cis-sync}/eventEmitter.d.ts +0 -0
  377. /package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/types/cis-sync}/index.d.ts +0 -0
  378. /package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/types/cis-sync}/pulse-cookie.d.ts +0 -0
  379. /package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/types/cis-sync}/types.d.ts +0 -0
  380. /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/cookie-config.d.ts +0 -0
  381. /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/cookie.d.ts +0 -0
  382. /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/events.d.ts +0 -0
  383. /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/get.d.ts +0 -0
  384. /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/getRootDomain.d.ts +0 -0
  385. /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/merge.d.ts +0 -0
  386. /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/objects.d.ts +0 -0
  387. /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/omit.d.ts +0 -0
  388. /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/randomString.d.ts +0 -0
  389. /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/throttle.d.ts +0 -0
  390. /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/webApi.d.ts +0 -0
@@ -16,8 +16,8 @@ export declare const MESSAGE_TYPE_ACK = "pulse-tracker-proxy:ack";
16
16
  export declare const MESSAGE_TYPE_INVOKE = "pulse-tracker-proxy:invoke";
17
17
  export declare const MESSAGE_TYPE_RETURN = "pulse-tracker-proxy:return";
18
18
  export declare const MESSAGE_TYPE_RETURN_ERROR = "pulse-tracker-proxy:return-error";
19
- export declare const ALLOWED_METHODS: readonly ["track"];
20
- export declare const TPAAS_ALLOWED_METHODS: readonly ["trackAnonymousViewUIElement", "trackEngagementAudio", "trackEngagementForm", "trackEngagementHealthUIElement", "trackEngagementOffer", "trackEngagementTeaser", "trackEngagementUIElement", "trackEngagementVideo", "trackEngagementVideoAd", "trackEngagementWidget", "trackCompletedHealthAction", "trackImpressionAdSlot", "trackImpressionForm", "trackImpressionHealthUIElement", "trackImpressionOffer", "trackImpressionPlayer", "trackImpressionTeaser", "trackImpressionUIElement", "trackImpressionWidget", "trackLeaveArticle", "trackLeaveAudioPage", "trackLeaveError", "trackLeaveFrontpage", "trackLeaveLandingpage", "trackLeaveListing", "trackLeaveLockedArticle", "trackLeaveLockedAudio", "trackLeaveLockedAudioPage", "trackLeaveLockedVideo", "trackLeaveLockedVideoPage", "trackLeavePage", "trackLeaveVideoPage", "trackLeaveWeather", "trackViewArticle", "trackViewAudio", "trackViewAudioPage", "trackViewError", "trackViewFrontpage", "trackViewHealthPage", "trackViewLandingpage", "trackViewListing", "trackViewLockedArticle", "trackViewLockedAudio", "trackViewLockedAudioPage", "trackViewLockedVideo", "trackViewLockedVideoPage", "trackViewPage", "trackViewTitle", "trackViewVideo", "trackViewVideoPage", "trackViewWeather"];
19
+ export declare const ALLOWED_METHODS: readonly ['track'];
20
+ export declare const TPAAS_ALLOWED_METHODS: readonly ['trackAnonymousViewUIElement', 'trackEngagementAd', 'trackEngagementAffiliate', 'trackEngagementAudio', 'trackEngagementForm', 'trackEngagementHealthUIElement', 'trackEngagementOffer', 'trackEngagementSchoolUIElement', 'trackEngagementSportsUIElement', 'trackEngagementTeaser', 'trackEngagementTvModule', 'trackEngagementTvSearch', 'trackEngagementUIElement', 'trackEngagementVideo', 'trackEngagementVideoAd', 'trackEngagementWidget', 'trackHeartbeatCommercialArticle', 'trackCompletedHealthAction', 'trackImpressionAd', 'trackImpressionAdSlot', 'trackImpressionAffiliate', 'trackImpressionForm', 'trackImpressionHealthUIElement', 'trackImpressionOffer', 'trackImpressionPlayer', 'trackImpressionSchoolUIElement', 'trackImpressionSportsUIElement', 'trackImpressionTeaser', 'trackImpressionUIElement', 'trackImpressionWidget', 'trackLoadAd', 'trackRequestAd', 'trackLeaveArticle', 'trackLeaveAudioPage', 'trackLeaveError', 'trackLeaveFrontpage', 'trackLeaveLandingpage', 'trackLeaveListing', 'trackLeaveLockedArticle', 'trackLeaveLockedAudioPage', 'trackLeaveLockedPage', 'trackLeaveLockedVideoPage', 'trackLeavePage', 'trackLeaveSchoolPage', 'trackLeaveSportsPage', 'trackLeaveVideoPage', 'trackLeaveWeather', 'trackViewArticle', 'trackViewAudioPage', 'trackViewError', 'trackViewFrontpage', 'trackViewHealthPage', 'trackViewLandingpage', 'trackViewListing', 'trackViewLockedArticle', 'trackViewLockedAudioPage', 'trackViewLockedPage', 'trackViewLockedVideoPage', 'trackViewPage', 'trackViewSchoolPage', 'trackViewSportsPage', 'trackViewTitle', 'trackViewVideoPage', 'trackViewWeather', 'trackLegacyViewArticle', 'trackLegacyViewLoginPoster', 'trackLegacyViewSalesPoster', 'trackLegacyViewListing', 'trackLegacyViewFrontpage', 'trackLegacyViewPage', 'trackLegacyViewUIElement', 'trackLegacyClickUIElement'];
21
21
  export declare function isPulseProxyMessage(message: unknown): message is Message;
22
22
  export type TrackInvocation = {
23
23
  method: 'track';
@@ -1,9 +1,9 @@
1
- import type { ILeaveAudio, ILeaveStories } from '@schibsted/tpaas-schemas';
2
1
  import type { v4 } from 'uuid';
3
2
  import type { Session } from './builders';
4
3
  import type { AnonymousTrackerEventInput } from './builders/events-anonymous-node';
5
4
  import type { IdentityEventInput, RoutableEventInput, TrackerEventInput } from './builders/events-node';
6
5
  import type { AdditionalHeightInfo } from './leaveTracking/types';
6
+ import type { ILeaveAudio, ILeaveStories, ITpaasEvent, IViewAudioPage, IViewVideoPage } from './tpaas-schemas';
7
7
  /**
8
8
  * @typedef EventInput
9
9
  */
@@ -53,41 +53,47 @@ export type LeaveAudioInput = Omit<ILeaveAudio, 'activityDurationMs' | 'duration
53
53
  * metrics when the Leave VideoPage event fires.
54
54
  */
55
55
  export type LeaveStoriesInput = Omit<ILeaveStories, 'activityDurationMs' | 'durationMs'>;
56
- export type TrackViewEventOptions = {
57
- leaveTracking: LeaveTrackingOptions | LeaveTrackingDisabled;
56
+ export type TrackViewEventOptions<T extends ITpaasEvent> = {
57
+ leaveTracking: LeaveTrackingDisabled | LeaveTrackingOptionsForProxy | (T extends IViewAudioPage ? AudioPageLeaveTrackingOptions : T extends IViewVideoPage ? VideoPageLeaveTrackingOptions : LeaveTrackingOptions);
58
+ };
59
+ export type TrackViewEventOptionsForProxy = {
60
+ leaveTracking: LeaveTrackingDisabled | LeaveTrackingOptionsForProxy;
58
61
  };
59
62
  export type LeaveTrackingOptions = {
60
- objectElement: HTMLElement;
61
- pageElement?: HTMLElement;
63
+ objectElement: Element;
64
+ pageElement?: Element;
62
65
  objectResizable?: boolean;
63
66
  heightBuilder?: () => AdditionalHeightInfo;
64
67
  };
68
+ export type LeaveTrackingOptionsForProxy = {
69
+ objectElement: string;
70
+ pageElement?: string;
71
+ objectResizable?: boolean;
72
+ heightBuilder?: never;
73
+ leaveAudioBuilder?: never;
74
+ leaveStoriesBuilder?: never;
75
+ };
65
76
  export type LeaveTrackingDisabled = false;
66
77
  /**
67
78
  * Leave tracking options for {@link Tracker.trackViewAudioPage}.
68
79
  * Extends {@link LeaveTrackingOptions} with an optional builder for audio engagement statistics.
69
80
  */
70
- export type AudioPageLeaveTrackingOptions = LeaveTrackingOptions & {
81
+ type AudioPageLeaveTrackingOptions = LeaveTrackingOptions & {
71
82
  /**
72
83
  * Called at leave time to provide audio engagement statistics for the Leave AudioPage event.
73
84
  * If not provided, all audio engagement fields default to `0`.
74
85
  */
75
86
  leaveAudioBuilder?: () => LeaveAudioInput;
76
87
  };
77
- export type TrackViewAudioPageOptions = {
78
- leaveTracking: AudioPageLeaveTrackingOptions | LeaveTrackingDisabled;
79
- };
80
88
  /**
81
89
  * Leave tracking options for {@link Tracker.trackViewVideoPage}.
82
90
  * Extends {@link LeaveTrackingOptions} with an optional builder for story carousel statistics.
83
91
  */
84
- export type VideoPageLeaveTrackingOptions = LeaveTrackingOptions & {
92
+ type VideoPageLeaveTrackingOptions = LeaveTrackingOptions & {
85
93
  /**
86
94
  * Called at leave time to provide story carousel statistics for the Leave VideoPage event.
87
95
  * If not provided, `leaveStories` will be omitted from the Leave VideoPage event.
88
96
  */
89
97
  leaveStoriesBuilder?: () => LeaveStoriesInput;
90
98
  };
91
- export type TrackViewVideoPageOptions = {
92
- leaveTracking: VideoPageLeaveTrackingOptions | LeaveTrackingDisabled;
93
- };
99
+ export {};
@@ -9,3 +9,4 @@ export { omit } from './omit';
9
9
  export { randomString } from './randomString';
10
10
  export { throttle } from './throttle';
11
11
  export { initializeStorage, isBrowser, type StorageType, webApi } from './webApi';
12
+ export { getXDomainId, SESSION_SDRN_PREFIX } from './xDomainId';
@@ -0,0 +1,2 @@
1
+ export declare const SESSION_SDRN_PREFIX = "sdrn:schibsted:session:";
2
+ export declare const getXDomainId: () => string | undefined;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "8.0.0-rc.2";
1
+ export declare const SDK_VERSION = "8.0.0-rc.20";
@@ -1,4 +1,7 @@
1
1
  type ComponentViewCallback = (node: HTMLElement) => void;
2
+ export interface ObserverOptions {
3
+ threshold?: number;
4
+ }
2
5
  /**
3
6
  * Observes visibility of elements matching a selector using MutationObserver and IntersectionObserver.
4
7
  */
@@ -16,9 +19,11 @@ export declare class VisibilityObserver {
16
19
  * Uses {@link https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver | MutationObserver} to monitor the DOM for dynamically loaded content.
17
20
  * Callback is invoked only once per element.
18
21
  * @param selector The CSS selector for elements to track.
22
+ * @param options {ObserverOptions} Optional configuration for the observer.
23
+ * @param options.threshold Which ratio triggers the Observer callback.
19
24
  * @throws Error if called more than once.
20
25
  */
21
- observe(selector: string): void;
26
+ observe(selector: string, { threshold }: ObserverOptions): void;
22
27
  /**
23
28
  * @returns {HTMLElement[]} An array of elements that match the selector in the document.
24
29
  */
@@ -27,4 +27,4 @@ type ClickUIElementInputProperties = {
27
27
  experiments?: BaseEventExperiment[];
28
28
  };
29
29
  type ClickUIElementEvent = EngagementEvent<ClickUIElementOutputObject>;
30
- export type { ClickUIElementInputObject, ClickUIElementOutputObject, ClickUIElementInputProperties, ClickUIElementEvent, };
30
+ export type { ClickUIElementEvent, ClickUIElementInputObject, ClickUIElementInputProperties, ClickUIElementOutputObject, };
@@ -71,4 +71,4 @@ type PromisableExperiments = Promisable<BaseEventExperiment[]> | Array<Promisabl
71
71
  type EventProperties = DeepPartial<Omit<BaseEvent, 'experiments'>> & {
72
72
  experiments?: PromisableExperiments;
73
73
  };
74
- export type { BaseEvent, BaseEventObject, BaseEventCustom, BaseEventProvider, BaseEventOrigin, EventProperties, Actor };
74
+ export type { Actor, BaseEvent, BaseEventCustom, BaseEventObject, BaseEventOrigin, BaseEventProvider, EventProperties };
@@ -1,5 +1,7 @@
1
1
  type NavigationType = 'navigation' | 'alternative' | 'refresh' | 'unknown';
2
- type PageType = 'Article' | 'Listing' | 'Frontpage' | 'SalesPoster' | 'Page' | 'LoginPoster';
2
+ declare const LEGACY_PAGE_TYPE_VALUES: readonly ['Article', 'Listing', 'Frontpage', 'SalesPoster', 'Page', 'LoginPoster'];
3
+ export declare function isLegacyPageType(value: string): value is PageType;
4
+ type PageType = (typeof LEGACY_PAGE_TYPE_VALUES)[number];
3
5
  type TargetCategory = 'Article' | 'Audio' | 'Video' | 'Weather' | 'Title' | 'other';
4
6
  type TargetType = 'Article' | 'ArticleReference' | 'ExternalContent';
5
7
  type SalesPosterType = 'Ip' | 'Login' | 'Paid' | 'Meter' | 'Personalised';
@@ -38,4 +40,4 @@ type Target = {
38
40
  accessLevelName?: string;
39
41
  newsroom?: string;
40
42
  };
41
- export type { NavigationType, SalesPosterType, Page, PageType, AccessLevel, Layout, Placement, Target, TargetCategory, TargetType, };
43
+ export type { AccessLevel, Layout, NavigationType, Page, PageType, Placement, SalesPosterType, Target, TargetCategory, TargetType, };
@@ -2,4 +2,4 @@ type Promisable<T> = T | Promise<T>;
2
2
  type DeepPartial<T> = T extends object ? {
3
3
  [P in keyof T]?: DeepPartial<T[P]>;
4
4
  } : T;
5
- export type { Promisable, DeepPartial };
5
+ export type { DeepPartial, Promisable };
@@ -0,0 +1,3 @@
1
+ import type { IPageRef } from '../../tpaas-schemas';
2
+ declare const mapPageToPageRef: (id?: string, type?: string, url?: string) => IPageRef;
3
+ export { mapPageToPageRef };
@@ -24,4 +24,4 @@ type ViewArticleOutputObject = {
24
24
  } & Omit<ViewArticleInputObject, 'articleId'>;
25
25
  type ViewArticleInputProperties = BaseEvent<ViewArticleInputObject>;
26
26
  type ViewArticleEvent = BaseEvent<ViewArticleOutputObject>;
27
- export type { ViewArticleInputObject, ViewArticleOutputObject, ViewArticleInputProperties, ViewArticleEvent };
27
+ export type { ViewArticleEvent, ViewArticleInputObject, ViewArticleInputProperties, ViewArticleOutputObject };
@@ -15,4 +15,4 @@ type ViewFrontpageOutputObject = {
15
15
  } & ViewFrontpageInputObject;
16
16
  type ViewFrontpageInputProperties = BaseEvent<ViewFrontpageInputObject>;
17
17
  type ViewFrontpageEvent = BaseEvent<ViewFrontpageOutputObject>;
18
- export type { ViewFrontpageInputObject, ViewFrontpageOutputObject, ViewFrontpageInputProperties, ViewFrontpageEvent };
18
+ export type { ViewFrontpageEvent, ViewFrontpageInputObject, ViewFrontpageInputProperties, ViewFrontpageOutputObject };
@@ -24,4 +24,4 @@ type ViewListingOutputObject = {
24
24
  } & ViewListingInputObject;
25
25
  type ViewListingInputProperties = BaseEvent<ViewListingInputObject>;
26
26
  type ViewListingEvent = BaseEvent<ViewListingOutputObject>;
27
- export type { ViewListingInputObject, ViewListingOutputObject, ViewListingInputProperties, ViewListingEvent };
27
+ export type { ViewListingEvent, ViewListingInputObject, ViewListingInputProperties, ViewListingOutputObject };
@@ -11,4 +11,4 @@ type ViewLoginPosterOutputObject = {
11
11
  } & ViewLoginPosterInputObject;
12
12
  type ViewLoginPosterInputProperties = BaseEvent<ViewLoginPosterInputObject>;
13
13
  type ViewLoginPosterEvent = BaseEvent<ViewLoginPosterOutputObject>;
14
- export type { ViewLoginPosterInputObject, ViewLoginPosterOutputObject, ViewLoginPosterInputProperties, ViewLoginPosterEvent, };
14
+ export type { ViewLoginPosterEvent, ViewLoginPosterInputObject, ViewLoginPosterInputProperties, ViewLoginPosterOutputObject, };
@@ -13,4 +13,4 @@ type ViewPageOutputObject = {
13
13
  } & Omit<ViewPageInputObject, 'pageId'>;
14
14
  type ViewPageInputProperties = BaseEvent<ViewPageInputObject>;
15
15
  type ViewPageEvent = BaseEvent<ViewPageOutputObject>;
16
- export type { ViewPageInputObject, ViewPageOutputObject, ViewPageInputProperties, ViewPageEvent };
16
+ export type { ViewPageEvent, ViewPageInputObject, ViewPageInputProperties, ViewPageOutputObject };
@@ -12,4 +12,4 @@ type ViewSalesPosterOutputObject = {
12
12
  } & Omit<ViewSalesPosterInputObject, 'articleId'>;
13
13
  type ViewSalesPosterInputProperties = BaseEvent<ViewSalesPosterInputObject>;
14
14
  type ViewSalesPosterEvent = BaseEvent<ViewSalesPosterOutputObject>;
15
- export type { ViewSalesPosterInputObject, ViewSalesPosterOutputObject, ViewSalesPosterInputProperties, ViewSalesPosterEvent, };
15
+ export type { ViewSalesPosterEvent, ViewSalesPosterInputObject, ViewSalesPosterInputProperties, ViewSalesPosterOutputObject, };
@@ -26,4 +26,4 @@ type ViewUIElementInputProperties = BaseEvent<ViewUIElementInputObject> & {
26
26
  type ViewUIElementEvent = BaseEvent<ViewUIElementOutputObject> & {
27
27
  target?: Target;
28
28
  };
29
- export type { ViewUIElementInputObject, ViewUIElementOutputObject, ViewUIElementInputProperties, ViewUIElementEvent };
29
+ export type { ViewUIElementEvent, ViewUIElementInputObject, ViewUIElementInputProperties, ViewUIElementOutputObject };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schibsted/pulse-sdk",
3
- "version": "8.0.0-rc.2",
3
+ "version": "8.0.0-rc.20",
4
4
  "description": "Node.js / Browser Pulse SDK",
5
5
  "author": "Schibsted Data&Tech",
6
6
  "license": "UNLICENSED",
@@ -32,44 +32,45 @@
32
32
  "./dist/cjs/builders/session.js": "./dist/cjs/builders/session-browser.js",
33
33
  "./dist/ejs/builders/session.js": "./dist/ejs/builders/session-browser.js",
34
34
  "./dist/cjs/builders/tracker.js": "./dist/cjs/builders/tracker-browser.js",
35
- "./dist/ejs/builders/tracker.js": "./dist/ejs/builders/tracker-browser.js"
35
+ "./dist/ejs/builders/tracker.js": "./dist/ejs/builders/tracker-browser.js",
36
+ "./dist/cjs/cis-sync/cis.js": "./dist/cjs/cis-sync/cis-browser.js",
37
+ "./dist/ejs/cis-sync/cis.js": "./dist/ejs/cis-sync/cis-browser.js"
36
38
  },
37
39
  "files": [
38
40
  "dist"
39
41
  ],
40
42
  "dependencies": {
41
43
  "loglevel": "1.9.2",
42
- "ts-deepmerge": "7.0.3",
43
- "ua-parser-js": "2.0.9",
44
- "uuid": "13.0.0",
45
- "@schibsted/pulse-cis-sync": "2.0.18",
46
- "@schibsted/tpaas-event-builder": "1.0.0",
47
- "@schibsted/pulse-utils": "1.0.2",
48
- "@schibsted/tpaas-schemas": "1.0.0"
44
+ "ts-deepmerge": "8.0.0",
45
+ "ua-parser-js": "1.0.41",
46
+ "uuid": "14.0.1"
49
47
  },
50
48
  "devDependencies": {
51
49
  "@testing-library/dom": "10.4.1",
52
50
  "@types/debounce": "1.2.4",
53
- "@types/node": "24.10.13",
54
- "@vitest/browser-playwright": "^4.0.18",
55
- "msw": "2.12.10",
56
- "typescript": "5.9.3"
51
+ "@types/lodash": "4.17.24",
52
+ "@types/node": "24.13.2",
53
+ "@types/ua-parser-js": "0.7.39",
54
+ "@vitest/browser-playwright": "4.1.10",
55
+ "json-schema-to-typescript": "15.0.4",
56
+ "lodash": "4.18.1",
57
+ "msw": "2.15.0",
58
+ "ts-morph": "28.0.0",
59
+ "tsx": "4.23.1",
60
+ "typescript": "7.0.2",
61
+ "yoctocolors": "2.2.0",
62
+ "@schibsted/tpaas-test-fixtures": "1.0.0"
57
63
  },
58
- "bundledDependencies": [
59
- "@schibsted/pulse-cis-sync",
60
- "@schibsted/tpaas-event-builder",
61
- "@schibsted/tpaas-schemas",
62
- "@schibsted/pulse-utils"
63
- ],
64
64
  "scripts": {
65
65
  "prebuild": "pnpm run generate:version",
66
66
  "build": "pnpm run build:cjs && pnpm run build:ejs && pnpm run build:types",
67
67
  "build:clean": "rm -fr dist",
68
68
  "build:ejs": "tsc --project tsconfig.ejs.json",
69
- "build:types": "tsc --project tsconfig.types.json",
69
+ "build:types": "tsc --project tsconfig.types.json && cp -R src/tpaas-schemas/types dist/types/tpaas-schemas",
70
70
  "build:cjs": "tsc",
71
71
  "dev": "tsc --watch",
72
72
  "generate:version": "node bin/generate-version.js",
73
+ "generate:tpaas-types": "tsx ./bin/types/main.ts && pnpm run test:lint:fix",
73
74
  "test": "pnpm run test:lint && pnpm run test:unit",
74
75
  "test:lint": "biome check",
75
76
  "test:lint:fix": "biome check --write",
@@ -1,76 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const vitest_1 = require("vitest");
7
- const Tracker_1 = __importDefault(require("./Tracker"));
8
- const ARTICLE_PAYLOAD = {
9
- experiments: [
10
- {
11
- name: 'test-experiment',
12
- variant: 'test-variant',
13
- },
14
- ],
15
- object: {
16
- category: 'abcd',
17
- objectId: 'page-123',
18
- objectSdrn: 'sdrn:the-standard:page:page-123',
19
- tags: ['tag1', 'tag2'],
20
- title: 'Test Page',
21
- },
22
- metrics: [
23
- {
24
- key: 'topKScore',
25
- name: 'topKScore',
26
- source: 'Curate',
27
- value: 0,
28
- },
29
- ],
30
- page: {
31
- navigationType: 'Navigate',
32
- referrer: {
33
- pageId: 'referrer-page',
34
- pageType: 'Article',
35
- },
36
- },
37
- provider: {
38
- component: 'test-component',
39
- componentVersion: '1.0.0',
40
- product: 'test-product',
41
- stage: 'Dev',
42
- version: '1.0.0',
43
- },
44
- };
45
- const tracker = new Tracker_1.default('test-site', {});
46
- (0, vitest_1.describe)('Type tests for Tracker', () => {
47
- (0, vitest_1.it)('should compile without errors', () => {
48
- tracker.trackViewPage(ARTICLE_PAYLOAD, { leaveTracking: false });
49
- tracker.trackViewPage(ARTICLE_PAYLOAD, {
50
- leaveTracking: {
51
- objectElement: document.body,
52
- },
53
- });
54
- tracker.trackViewPage(ARTICLE_PAYLOAD, {
55
- leaveTracking: {
56
- objectElement: document.body,
57
- pageElement: document.documentElement,
58
- objectResizable: true,
59
- heightBuilder: () => ({
60
- totalHeight: 0,
61
- viewedHeight: 0,
62
- }),
63
- },
64
- });
65
- });
66
- (0, vitest_1.it)('expects errors because invalid API calls', () => {
67
- tracker.trackViewPage(ARTICLE_PAYLOAD, {
68
- // @ts-expect-error we expect an error here because leaveTracking shouldn't be passed as true
69
- leaveTracking: true,
70
- });
71
- // @ts-expect-error we expect an error here because we're missing the second parameter (options)
72
- tracker.trackViewPage(ARTICLE_PAYLOAD);
73
- // @ts-expect-error we expect an error here because we're mising leaveTracking options
74
- tracker.trackViewPage(ARTICLE_PAYLOAD, {});
75
- });
76
- });
@@ -1,71 +0,0 @@
1
- import { describe, it } from 'vitest';
2
- import Tracker from './Tracker';
3
- const ARTICLE_PAYLOAD = {
4
- experiments: [
5
- {
6
- name: 'test-experiment',
7
- variant: 'test-variant',
8
- },
9
- ],
10
- object: {
11
- category: 'abcd',
12
- objectId: 'page-123',
13
- objectSdrn: 'sdrn:the-standard:page:page-123',
14
- tags: ['tag1', 'tag2'],
15
- title: 'Test Page',
16
- },
17
- metrics: [
18
- {
19
- key: 'topKScore',
20
- name: 'topKScore',
21
- source: 'Curate',
22
- value: 0,
23
- },
24
- ],
25
- page: {
26
- navigationType: 'Navigate',
27
- referrer: {
28
- pageId: 'referrer-page',
29
- pageType: 'Article',
30
- },
31
- },
32
- provider: {
33
- component: 'test-component',
34
- componentVersion: '1.0.0',
35
- product: 'test-product',
36
- stage: 'Dev',
37
- version: '1.0.0',
38
- },
39
- };
40
- const tracker = new Tracker('test-site', {});
41
- describe('Type tests for Tracker', () => {
42
- it('should compile without errors', () => {
43
- tracker.trackViewPage(ARTICLE_PAYLOAD, { leaveTracking: false });
44
- tracker.trackViewPage(ARTICLE_PAYLOAD, {
45
- leaveTracking: {
46
- objectElement: document.body,
47
- },
48
- });
49
- tracker.trackViewPage(ARTICLE_PAYLOAD, {
50
- leaveTracking: {
51
- objectElement: document.body,
52
- pageElement: document.documentElement,
53
- objectResizable: true,
54
- heightBuilder: () => ({
55
- totalHeight: 0,
56
- viewedHeight: 0,
57
- }),
58
- },
59
- });
60
- });
61
- it('expects errors because invalid API calls', () => {
62
- tracker.trackViewPage(ARTICLE_PAYLOAD, {
63
- // @ts-expect-error we expect an error here because leaveTracking shouldn't be passed as true
64
- leaveTracking: true,
65
- });
66
- // @ts-expect-error we expect an error here because we're missing the second parameter (options)
67
- tracker.trackViewPage(ARTICLE_PAYLOAD);
68
- // @ts-expect-error we expect an error here because we're mising leaveTracking options
69
- tracker.trackViewPage(ARTICLE_PAYLOAD, {});
70
- });
71
- });
@@ -1,26 +0,0 @@
1
- import type { PulseStorage } from './storage/pulseStorage';
2
- import type { AdvertisingVendor } from './types';
3
- /**
4
- * Sync with CIS
5
- *
6
- * This method deals with all communication and communication with dependent systems (currently AppNexus and Norstat).
7
- *
8
- * An optional user id should be provided if a tracker have received a logged in state. Providing a new user id
9
- * (different from a previous user id, serialized to the pulse cookie) will cause a "blocking call" to CIS (the
10
- * returned promise will not resolve before the communication is done). This is done because CIS could provide new data
11
- * regarding opt-out.
12
- *
13
- * The returned promise will also be blocking if no pulse cookie is found. Pulse requires environmentIds generated
14
- * server side so one have to wait to be allocated to one.
15
- *
16
- * In other context CIS could or could not be called but the returned promise will resolve immediately. If CIS have
17
- * been called recently there is no point in calling it again. In a different case, if a refresh call to CIS is required
18
- * it doesn't mean that other systems have to wait of it. Both cases will return a promise that resolves more or less
19
- * immediately.
20
- */
21
- export declare function syncWithCis(shortUserId?: string, nativeJwe?: string, userServiceLocation?: string, realm?: string, clientId?: string, trackerType?: string, trackerVersion?: string, options?: {
22
- forceSync: boolean;
23
- includeAdvertising: boolean;
24
- trackerId: string;
25
- vendors?: AdvertisingVendor[];
26
- }): Promise<PulseStorage>;