@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.
- package/dist/cjs/Tracker.js +578 -303
- package/dist/cjs/app-integration.js +3 -3
- package/dist/cjs/builders/actor.js +6 -6
- package/dist/cjs/builders/consents.js +8 -8
- package/dist/cjs/builders/device-browser.js +8 -8
- package/dist/cjs/builders/device-node.js +3 -3
- package/dist/cjs/builders/events-anonymous-node.js +3 -3
- package/dist/cjs/builders/events-node.js +7 -7
- package/dist/cjs/builders/experimentMetadata.js +2 -2
- package/dist/cjs/builders/experiments.js +1 -0
- package/dist/cjs/builders/objects/objects-anonymous-browser.js +2 -2
- package/dist/cjs/builders/objects/objects-anonymous-node.js +9 -9
- package/dist/cjs/builders/objects/objects-browser.js +2 -2
- package/dist/cjs/builders/objects/objects-node.js +10 -10
- package/dist/cjs/builders/objects/utils.js +3 -3
- package/dist/cjs/builders/origin-browser.js +2 -2
- package/dist/cjs/builders/origin-node.js +4 -4
- package/dist/cjs/builders/session-browser.js +6 -5
- package/dist/cjs/cis-sync/cis-browser.js +219 -0
- package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/cjs/cis-sync}/cis.js +0 -1
- package/dist/cjs/cis-sync/eventEmitter.js +37 -0
- package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/cjs/cis-sync}/index.js +0 -1
- package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/cjs/cis-sync}/pulse-cookie.js +53 -63
- package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/cjs/cis-sync}/storage/pulseStorage.js +28 -21
- package/dist/cjs/cis-sync/storage/storage.js +24 -0
- package/dist/cjs/createPulseTracker.js +4 -4
- package/dist/cjs/identity/actor.js +20 -8
- package/dist/cjs/identity/advertising.js +1 -1
- package/dist/cjs/identity/cis.js +7 -6
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/leaveTracking/index.js +10 -10
- package/dist/cjs/leaveTrackingTpaas/constants.js +2 -7
- package/dist/cjs/leaveTrackingTpaas/index.js +70 -46
- package/dist/cjs/network-browser.js +3 -3
- package/dist/cjs/remoteConfig/index.js +5 -5
- package/dist/cjs/tpaas-builders/builders/catalogVersion.js +9 -0
- package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/device.js +11 -5
- package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/navigationType.js +2 -3
- package/dist/cjs/tpaas-builders/builders/pageContent.js +7 -0
- package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/pageInfo.js +2 -2
- package/dist/cjs/tpaas-builders/builders/pageSports.js +7 -0
- package/dist/cjs/tpaas-builders/builders/provider.js +19 -0
- package/dist/cjs/tpaas-builders/builders/referrer.js +17 -0
- package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/session.js +23 -20
- package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/trackerBuilder.js +2 -3
- package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/user.js +1 -1
- package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/utm.js +3 -3
- package/dist/cjs/tpaas-builders/builders.js +339 -0
- package/dist/cjs/tpaas-builders/guards.js +7 -0
- package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/index.js +3 -0
- package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/cjs/tpaas-builders}/types.js +0 -1
- package/{node_modules/@schibsted/tpaas-schemas/dist/cjs → dist/cjs/tpaas-schemas}/constants.js +193 -155
- package/{node_modules/@schibsted/tpaas-schemas/dist/cjs → dist/cjs/tpaas-schemas}/index.js +1 -0
- package/dist/cjs/tpaas-schemas/types.js +2 -0
- package/dist/cjs/tracker-proxy/consts.js +29 -6
- package/dist/cjs/tracker-proxy/proxy-provider.js +2 -2
- package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/index.js +4 -1
- package/dist/cjs/utils/xDomainId.js +15 -0
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/visibility-observer/index.js +9 -7
- package/dist/cjs/wrapper/types/event.js +5 -0
- package/dist/cjs/wrapper/utils/map-page-to-page-ref.js +13 -0
- package/dist/ejs/Tracker.js +510 -235
- package/dist/ejs/app-integration.js +1 -1
- package/dist/ejs/builders/actor.js +3 -3
- package/dist/ejs/builders/consents.js +4 -4
- package/dist/ejs/builders/device-browser.js +2 -2
- package/dist/ejs/builders/device-node.js +1 -1
- package/dist/ejs/builders/events-anonymous-node.js +1 -1
- package/dist/ejs/builders/events-node.js +4 -4
- package/dist/ejs/builders/experimentMetadata.js +1 -1
- package/dist/ejs/builders/experiments.js +1 -1
- package/dist/ejs/builders/objects/objects-anonymous-browser.js +1 -1
- package/dist/ejs/builders/objects/objects-anonymous-node.js +1 -1
- package/dist/ejs/builders/objects/objects-browser.js +1 -1
- package/dist/ejs/builders/objects/objects-node.js +1 -1
- package/dist/ejs/builders/objects/utils.js +1 -1
- package/dist/ejs/builders/origin-browser.js +1 -1
- package/dist/ejs/builders/origin-node.js +1 -1
- package/dist/ejs/builders/session-browser.js +2 -1
- package/{node_modules/@schibsted/pulse-cis-sync/dist/ejs → dist/ejs/cis-sync}/cis-browser.js +17 -4
- package/{node_modules/@schibsted/pulse-cis-sync/dist/ejs → dist/ejs/cis-sync}/cis.js +0 -1
- package/{node_modules/@schibsted/pulse-cis-sync/dist/ejs → dist/ejs/cis-sync}/eventEmitter.js +0 -1
- package/{node_modules/@schibsted/pulse-cis-sync/dist/ejs → dist/ejs/cis-sync}/index.js +0 -1
- package/{node_modules/@schibsted/pulse-cis-sync/dist/ejs → dist/ejs/cis-sync}/pulse-cookie.js +1 -2
- package/{node_modules/@schibsted/pulse-cis-sync/dist/ejs → dist/ejs/cis-sync}/storage/pulseStorage.js +12 -4
- package/{node_modules/@schibsted/pulse-cis-sync/dist/ejs → dist/ejs/cis-sync}/storage/storage.js +6 -2
- package/dist/ejs/createPulseTracker.js +1 -1
- package/dist/ejs/identity/actor.js +21 -9
- package/dist/ejs/identity/advertising.js +1 -1
- package/dist/ejs/identity/cis.js +4 -3
- package/dist/ejs/index.js +4 -3
- package/dist/ejs/leaveTracking/index.js +1 -1
- package/dist/ejs/leaveTrackingTpaas/constants.js +1 -5
- package/dist/ejs/leaveTrackingTpaas/index.js +65 -41
- package/dist/ejs/network-browser.js +1 -1
- package/dist/ejs/remoteConfig/index.js +1 -1
- package/dist/ejs/tpaas-builders/builders/catalogVersion.js +6 -0
- package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/device.js +10 -4
- package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/navigationType.js +2 -3
- package/dist/ejs/tpaas-builders/builders/pageContent.js +3 -0
- package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/pageInfo.js +1 -1
- package/dist/ejs/tpaas-builders/builders/pageSports.js +3 -0
- package/dist/ejs/tpaas-builders/builders/provider.js +16 -0
- package/dist/ejs/tpaas-builders/builders/referrer.js +13 -0
- package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/session.js +18 -15
- package/dist/ejs/tpaas-builders/builders/trackerBuilder.js +10 -0
- package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/user.js +1 -1
- package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/utm.js +2 -2
- package/dist/ejs/tpaas-builders/builders.js +271 -0
- package/dist/ejs/tpaas-builders/guards.js +4 -0
- package/dist/ejs/tpaas-builders/index.js +2 -0
- package/{node_modules/@schibsted/tpaas-schemas/dist/ejs → dist/ejs/tpaas-schemas}/constants.js +191 -153
- package/{node_modules/@schibsted/tpaas-schemas/dist/ejs → dist/ejs/tpaas-schemas}/index.js +1 -0
- package/dist/ejs/tpaas-schemas/types.js +1 -0
- package/dist/ejs/tracker-proxy/consts.js +29 -6
- package/dist/ejs/tracker-proxy/proxy-provider.js +1 -1
- package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/index.js +1 -0
- package/dist/ejs/utils/xDomainId.js +11 -0
- package/dist/ejs/version.js +1 -1
- package/dist/ejs/visibility-observer/index.js +9 -7
- package/dist/ejs/wrapper/types/event.js +4 -1
- package/dist/ejs/wrapper/utils/map-page-to-page-ref.js +10 -0
- package/dist/types/Tracker.d.ts +178 -77
- package/dist/types/builders/actor.d.ts +3 -2
- package/dist/types/builders/consents.d.ts +3 -3
- package/dist/types/builders/device-node.d.ts +2 -2
- package/dist/types/builders/events-anonymous-node.d.ts +4 -4
- package/dist/types/builders/events-node.d.ts +5 -5
- package/dist/types/builders/experiments.d.ts +1 -0
- package/dist/types/builders/index.d.ts +1 -1
- package/dist/types/builders/objects/objects-anonymous-node.d.ts +1 -1
- package/dist/types/builders/objects/objects-node.d.ts +1 -1
- package/dist/types/builders/origin-node.d.ts +1 -1
- package/dist/types/builders/session-browser.d.ts +1 -0
- package/{node_modules/@schibsted/pulse-cis-sync/dist/types → dist/types/cis-sync}/cis-browser.d.ts +1 -0
- package/{node_modules/@schibsted/pulse-cis-sync/dist/types → dist/types/cis-sync}/storage/pulseStorage.d.ts +12 -4
- package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/types/cis-sync}/storage/storage.d.ts +2 -1
- package/dist/types/config.d.ts +1 -1
- package/dist/types/createPulseTracker.d.ts +1 -1
- package/dist/types/identity/actor.d.ts +3 -3
- package/dist/types/identity/advertising.d.ts +2 -2
- package/dist/types/identity/cis.d.ts +4 -4
- package/dist/types/index.d.ts +7 -8
- package/dist/types/leaveTrackingTpaas/constants.d.ts +1 -5
- package/dist/types/leaveTrackingTpaas/index.d.ts +6 -6
- package/dist/types/leaveTrackingTpaas/types.d.ts +2 -10
- package/dist/types/tpaas-builders/builders/anonymous.d.ts +3 -0
- package/dist/types/tpaas-builders/builders/baseEvent.d.ts +3 -0
- package/dist/types/tpaas-builders/builders/catalogVersion.d.ts +3 -0
- package/dist/types/tpaas-builders/builders/consents.d.ts +5 -0
- package/dist/types/tpaas-builders/builders/device.d.ts +5 -0
- package/dist/types/tpaas-builders/builders/experiments.d.ts +9 -0
- package/dist/types/tpaas-builders/builders/navigationType.d.ts +6 -0
- package/dist/types/tpaas-builders/builders/pageContent.d.ts +6 -0
- package/dist/types/tpaas-builders/builders/pageInfo.d.ts +6 -0
- package/dist/types/tpaas-builders/builders/pageSports.d.ts +6 -0
- package/dist/types/tpaas-builders/builders/pageviewId.d.ts +6 -0
- package/dist/types/tpaas-builders/builders/provider.d.ts +5 -0
- package/dist/types/tpaas-builders/builders/referrer.d.ts +6 -0
- package/dist/types/tpaas-builders/builders/session.d.ts +15 -0
- package/dist/types/tpaas-builders/builders/time.d.ts +4 -0
- package/dist/types/tpaas-builders/builders/trackerBuilder.d.ts +5 -0
- package/dist/types/tpaas-builders/builders/user.d.ts +5 -0
- package/dist/types/tpaas-builders/builders/utm.d.ts +6 -0
- package/dist/types/tpaas-builders/builders.d.ts +141 -0
- package/dist/types/tpaas-builders/guards.d.ts +2 -0
- package/dist/types/tpaas-builders/index.d.ts +3 -0
- package/dist/types/tpaas-builders/types.d.ts +36 -0
- package/dist/types/tpaas-schemas/constants.d.ts +478 -0
- package/dist/types/tpaas-schemas/index.d.ts +5 -0
- package/dist/types/tpaas-schemas/types/ITpaasEvent.d.ts +132 -0
- package/dist/types/tpaas-schemas/types/schemas/IAnonymousViewUIElement.d.ts +58 -0
- package/dist/types/tpaas-schemas/types/schemas/ICompletedHealthAction.d.ts +139 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementAd.d.ts +117 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementAffiliate.d.ts +144 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementAudio.d.ts +209 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementForm.d.ts +111 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementHealthUIElement.d.ts +133 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementOffer.d.ts +107 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementSchoolUIElement.d.ts +107 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementSportsUIElement.d.ts +157 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementTeaser.d.ts +114 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementTvModule.d.ts +130 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementTvSearch.d.ts +142 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementUIElement.d.ts +105 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementVideo.d.ts +234 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementVideoAd.d.ts +145 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementWidget.d.ts +91 -0
- package/dist/types/tpaas-schemas/types/schemas/IHeartbeatCommercialArticle.d.ts +96 -0
- package/dist/types/tpaas-schemas/types/schemas/IImpressionAd.d.ts +115 -0
- package/dist/types/tpaas-schemas/types/schemas/IImpressionAdSlot.d.ts +89 -0
- package/dist/types/tpaas-schemas/types/schemas/IImpressionAffiliate.d.ts +142 -0
- package/dist/types/tpaas-schemas/types/schemas/IImpressionForm.d.ts +113 -0
- package/dist/types/tpaas-schemas/types/schemas/IImpressionHealthUIElement.d.ts +138 -0
- package/dist/types/tpaas-schemas/types/schemas/IImpressionOffer.d.ts +109 -0
- package/dist/types/tpaas-schemas/types/schemas/IImpressionPlayer.d.ts +108 -0
- package/dist/types/tpaas-schemas/types/schemas/IImpressionSchoolUIElement.d.ts +109 -0
- package/dist/types/tpaas-schemas/types/schemas/IImpressionSportsUIElement.d.ts +159 -0
- package/dist/types/tpaas-schemas/types/schemas/IImpressionTeaser.d.ts +112 -0
- package/dist/types/tpaas-schemas/types/schemas/IImpressionUIElement.d.ts +107 -0
- package/dist/types/tpaas-schemas/types/schemas/IImpressionWidget.d.ts +89 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeaveArticle.d.ts +133 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeaveAudioPage.d.ts +88 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeaveError.d.ts +95 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeaveFrontpage.d.ts +83 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeaveLandingpage.d.ts +90 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeaveListing.d.ts +123 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeaveLockedArticle.d.ts +139 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeaveLockedAudioPage.d.ts +97 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeaveLockedPage.d.ts +90 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeaveLockedVideoPage.d.ts +97 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeavePage.d.ts +82 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeaveSchoolPage.d.ts +84 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeaveSportsPage.d.ts +137 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeaveVideoPage.d.ts +91 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeaveWeather.d.ts +94 -0
- package/dist/types/tpaas-schemas/types/schemas/ILoadAd.d.ts +119 -0
- package/dist/types/tpaas-schemas/types/schemas/IRequestAd.d.ts +95 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewArticle.d.ts +133 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewAudioPage.d.ts +87 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewError.d.ts +90 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewFrontpage.d.ts +80 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewHealthPage.d.ts +119 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewLandingpage.d.ts +76 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewListing.d.ts +118 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewLockedArticle.d.ts +139 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewLockedAudioPage.d.ts +95 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewLockedPage.d.ts +94 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewLockedVideoPage.d.ts +95 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewPage.d.ts +86 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewSchoolPage.d.ts +88 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewSportsPage.d.ts +135 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewTitle.d.ts +92 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewVideoPage.d.ts +87 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewWeather.d.ts +94 -0
- package/dist/types/tpaas-schemas/types/schemas/index.d.ts +64 -0
- package/dist/types/tpaas-schemas/types/templates/IBranded.d.ts +42 -0
- package/dist/types/tpaas-schemas/types/templates/IConsents.d.ts +34 -0
- package/dist/types/tpaas-schemas/types/templates/IContent.d.ts +56 -0
- package/dist/types/tpaas-schemas/types/templates/IDevice.d.ts +62 -0
- package/dist/types/tpaas-schemas/types/templates/IEngagement.d.ts +21 -0
- package/dist/types/tpaas-schemas/types/templates/IExperiments.d.ts +35 -0
- package/dist/types/tpaas-schemas/types/templates/IHealthFood.d.ts +55 -0
- package/dist/types/tpaas-schemas/types/templates/IHealthOrigin.d.ts +27 -0
- package/dist/types/tpaas-schemas/types/templates/IHealthPhysicalActivity.d.ts +36 -0
- package/dist/types/tpaas-schemas/types/templates/IHealthTraining.d.ts +74 -0
- package/dist/types/tpaas-schemas/types/templates/IHealthUserData.d.ts +25 -0
- package/dist/types/tpaas-schemas/types/templates/ILeave.d.ts +54 -0
- package/dist/types/tpaas-schemas/types/templates/ILeaveAudio.d.ts +37 -0
- package/dist/types/tpaas-schemas/types/templates/ILeaveStories.d.ts +34 -0
- package/dist/types/tpaas-schemas/types/templates/ILocation.d.ts +21 -0
- package/dist/types/tpaas-schemas/types/templates/IMetrics.d.ts +32 -0
- package/dist/types/tpaas-schemas/types/templates/IPageRef.d.ts +46 -0
- package/dist/types/tpaas-schemas/types/templates/IPlacement.d.ts +45 -0
- package/dist/types/tpaas-schemas/types/templates/IProvider.d.ts +73 -0
- package/dist/types/tpaas-schemas/types/templates/ISchool.d.ts +74 -0
- package/dist/types/tpaas-schemas/types/templates/ISession.d.ts +33 -0
- package/dist/types/tpaas-schemas/types/templates/ISports.d.ts +98 -0
- package/dist/types/tpaas-schemas/types/templates/ISportsUserFeatures.d.ts +28 -0
- package/dist/types/tpaas-schemas/types/templates/ITime.d.ts +32 -0
- package/dist/types/tpaas-schemas/types/templates/ITracker.d.ts +37 -0
- package/dist/types/tpaas-schemas/types/templates/IUser.d.ts +34 -0
- package/dist/types/tpaas-schemas/types/templates/IUtmTags.d.ts +38 -0
- package/dist/types/tpaas-schemas/types/templates/index.d.ts +27 -0
- package/dist/types/tpaas-schemas/types.d.ts +42 -0
- package/dist/types/tracker-proxy/consts.d.ts +2 -2
- package/dist/types/types.d.ts +19 -13
- package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/index.d.ts +1 -0
- package/dist/types/utils/xDomainId.d.ts +2 -0
- package/dist/types/version.d.ts +1 -1
- package/dist/types/visibility-observer/index.d.ts +6 -1
- package/dist/types/wrapper/engagement/ui-element/types.d.ts +1 -1
- package/dist/types/wrapper/types/base-event.d.ts +1 -1
- package/dist/types/wrapper/types/event.d.ts +4 -2
- package/dist/types/wrapper/types/utils.d.ts +1 -1
- package/dist/types/wrapper/utils/map-page-to-page-ref.d.ts +3 -0
- package/dist/types/wrapper/view/article/types.d.ts +1 -1
- package/dist/types/wrapper/view/frontpage/types.d.ts +1 -1
- package/dist/types/wrapper/view/listing/types.d.ts +1 -1
- package/dist/types/wrapper/view/loginposter/types.d.ts +1 -1
- package/dist/types/wrapper/view/page/types.d.ts +1 -1
- package/dist/types/wrapper/view/salesposter/types.d.ts +1 -1
- package/dist/types/wrapper/view/ui-element/types.d.ts +1 -1
- package/package.json +21 -20
- package/dist/cjs/Tracker.test-d.js +0 -76
- package/dist/ejs/Tracker.test-d.js +0 -71
- package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/cis-browser.d.ts +0 -26
- package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/cis-browser.js +0 -273
- package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/cis-browser.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/cis.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/eventEmitter.js +0 -39
- package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/eventEmitter.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/index.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/pulse-cookie.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/storage/pulseStorage.d.ts +0 -36
- package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/storage/pulseStorage.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/storage/storage.js +0 -21
- package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/storage/storage.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/types.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/cis-browser.d.ts +0 -26
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/cis-browser.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/cis.d.ts +0 -10
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/cis.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/eventEmitter.d.ts +0 -14
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/eventEmitter.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/index.d.ts +0 -4
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/index.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/pulse-cookie.d.ts +0 -55
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/pulse-cookie.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/storage/pulseStorage.d.ts +0 -36
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/storage/pulseStorage.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/storage/storage.d.ts +0 -6
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/storage/storage.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/types.d.ts +0 -24
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/types.js +0 -2
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/types.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/types/cis.d.ts +0 -10
- package/node_modules/@schibsted/pulse-cis-sync/dist/types/eventEmitter.d.ts +0 -14
- package/node_modules/@schibsted/pulse-cis-sync/dist/types/index.d.ts +0 -4
- package/node_modules/@schibsted/pulse-cis-sync/dist/types/pulse-cookie.d.ts +0 -55
- package/node_modules/@schibsted/pulse-cis-sync/dist/types/storage/storage.d.ts +0 -6
- package/node_modules/@schibsted/pulse-cis-sync/dist/types/types.d.ts +0 -24
- package/node_modules/@schibsted/pulse-cis-sync/package.json +0 -44
- package/node_modules/@schibsted/pulse-utils/package.json +0 -36
- package/node_modules/@schibsted/tpaas-event-builder/dist/cjs/builders/provider.js +0 -12
- package/node_modules/@schibsted/tpaas-event-builder/dist/cjs/builders/referrer.js +0 -19
- package/node_modules/@schibsted/tpaas-event-builder/dist/cjs/builders.js +0 -272
- package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/builders/provider.js +0 -9
- package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/builders/referrer.js +0 -15
- package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/builders/trackerBuilder.js +0 -11
- package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/builders.js +0 -215
- package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/index.js +0 -1
- package/node_modules/@schibsted/tpaas-event-builder/dist/index.d.ts +0 -5403
- package/node_modules/@schibsted/tpaas-event-builder/package.json +0 -40
- package/node_modules/@schibsted/tpaas-schemas/dist/index.d.ts +0 -6176
- package/node_modules/@schibsted/tpaas-schemas/package.json +0 -35
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/cis-sync}/types.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/anonymous.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/baseEvent.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/consents.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/experiments.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/pageviewId.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/time.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/cookie-config.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/cookie.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/events.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/get.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/getRootDomain.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/merge.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/objects.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/omit.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/randomString.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/throttle.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/webApi.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/cis-sync}/types.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/anonymous.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/baseEvent.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/consents.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/experiments.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/pageviewId.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/time.js +0 -0
- /package/dist/{types/Tracker.test-d.d.ts → ejs/tpaas-builders/types.js} +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/cookie-config.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/cookie.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/events.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/get.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/getRootDomain.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/merge.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/objects.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/omit.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/randomString.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/throttle.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/webApi.js +0 -0
- /package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/types/cis-sync}/cis.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/types/cis-sync}/eventEmitter.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/types/cis-sync}/index.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/types/cis-sync}/pulse-cookie.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/types/cis-sync}/types.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/cookie-config.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/cookie.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/events.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/get.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/getRootDomain.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/merge.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/objects.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/omit.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/randomString.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/throttle.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/webApi.d.ts +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.builder = builder;
|
|
4
|
+
const generateProviderSDRN = (providerId) => `sdrn:schibsted:client:${providerId}`;
|
|
5
|
+
function builder(providerId, providerStage, providerProduct, providerVersion, component, componentVersion, providerName, providerGroup) {
|
|
6
|
+
return {
|
|
7
|
+
provider: {
|
|
8
|
+
providerId,
|
|
9
|
+
providerSdrn: generateProviderSDRN(providerId),
|
|
10
|
+
...(component !== undefined && { component }),
|
|
11
|
+
...(componentVersion !== undefined && { componentVersion }),
|
|
12
|
+
...(providerGroup !== undefined && { group: providerGroup }),
|
|
13
|
+
...(providerName !== undefined && { name: providerName }),
|
|
14
|
+
stage: providerStage,
|
|
15
|
+
product: providerProduct,
|
|
16
|
+
version: providerVersion,
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.builder = void 0;
|
|
4
|
+
const hasReferrerData = (referrer) => Boolean(referrer.pageId || referrer.url || referrer.pageType);
|
|
5
|
+
const builder = (referrer) => {
|
|
6
|
+
if (!hasReferrerData(referrer)) {
|
|
7
|
+
return {
|
|
8
|
+
page: {},
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
page: {
|
|
13
|
+
referrer,
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
exports.builder = builder;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.readSession = exports.readAndParse = exports.builder = void 0;
|
|
4
|
-
const pulse_utils_1 = require("@schibsted/pulse-utils");
|
|
5
4
|
const uuid_1 = require("uuid");
|
|
6
|
-
const
|
|
5
|
+
const utils_1 = require("../../utils");
|
|
6
|
+
const { USE_LOCALSTORAGE } = utils_1.cookieConfig;
|
|
7
7
|
const SESSION_STORAGE_KEY = '_pulsesession';
|
|
8
|
+
const generateSessionSDRN = (sessionId) => `${utils_1.SESSION_SDRN_PREFIX}${sessionId}`;
|
|
8
9
|
// 1. there are pros and cons to outputting { session: ISession } instead of just ISession
|
|
9
10
|
// this allows us to always have the session builde populate the same property (in this case '.session')
|
|
10
11
|
// if in the future we want the session builder to populate other properties, we should just output ISession and move the mapping logic in index.ts, as part of buildersByEventType
|
|
@@ -20,25 +21,16 @@ const builder = (createdAt) => {
|
|
|
20
21
|
isFirstEvent,
|
|
21
22
|
sessionId,
|
|
22
23
|
startTime,
|
|
23
|
-
xDomainId: getXDomainId(),
|
|
24
|
+
xDomainId: (0, utils_1.getXDomainId)(),
|
|
24
25
|
},
|
|
25
26
|
};
|
|
26
27
|
};
|
|
27
28
|
exports.builder = builder;
|
|
28
|
-
// TODO: do we need to save this in the session, as part of the localStorage?
|
|
29
|
-
// or should we just read it from the URL params every time?
|
|
30
|
-
const getXDomainId = () => {
|
|
31
|
-
if (!pulse_utils_1.isBrowser) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
const urlParams = new URLSearchParams(window?.location?.search ?? '');
|
|
35
|
-
return urlParams.get('x_domain_id') || undefined;
|
|
36
|
-
};
|
|
37
29
|
// Return parsed json from cookie (or localStorage if enabled), or undefined.
|
|
38
30
|
// exported for testing purposes.
|
|
39
31
|
const readAndParse = (storageKey) => {
|
|
40
32
|
try {
|
|
41
|
-
const storedSession = (0,
|
|
33
|
+
const storedSession = (0, utils_1.readCookie)(storageKey);
|
|
42
34
|
if (storedSession) {
|
|
43
35
|
return JSON.parse(storedSession);
|
|
44
36
|
}
|
|
@@ -65,7 +57,14 @@ const readSession = () => {
|
|
|
65
57
|
lastEventTime &&
|
|
66
58
|
!Number.isNaN(startTime.getTime()) &&
|
|
67
59
|
!Number.isNaN(lastEventTime.getTime())) {
|
|
68
|
-
return {
|
|
60
|
+
return {
|
|
61
|
+
// to ensure backwards compatibility between the new TPaaS sessionId format and old sessions
|
|
62
|
+
// we need to remove the SDRN prefix from old sessionIds before using it
|
|
63
|
+
sessionId: sessionId.replace(utils_1.SESSION_SDRN_PREFIX, ''),
|
|
64
|
+
startTime: startTime.toISOString(),
|
|
65
|
+
lastEventTime,
|
|
66
|
+
isFirstEvent: false,
|
|
67
|
+
};
|
|
69
68
|
}
|
|
70
69
|
}
|
|
71
70
|
return undefined;
|
|
@@ -74,15 +73,22 @@ exports.readSession = readSession;
|
|
|
74
73
|
// Write session data to localStorage
|
|
75
74
|
const writeSession = (session) => {
|
|
76
75
|
const { sessionId, startTime, lastEventTime } = session;
|
|
76
|
+
// SDK v8 (supporting TPaaS events) needs to be compatible with legacy events AND older SDK versions
|
|
77
|
+
// as a result, we can't store just the sessionId, we need the full SDRN in there
|
|
78
|
+
const sessionSdrn = generateSessionSDRN(sessionId);
|
|
77
79
|
try {
|
|
78
|
-
const sessionToStore = [
|
|
80
|
+
const sessionToStore = [
|
|
81
|
+
sessionSdrn,
|
|
82
|
+
new Date(startTime).getTime(),
|
|
83
|
+
lastEventTime.getTime(),
|
|
84
|
+
];
|
|
79
85
|
const halfHourInDays = 1.0 / (24 * 2);
|
|
80
|
-
(0,
|
|
86
|
+
(0, utils_1.writeCookie)(SESSION_STORAGE_KEY, JSON.stringify(sessionToStore), (0, utils_1.getRootDomain)(), halfHourInDays);
|
|
81
87
|
// Delete old localStorage-based session if needed
|
|
82
88
|
if (!USE_LOCALSTORAGE) {
|
|
83
89
|
// removeItem will do nothing to a non-existing item.
|
|
84
90
|
// use webApi.localStorage instead of window.localStorage
|
|
85
|
-
|
|
91
|
+
utils_1.webApi.localStorage?.removeItem(SESSION_STORAGE_KEY);
|
|
86
92
|
}
|
|
87
93
|
}
|
|
88
94
|
catch (_e) {
|
|
@@ -105,9 +111,6 @@ const updateSession = (eventCreationDate, session) => {
|
|
|
105
111
|
}
|
|
106
112
|
return {
|
|
107
113
|
...session,
|
|
108
|
-
// to ensure backwards compatibility between the new sessionId format and old sessions
|
|
109
|
-
// we need to remove the SDRN prefix from old sessionIds
|
|
110
|
-
sessionId: session.sessionId.replace('sdrn:schibsted:session:', ''),
|
|
111
114
|
isFirstEvent: false,
|
|
112
115
|
lastEventTime: eventCreationDate,
|
|
113
116
|
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.builder = void 0;
|
|
4
|
-
const builder = (
|
|
4
|
+
const builder = ({ isHybrid, routingStage, version, }) => {
|
|
5
5
|
return {
|
|
6
6
|
tracker: {
|
|
7
|
-
autoTrackerVersion,
|
|
8
|
-
isAutoTracker: !!autoTrackerVersion,
|
|
9
7
|
isHybrid,
|
|
8
|
+
routingStage,
|
|
10
9
|
trackerType: 'JS',
|
|
11
10
|
version,
|
|
12
11
|
},
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.builder = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const tpaas_schemas_1 = require("../../tpaas-schemas");
|
|
5
|
+
const utils_1 = require("../../utils");
|
|
6
6
|
const builder = () => {
|
|
7
|
-
if (!
|
|
7
|
+
if (!utils_1.isBrowser) {
|
|
8
8
|
return {
|
|
9
9
|
page: {},
|
|
10
10
|
};
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCommonBuildersOutput = void 0;
|
|
4
|
+
exports.buildAnonymousViewUIElementEvent = buildAnonymousViewUIElementEvent;
|
|
5
|
+
exports.buildViewArticleEvent = buildViewArticleEvent;
|
|
6
|
+
exports.buildViewAudioPageEvent = buildViewAudioPageEvent;
|
|
7
|
+
exports.buildViewErrorEvent = buildViewErrorEvent;
|
|
8
|
+
exports.buildViewFrontpageEvent = buildViewFrontpageEvent;
|
|
9
|
+
exports.buildViewLandingpageEvent = buildViewLandingpageEvent;
|
|
10
|
+
exports.buildViewListingEvent = buildViewListingEvent;
|
|
11
|
+
exports.buildViewLockedArticleEvent = buildViewLockedArticleEvent;
|
|
12
|
+
exports.buildViewLockedAudioPageEvent = buildViewLockedAudioPageEvent;
|
|
13
|
+
exports.buildViewLockedPageEvent = buildViewLockedPageEvent;
|
|
14
|
+
exports.buildViewLockedVideoPageEvent = buildViewLockedVideoPageEvent;
|
|
15
|
+
exports.buildLeaveLockedVideoPageEvent = buildLeaveLockedVideoPageEvent;
|
|
16
|
+
exports.buildViewPageEvent = buildViewPageEvent;
|
|
17
|
+
exports.buildViewSportsPageEvent = buildViewSportsPageEvent;
|
|
18
|
+
exports.buildViewSchoolPageEvent = buildViewSchoolPageEvent;
|
|
19
|
+
exports.buildViewTitleEvent = buildViewTitleEvent;
|
|
20
|
+
exports.buildViewVideoPageEvent = buildViewVideoPageEvent;
|
|
21
|
+
exports.buildViewWeatherEvent = buildViewWeatherEvent;
|
|
22
|
+
exports.buildLeaveArticleEvent = buildLeaveArticleEvent;
|
|
23
|
+
exports.buildLeaveAudioPageEvent = buildLeaveAudioPageEvent;
|
|
24
|
+
exports.buildLeaveErrorEvent = buildLeaveErrorEvent;
|
|
25
|
+
exports.buildLeaveFrontpageEvent = buildLeaveFrontpageEvent;
|
|
26
|
+
exports.buildLeaveLandingpageEvent = buildLeaveLandingpageEvent;
|
|
27
|
+
exports.buildLeaveListingEvent = buildLeaveListingEvent;
|
|
28
|
+
exports.buildLeaveLockedArticleEvent = buildLeaveLockedArticleEvent;
|
|
29
|
+
exports.buildLeaveLockedAudioPageEvent = buildLeaveLockedAudioPageEvent;
|
|
30
|
+
exports.buildLeaveLockedPageEvent = buildLeaveLockedPageEvent;
|
|
31
|
+
exports.buildLeavePageEvent = buildLeavePageEvent;
|
|
32
|
+
exports.buildLeaveSportsPageEvent = buildLeaveSportsPageEvent;
|
|
33
|
+
exports.buildLeaveSchoolPageEvent = buildLeaveSchoolPageEvent;
|
|
34
|
+
exports.buildLeaveVideoPageEvent = buildLeaveVideoPageEvent;
|
|
35
|
+
exports.buildLeaveWeatherEvent = buildLeaveWeatherEvent;
|
|
36
|
+
exports.buildEngagementAdEvent = buildEngagementAdEvent;
|
|
37
|
+
exports.buildEngagementAffiliateEvent = buildEngagementAffiliateEvent;
|
|
38
|
+
exports.buildEngagementAudioEvent = buildEngagementAudioEvent;
|
|
39
|
+
exports.buildEngagementFormEvent = buildEngagementFormEvent;
|
|
40
|
+
exports.buildEngagementOfferEvent = buildEngagementOfferEvent;
|
|
41
|
+
exports.buildEngagementSportsUIElementEvent = buildEngagementSportsUIElementEvent;
|
|
42
|
+
exports.buildEngagementSchoolUIElementEvent = buildEngagementSchoolUIElementEvent;
|
|
43
|
+
exports.buildEngagementTeaserEvent = buildEngagementTeaserEvent;
|
|
44
|
+
exports.buildEngagementTvModuleEvent = buildEngagementTvModuleEvent;
|
|
45
|
+
exports.buildEngagementTvSearchEvent = buildEngagementTvSearchEvent;
|
|
46
|
+
exports.buildEngagementUIElementEvent = buildEngagementUIElementEvent;
|
|
47
|
+
exports.buildEngagementVideoEvent = buildEngagementVideoEvent;
|
|
48
|
+
exports.buildEngagementVideoAdEvent = buildEngagementVideoAdEvent;
|
|
49
|
+
exports.buildEngagementWidgetEvent = buildEngagementWidgetEvent;
|
|
50
|
+
exports.buildHeartbeatCommercialArticleEvent = buildHeartbeatCommercialArticleEvent;
|
|
51
|
+
exports.buildCompletedHealthActionEvent = buildCompletedHealthActionEvent;
|
|
52
|
+
exports.buildEngagementHealthUIElementEvent = buildEngagementHealthUIElementEvent;
|
|
53
|
+
exports.buildViewHealthPageEvent = buildViewHealthPageEvent;
|
|
54
|
+
exports.buildImpressionHealthUIElementEvent = buildImpressionHealthUIElementEvent;
|
|
55
|
+
exports.buildImpressionAdEvent = buildImpressionAdEvent;
|
|
56
|
+
exports.buildImpressionAdSlotEvent = buildImpressionAdSlotEvent;
|
|
57
|
+
exports.buildImpressionAffiliateEvent = buildImpressionAffiliateEvent;
|
|
58
|
+
exports.buildImpressionFormEvent = buildImpressionFormEvent;
|
|
59
|
+
exports.buildImpressionOfferEvent = buildImpressionOfferEvent;
|
|
60
|
+
exports.buildImpressionPlayerEvent = buildImpressionPlayerEvent;
|
|
61
|
+
exports.buildImpressionSportsUIElementEvent = buildImpressionSportsUIElementEvent;
|
|
62
|
+
exports.buildImpressionSchoolUIElementEvent = buildImpressionSchoolUIElementEvent;
|
|
63
|
+
exports.buildImpressionTeaserEvent = buildImpressionTeaserEvent;
|
|
64
|
+
exports.buildImpressionUIElementEvent = buildImpressionUIElementEvent;
|
|
65
|
+
exports.buildImpressionWidgetEvent = buildImpressionWidgetEvent;
|
|
66
|
+
exports.buildLoadAdEvent = buildLoadAdEvent;
|
|
67
|
+
exports.buildRequestAdEvent = buildRequestAdEvent;
|
|
68
|
+
const ts_deepmerge_1 = require("ts-deepmerge");
|
|
69
|
+
const tpaas_schemas_1 = require("../tpaas-schemas");
|
|
70
|
+
const anonymous_1 = require("./builders/anonymous");
|
|
71
|
+
const baseEvent_1 = require("./builders/baseEvent");
|
|
72
|
+
const catalogVersion_1 = require("./builders/catalogVersion");
|
|
73
|
+
const consents_1 = require("./builders/consents");
|
|
74
|
+
const device_1 = require("./builders/device");
|
|
75
|
+
const experiments_1 = require("./builders/experiments");
|
|
76
|
+
const navigationType_1 = require("./builders/navigationType");
|
|
77
|
+
const pageContent_1 = require("./builders/pageContent");
|
|
78
|
+
const pageInfo_1 = require("./builders/pageInfo");
|
|
79
|
+
const pageSports_1 = require("./builders/pageSports");
|
|
80
|
+
const pageviewId_1 = require("./builders/pageviewId");
|
|
81
|
+
const provider_1 = require("./builders/provider");
|
|
82
|
+
const referrer_1 = require("./builders/referrer");
|
|
83
|
+
const session_1 = require("./builders/session");
|
|
84
|
+
const time_1 = require("./builders/time");
|
|
85
|
+
const trackerBuilder_1 = require("./builders/trackerBuilder");
|
|
86
|
+
const user_1 = require("./builders/user");
|
|
87
|
+
const utm_1 = require("./builders/utm");
|
|
88
|
+
/**
|
|
89
|
+
* Common builders output to be merged into all events
|
|
90
|
+
* @param createdAt
|
|
91
|
+
* @param dependencies {TpaasEventBuilderDependencies}
|
|
92
|
+
* @private
|
|
93
|
+
*/
|
|
94
|
+
const getCommonBuildersOutput = (createdAt, dependencies, input) => {
|
|
95
|
+
const { isHybrid, version, environmentId, jwe, user, consents, providerId, providerName, providerGroup, providerStage, providerProduct, providerVersion, component, componentVersion, pageviewId, currentPage, currentPageReferrer, routingStage, } = dependencies;
|
|
96
|
+
const { experiments } = input;
|
|
97
|
+
return (0, ts_deepmerge_1.merge)((0, trackerBuilder_1.builder)({ isHybrid, version, routingStage }), (0, time_1.builder)(createdAt), (0, session_1.builder)(createdAt), (0, device_1.builder)(environmentId, jwe), (0, user_1.builder)(user), (0, baseEvent_1.builder)(), (0, consents_1.builder)(consents), (0, provider_1.builder)(providerId, providerStage, providerProduct, providerVersion, component, componentVersion, providerName, providerGroup), (0, pageInfo_1.builder)(currentPage), (0, pageviewId_1.builder)(pageviewId), (0, utm_1.builder)(), (0, referrer_1.builder)(currentPageReferrer), (0, catalogVersion_1.builder)(), (0, experiments_1.builder)(dependencies.experiments, experiments));
|
|
98
|
+
};
|
|
99
|
+
exports.getCommonBuildersOutput = getCommonBuildersOutput;
|
|
100
|
+
const getElementEventBuildersOutput = (createdAt, dependencies, input) => (0, ts_deepmerge_1.merge)((0, exports.getCommonBuildersOutput)(createdAt, dependencies, input), (0, pageContent_1.builder)(dependencies.currentPageContent));
|
|
101
|
+
const getSportsElementEventBuildersOutput = (createdAt, dependencies, input) => (0, ts_deepmerge_1.merge)(getElementEventBuildersOutput(createdAt, dependencies, input), (0, pageSports_1.builder)(dependencies.currentPageSports));
|
|
102
|
+
// there's a bug in the ts-deepmerge library that doesn't properly resolve merging optionals with required properties
|
|
103
|
+
// due to this, we need to do 2 things:
|
|
104
|
+
// (1) manually omit navigationType from the input before merging.
|
|
105
|
+
// it has no effect on the final value since navigationType will always be set by the navigationTypeBuilder.
|
|
106
|
+
// (2) ensure page is always defined in the input, even when it's not passed to the SDK
|
|
107
|
+
// again, it has no effect on the final value because several builders are passing a page object
|
|
108
|
+
// But this makes TS happy in an elegant way, without type assertions at the merge level
|
|
109
|
+
const normalizePageInput = (input) => {
|
|
110
|
+
const { page, ...rest } = input;
|
|
111
|
+
if (!page) {
|
|
112
|
+
return {
|
|
113
|
+
...rest,
|
|
114
|
+
page: {},
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
if (!('navigationType' in page)) {
|
|
118
|
+
return input;
|
|
119
|
+
}
|
|
120
|
+
const { navigationType: _, ...pageRest } = page;
|
|
121
|
+
return {
|
|
122
|
+
...rest,
|
|
123
|
+
page: {
|
|
124
|
+
...pageRest,
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
// #region AnonymousView Event Builders
|
|
129
|
+
function buildAnonymousViewUIElementEvent(input, dependencies) {
|
|
130
|
+
const createdAt = new Date();
|
|
131
|
+
const { isHybrid, version, pageviewId, providerId, providerName, providerGroup, providerStage, providerProduct, providerVersion, component, componentVersion, currentPageReferrer, routingStage, } = dependencies;
|
|
132
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.AnonymousViewUIElement, (0, baseEvent_1.builder)(), (0, trackerBuilder_1.builder)({ isHybrid, version, routingStage }), (0, time_1.builder)(createdAt), (0, pageviewId_1.builder)(pageviewId), (0, utm_1.builder)(), (0, anonymous_1.builder)(), (0, provider_1.builder)(providerId, providerStage, providerProduct, providerVersion, component, componentVersion, providerName, providerGroup), (0, referrer_1.builder)(currentPageReferrer), (0, experiments_1.builder)(dependencies.experiments, input.experiments), (0, catalogVersion_1.builder)(), normalizePageInput(input));
|
|
133
|
+
}
|
|
134
|
+
// #endregion
|
|
135
|
+
// #region View Event Builders
|
|
136
|
+
function buildViewArticleEvent(input, dependencies) {
|
|
137
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ViewArticle, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
138
|
+
}
|
|
139
|
+
function buildViewAudioPageEvent(input, dependencies) {
|
|
140
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ViewAudioPage, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
141
|
+
}
|
|
142
|
+
function buildViewErrorEvent(input, dependencies) {
|
|
143
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ViewError, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
144
|
+
}
|
|
145
|
+
function buildViewFrontpageEvent(input, dependencies) {
|
|
146
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ViewFrontpage, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
147
|
+
}
|
|
148
|
+
function buildViewLandingpageEvent(input, dependencies) {
|
|
149
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ViewLandingpage, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
150
|
+
}
|
|
151
|
+
function buildViewListingEvent(input, dependencies) {
|
|
152
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ViewListing, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
153
|
+
}
|
|
154
|
+
function buildViewLockedArticleEvent(input, dependencies) {
|
|
155
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ViewLockedArticle, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
156
|
+
}
|
|
157
|
+
function buildViewLockedAudioPageEvent(input, dependencies) {
|
|
158
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ViewLockedAudioPage, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
159
|
+
}
|
|
160
|
+
function buildViewLockedPageEvent(input, dependencies) {
|
|
161
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ViewLockedPage, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
162
|
+
}
|
|
163
|
+
function buildViewLockedVideoPageEvent(input, dependencies) {
|
|
164
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ViewLockedVideoPage, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
165
|
+
}
|
|
166
|
+
function buildLeaveLockedVideoPageEvent(input, dependencies) {
|
|
167
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.LeaveLockedVideoPage, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
168
|
+
}
|
|
169
|
+
function buildViewPageEvent(input, dependencies) {
|
|
170
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ViewPage, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
171
|
+
}
|
|
172
|
+
function buildViewSportsPageEvent(input, dependencies) {
|
|
173
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ViewSportsPage, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
174
|
+
}
|
|
175
|
+
function buildViewSchoolPageEvent(input, dependencies) {
|
|
176
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ViewSchoolPage, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
177
|
+
}
|
|
178
|
+
function buildViewTitleEvent(input, dependencies) {
|
|
179
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ViewTitle, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
180
|
+
}
|
|
181
|
+
function buildViewVideoPageEvent(input, dependencies) {
|
|
182
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ViewVideoPage, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
183
|
+
}
|
|
184
|
+
function buildViewWeatherEvent(input, dependencies) {
|
|
185
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ViewWeather, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
186
|
+
}
|
|
187
|
+
// #endregion
|
|
188
|
+
// #region Leave Event Builders
|
|
189
|
+
function buildLeaveArticleEvent(input, dependencies) {
|
|
190
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.LeaveArticle, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
191
|
+
}
|
|
192
|
+
function buildLeaveAudioPageEvent(input, dependencies) {
|
|
193
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.LeaveAudioPage, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
194
|
+
}
|
|
195
|
+
function buildLeaveErrorEvent(input, dependencies) {
|
|
196
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.LeaveError, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
197
|
+
}
|
|
198
|
+
function buildLeaveFrontpageEvent(input, dependencies) {
|
|
199
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.LeaveFrontpage, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
200
|
+
}
|
|
201
|
+
function buildLeaveLandingpageEvent(input, dependencies) {
|
|
202
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.LeaveLandingpage, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
203
|
+
}
|
|
204
|
+
function buildLeaveListingEvent(input, dependencies) {
|
|
205
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.LeaveListing, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
206
|
+
}
|
|
207
|
+
function buildLeaveLockedArticleEvent(input, dependencies) {
|
|
208
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.LeaveLockedArticle, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
209
|
+
}
|
|
210
|
+
function buildLeaveLockedAudioPageEvent(input, dependencies) {
|
|
211
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.LeaveLockedAudioPage, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
212
|
+
}
|
|
213
|
+
function buildLeaveLockedPageEvent(input, dependencies) {
|
|
214
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.LeaveLockedPage, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
215
|
+
}
|
|
216
|
+
function buildLeavePageEvent(input, dependencies) {
|
|
217
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.LeavePage, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
218
|
+
}
|
|
219
|
+
function buildLeaveSportsPageEvent(input, dependencies) {
|
|
220
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.LeaveSportsPage, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
221
|
+
}
|
|
222
|
+
function buildLeaveSchoolPageEvent(input, dependencies) {
|
|
223
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.LeaveSchoolPage, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
224
|
+
}
|
|
225
|
+
function buildLeaveVideoPageEvent(input, dependencies) {
|
|
226
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.LeaveVideoPage, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
227
|
+
}
|
|
228
|
+
function buildLeaveWeatherEvent(input, dependencies) {
|
|
229
|
+
const createdAt = new Date();
|
|
230
|
+
const { isHybrid, version, providerId, providerName, providerGroup, providerStage, providerProduct, providerVersion, component, componentVersion, user, experiments, routingStage, } = dependencies;
|
|
231
|
+
return (0, ts_deepmerge_1.merge)(normalizePageInput(input), tpaas_schemas_1.LeaveWeather, (0, time_1.builder)(createdAt), (0, trackerBuilder_1.builder)({ isHybrid, version, routingStage }), (0, baseEvent_1.builder)(), (0, provider_1.builder)(providerId, providerStage, providerProduct, providerVersion, component, componentVersion, providerName, providerGroup), (0, user_1.builder)(user), (0, experiments_1.builder)(experiments, input.experiments), (0, consents_1.builder)(dependencies.consents), (0, device_1.builder)(dependencies.environmentId, dependencies.jwe), (0, catalogVersion_1.builder)(), (0, navigationType_1.builder)(input.page?.navigationType), (0, pageviewId_1.builder)(dependencies.pageviewId), (0, pageInfo_1.builder)(dependencies.currentPage), (0, referrer_1.builder)(dependencies.currentPageReferrer));
|
|
232
|
+
}
|
|
233
|
+
// #endregion
|
|
234
|
+
// #region Engagement Event Builders
|
|
235
|
+
function buildEngagementAdEvent(input, dependencies) {
|
|
236
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.EngagementAd, getElementEventBuildersOutput(new Date(), dependencies, input), normalizePageInput(input));
|
|
237
|
+
}
|
|
238
|
+
function buildEngagementAffiliateEvent(input, dependencies) {
|
|
239
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.EngagementAffiliate, getElementEventBuildersOutput(new Date(), dependencies, input), normalizePageInput(input));
|
|
240
|
+
}
|
|
241
|
+
function buildEngagementAudioEvent(input, dependencies) {
|
|
242
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.EngagementAudio, getElementEventBuildersOutput(new Date(), dependencies, input), normalizePageInput(input));
|
|
243
|
+
}
|
|
244
|
+
function buildEngagementFormEvent(input, dependencies) {
|
|
245
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.EngagementForm, getElementEventBuildersOutput(new Date(), dependencies, input), normalizePageInput(input));
|
|
246
|
+
}
|
|
247
|
+
function buildEngagementOfferEvent(input, dependencies) {
|
|
248
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.EngagementOffer, getElementEventBuildersOutput(new Date(), dependencies, input), normalizePageInput(input));
|
|
249
|
+
}
|
|
250
|
+
function buildEngagementSportsUIElementEvent(input, dependencies) {
|
|
251
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.EngagementSportsUIElement, getSportsElementEventBuildersOutput(new Date(), dependencies, input), normalizePageInput(input));
|
|
252
|
+
}
|
|
253
|
+
function buildEngagementSchoolUIElementEvent(input, dependencies) {
|
|
254
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.EngagementSchoolUIElement, getElementEventBuildersOutput(new Date(), dependencies, input), normalizePageInput(input));
|
|
255
|
+
}
|
|
256
|
+
function buildEngagementTeaserEvent(input, dependencies) {
|
|
257
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.EngagementTeaser, getElementEventBuildersOutput(new Date(), dependencies, input), normalizePageInput(input));
|
|
258
|
+
}
|
|
259
|
+
function buildEngagementTvModuleEvent(input, dependencies) {
|
|
260
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.EngagementTvModule, getElementEventBuildersOutput(new Date(), dependencies, input), normalizePageInput(input));
|
|
261
|
+
}
|
|
262
|
+
function buildEngagementTvSearchEvent(input, dependencies) {
|
|
263
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.EngagementTvSearch, getElementEventBuildersOutput(new Date(), dependencies, input), normalizePageInput(input));
|
|
264
|
+
}
|
|
265
|
+
function buildEngagementUIElementEvent(input, dependencies) {
|
|
266
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.EngagementUIElement, getElementEventBuildersOutput(new Date(), dependencies, input), normalizePageInput(input));
|
|
267
|
+
}
|
|
268
|
+
function buildEngagementVideoEvent(input, dependencies) {
|
|
269
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.EngagementVideo, getElementEventBuildersOutput(new Date(), dependencies, input), normalizePageInput(input));
|
|
270
|
+
}
|
|
271
|
+
function buildEngagementVideoAdEvent(input, dependencies) {
|
|
272
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.EngagementVideoAd, getElementEventBuildersOutput(new Date(), dependencies, input), normalizePageInput(input));
|
|
273
|
+
}
|
|
274
|
+
function buildEngagementWidgetEvent(input, dependencies) {
|
|
275
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.EngagementWidget, getElementEventBuildersOutput(new Date(), dependencies, input), normalizePageInput(input));
|
|
276
|
+
}
|
|
277
|
+
// #endregion
|
|
278
|
+
// #region Heartbeat Event Builders
|
|
279
|
+
function buildHeartbeatCommercialArticleEvent(input, dependencies) {
|
|
280
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.HeartbeatCommercialArticle, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
281
|
+
}
|
|
282
|
+
// #endregion
|
|
283
|
+
// #region Health Event Builders
|
|
284
|
+
function buildCompletedHealthActionEvent(input, dependencies) {
|
|
285
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.CompletedHealthAction, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input));
|
|
286
|
+
}
|
|
287
|
+
function buildEngagementHealthUIElementEvent(input, dependencies) {
|
|
288
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.EngagementHealthUIElement, getElementEventBuildersOutput(new Date(), dependencies, input), normalizePageInput(input));
|
|
289
|
+
}
|
|
290
|
+
function buildViewHealthPageEvent(input, dependencies) {
|
|
291
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ViewHealthPage, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input), (0, navigationType_1.builder)(input.page?.navigationType));
|
|
292
|
+
}
|
|
293
|
+
function buildImpressionHealthUIElementEvent(input, dependencies) {
|
|
294
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ImpressionHealthUIElement, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input));
|
|
295
|
+
}
|
|
296
|
+
// #endregion
|
|
297
|
+
// #region Impression Event Builders
|
|
298
|
+
function buildImpressionAdEvent(input, dependencies) {
|
|
299
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ImpressionAd, getElementEventBuildersOutput(new Date(), dependencies, input), normalizePageInput(input));
|
|
300
|
+
}
|
|
301
|
+
function buildImpressionAdSlotEvent(input, dependencies) {
|
|
302
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ImpressionAdSlot, getElementEventBuildersOutput(new Date(), dependencies, input), normalizePageInput(input));
|
|
303
|
+
}
|
|
304
|
+
function buildImpressionAffiliateEvent(input, dependencies) {
|
|
305
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ImpressionAffiliate, getElementEventBuildersOutput(new Date(), dependencies, input), normalizePageInput(input));
|
|
306
|
+
}
|
|
307
|
+
function buildImpressionFormEvent(input, dependencies) {
|
|
308
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ImpressionForm, getElementEventBuildersOutput(new Date(), dependencies, input), normalizePageInput(input));
|
|
309
|
+
}
|
|
310
|
+
function buildImpressionOfferEvent(input, dependencies) {
|
|
311
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ImpressionOffer, getElementEventBuildersOutput(new Date(), dependencies, input), normalizePageInput(input));
|
|
312
|
+
}
|
|
313
|
+
function buildImpressionPlayerEvent(input, dependencies) {
|
|
314
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ImpressionPlayer, getElementEventBuildersOutput(new Date(), dependencies, input), normalizePageInput(input));
|
|
315
|
+
}
|
|
316
|
+
function buildImpressionSportsUIElementEvent(input, dependencies) {
|
|
317
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ImpressionSportsUIElement, getSportsElementEventBuildersOutput(new Date(), dependencies, input), normalizePageInput(input));
|
|
318
|
+
}
|
|
319
|
+
function buildImpressionSchoolUIElementEvent(input, dependencies) {
|
|
320
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ImpressionSchoolUIElement, getElementEventBuildersOutput(new Date(), dependencies, input), normalizePageInput(input));
|
|
321
|
+
}
|
|
322
|
+
function buildImpressionTeaserEvent(input, dependencies) {
|
|
323
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ImpressionTeaser, getElementEventBuildersOutput(new Date(), dependencies, input), normalizePageInput(input));
|
|
324
|
+
}
|
|
325
|
+
function buildImpressionUIElementEvent(input, dependencies) {
|
|
326
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ImpressionUIElement, getElementEventBuildersOutput(new Date(), dependencies, input), normalizePageInput(input));
|
|
327
|
+
}
|
|
328
|
+
function buildImpressionWidgetEvent(input, dependencies) {
|
|
329
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.ImpressionWidget, getElementEventBuildersOutput(new Date(), dependencies, input), normalizePageInput(input));
|
|
330
|
+
}
|
|
331
|
+
// #endregion
|
|
332
|
+
// #region Ad Lifecycle Event Builders
|
|
333
|
+
function buildLoadAdEvent(input, dependencies) {
|
|
334
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.LoadAd, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input));
|
|
335
|
+
}
|
|
336
|
+
function buildRequestAdEvent(input, dependencies) {
|
|
337
|
+
return (0, ts_deepmerge_1.merge)(tpaas_schemas_1.RequestAd, (0, exports.getCommonBuildersOutput)(new Date(), dependencies, input), normalizePageInput(input));
|
|
338
|
+
}
|
|
339
|
+
// #endregion
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isPageType = isPageType;
|
|
4
|
+
const tpaas_schemas_1 = require("../tpaas-schemas");
|
|
5
|
+
function isPageType(pageType) {
|
|
6
|
+
return tpaas_schemas_1.PAGE_TYPE_VALUES.some((val) => val === pageType);
|
|
7
|
+
}
|
package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/index.js
RENAMED
|
@@ -14,4 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.isPageType = void 0;
|
|
17
18
|
__exportStar(require("./builders"), exports);
|
|
19
|
+
var guards_1 = require("./guards");
|
|
20
|
+
Object.defineProperty(exports, "isPageType", { enumerable: true, get: function () { return guards_1.isPageType; } });
|