@schibsted/pulse-sdk 8.0.0-alpha.16 → 8.0.0-alpha.18

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 (398) hide show
  1. package/dist/cjs/EventBus/EventBus.js +146 -0
  2. package/dist/cjs/Tracker.js +2499 -0
  3. package/dist/cjs/Tracker.test-d.js +76 -0
  4. package/dist/cjs/app-integration.js +40 -0
  5. package/dist/cjs/builders/actor.js +60 -0
  6. package/dist/cjs/builders/consent-manager.js +134 -0
  7. package/dist/cjs/builders/consents.js +149 -0
  8. package/dist/cjs/builders/device-browser.js +89 -0
  9. package/dist/cjs/builders/device-node.js +63 -0
  10. package/dist/cjs/builders/device.js +23 -0
  11. package/dist/cjs/builders/events-anonymous-browser.js +6 -0
  12. package/dist/cjs/builders/events-anonymous-node.js +88 -0
  13. package/dist/cjs/builders/events-anonymous.js +17 -0
  14. package/dist/cjs/builders/events-browser.js +8 -0
  15. package/dist/cjs/builders/events-node.js +127 -0
  16. package/dist/cjs/builders/events.js +17 -0
  17. package/dist/cjs/builders/experimentMetadata.js +25 -0
  18. package/dist/cjs/builders/experiments.js +32 -0
  19. package/dist/cjs/builders/index.js +52 -0
  20. package/dist/cjs/builders/location.js +38 -0
  21. package/dist/cjs/builders/objects/objects-anonymous-browser.js +36 -0
  22. package/dist/cjs/builders/objects/objects-anonymous-node.js +95 -0
  23. package/dist/cjs/builders/objects/objects-anonymous.js +23 -0
  24. package/dist/cjs/builders/objects/objects-browser.js +36 -0
  25. package/dist/cjs/builders/objects/objects-node.js +126 -0
  26. package/dist/cjs/builders/objects/objects.js +23 -0
  27. package/dist/cjs/builders/objects/utils.js +23 -0
  28. package/dist/cjs/builders/origin-browser.js +28 -0
  29. package/dist/cjs/builders/origin-node.js +29 -0
  30. package/dist/cjs/builders/origin.js +23 -0
  31. package/dist/cjs/builders/provider.js +24 -0
  32. package/dist/cjs/builders/session-browser.js +97 -0
  33. package/dist/cjs/builders/session-node.js +9 -0
  34. package/dist/cjs/builders/session.js +23 -0
  35. package/dist/cjs/builders/tracker-browser.js +34 -0
  36. package/dist/cjs/builders/tracker-node.js +22 -0
  37. package/dist/cjs/builders/trackerBuilder.js +23 -0
  38. package/dist/cjs/config-browser.js +26 -0
  39. package/dist/cjs/config.js +9 -0
  40. package/dist/cjs/createPulseTracker.js +50 -0
  41. package/dist/cjs/defer.js +20 -0
  42. package/dist/cjs/getPulseTracker.js +74 -0
  43. package/dist/cjs/identity/actor.js +60 -0
  44. package/dist/cjs/identity/advertising.js +62 -0
  45. package/dist/cjs/identity/cis.js +66 -0
  46. package/dist/cjs/identity/device.js +20 -0
  47. package/dist/cjs/identity/index.js +20 -0
  48. package/dist/cjs/index.js +57 -0
  49. package/dist/cjs/leaveTracking/constants.js +26 -0
  50. package/dist/cjs/leaveTracking/index.js +368 -0
  51. package/dist/cjs/leaveTracking/types.js +19 -0
  52. package/dist/cjs/leaveTrackingTpaas/constants.js +18 -0
  53. package/dist/cjs/leaveTrackingTpaas/index.js +341 -0
  54. package/dist/cjs/leaveTrackingTpaas/types.js +19 -0
  55. package/dist/cjs/network-browser.js +35 -0
  56. package/dist/cjs/network.js +15 -0
  57. package/dist/cjs/remoteConfig/index.js +124 -0
  58. package/dist/cjs/tracker-proxy/consts.js +72 -0
  59. package/dist/cjs/tracker-proxy/proxy-provider.js +68 -0
  60. package/dist/cjs/types.js +2 -0
  61. package/dist/cjs/version.json +1 -0
  62. package/dist/cjs/visibility-observer/index.js +101 -0
  63. package/dist/cjs/warnOnce.js +11 -0
  64. package/dist/cjs/wrapper/engagement/ui-element/event-builder.js +21 -0
  65. package/dist/cjs/wrapper/engagement/ui-element/types.js +2 -0
  66. package/dist/cjs/wrapper/types/base-event.js +2 -0
  67. package/dist/cjs/wrapper/types/engagement-event.js +2 -0
  68. package/dist/cjs/wrapper/types/event.js +2 -0
  69. package/dist/cjs/wrapper/types/index.js +19 -0
  70. package/dist/cjs/wrapper/types/utils.js +2 -0
  71. package/dist/cjs/wrapper/utils/get-navigation-type.js +32 -0
  72. package/dist/cjs/wrapper/utils/page-from-page-view.js +9 -0
  73. package/dist/cjs/wrapper/view/article/event-builder.js +19 -0
  74. package/dist/cjs/wrapper/view/article/types.js +2 -0
  75. package/dist/cjs/wrapper/view/frontpage/event-builder.js +16 -0
  76. package/dist/cjs/wrapper/view/frontpage/types.js +2 -0
  77. package/dist/cjs/wrapper/view/listing/event-builder.js +14 -0
  78. package/dist/cjs/wrapper/view/listing/types.js +2 -0
  79. package/dist/cjs/wrapper/view/loginposter/event-builder.js +11 -0
  80. package/dist/cjs/wrapper/view/loginposter/types.js +2 -0
  81. package/dist/cjs/wrapper/view/page/event-builder.js +18 -0
  82. package/dist/cjs/wrapper/view/page/types.js +2 -0
  83. package/dist/cjs/wrapper/view/salesposter/event-builder.js +18 -0
  84. package/dist/cjs/wrapper/view/salesposter/types.js +2 -0
  85. package/dist/cjs/wrapper/view/ui-element/event-builder.js +15 -0
  86. package/dist/cjs/wrapper/view/ui-element/types.js +2 -0
  87. package/dist/ejs/EventBus/EventBus.js +140 -0
  88. package/dist/ejs/Tracker.js +2455 -0
  89. package/dist/ejs/Tracker.test-d.js +71 -0
  90. package/dist/ejs/app-integration.js +33 -0
  91. package/dist/ejs/builders/actor.js +53 -0
  92. package/dist/ejs/builders/consent-manager.js +125 -0
  93. package/dist/ejs/builders/consents.js +138 -0
  94. package/dist/ejs/builders/device-browser.js +69 -0
  95. package/dist/ejs/builders/device-node.js +57 -0
  96. package/dist/ejs/builders/device.js +2 -0
  97. package/dist/ejs/builders/events-anonymous-browser.js +1 -0
  98. package/dist/ejs/builders/events-anonymous-node.js +48 -0
  99. package/dist/ejs/builders/events-anonymous.js +1 -0
  100. package/dist/ejs/builders/events-browser.js +1 -0
  101. package/dist/ejs/builders/events-node.js +84 -0
  102. package/dist/ejs/builders/events.js +1 -0
  103. package/dist/ejs/builders/experimentMetadata.js +21 -0
  104. package/dist/ejs/builders/experiments.js +27 -0
  105. package/dist/ejs/builders/index.js +12 -0
  106. package/dist/ejs/builders/location.js +34 -0
  107. package/dist/ejs/builders/objects/objects-anonymous-browser.js +14 -0
  108. package/dist/ejs/builders/objects/objects-anonymous-node.js +90 -0
  109. package/dist/ejs/builders/objects/objects-anonymous.js +2 -0
  110. package/dist/ejs/builders/objects/objects-browser.js +14 -0
  111. package/dist/ejs/builders/objects/objects-node.js +121 -0
  112. package/dist/ejs/builders/objects/objects.js +2 -0
  113. package/dist/ejs/builders/objects/utils.js +20 -0
  114. package/dist/ejs/builders/origin-browser.js +6 -0
  115. package/dist/ejs/builders/origin-node.js +24 -0
  116. package/dist/ejs/builders/origin.js +2 -0
  117. package/dist/ejs/builders/provider.js +18 -0
  118. package/dist/ejs/builders/session-browser.js +90 -0
  119. package/dist/ejs/builders/session-node.js +4 -0
  120. package/dist/ejs/builders/session.js +2 -0
  121. package/dist/ejs/builders/tracker-browser.js +13 -0
  122. package/dist/ejs/builders/tracker-node.js +14 -0
  123. package/dist/ejs/builders/trackerBuilder.js +2 -0
  124. package/dist/ejs/config-browser.js +23 -0
  125. package/dist/ejs/config.js +6 -0
  126. package/dist/ejs/createPulseTracker.js +44 -0
  127. package/dist/ejs/defer.js +17 -0
  128. package/dist/ejs/getPulseTracker.js +71 -0
  129. package/dist/ejs/identity/actor.js +51 -0
  130. package/dist/ejs/identity/advertising.js +57 -0
  131. package/dist/ejs/identity/cis.js +58 -0
  132. package/dist/ejs/identity/device.js +17 -0
  133. package/dist/ejs/identity/index.js +4 -0
  134. package/dist/ejs/index.js +9 -0
  135. package/dist/ejs/leaveTracking/constants.js +19 -0
  136. package/dist/ejs/leaveTracking/index.js +319 -0
  137. package/dist/ejs/leaveTracking/types.js +16 -0
  138. package/dist/ejs/leaveTrackingTpaas/constants.js +13 -0
  139. package/dist/ejs/leaveTrackingTpaas/index.js +291 -0
  140. package/dist/ejs/leaveTrackingTpaas/types.js +16 -0
  141. package/dist/ejs/network-browser.js +32 -0
  142. package/dist/ejs/network.js +12 -0
  143. package/dist/ejs/remoteConfig/index.js +111 -0
  144. package/dist/ejs/tracker-proxy/consts.js +68 -0
  145. package/dist/ejs/tracker-proxy/proxy-provider.js +62 -0
  146. package/dist/ejs/types.js +1 -0
  147. package/dist/ejs/version.json +1 -0
  148. package/dist/ejs/visibility-observer/index.js +97 -0
  149. package/dist/ejs/warnOnce.js +9 -0
  150. package/dist/ejs/wrapper/engagement/ui-element/event-builder.js +17 -0
  151. package/dist/ejs/wrapper/engagement/ui-element/types.js +1 -0
  152. package/dist/ejs/wrapper/types/base-event.js +1 -0
  153. package/dist/ejs/wrapper/types/engagement-event.js +1 -0
  154. package/dist/ejs/wrapper/types/event.js +1 -0
  155. package/dist/ejs/wrapper/types/index.js +3 -0
  156. package/dist/ejs/wrapper/types/utils.js +1 -0
  157. package/dist/ejs/wrapper/utils/get-navigation-type.js +29 -0
  158. package/dist/ejs/wrapper/utils/page-from-page-view.js +6 -0
  159. package/dist/ejs/wrapper/view/article/event-builder.js +15 -0
  160. package/dist/ejs/wrapper/view/article/types.js +1 -0
  161. package/dist/ejs/wrapper/view/frontpage/event-builder.js +12 -0
  162. package/dist/ejs/wrapper/view/frontpage/types.js +1 -0
  163. package/dist/ejs/wrapper/view/listing/event-builder.js +10 -0
  164. package/dist/ejs/wrapper/view/listing/types.js +1 -0
  165. package/dist/ejs/wrapper/view/loginposter/event-builder.js +7 -0
  166. package/dist/ejs/wrapper/view/loginposter/types.js +1 -0
  167. package/dist/ejs/wrapper/view/page/event-builder.js +14 -0
  168. package/dist/ejs/wrapper/view/page/types.js +1 -0
  169. package/dist/ejs/wrapper/view/salesposter/event-builder.js +14 -0
  170. package/dist/ejs/wrapper/view/salesposter/types.js +1 -0
  171. package/dist/ejs/wrapper/view/ui-element/event-builder.js +11 -0
  172. package/dist/ejs/wrapper/view/ui-element/types.js +1 -0
  173. package/dist/types/EventBus/EventBus.d.ts +106 -0
  174. package/dist/types/Tracker.d.ts +1418 -0
  175. package/dist/types/Tracker.test-d.d.ts +1 -0
  176. package/dist/types/app-integration.d.ts +10 -0
  177. package/dist/types/builders/actor.d.ts +39 -0
  178. package/dist/types/builders/consent-manager.d.ts +49 -0
  179. package/dist/types/builders/consents.d.ts +107 -0
  180. package/dist/types/builders/device-browser.d.ts +6 -0
  181. package/dist/types/builders/device-node.d.ts +65 -0
  182. package/dist/types/builders/device.d.ts +2 -0
  183. package/dist/types/builders/events-anonymous-browser.d.ts +1 -0
  184. package/dist/types/builders/events-anonymous-node.d.ts +82 -0
  185. package/dist/types/builders/events-anonymous.d.ts +1 -0
  186. package/dist/types/builders/events-browser.d.ts +1 -0
  187. package/dist/types/builders/events-node.d.ts +130 -0
  188. package/dist/types/builders/events.d.ts +1 -0
  189. package/dist/types/builders/experimentMetadata.d.ts +25 -0
  190. package/dist/types/builders/experiments.d.ts +24 -0
  191. package/dist/types/builders/index.d.ts +23 -0
  192. package/dist/types/builders/location.d.ts +34 -0
  193. package/dist/types/builders/objects/objects-anonymous-browser.d.ts +11 -0
  194. package/dist/types/builders/objects/objects-anonymous-node.d.ts +52 -0
  195. package/dist/types/builders/objects/objects-anonymous.d.ts +2 -0
  196. package/dist/types/builders/objects/objects-browser.d.ts +11 -0
  197. package/dist/types/builders/objects/objects-node.d.ts +60 -0
  198. package/dist/types/builders/objects/objects.d.ts +2 -0
  199. package/dist/types/builders/objects/utils.d.ts +1 -0
  200. package/dist/types/builders/origin-browser.d.ts +5 -0
  201. package/dist/types/builders/origin-node.d.ts +18 -0
  202. package/dist/types/builders/origin.d.ts +2 -0
  203. package/dist/types/builders/provider.d.ts +14 -0
  204. package/dist/types/builders/session-browser.d.ts +20 -0
  205. package/dist/types/builders/session-node.d.ts +3 -0
  206. package/dist/types/builders/session.d.ts +2 -0
  207. package/dist/types/builders/tracker-browser.d.ts +2 -0
  208. package/dist/types/builders/tracker-node.d.ts +14 -0
  209. package/dist/types/builders/trackerBuilder.d.ts +2 -0
  210. package/dist/types/config-browser.d.ts +23 -0
  211. package/dist/types/config.d.ts +6 -0
  212. package/dist/types/createPulseTracker.d.ts +21 -0
  213. package/dist/types/defer.d.ts +28 -0
  214. package/dist/types/getPulseTracker.d.ts +59 -0
  215. package/dist/types/identity/actor.d.ts +28 -0
  216. package/dist/types/identity/advertising.d.ts +30 -0
  217. package/dist/types/identity/cis.d.ts +21 -0
  218. package/dist/types/identity/device.d.ts +12 -0
  219. package/dist/types/identity/index.d.ts +4 -0
  220. package/dist/types/index.d.ts +31 -0
  221. package/dist/types/leaveTracking/constants.d.ts +26 -0
  222. package/dist/types/leaveTracking/index.d.ts +23 -0
  223. package/dist/types/leaveTracking/types.d.ts +78 -0
  224. package/dist/types/leaveTrackingTpaas/constants.d.ts +13 -0
  225. package/dist/types/leaveTrackingTpaas/index.d.ts +28 -0
  226. package/dist/types/leaveTrackingTpaas/types.d.ts +45 -0
  227. package/dist/types/network-browser.d.ts +5 -0
  228. package/dist/types/network.d.ts +4 -0
  229. package/dist/types/remoteConfig/index.d.ts +32 -0
  230. package/dist/types/tracker-proxy/consts.d.ts +45 -0
  231. package/dist/types/tracker-proxy/proxy-provider.d.ts +2 -0
  232. package/dist/types/types.d.ts +93 -0
  233. package/dist/types/visibility-observer/index.d.ts +38 -0
  234. package/dist/types/warnOnce.d.ts +2 -0
  235. package/dist/types/wrapper/engagement/ui-element/event-builder.d.ts +3 -0
  236. package/dist/types/wrapper/engagement/ui-element/types.d.ts +29 -0
  237. package/dist/types/wrapper/types/base-event.d.ts +74 -0
  238. package/dist/types/wrapper/types/engagement-event.d.ts +5 -0
  239. package/dist/types/wrapper/types/event.d.ts +41 -0
  240. package/dist/types/wrapper/types/index.d.ts +3 -0
  241. package/dist/types/wrapper/types/utils.d.ts +5 -0
  242. package/dist/types/wrapper/utils/get-navigation-type.d.ts +3 -0
  243. package/dist/types/wrapper/utils/page-from-page-view.d.ts +3 -0
  244. package/dist/types/wrapper/view/article/event-builder.d.ts +2 -0
  245. package/dist/types/wrapper/view/article/types.d.ts +27 -0
  246. package/dist/types/wrapper/view/frontpage/event-builder.d.ts +2 -0
  247. package/dist/types/wrapper/view/frontpage/types.d.ts +18 -0
  248. package/dist/types/wrapper/view/listing/event-builder.d.ts +2 -0
  249. package/dist/types/wrapper/view/listing/types.d.ts +27 -0
  250. package/dist/types/wrapper/view/loginposter/event-builder.d.ts +2 -0
  251. package/dist/types/wrapper/view/loginposter/types.d.ts +14 -0
  252. package/dist/types/wrapper/view/page/event-builder.d.ts +2 -0
  253. package/dist/types/wrapper/view/page/types.d.ts +16 -0
  254. package/dist/types/wrapper/view/salesposter/event-builder.d.ts +2 -0
  255. package/dist/types/wrapper/view/salesposter/types.d.ts +15 -0
  256. package/dist/types/wrapper/view/ui-element/event-builder.d.ts +3 -0
  257. package/dist/types/wrapper/view/ui-element/types.d.ts +28 -0
  258. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/cis-browser.d.ts +26 -0
  259. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/cis-browser.js +273 -0
  260. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/cis-browser.js.map +1 -0
  261. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/cis.d.ts +10 -0
  262. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/cis.js +7 -0
  263. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/cis.js.map +1 -0
  264. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/eventEmitter.d.ts +14 -0
  265. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/eventEmitter.js +39 -0
  266. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/eventEmitter.js.map +1 -0
  267. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/index.d.ts +4 -0
  268. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/index.js +12 -0
  269. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/index.js.map +1 -0
  270. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/pulse-cookie.d.ts +55 -0
  271. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/pulse-cookie.js +276 -0
  272. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/pulse-cookie.js.map +1 -0
  273. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/storage/pulseStorage.d.ts +36 -0
  274. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/storage/pulseStorage.js +87 -0
  275. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/storage/pulseStorage.js.map +1 -0
  276. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/storage/storage.d.ts +6 -0
  277. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/storage/storage.js +21 -0
  278. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/storage/storage.js.map +1 -0
  279. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/types.d.ts +24 -0
  280. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/types.js +3 -0
  281. package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/types.js.map +1 -0
  282. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/cis-browser.d.ts +26 -0
  283. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/cis-browser.js +203 -0
  284. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/cis-browser.js.map +1 -0
  285. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/cis.d.ts +10 -0
  286. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/cis.js +4 -0
  287. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/cis.js.map +1 -0
  288. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/eventEmitter.d.ts +14 -0
  289. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/eventEmitter.js +35 -0
  290. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/eventEmitter.js.map +1 -0
  291. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/index.d.ts +4 -0
  292. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/index.js +3 -0
  293. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/index.js.map +1 -0
  294. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/pulse-cookie.d.ts +55 -0
  295. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/pulse-cookie.js +254 -0
  296. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/pulse-cookie.js.map +1 -0
  297. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/storage/pulseStorage.d.ts +36 -0
  298. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/storage/pulseStorage.js +50 -0
  299. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/storage/pulseStorage.js.map +1 -0
  300. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/storage/storage.d.ts +6 -0
  301. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/storage/storage.js +17 -0
  302. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/storage/storage.js.map +1 -0
  303. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/types.d.ts +24 -0
  304. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/types.js +2 -0
  305. package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/types.js.map +1 -0
  306. package/node_modules/@schibsted/pulse-cis-sync/dist/types/cis-browser.d.ts +26 -0
  307. package/node_modules/@schibsted/pulse-cis-sync/dist/types/cis.d.ts +10 -0
  308. package/node_modules/@schibsted/pulse-cis-sync/dist/types/eventEmitter.d.ts +14 -0
  309. package/node_modules/@schibsted/pulse-cis-sync/dist/types/index.d.ts +4 -0
  310. package/node_modules/@schibsted/pulse-cis-sync/dist/types/pulse-cookie.d.ts +55 -0
  311. package/node_modules/@schibsted/pulse-cis-sync/dist/types/storage/pulseStorage.d.ts +36 -0
  312. package/node_modules/@schibsted/pulse-cis-sync/dist/types/storage/storage.d.ts +6 -0
  313. package/node_modules/@schibsted/pulse-cis-sync/dist/types/types.d.ts +24 -0
  314. package/node_modules/@schibsted/pulse-cis-sync/package.json +44 -0
  315. package/node_modules/@schibsted/pulse-utils/dist/cjs/cookie-config.js +10 -0
  316. package/node_modules/@schibsted/pulse-utils/dist/cjs/cookie.js +86 -0
  317. package/node_modules/@schibsted/pulse-utils/dist/cjs/events.js +109 -0
  318. package/node_modules/@schibsted/pulse-utils/dist/cjs/get.js +18 -0
  319. package/node_modules/@schibsted/pulse-utils/dist/cjs/getRootDomain.js +54 -0
  320. package/node_modules/@schibsted/pulse-utils/dist/cjs/index.js +38 -0
  321. package/node_modules/@schibsted/pulse-utils/dist/cjs/merge.js +38 -0
  322. package/node_modules/@schibsted/pulse-utils/dist/cjs/objects.js +34 -0
  323. package/node_modules/@schibsted/pulse-utils/dist/cjs/omit.js +9 -0
  324. package/node_modules/@schibsted/pulse-utils/dist/cjs/randomString.js +18 -0
  325. package/node_modules/@schibsted/pulse-utils/dist/cjs/throttle.js +34 -0
  326. package/node_modules/@schibsted/pulse-utils/dist/cjs/webApi.js +21 -0
  327. package/node_modules/@schibsted/pulse-utils/dist/ejs/cookie-config.js +7 -0
  328. package/node_modules/@schibsted/pulse-utils/dist/ejs/cookie.js +81 -0
  329. package/node_modules/@schibsted/pulse-utils/dist/ejs/events.js +103 -0
  330. package/node_modules/@schibsted/pulse-utils/dist/ejs/get.js +15 -0
  331. package/node_modules/@schibsted/pulse-utils/dist/ejs/getRootDomain.js +49 -0
  332. package/node_modules/@schibsted/pulse-utils/dist/ejs/index.js +11 -0
  333. package/node_modules/@schibsted/pulse-utils/dist/ejs/merge.js +35 -0
  334. package/node_modules/@schibsted/pulse-utils/dist/ejs/objects.js +26 -0
  335. package/node_modules/@schibsted/pulse-utils/dist/ejs/omit.js +6 -0
  336. package/node_modules/@schibsted/pulse-utils/dist/ejs/randomString.js +15 -0
  337. package/node_modules/@schibsted/pulse-utils/dist/ejs/throttle.js +31 -0
  338. package/node_modules/@schibsted/pulse-utils/dist/ejs/webApi.js +17 -0
  339. package/node_modules/@schibsted/pulse-utils/dist/types/cookie-config.d.ts +7 -0
  340. package/node_modules/@schibsted/pulse-utils/dist/types/cookie.d.ts +23 -0
  341. package/node_modules/@schibsted/pulse-utils/dist/types/events.d.ts +17 -0
  342. package/node_modules/@schibsted/pulse-utils/dist/types/get.d.ts +1 -0
  343. package/node_modules/@schibsted/pulse-utils/dist/types/getRootDomain.d.ts +13 -0
  344. package/node_modules/@schibsted/pulse-utils/dist/types/index.d.ts +11 -0
  345. package/node_modules/@schibsted/pulse-utils/dist/types/merge.d.ts +4 -0
  346. package/node_modules/@schibsted/pulse-utils/dist/types/objects.d.ts +6 -0
  347. package/node_modules/@schibsted/pulse-utils/dist/types/omit.d.ts +3 -0
  348. package/node_modules/@schibsted/pulse-utils/dist/types/randomString.d.ts +1 -0
  349. package/node_modules/@schibsted/pulse-utils/dist/types/throttle.d.ts +3 -0
  350. package/node_modules/@schibsted/pulse-utils/dist/types/webApi.d.ts +10 -0
  351. package/node_modules/@schibsted/pulse-utils/package.json +36 -0
  352. package/node_modules/@schibsted/tpaas-event-builder/dist/cjs/builders/anonymous.js +8 -0
  353. package/node_modules/@schibsted/tpaas-event-builder/dist/cjs/builders/baseEvent.js +9 -0
  354. package/node_modules/@schibsted/tpaas-event-builder/dist/cjs/builders/consents.js +15 -0
  355. package/node_modules/@schibsted/tpaas-event-builder/dist/cjs/builders/device.js +211 -0
  356. package/node_modules/@schibsted/tpaas-event-builder/dist/cjs/builders/experiments.js +11 -0
  357. package/node_modules/@schibsted/tpaas-event-builder/dist/cjs/builders/navigationType.js +52 -0
  358. package/node_modules/@schibsted/tpaas-event-builder/dist/cjs/builders/pageInfo.js +24 -0
  359. package/node_modules/@schibsted/tpaas-event-builder/dist/cjs/builders/pageviewId.js +11 -0
  360. package/node_modules/@schibsted/tpaas-event-builder/dist/cjs/builders/provider.js +12 -0
  361. package/node_modules/@schibsted/tpaas-event-builder/dist/cjs/builders/referrer.js +19 -0
  362. package/node_modules/@schibsted/tpaas-event-builder/dist/cjs/builders/session.js +114 -0
  363. package/node_modules/@schibsted/tpaas-event-builder/dist/cjs/builders/time.js +15 -0
  364. package/node_modules/@schibsted/tpaas-event-builder/dist/cjs/builders/trackerBuilder.js +15 -0
  365. package/node_modules/@schibsted/tpaas-event-builder/dist/cjs/builders/user.js +26 -0
  366. package/node_modules/@schibsted/tpaas-event-builder/dist/cjs/builders/utm.js +35 -0
  367. package/node_modules/@schibsted/tpaas-event-builder/dist/cjs/builders.js +264 -0
  368. package/node_modules/@schibsted/tpaas-event-builder/dist/cjs/index.js +17 -0
  369. package/node_modules/@schibsted/tpaas-event-builder/dist/cjs/types.js +2 -0
  370. package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/builders/anonymous.js +5 -0
  371. package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/builders/baseEvent.js +6 -0
  372. package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/builders/consents.js +12 -0
  373. package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/builders/device.js +174 -0
  374. package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/builders/experiments.js +7 -0
  375. package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/builders/navigationType.js +48 -0
  376. package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/builders/pageInfo.js +20 -0
  377. package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/builders/pageviewId.js +7 -0
  378. package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/builders/provider.js +9 -0
  379. package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/builders/referrer.js +15 -0
  380. package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/builders/session.js +108 -0
  381. package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/builders/time.js +11 -0
  382. package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/builders/trackerBuilder.js +11 -0
  383. package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/builders/user.js +22 -0
  384. package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/builders/utm.js +31 -0
  385. package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/builders.js +209 -0
  386. package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/index.js +1 -0
  387. package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/types.js +1 -0
  388. package/node_modules/@schibsted/tpaas-event-builder/dist/index.d.ts +5171 -0
  389. package/node_modules/@schibsted/tpaas-event-builder/package.json +40 -0
  390. package/node_modules/@schibsted/tpaas-schemas/dist/cjs/constants.js +62 -1
  391. package/node_modules/@schibsted/tpaas-schemas/dist/ejs/constants.js +61 -0
  392. package/node_modules/@schibsted/tpaas-schemas/dist/index.d.ts +128 -0
  393. package/package.json +58 -13
  394. package/CHANGELOG.md +0 -1035
  395. package/dist/index.d.ts +0 -13
  396. package/dist/index.d.ts.map +0 -1
  397. package/dist/index.js +0 -47
  398. package/dist/index.js.map +0 -1
@@ -0,0 +1,28 @@
1
+ import type { ILeave } from '@schibsted/tpaas-schemas';
2
+ import type { LeaveTrackingOptions, TrackViewEventOptions } from '../types';
3
+ import type { LeaveObjectTypes, Listener, TrackMethod } from './types';
4
+ export declare function addTpaasLeaveTracking({ objectElement, pageElement, schema, objectResizable, heightBuilder, trackMethod, }: LeaveTrackingOptions & {
5
+ schema: LeaveObjectTypes;
6
+ trackMethod: TrackMethod;
7
+ }): void;
8
+ export declare function leaveTpaasTrackingIsActive(): boolean;
9
+ export declare function removeTpaasLeaveTracking(): void;
10
+ /**
11
+ * Update leave tracking
12
+ * @param objectElement new object element to track
13
+ * @param pageElement new page element to track
14
+ * @param resetProperties if ALL engagement properties should be reset (duration, scroll etc.)
15
+ */
16
+ export declare function updateTpaasLeaveTracking(objectElement: Element, pageElement: Element, resetProperties: boolean): void;
17
+ export declare const resetTpaasViewedContent: () => void;
18
+ export declare function trackTpaasActiveLeave(): void;
19
+ export declare function trackTpaasLeave(): void;
20
+ export declare function getTpaasLeaveObject(): ILeave;
21
+ export declare function updateTpaasViewedContent(objectElement: Element, pageElement: Element): void;
22
+ export declare const calculateScrolledPixels: (element: Element) => number;
23
+ export declare const calculateScrollPosition: (element: Element) => number;
24
+ export declare function addEventListeners(events: string[], handler: () => void, options?: boolean | AddEventListenerOptions): Listener[];
25
+ export declare function removeEventListeners(eventListeners: Listener[], options?: {
26
+ capture?: boolean;
27
+ }): Listener[];
28
+ export declare function shouldEnableLeaveTracking(leaveOptions: TrackViewEventOptions['leaveTracking']): leaveOptions is LeaveTrackingOptions;
@@ -0,0 +1,45 @@
1
+ import type { ILeave, ITpaasEvent } from '@schibsted/tpaas-schemas';
2
+ /**
3
+ * @typedef BrowserEvents
4
+ */
5
+ export declare enum BrowserEvents {
6
+ BEFORE_UNLOAD = "beforeunload",
7
+ PAGE_HIDE = "pagehide",
8
+ POP_STATE = "popstate",
9
+ VISIBILITY_CHANGE = "visibilitychange",
10
+ SCROLL = "scroll",
11
+ RESIZE = "resize",
12
+ MOUSEDOWN = "mousedown",
13
+ MOUSEMOVE = "mousemove",
14
+ KEYDOWN = "keydown",
15
+ TOUCHSTART = "touchstart"
16
+ }
17
+ export type Listener = [name: string, listener: () => void];
18
+ /**
19
+ * @typedef ActivityDuration
20
+ */
21
+ export type ActivityDuration = {
22
+ value: number;
23
+ interval: number | undefined;
24
+ timeSinceLastActivity: number;
25
+ };
26
+ /**
27
+ * Used to provide extra height to view %-calculations for objects that have fake-scrolls or similar
28
+ * For instance if you have an element that captures scroll for about 1000px
29
+ * you would report totalHeight 1000px and then viewedHeight 0px if the user had not yet started scrolling, 500px if
30
+ * scrolled halfway through or 1000px if the user had scrolled to the end or past that element
31
+ */
32
+ export interface AdditionalHeightInfo {
33
+ /**
34
+ * The number of px to add to the object & page height
35
+ */
36
+ totalHeight: number;
37
+ /**
38
+ * The number of px to add to the users current scroll depth
39
+ */
40
+ viewedHeight: number;
41
+ }
42
+ export type TrackMethod = (leave: ILeave) => void;
43
+ export type LeaveObjectTypes = Extract<ITpaasEvent, {
44
+ eventType: 'Leave';
45
+ }>['object']['objectType'];
@@ -0,0 +1,5 @@
1
+ import type { EventInput } from './types';
2
+ export default function send(url: string, data: EventInput | EventInput[], sdkConfig: {
3
+ useBeaconWhenAvailable: boolean;
4
+ useBeacon: boolean;
5
+ }): Promise<unknown>;
@@ -0,0 +1,4 @@
1
+ export default function send(url: string, data: unknown, state: {
2
+ username?: string;
3
+ password?: string;
4
+ }): Promise<Response>;
@@ -0,0 +1,32 @@
1
+ declare const CIS_KEY = "cis";
2
+ declare const COLLECTOR_KEY = "collector";
3
+ export type RemoteConfigServices = {
4
+ [CIS_KEY]: string;
5
+ [COLLECTOR_KEY]: string;
6
+ };
7
+ export type RemoteConfig = {
8
+ version: number;
9
+ scopes: {
10
+ [key: string]: {
11
+ services: RemoteConfigServices;
12
+ };
13
+ };
14
+ 'ttl-minutes'?: number;
15
+ };
16
+ export type RemoteConfigMetadata = {
17
+ remoteConfigUrl: string;
18
+ updatedAt: string;
19
+ };
20
+ export type RemoteConfigPersistence = {
21
+ config: RemoteConfig;
22
+ metadata: RemoteConfigMetadata;
23
+ };
24
+ export declare function fetchRemoteConfig(url: string): Promise<RemoteConfig>;
25
+ export declare function fetchRemoteConfigWithRetry(url: string, retries?: number): Promise<RemoteConfig>;
26
+ export declare function readConfigFromStorage(): RemoteConfigPersistence | null;
27
+ export declare function clearConfigFromStorage(): boolean;
28
+ export declare function clearInMemoryConfig(): void;
29
+ export declare function shouldSyncRemoteConfig(url: string, config?: RemoteConfig, metadata?: RemoteConfigMetadata): boolean;
30
+ export declare function resolveConfigServicesByTag(tag?: string, config?: RemoteConfig): RemoteConfigServices | null;
31
+ export declare function syncRemoteConfig(tag: string | undefined, url: string): Promise<RemoteConfigServices | null>;
32
+ export {};
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Keep those files in sync between the SDK and the extension:
3
+ * - workspaces/sdk/src/tracker-proxy/consts.ts
4
+ * - workspaces/tracker-proxy/src/consts.ts
5
+ *
6
+ * SDK package is imported in the tracker-proxy package, but only in the development environment
7
+ * to generate the types for the proxy client. However, we do not want to import constants from
8
+ * the SDK in the tracker-proxy package, as that would mean runtime dependency.
9
+ * We also cannot import from the tracker-proxy package in the SDK as that would
10
+ * create a circular dependency, so we keep the constants in sync manually.
11
+ */
12
+ import type Tracker from '../Tracker';
13
+ export declare const MESSAGE_PREFIX = "pulse-tracker-proxy";
14
+ export declare const MESSAGE_TYPE_REQUEST = "pulse-tracker-proxy:request";
15
+ export declare const MESSAGE_TYPE_ACK = "pulse-tracker-proxy:ack";
16
+ export declare const MESSAGE_TYPE_INVOKE = "pulse-tracker-proxy:invoke";
17
+ export declare const MESSAGE_TYPE_RETURN = "pulse-tracker-proxy:return";
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"];
21
+ export declare function isPulseProxyMessage(message: unknown): message is Message;
22
+ export type TrackInvocation = {
23
+ method: 'track';
24
+ args: Parameters<Tracker['track']>;
25
+ };
26
+ type TpaasAllowedMethodsType = (typeof TPAAS_ALLOWED_METHODS)[number];
27
+ export interface TpaasInvocation {
28
+ method: TpaasAllowedMethodsType;
29
+ args: Parameters<Tracker[TpaasAllowedMethodsType]>;
30
+ }
31
+ export type Message = {
32
+ type: typeof MESSAGE_TYPE_REQUEST;
33
+ } | {
34
+ type: typeof MESSAGE_TYPE_ACK;
35
+ } | {
36
+ type: typeof MESSAGE_TYPE_INVOKE;
37
+ payload: TrackInvocation | TpaasInvocation;
38
+ } | {
39
+ type: typeof MESSAGE_TYPE_RETURN;
40
+ payload: unknown;
41
+ } | {
42
+ type: typeof MESSAGE_TYPE_RETURN_ERROR;
43
+ error: string;
44
+ };
45
+ export {};
@@ -0,0 +1,2 @@
1
+ import type Tracker from '../Tracker';
2
+ export declare function startProxyProviderListener(tracker: Tracker): () => void;
@@ -0,0 +1,93 @@
1
+ import type { ILeaveAudio, ILeaveStories } from '@schibsted/tpaas-schemas';
2
+ import type { v4 } from 'uuid';
3
+ import type { Session } from './builders';
4
+ import type { AnonymousTrackerEventInput } from './builders/events-anonymous-node';
5
+ import type { IdentityEventInput, RoutableEventInput, TrackerEventInput } from './builders/events-node';
6
+ import type { AdditionalHeightInfo } from './leaveTracking/types';
7
+ /**
8
+ * @typedef EventInput
9
+ */
10
+ export type EventInput = Record<string, unknown>;
11
+ declare global {
12
+ interface Navigator {
13
+ userLanguage?: string;
14
+ }
15
+ }
16
+ /**
17
+ * Makes the type T allow Promise or non-promise version of itself and any nested objects or array content recursively
18
+ */
19
+ export type Promisable<T> = T extends Record<PropertyKey, unknown> ? {
20
+ [K in keyof T]: Promisable<T[K]>;
21
+ } | Promise<T> : T extends Array<infer U> ? Array<Promisable<U>> | Promise<Array<Promisable<U>>> : Promise<T> | T;
22
+ export type PromisableRecord<T> = {
23
+ [K in keyof T]: Promisable<T[K]>;
24
+ };
25
+ export type BaseEvent = {
26
+ '@id': ReturnType<typeof v4>;
27
+ creationDate: string;
28
+ session: Session;
29
+ };
30
+ export type BaseAnonymousEvent = {
31
+ '@id': ReturnType<typeof v4>;
32
+ creationDate: string;
33
+ };
34
+ export type EventInputTypesByTrackingMethod = {
35
+ identity: PromisableRecord<IdentityEventInput>;
36
+ trackerEvent: PromisableRecord<TrackerEventInput>;
37
+ engagementEvent: PromisableRecord<TrackerEventInput>;
38
+ routableEvent: PromisableRecord<RoutableEventInput>;
39
+ };
40
+ export type AnonymousEventInputTypesByTrackingMethod = {
41
+ trackerEvent: PromisableRecord<AnonymousTrackerEventInput>;
42
+ engagementEvent: PromisableRecord<AnonymousTrackerEventInput>;
43
+ };
44
+ /**
45
+ * Input for {@link AudioPageLeaveTrackingOptions.leaveAudioBuilder}. Omits `activityDurationMs` and
46
+ * `durationMs` because those are copied automatically from the computed `leave` engagement
47
+ * metrics when the Leave AudioPage event fires.
48
+ */
49
+ export type LeaveAudioInput = Omit<ILeaveAudio, 'activityDurationMs' | 'durationMs'>;
50
+ /**
51
+ * Input for {@link VideoPageLeaveTrackingOptions.leaveStoriesBuilder}. Omits `activityDurationMs` and
52
+ * `durationMs` because those are copied automatically from the computed `leave` engagement
53
+ * metrics when the Leave VideoPage event fires.
54
+ */
55
+ export type LeaveStoriesInput = Omit<ILeaveStories, 'activityDurationMs' | 'durationMs'>;
56
+ export type TrackViewEventOptions = {
57
+ leaveTracking: LeaveTrackingOptions | LeaveTrackingDisabled;
58
+ };
59
+ export type LeaveTrackingOptions = {
60
+ objectElement: HTMLElement;
61
+ pageElement?: HTMLElement;
62
+ objectResizable?: boolean;
63
+ heightBuilder?: () => AdditionalHeightInfo;
64
+ };
65
+ export type LeaveTrackingDisabled = false;
66
+ /**
67
+ * Leave tracking options for {@link Tracker.trackViewAudioPage}.
68
+ * Extends {@link LeaveTrackingOptions} with an optional builder for audio engagement statistics.
69
+ */
70
+ export type AudioPageLeaveTrackingOptions = LeaveTrackingOptions & {
71
+ /**
72
+ * Called at leave time to provide audio engagement statistics for the Leave AudioPage event.
73
+ * If not provided, all audio engagement fields default to `0`.
74
+ */
75
+ leaveAudioBuilder?: () => LeaveAudioInput;
76
+ };
77
+ export type TrackViewAudioPageOptions = {
78
+ leaveTracking: AudioPageLeaveTrackingOptions | LeaveTrackingDisabled;
79
+ };
80
+ /**
81
+ * Leave tracking options for {@link Tracker.trackViewVideoPage}.
82
+ * Extends {@link LeaveTrackingOptions} with an optional builder for story carousel statistics.
83
+ */
84
+ export type VideoPageLeaveTrackingOptions = LeaveTrackingOptions & {
85
+ /**
86
+ * Called at leave time to provide story carousel statistics for the Leave VideoPage event.
87
+ * If not provided, `leaveStories` will be omitted from the Leave VideoPage event.
88
+ */
89
+ leaveStoriesBuilder?: () => LeaveStoriesInput;
90
+ };
91
+ export type TrackViewVideoPageOptions = {
92
+ leaveTracking: VideoPageLeaveTrackingOptions | LeaveTrackingDisabled;
93
+ };
@@ -0,0 +1,38 @@
1
+ type ComponentViewCallback = (node: HTMLElement) => void;
2
+ /**
3
+ * Observes visibility of elements matching a selector using MutationObserver and IntersectionObserver.
4
+ */
5
+ export declare class VisibilityObserver {
6
+ private callback;
7
+ private mutationObserver;
8
+ private intersectionObserver;
9
+ private selector;
10
+ /**
11
+ * @param callback The callback function to be executed when an element becomes visible.
12
+ */
13
+ constructor(callback: ComponentViewCallback);
14
+ /**
15
+ * Tracks visibility of elements matching {@link selector}, triggering {@link callback} when an element is over 2/3 visible.
16
+ * Uses {@link https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver | MutationObserver} to monitor the DOM for dynamically loaded content.
17
+ * Callback is invoked only once per element.
18
+ * @param selector The CSS selector for elements to track.
19
+ * @throws Error if called more than once.
20
+ */
21
+ observe(selector: string): void;
22
+ /**
23
+ * @returns {HTMLElement[]} An array of elements that match the selector in the document.
24
+ */
25
+ elements(): HTMLElement[];
26
+ private setupObservers;
27
+ private setupIntersectionObserver;
28
+ private setupMutationObserver;
29
+ private handleAddedNodes;
30
+ private handleRemovedNodes;
31
+ private processHtmlNodes;
32
+ private processMatchingElements;
33
+ private nodeMatchesOrContainsSelector;
34
+ private extractElementsToTrack;
35
+ private observeIntersection;
36
+ private observeMutations;
37
+ }
38
+ export {};
@@ -0,0 +1,2 @@
1
+ declare const warnOnce: (id: string, ...data: Array<unknown>) => void;
2
+ export default warnOnce;
@@ -0,0 +1,3 @@
1
+ import type { Page, Promisable } from '../../types/index.js';
2
+ import type { ClickUIElementEvent, ClickUIElementInputProperties } from './types.js';
3
+ export declare const buildClickUIElementEvent: (inputProperties: ClickUIElementInputProperties, currentPage: Promisable<Page>) => ClickUIElementEvent;
@@ -0,0 +1,29 @@
1
+ import type { BaseEventExperiment, BaseEventMetrics } from '../../types/base-event.js';
2
+ import type { EngagementEvent } from '../../types/engagement-event.js';
3
+ import type { Layout, NavigationType, Page, Placement, Target } from '../../types/event.js';
4
+ type ClickUIElementInputObject = {
5
+ id: string;
6
+ elementType: string;
7
+ name: string;
8
+ duration?: number;
9
+ layout?: Layout;
10
+ page?: Page;
11
+ placement?: Placement;
12
+ position?: string;
13
+ size?: string;
14
+ custom?: Record<string, unknown>;
15
+ };
16
+ type ClickUIElementOutputObject = {
17
+ navigationType: NavigationType;
18
+ type: 'UIElement';
19
+ url: string;
20
+ } & ClickUIElementInputObject;
21
+ type ClickUIElementInputProperties = {
22
+ object: ClickUIElementInputObject;
23
+ intent?: string;
24
+ target?: Target;
25
+ metrics?: BaseEventMetrics;
26
+ experiments?: BaseEventExperiment[];
27
+ };
28
+ type ClickUIElementEvent = EngagementEvent<ClickUIElementOutputObject>;
29
+ export type { ClickUIElementInputObject, ClickUIElementOutputObject, ClickUIElementInputProperties, ClickUIElementEvent, };
@@ -0,0 +1,74 @@
1
+ import type { EventInput } from '../../types.js';
2
+ import type { Promisable } from './utils.js';
3
+ type BaseEventEventActor = {
4
+ id: string | number;
5
+ subscriptionName: string;
6
+ realm: string;
7
+ };
8
+ type BaseEventEventActorUndefined = {
9
+ id: undefined;
10
+ };
11
+ type Actor = BaseEventEventActor | BaseEventEventActorUndefined;
12
+ export type BaseEventExperiment = {
13
+ id: string;
14
+ variant?: string;
15
+ name?: string;
16
+ platform?: string;
17
+ custom?: Record<string, string>;
18
+ };
19
+ type BaseEventOrigin = {
20
+ id?: string;
21
+ type?: string;
22
+ campaign?: string | Promise<string | undefined>;
23
+ category?: string;
24
+ channel?: string | Promise<string | undefined>;
25
+ content?: string | Promise<string | undefined>;
26
+ source?: string | Promise<string | undefined>;
27
+ url?: string;
28
+ terms?: string | Promise<string | undefined>;
29
+ xDomainId?: string | Promise<string | undefined>;
30
+ };
31
+ type ProductType = 'Web' | 'ResponsiveWeb' | 'AndroidApp' | 'iOSApp' | 'Other';
32
+ type ProviderComponent = 'core-navigation' | 'hermes' | 'schibsted-account' | 'payments' | 'privacy' | 'pulse';
33
+ type BaseEventProvider = {
34
+ id: string;
35
+ type?: string;
36
+ product: string;
37
+ productTag?: string;
38
+ productType: ProductType;
39
+ author?: string;
40
+ component?: ProviderComponent;
41
+ componentVersion?: string;
42
+ };
43
+ type BaseEventCustom = Record<string, unknown>;
44
+ type BaseEventObject = {
45
+ id: string;
46
+ type?: string;
47
+ url?: string;
48
+ 'spt:custom'?: Record<string, unknown>;
49
+ };
50
+ type BaseEventMetric = {
51
+ source: string;
52
+ name: string;
53
+ key: string;
54
+ value: string | number | boolean;
55
+ };
56
+ export type BaseEventMetrics = BaseEventMetric[];
57
+ type BaseEvent<EventObject = BaseEventObject> = {
58
+ actor?: Promisable<Actor>;
59
+ experiments?: Promisable<BaseEventExperiment[]>;
60
+ object: Promisable<EventObject>;
61
+ provider?: Promisable<BaseEventProvider>;
62
+ origin?: Promisable<BaseEventOrigin>;
63
+ metrics?: Promisable<BaseEventMetrics>;
64
+ deployStage?: Promisable<string>;
65
+ deployTag?: Promisable<string>;
66
+ } & EventInput;
67
+ type DeepPartial<T> = T extends object ? {
68
+ [P in keyof T]?: DeepPartial<T[P]>;
69
+ } : T;
70
+ type PromisableExperiments = Promisable<BaseEventExperiment[]> | Array<Promisable<BaseEventExperiment>>;
71
+ type EventProperties = DeepPartial<Omit<BaseEvent, 'experiments'>> & {
72
+ experiments?: PromisableExperiments;
73
+ };
74
+ export type { BaseEvent, BaseEventObject, BaseEventCustom, BaseEventProvider, BaseEventOrigin, EventProperties, Actor };
@@ -0,0 +1,5 @@
1
+ import type { BaseEvent, BaseEventObject } from './base-event.js';
2
+ export type EngagementEvent<EventObject = BaseEventObject> = BaseEvent<EventObject> & {
3
+ action?: 'Click' | 'Zoom' | 'Pinch' | 'Swipe' | 'Drag' | 'Drop' | 'Spin' | 'Scroll';
4
+ type: 'Engagement';
5
+ };
@@ -0,0 +1,41 @@
1
+ type NavigationType = 'navigation' | 'alternative' | 'refresh' | 'unknown';
2
+ type PageType = 'Article' | 'Listing' | 'Frontpage' | 'SalesPoster' | 'Page' | 'LoginPoster';
3
+ type TargetCategory = 'Article' | 'Audio' | 'Video' | 'Weather' | 'Title' | 'other';
4
+ type TargetType = 'Article' | 'ArticleReference' | 'ExternalContent';
5
+ type SalesPosterType = 'Ip' | 'Login' | 'Paid' | 'Meter' | 'Personalised';
6
+ type Page = {
7
+ id: string;
8
+ type: PageType;
9
+ url?: string;
10
+ };
11
+ type AccessLevel = 'Paid' | 'Free' | 'Meter' | 'Login';
12
+ type Layout = {
13
+ elementSize?: string;
14
+ imageUrl?: string;
15
+ name?: string;
16
+ };
17
+ type Placement = {
18
+ primaryPosition?: number;
19
+ secondaryPosition?: number;
20
+ positionInBundle?: number;
21
+ columnName?: string;
22
+ curateContext?: string;
23
+ source?: string;
24
+ };
25
+ type Target = {
26
+ url: string;
27
+ } | {
28
+ url: string;
29
+ id: string;
30
+ type: string;
31
+ } | {
32
+ id: string;
33
+ type: TargetType;
34
+ category?: TargetCategory;
35
+ name: string;
36
+ url: string;
37
+ accessLevel?: AccessLevel;
38
+ accessLevelName?: string;
39
+ newsroom?: string;
40
+ };
41
+ export type { NavigationType, SalesPosterType, Page, PageType, AccessLevel, Layout, Placement, Target, TargetCategory, TargetType, };
@@ -0,0 +1,3 @@
1
+ export * from './base-event.js';
2
+ export * from './event.js';
3
+ export * from './utils.js';
@@ -0,0 +1,5 @@
1
+ type Promisable<T> = T | Promise<T>;
2
+ type DeepPartial<T> = T extends object ? {
3
+ [P in keyof T]?: DeepPartial<T[P]>;
4
+ } : T;
5
+ export type { Promisable, DeepPartial };
@@ -0,0 +1,3 @@
1
+ import type { NavigationType } from '../types/event.js';
2
+ declare const getNavigationType: () => NavigationType;
3
+ export { getNavigationType };
@@ -0,0 +1,3 @@
1
+ import type { BaseEvent, Page, Promisable } from '../types/index.js';
2
+ declare const pageFromPageView: (pageView: BaseEvent) => Promisable<Page>;
3
+ export { pageFromPageView };
@@ -0,0 +1,2 @@
1
+ import type { ViewArticleEvent, ViewArticleInputProperties } from './types.js';
2
+ export declare const buildLegacyViewArticleEvent: (inputProperties: ViewArticleInputProperties) => ViewArticleEvent;
@@ -0,0 +1,27 @@
1
+ import type { BaseEvent } from '../../types/base-event.js';
2
+ import type { AccessLevel, NavigationType, Page } from '../../types/event.js';
3
+ type ViewArticleInputObject = {
4
+ articleId: string;
5
+ accessLevel: AccessLevel;
6
+ accessLevelName: string;
7
+ authors: string[];
8
+ category: string;
9
+ name: string;
10
+ tags: string[];
11
+ wordCount: number;
12
+ group?: 'news' | 'sports';
13
+ page?: Page;
14
+ updated?: string;
15
+ imageUrl?: string;
16
+ 'spt:custom'?: Record<string, unknown>;
17
+ };
18
+ type ViewArticleOutputObject = {
19
+ id: string;
20
+ navigationType: NavigationType;
21
+ type: 'Article';
22
+ contentId: string;
23
+ url: string;
24
+ } & Omit<ViewArticleInputObject, 'articleId'>;
25
+ type ViewArticleInputProperties = BaseEvent<ViewArticleInputObject>;
26
+ type ViewArticleEvent = BaseEvent<ViewArticleOutputObject>;
27
+ export type { ViewArticleInputObject, ViewArticleOutputObject, ViewArticleInputProperties, ViewArticleEvent };
@@ -0,0 +1,2 @@
1
+ import type { ViewFrontpageEvent, ViewFrontpageInputProperties } from './types.js';
2
+ export declare const buildLegacyViewFrontpageEvent: (inputProperties: ViewFrontpageInputProperties) => ViewFrontpageEvent;
@@ -0,0 +1,18 @@
1
+ import type { BaseEvent } from '../../types/base-event.js';
2
+ import type { NavigationType, Page, PageType } from '../../types/event.js';
3
+ type ViewFrontpageInputObject = {
4
+ id: string;
5
+ name: string;
6
+ page?: Page;
7
+ pageType?: PageType;
8
+ category?: string;
9
+ 'spt:custom'?: Record<string, unknown>;
10
+ };
11
+ type ViewFrontpageOutputObject = {
12
+ navigationType: NavigationType;
13
+ type: 'Frontpage';
14
+ url: string;
15
+ } & ViewFrontpageInputObject;
16
+ type ViewFrontpageInputProperties = BaseEvent<ViewFrontpageInputObject>;
17
+ type ViewFrontpageEvent = BaseEvent<ViewFrontpageOutputObject>;
18
+ export type { ViewFrontpageInputObject, ViewFrontpageOutputObject, ViewFrontpageInputProperties, ViewFrontpageEvent };
@@ -0,0 +1,2 @@
1
+ import type { ViewListingEvent, ViewListingInputProperties } from './types.js';
2
+ export declare const buildLegacyViewListingEvent: (inputProperties: ViewListingInputProperties) => ViewListingEvent;
@@ -0,0 +1,27 @@
1
+ import type { BaseEvent } from '../../types/base-event.js';
2
+ import type { NavigationType, Page } from '../../types/event.js';
3
+ type AutoComplete = {
4
+ chosenIndex: number;
5
+ input: string;
6
+ suggestionCategory: string;
7
+ suggestions: string[];
8
+ };
9
+ type ViewListingInputObject = {
10
+ id: string;
11
+ name: string;
12
+ autoComplete?: AutoComplete;
13
+ category?: string;
14
+ listingType?: string;
15
+ numItems?: number;
16
+ page?: Page;
17
+ pageNumber?: number;
18
+ 'spt:custom'?: Record<string, unknown>;
19
+ };
20
+ type ViewListingOutputObject = {
21
+ navigationType: NavigationType;
22
+ type: 'Listing';
23
+ url: string;
24
+ } & ViewListingInputObject;
25
+ type ViewListingInputProperties = BaseEvent<ViewListingInputObject>;
26
+ type ViewListingEvent = BaseEvent<ViewListingOutputObject>;
27
+ export type { ViewListingInputObject, ViewListingOutputObject, ViewListingInputProperties, ViewListingEvent };
@@ -0,0 +1,2 @@
1
+ import type { ViewLoginPosterEvent, ViewLoginPosterInputProperties } from './types.js';
2
+ export declare const buildViewLoginPosterEvent: (inputProperties: ViewLoginPosterInputProperties) => ViewLoginPosterEvent;
@@ -0,0 +1,14 @@
1
+ import type { BaseEvent } from '../../types/base-event.js';
2
+ type LoginMethod = 'magiclink' | 'embedded-schibsted-account' | 'link-to-schibsted-account';
3
+ type ViewLoginPosterInputObject = {
4
+ id: string;
5
+ name: string;
6
+ loginMethod: LoginMethod;
7
+ 'spt:custom'?: Record<string, unknown>;
8
+ };
9
+ type ViewLoginPosterOutputObject = {
10
+ type: 'LoginPoster';
11
+ } & ViewLoginPosterInputObject;
12
+ type ViewLoginPosterInputProperties = BaseEvent<ViewLoginPosterInputObject>;
13
+ type ViewLoginPosterEvent = BaseEvent<ViewLoginPosterOutputObject>;
14
+ export type { ViewLoginPosterInputObject, ViewLoginPosterOutputObject, ViewLoginPosterInputProperties, ViewLoginPosterEvent, };
@@ -0,0 +1,2 @@
1
+ import type { ViewPageEvent, ViewPageInputProperties } from './types.js';
2
+ export declare const buildLegacyViewPageEvent: (inputProperties: ViewPageInputProperties) => ViewPageEvent;
@@ -0,0 +1,16 @@
1
+ import type { BaseEvent } from '../../types/base-event.js';
2
+ import type { NavigationType } from '../../types/event.js';
3
+ type ViewPageInputObject = {
4
+ pageId: string;
5
+ name: string;
6
+ 'spt:custom'?: Record<string, unknown>;
7
+ };
8
+ type ViewPageOutputObject = {
9
+ id: string;
10
+ navigationType: NavigationType;
11
+ type: 'Page';
12
+ url: string;
13
+ } & Omit<ViewPageInputObject, 'pageId'>;
14
+ type ViewPageInputProperties = BaseEvent<ViewPageInputObject>;
15
+ type ViewPageEvent = BaseEvent<ViewPageOutputObject>;
16
+ export type { ViewPageInputObject, ViewPageOutputObject, ViewPageInputProperties, ViewPageEvent };
@@ -0,0 +1,2 @@
1
+ import type { ViewSalesPosterEvent, ViewSalesPosterInputProperties } from './types.js';
2
+ export declare const buildViewSalesPosterEvent: (inputProperties: ViewSalesPosterInputProperties) => ViewSalesPosterEvent;
@@ -0,0 +1,15 @@
1
+ import type { BaseEvent } from '../../types/base-event.js';
2
+ import type { NavigationType, SalesPosterType } from '../../types/event.js';
3
+ import type { ViewArticleInputObject } from '../article/types.js';
4
+ type ViewSalesPosterInputObject = ViewArticleInputObject & {
5
+ salesPosterType: SalesPosterType;
6
+ };
7
+ type ViewSalesPosterOutputObject = {
8
+ id: string;
9
+ navigationType: NavigationType;
10
+ type: 'SalesPoster';
11
+ url: string;
12
+ } & Omit<ViewSalesPosterInputObject, 'articleId'>;
13
+ type ViewSalesPosterInputProperties = BaseEvent<ViewSalesPosterInputObject>;
14
+ type ViewSalesPosterEvent = BaseEvent<ViewSalesPosterOutputObject>;
15
+ export type { ViewSalesPosterInputObject, ViewSalesPosterOutputObject, ViewSalesPosterInputProperties, ViewSalesPosterEvent, };
@@ -0,0 +1,3 @@
1
+ import type { Page, Promisable } from '../../types/index.js';
2
+ import type { ViewUIElementEvent, ViewUIElementInputProperties } from './types.js';
3
+ export declare const buildLegacyViewUIElementEvent: (inputProperties: ViewUIElementInputProperties, currentPage: Promisable<Page>) => ViewUIElementEvent;