@schibsted/pulse-sdk 8.0.0-rc.2 → 8.0.0-rc.21
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 +582 -471
- 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 -80
- 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/session/store.js +96 -0
- 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 +50 -72
- 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 -3
- 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/dist/cjs/tpaas-builders/builders/session.js +5 -0
- 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 -9
- package/dist/cjs/tpaas-builders/builders.js +326 -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/dist/cjs/tpaas-context/adapters.js +85 -0
- package/dist/cjs/tpaas-context/browser.js +51 -0
- package/dist/cjs/tpaas-context/index.js +6 -0
- package/dist/cjs/tpaas-context/prepare.js +177 -0
- package/dist/cjs/tpaas-context/session.js +23 -0
- package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/cjs/tpaas-context}/types.js +0 -1
- package/{node_modules/@schibsted/tpaas-schemas/dist/cjs → dist/cjs/tpaas-schemas}/constants.js +189 -158
- 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 -7
- 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 +558 -447
- 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 +5 -77
- 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/session/store.js +90 -0
- 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 +50 -72
- 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 +2 -3
- 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/dist/ejs/tpaas-builders/builders/session.js +1 -0
- 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 +3 -9
- package/dist/ejs/tpaas-builders/builders.js +259 -0
- package/dist/ejs/tpaas-builders/guards.js +4 -0
- package/dist/ejs/tpaas-builders/index.js +2 -0
- package/dist/ejs/tpaas-context/adapters.js +80 -0
- package/dist/ejs/tpaas-context/browser.js +47 -0
- package/dist/ejs/tpaas-context/index.js +1 -0
- package/dist/ejs/tpaas-context/prepare.js +137 -0
- package/dist/ejs/tpaas-context/session.js +19 -0
- package/{node_modules/@schibsted/tpaas-schemas/dist/ejs → dist/ejs/tpaas-schemas}/constants.js +187 -156
- 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 -7
- 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 +198 -93
- 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 -13
- 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/session/store.d.ts +34 -0
- 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 +7 -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 +4 -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 +7 -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 +2 -0
- package/dist/types/tpaas-context/adapters.d.ts +26 -0
- package/dist/types/tpaas-context/browser.d.ts +8 -0
- package/dist/types/tpaas-context/index.d.ts +2 -0
- package/dist/types/tpaas-context/prepare.d.ts +38 -0
- package/dist/types/tpaas-context/session.d.ts +10 -0
- package/dist/types/tpaas-context/types.d.ts +66 -0
- package/dist/types/tpaas-schemas/constants.d.ts +471 -0
- package/dist/types/tpaas-schemas/index.d.ts +5 -0
- package/dist/types/tpaas-schemas/types/ITpaasEvent.d.ts +130 -0
- package/dist/types/tpaas-schemas/types/schemas/IAnonymousImpressionUIElement.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 +213 -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 +133 -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 +238 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementVideoAd.d.ts +147 -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 +96 -0
- package/dist/types/tpaas-schemas/types/schemas/ILoadAd.d.ts +119 -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 +63 -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 +21 -17
- 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/session.js +0 -114
- 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/session.js +0 -108
- 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-context/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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isPlainObject, isString } from '
|
|
1
|
+
import { isPlainObject, isString } from '../utils';
|
|
2
2
|
/**
|
|
3
3
|
* generateActorSDRN
|
|
4
4
|
* Generates a well-formed sdrn for an actor, based on id, realm inputs
|
|
@@ -12,11 +12,11 @@ export function generateActorSDRN(id, realm = '__REALM_NOT_SET__') {
|
|
|
12
12
|
return `sdrn:${realm}:user:${outputId}`;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
|
-
* Type guard to check if the input
|
|
15
|
+
* Type guard to check if the input has an Actor Builder
|
|
16
16
|
* @param input
|
|
17
17
|
* @internal
|
|
18
18
|
*/
|
|
19
|
-
export function
|
|
19
|
+
export function hasActorBuilder(input) {
|
|
20
20
|
// biome-ignore lint/suspicious/noPrototypeBuiltins: Object.hasOwn is not available in ES2020
|
|
21
21
|
return isPlainObject(input) && Object.prototype.hasOwnProperty.call(input, 'actor');
|
|
22
22
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { clearCookieAdvertisingIds } from '
|
|
2
|
-
import { isPromise } from '
|
|
1
|
+
import { clearCookieAdvertisingIds } from '../cis-sync';
|
|
2
|
+
import { isPromise } from '../utils';
|
|
3
3
|
import warnOnce from '../warnOnce';
|
|
4
4
|
import { getFallbackConsents } from './consent-manager';
|
|
5
5
|
/**
|
|
6
|
-
* @enum
|
|
6
|
+
* @enum ConsentsCategory
|
|
7
7
|
*/
|
|
8
8
|
export var ConsentsCategory;
|
|
9
9
|
(function (ConsentsCategory) {
|
|
@@ -12,7 +12,7 @@ export var ConsentsCategory;
|
|
|
12
12
|
ConsentsCategory["CMP_ADVERTISING"] = "CMP_ADVERTISING";
|
|
13
13
|
ConsentsCategory["CMP_PERSONALIZATION"] = "CMP_PERSONALIZATION";
|
|
14
14
|
})(ConsentsCategory || (ConsentsCategory = {}));
|
|
15
|
-
export const ConsentsSourceValues = ['default', 'cmp', 'cache'];
|
|
15
|
+
export const ConsentsSourceValues = ['default', 'cmp', 'cache', 'url'];
|
|
16
16
|
export const ConsentsPurposeCategoryStatusValues = ['accepted', 'rejected', 'unknown'];
|
|
17
17
|
const isLegacyConsentsPurpose = (consentsPurposeCategory) => {
|
|
18
18
|
return !consentsPurposeCategory?.status;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { parsePulseCookies } from '
|
|
2
|
-
import { deviceType, isBrowser, isString } from '
|
|
1
|
+
import { parsePulseCookies } from '../cis-sync';
|
|
2
|
+
import { deviceType, isBrowser, isString } from '../utils';
|
|
3
3
|
import { device } from './device-node';
|
|
4
4
|
export * from './device-node';
|
|
5
5
|
function supportsLocalStorage() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { omit, pulseMerge } from '
|
|
1
|
+
import { omit, pulseMerge } from '../utils';
|
|
2
2
|
import consentsBuilder from './consents';
|
|
3
3
|
import { DEFAULT_SCHEMA_LOCATION } from './events-node';
|
|
4
4
|
import experimentMetadataBuilder, { defaultValue as experimentMetadataDefaultValue } from './experimentMetadata';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { omit, pulseMerge } from '
|
|
1
|
+
import { omit, pulseMerge } from '../utils';
|
|
2
2
|
import actorBuilder, { defaultValue as actorDefaultValue } from './actor';
|
|
3
3
|
import consentsBuilder from './consents';
|
|
4
4
|
import deviceBuilder, { defaultValue as deviceDefaultValue } from './device';
|
|
@@ -22,7 +22,7 @@ function routableEventDefaults(eventInput) {
|
|
|
22
22
|
export function routableEvent({ eventInput, sdkConfig } = {}) {
|
|
23
23
|
return Object.assign({}, eventInput, {
|
|
24
24
|
schema: eventInput?.schema ||
|
|
25
|
-
`http://${sdkConfig?.schemaLocation || DEFAULT_SCHEMA_LOCATION}/events/base-routable-event.json/
|
|
25
|
+
`http://${sdkConfig?.schemaLocation || DEFAULT_SCHEMA_LOCATION}/events/base-routable-event.json/248.json#`,
|
|
26
26
|
provider: providerBuilder(eventInput),
|
|
27
27
|
actor: actorBuilder(eventInput),
|
|
28
28
|
});
|
|
@@ -55,7 +55,7 @@ export function trackerEvent({ eventInput, sdkConfig } = {}) {
|
|
|
55
55
|
'@type': eventInput?.type || 'View',
|
|
56
56
|
pageViewId: pageViewIdInput || pageViewIdSdk,
|
|
57
57
|
schema: eventInput?.schema ||
|
|
58
|
-
`http://${sdkConfig?.schemaLocation || DEFAULT_SCHEMA_LOCATION}/events/tracker-event.json/
|
|
58
|
+
`http://${sdkConfig?.schemaLocation || DEFAULT_SCHEMA_LOCATION}/events/tracker-event.json/361.json`,
|
|
59
59
|
actor: actorBuilder(parentInput),
|
|
60
60
|
consents: consentsBuilder(parentInput),
|
|
61
61
|
experiments: experimentsBuilder(parentInput),
|
|
@@ -73,7 +73,7 @@ trackerEvent.defaults = trackerEventInput;
|
|
|
73
73
|
export function engagementEvent({ eventInput, sdkConfig } = {}) {
|
|
74
74
|
return Object.assign(trackerEvent({ eventInput, sdkConfig }), {
|
|
75
75
|
schema: eventInput?.schema ||
|
|
76
|
-
`http://${sdkConfig?.schemaLocation || DEFAULT_SCHEMA_LOCATION}/events/engagement-event.json/
|
|
76
|
+
`http://${sdkConfig?.schemaLocation || DEFAULT_SCHEMA_LOCATION}/events/engagement-event.json/388.json`,
|
|
77
77
|
'@type': 'Engagement',
|
|
78
78
|
});
|
|
79
79
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isString } from '
|
|
1
|
+
import { isString } from '../utils';
|
|
2
2
|
import { generateObjectSDRN } from './objects/utils';
|
|
3
3
|
// https://schibsted.ghe.com/data-platform/event-formats/blob/master/schema/master/common-definitions.json
|
|
4
4
|
const originIdRegex = /^unknown$|^sdrn:(.*)$/;
|
|
@@ -1,75 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
const { USE_LOCALSTORAGE } = cookieConfig;
|
|
4
|
-
const SESSION_STORAGE_KEY = '_pulsesession';
|
|
5
|
-
const generateSessionSDRN = (sessionId) => `sdrn:schibsted:session:${sessionId}`;
|
|
6
|
-
// Return parsed json from cookie (or localStorage if enabled), or undefined.
|
|
7
|
-
export const readAndParse = (storageKey) => {
|
|
8
|
-
try {
|
|
9
|
-
const storedSession = readCookie(storageKey);
|
|
10
|
-
if (storedSession) {
|
|
11
|
-
return JSON.parse(storedSession);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
catch (_e) {
|
|
15
|
-
// If localStorage/cookie is not available, we treat it as if
|
|
16
|
-
// the value is undefined.
|
|
17
|
-
// If data is unparseable, we also ignore it.
|
|
18
|
-
return undefined;
|
|
19
|
-
}
|
|
20
|
-
return undefined;
|
|
21
|
-
};
|
|
22
|
-
// Read and parse session data from localStorage.
|
|
23
|
-
// Any invalid or unreadable data is ignored.
|
|
24
|
-
export const readSession = () => {
|
|
25
|
-
const storedSession = readAndParse(SESSION_STORAGE_KEY);
|
|
26
|
-
if (storedSession) {
|
|
27
|
-
const [id, startTimeMs, lastEventTimeMs] = storedSession;
|
|
28
|
-
const startTime = new Date(startTimeMs);
|
|
29
|
-
const lastEventTime = new Date(lastEventTimeMs);
|
|
30
|
-
if (id &&
|
|
31
|
-
startTime &&
|
|
32
|
-
lastEventTime &&
|
|
33
|
-
!Number.isNaN(startTime.getTime()) &&
|
|
34
|
-
!Number.isNaN(lastEventTime.getTime())) {
|
|
35
|
-
return { id, startTime, lastEventTime };
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return undefined;
|
|
39
|
-
};
|
|
40
|
-
// Write session data to localStorage
|
|
41
|
-
const writeSession = (session) => {
|
|
42
|
-
const { id, startTime, lastEventTime } = session;
|
|
43
|
-
try {
|
|
44
|
-
const sessionToStore = [id, startTime.getTime(), lastEventTime.getTime()];
|
|
45
|
-
const halfHourInDays = 1.0 / (24 * 2);
|
|
46
|
-
writeCookie(SESSION_STORAGE_KEY, JSON.stringify(sessionToStore), getRootDomain(), halfHourInDays);
|
|
47
|
-
// Delete old localStorage-based session if needed
|
|
48
|
-
if (!USE_LOCALSTORAGE && isBrowser && window.localStorage) {
|
|
49
|
-
// removeItem will do nothing to a non-existing item.
|
|
50
|
-
window.localStorage.removeItem(SESSION_STORAGE_KEY);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
catch (_e) {
|
|
54
|
-
// If we can't write the session, we just move on in life
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
const createSession = (eventCreationDate) => {
|
|
58
|
-
const now = eventCreationDate ?? new Date();
|
|
59
|
-
return {
|
|
60
|
-
id: generateSessionSDRN(uuid()),
|
|
61
|
-
startTime: now,
|
|
62
|
-
lastEventTime: now,
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
const updateSession = (session, eventCreationDate) => {
|
|
66
|
-
const now = eventCreationDate ?? new Date();
|
|
67
|
-
const sessionMaxInterval = 30 * 60 * 1000; // 30 minutes in milliseconds
|
|
68
|
-
if (!session || session.lastEventTime.getTime() < now.getTime() - sessionMaxInterval) {
|
|
69
|
-
return createSession(now);
|
|
70
|
-
}
|
|
71
|
-
return { ...session, lastEventTime: now };
|
|
72
|
-
};
|
|
1
|
+
import { generateSessionSDRN, touchSession } from '../session/store';
|
|
2
|
+
import { getXDomainId } from '../utils';
|
|
73
3
|
export const defaultValue = () => undefined;
|
|
74
4
|
// Add session information to an event
|
|
75
5
|
// {
|
|
@@ -79,12 +9,10 @@ export const defaultValue = () => undefined;
|
|
|
79
9
|
// }
|
|
80
10
|
// }
|
|
81
11
|
export default function session(_input, eventCreationDate) {
|
|
82
|
-
const
|
|
83
|
-
const newSession = updateSession(oldSession, eventCreationDate);
|
|
84
|
-
writeSession(newSession);
|
|
85
|
-
const { id, startTime } = newSession;
|
|
12
|
+
const { sessionId, startTime } = touchSession(eventCreationDate ?? new Date());
|
|
86
13
|
return {
|
|
87
|
-
'@id':
|
|
14
|
+
'@id': generateSessionSDRN(sessionId),
|
|
88
15
|
startTime: startTime.toISOString(),
|
|
16
|
+
xDomainId: getXDomainId(),
|
|
89
17
|
};
|
|
90
18
|
}
|
package/{node_modules/@schibsted/pulse-cis-sync/dist/ejs → dist/ejs/cis-sync}/cis-browser.js
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cookieConfig, readCookie } from '
|
|
1
|
+
import { cookieConfig, readCookie } from '../utils';
|
|
2
2
|
import { CisSyncReason, getSyncState, parsePulseCookies, serializePulseCookie } from './pulse-cookie';
|
|
3
3
|
const { PULSE_COOKIE_KEY } = cookieConfig;
|
|
4
4
|
const CIS_HOST = 'https://cis.schibsted.com';
|
|
@@ -35,9 +35,10 @@ const cisRequestMap = new Map();
|
|
|
35
35
|
*
|
|
36
36
|
* @private
|
|
37
37
|
*/
|
|
38
|
-
async function cisFetch({ cisLocation, clientId, includeAdvertising, resolvedJwe: jwe, trackerType, trackerVersion, userId, vendors, } = {}) {
|
|
38
|
+
async function cisFetch({ adChoicesEnabled, cisLocation, clientId, includeAdvertising, resolvedJwe: jwe, trackerType, trackerVersion, userId, vendors, } = {}) {
|
|
39
39
|
const basePath = cisLocation?.endsWith('/') ? cisLocation.slice(0, -1) : cisLocation;
|
|
40
40
|
const path = `${basePath}${getActorPath(userId)}`;
|
|
41
|
+
const features = adChoicesEnabled === true ? ['COP'] : undefined;
|
|
41
42
|
// Using 'toString' here to make unit test mock comparisons easier
|
|
42
43
|
return fetch(new URL(path).toString(), {
|
|
43
44
|
method: 'POST',
|
|
@@ -45,6 +46,7 @@ async function cisFetch({ cisLocation, clientId, includeAdvertising, resolvedJwe
|
|
|
45
46
|
headers: cisFetchHeaders,
|
|
46
47
|
body: JSON.stringify({
|
|
47
48
|
clientId,
|
|
49
|
+
features,
|
|
48
50
|
includeAdvertising,
|
|
49
51
|
jwe,
|
|
50
52
|
trackerType,
|
|
@@ -55,11 +57,12 @@ async function cisFetch({ cisLocation, clientId, includeAdvertising, resolvedJwe
|
|
|
55
57
|
});
|
|
56
58
|
}
|
|
57
59
|
/** Identify recursively until no `redirectToHost` field */
|
|
58
|
-
async function cisFetchWithRedirect({ cisLocation, clientId, includeAdvertising, resolvedJwe, trackerType, trackerVersion, userId, vendors, }, redirectAttempts = 0) {
|
|
60
|
+
async function cisFetchWithRedirect({ adChoicesEnabled, cisLocation, clientId, includeAdvertising, resolvedJwe, trackerType, trackerVersion, userId, vendors, }, redirectAttempts = 0) {
|
|
59
61
|
if (redirectAttempts > CIS_MAX_REDIRECT_ATTEMPTS) {
|
|
60
62
|
throw new Error('Too many CIS redirects');
|
|
61
63
|
}
|
|
62
64
|
const response = await cisFetch({
|
|
65
|
+
adChoicesEnabled,
|
|
63
66
|
cisLocation,
|
|
64
67
|
clientId,
|
|
65
68
|
includeAdvertising,
|
|
@@ -73,6 +76,7 @@ async function cisFetchWithRedirect({ cisLocation, clientId, includeAdvertising,
|
|
|
73
76
|
if (responseData.redirectToHost) {
|
|
74
77
|
preferredCISHost = responseData.redirectToHost;
|
|
75
78
|
return cisFetchWithRedirect({
|
|
79
|
+
adChoicesEnabled,
|
|
76
80
|
resolvedJwe,
|
|
77
81
|
userId,
|
|
78
82
|
cisLocation: `https://${preferredCISHost}`,
|
|
@@ -121,6 +125,7 @@ forceSync = false, cisLocation, nativeJwe, realm, clientId, trackerType, tracker
|
|
|
121
125
|
userId,
|
|
122
126
|
cisLocation,
|
|
123
127
|
clientId,
|
|
128
|
+
adChoicesEnabled: options?.adChoicesEnabled,
|
|
124
129
|
trackerType,
|
|
125
130
|
trackerVersion,
|
|
126
131
|
includeAdvertising: options?.includeAdvertising,
|
|
@@ -136,6 +141,15 @@ forceSync = false, cisLocation, nativeJwe, realm, clientId, trackerType, tracker
|
|
|
136
141
|
refreshAfterTimestamp,
|
|
137
142
|
includeAdvertising: options?.includeAdvertising,
|
|
138
143
|
};
|
|
144
|
+
/**
|
|
145
|
+
* AdChoices restricts the issuing of PPID.
|
|
146
|
+
* When the user has NOT consented to advertising purpose, and the application runs with AdChoices rules, the sdk
|
|
147
|
+
* cannot delegate or persist the PPID in localStorage.
|
|
148
|
+
* `adChoicesEnabled` must be explicitly set to `true`. No room for truthy values here.
|
|
149
|
+
*/
|
|
150
|
+
if (options?.adChoicesEnabled === true && options?.includeAdvertising !== true) {
|
|
151
|
+
storageData.ppId = {};
|
|
152
|
+
}
|
|
139
153
|
serializePulseCookie(storageData);
|
|
140
154
|
return storageData;
|
|
141
155
|
}
|
|
@@ -200,4 +214,3 @@ export async function syncWithCis(shortUserId, nativeJwe, userServiceLocation, r
|
|
|
200
214
|
}
|
|
201
215
|
return ongoingCISRequest;
|
|
202
216
|
}
|
|
203
|
-
//# sourceMappingURL=cis-browser.js.map
|
package/{node_modules/@schibsted/pulse-cis-sync/dist/ejs → dist/ejs/cis-sync}/pulse-cookie.js
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cookieConfig, getRootDomain, readCookie, writeCookie } from '
|
|
1
|
+
import { cookieConfig, getRootDomain, readCookie, writeCookie } from '../utils';
|
|
2
2
|
import EventEmitter from './eventEmitter';
|
|
3
3
|
import storage from './storage/pulseStorage';
|
|
4
4
|
const { PULSE_COOKIE_KEY, ENV_COOKIE_KEY } = cookieConfig;
|
|
@@ -251,4 +251,3 @@ export function getSyncState(userId, options = {}) {
|
|
|
251
251
|
syncWithCis: false,
|
|
252
252
|
};
|
|
253
253
|
}
|
|
254
|
-
//# sourceMappingURL=pulse-cookie.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as storage from './storage';
|
|
2
|
-
const pulseStorageKeys = {
|
|
2
|
+
export const pulseStorageKeys = {
|
|
3
3
|
PULSE_PPID_STORAGE_KEY: '_pulse.internal.identity.ppid',
|
|
4
4
|
PULSE_CIS_CACHE_STORAGE_KEY: '_pulse.internal.identity.cis',
|
|
5
5
|
};
|
|
6
6
|
const getPPIDsFromStorage = () => {
|
|
7
7
|
try {
|
|
8
8
|
const webStorage = storage.getStorage();
|
|
9
|
-
return JSON.parse(webStorage.getItem(pulseStorageKeys.PULSE_PPID_STORAGE_KEY) ?? '');
|
|
9
|
+
return JSON.parse(webStorage.getItem(pulseStorageKeys.PULSE_PPID_STORAGE_KEY) ?? '{}');
|
|
10
10
|
}
|
|
11
11
|
catch (_err) {
|
|
12
12
|
return {};
|
|
@@ -15,6 +15,15 @@ const getPPIDsFromStorage = () => {
|
|
|
15
15
|
const setPPIDsToStorage = (ppid) => {
|
|
16
16
|
try {
|
|
17
17
|
const webStorage = storage.getStorage();
|
|
18
|
+
/**
|
|
19
|
+
* we maintain the interface consistent with the ppId api, but there is no need to persist an empty object in
|
|
20
|
+
* localStorage. We normalise back when we read the value.
|
|
21
|
+
* @see getPPIDsFromStorage
|
|
22
|
+
*/
|
|
23
|
+
if (Object.keys(ppid).length === 0) {
|
|
24
|
+
webStorage.removeItem(pulseStorageKeys.PULSE_PPID_STORAGE_KEY);
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
18
27
|
webStorage.setItem(pulseStorageKeys.PULSE_PPID_STORAGE_KEY, JSON.stringify(ppid));
|
|
19
28
|
return true;
|
|
20
29
|
}
|
|
@@ -25,7 +34,7 @@ const setPPIDsToStorage = (ppid) => {
|
|
|
25
34
|
const getCisCacheFromStorage = () => {
|
|
26
35
|
try {
|
|
27
36
|
const webStorage = storage.getStorage();
|
|
28
|
-
return JSON.parse(webStorage.getItem(pulseStorageKeys.PULSE_CIS_CACHE_STORAGE_KEY) ?? '');
|
|
37
|
+
return JSON.parse(webStorage.getItem(pulseStorageKeys.PULSE_CIS_CACHE_STORAGE_KEY) ?? '{}');
|
|
29
38
|
}
|
|
30
39
|
catch (_err) {
|
|
31
40
|
return {};
|
|
@@ -47,4 +56,3 @@ export default {
|
|
|
47
56
|
getPPIDsFromStorage,
|
|
48
57
|
setPPIDsToStorage,
|
|
49
58
|
};
|
|
50
|
-
//# sourceMappingURL=pulseStorage.js.map
|
package/{node_modules/@schibsted/pulse-cis-sync/dist/ejs → dist/ejs/cis-sync}/storage/storage.js
RENAMED
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import { isBrowser, webApi } from '
|
|
1
|
+
import { isBrowser, webApi } from '../../utils';
|
|
2
2
|
const getStorage = (storageType = 'localStorage') => {
|
|
3
3
|
const storage = webApi[storageType];
|
|
4
4
|
const getItem = (key) => {
|
|
5
5
|
return isBrowser && storage ? storage.getItem(key) : undefined;
|
|
6
6
|
};
|
|
7
|
+
const removeItem = (key) => {
|
|
8
|
+
if (isBrowser && storage)
|
|
9
|
+
storage.removeItem(key);
|
|
10
|
+
};
|
|
7
11
|
const setItem = (key, value) => {
|
|
8
12
|
if (isBrowser && storage)
|
|
9
13
|
storage.setItem(key, value);
|
|
10
14
|
};
|
|
11
15
|
return {
|
|
12
16
|
getItem,
|
|
17
|
+
removeItem,
|
|
13
18
|
setItem,
|
|
14
19
|
};
|
|
15
20
|
};
|
|
16
21
|
export { getStorage };
|
|
17
|
-
//# sourceMappingURL=storage.js.map
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* It is intended to simplify the creation and management of a singleton Pulse Tracker instance in browser environments.
|
|
5
5
|
* Note that this module should only be used in browser environments, as it relies on the global `window` object.
|
|
6
6
|
*/
|
|
7
|
-
import { isBrowser } from '@schibsted/pulse-utils/';
|
|
8
7
|
import Tracker from './Tracker';
|
|
8
|
+
import { isBrowser } from './utils';
|
|
9
9
|
/**
|
|
10
10
|
* Flags whether the Pulse Tracker creation process has been started.
|
|
11
11
|
*/
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { hasActorBuilder } from '../builders/actor';
|
|
2
|
+
import { evaluateAndFlatten } from '../utils';
|
|
3
3
|
import warnOnce from '../warnOnce';
|
|
4
4
|
/**
|
|
5
5
|
* @internal exported for testing
|
|
6
6
|
*/
|
|
7
|
-
export const WARN_CIS_SYNC_LOGIN_UNDEFINED = '
|
|
8
|
-
' this using tracker.update({ actor: undefined }), otherwise do tracker.update({ actor: somePromise }) with a' +
|
|
9
|
-
' promise that resolves to the login state.';
|
|
7
|
+
export const WARN_CIS_SYNC_LOGIN_UNDEFINED = 'No Actor Builder found in event input or tracker builders. Please provide an Actor Builder to ensure the SDK resolves logged-in and logged-out scenarios correctly.';
|
|
10
8
|
/**
|
|
11
9
|
* Get the actor id (userId) from the current browser. A promise is returned
|
|
12
10
|
* because a call may be made to complete the login process.
|
|
@@ -25,6 +23,19 @@ const getUserId = async (builders) => {
|
|
|
25
23
|
const getActor = async (builders) => {
|
|
26
24
|
return await evaluateActor(builders);
|
|
27
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* Pinpoints the Actor Builder from the Event payload or the available Builders
|
|
28
|
+
* @param eventInput - The event input which may contain an `actor` property
|
|
29
|
+
* @param builders - The builders managed by the SDK.
|
|
30
|
+
*/
|
|
31
|
+
function getActorSource(eventInput = {}, builders = {}) {
|
|
32
|
+
if (hasActorBuilder(eventInput)) {
|
|
33
|
+
return eventInput.actor;
|
|
34
|
+
}
|
|
35
|
+
if (hasActorBuilder(builders)) {
|
|
36
|
+
return builders.actor;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
28
39
|
const userIsLoggedIn = async (builders) => {
|
|
29
40
|
const actor = await getActor(builders);
|
|
30
41
|
return !!actor?.id;
|
|
@@ -36,8 +47,9 @@ const userIsLoggedIn = async (builders) => {
|
|
|
36
47
|
* @private
|
|
37
48
|
*/
|
|
38
49
|
const evaluateActor = async (eventInput = {}, builders = {}) => {
|
|
39
|
-
|
|
40
|
-
|
|
50
|
+
const actorSource = getActorSource(eventInput, builders);
|
|
51
|
+
if (actorSource) {
|
|
52
|
+
const evaluatedActor = await evaluateAndFlatten(actorSource);
|
|
41
53
|
if (evaluatedActor) {
|
|
42
54
|
return evaluatedActor;
|
|
43
55
|
}
|
|
@@ -45,7 +57,7 @@ const evaluateActor = async (eventInput = {}, builders = {}) => {
|
|
|
45
57
|
// We allow an empty actor object, because it is a sign that the application is not setting nor updating Actor correctly.
|
|
46
58
|
// Inferring "id: undefined" as a fallback would mask that bug.
|
|
47
59
|
// Hence, the warning below.
|
|
48
|
-
warnOnce('no-actor-builder
|
|
60
|
+
warnOnce('no-actor-builder', WARN_CIS_SYNC_LOGIN_UNDEFINED);
|
|
49
61
|
return {};
|
|
50
62
|
};
|
|
51
|
-
export {
|
|
63
|
+
export { evaluateActor, getActor, getUserId, userIsLoggedIn };
|
package/dist/ejs/identity/cis.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { clearCookieJweIfStale, resetRefreshAfter, syncWithCis } from '
|
|
1
|
+
import { clearCookieJweIfStale, resetRefreshAfter, syncWithCis } from '../cis-sync';
|
|
2
2
|
import { SDK_VERSION } from '../version';
|
|
3
3
|
import { evaluateActor } from './actor';
|
|
4
4
|
const requireCisSyncCallForAdvertisingIds = () => {
|
|
@@ -40,7 +40,7 @@ const cisSync = async (data, builders, config) => {
|
|
|
40
40
|
// _pulse2data cookie, or just not do the sync.
|
|
41
41
|
//
|
|
42
42
|
const actorPromise = evaluateActor(data, builders);
|
|
43
|
-
const { cisBaseUrl, cisEnabled, includeAdvertising: includeAdvertisingPromise, isHybrid, nativeJwe, providerId, trackerId, vendors, } = config || {};
|
|
43
|
+
const { adChoicesEnabled, cisBaseUrl, cisEnabled, includeAdvertising: includeAdvertisingPromise, isHybrid, nativeJwe, providerId, trackerId, vendors, } = config || {};
|
|
44
44
|
const [includeAdvertising, actor] = await Promise.all([includeAdvertisingPromise, actorPromise]);
|
|
45
45
|
const { id, realm } = actor;
|
|
46
46
|
if (cisEnabled) {
|
|
@@ -48,6 +48,7 @@ const cisSync = async (data, builders, config) => {
|
|
|
48
48
|
return syncWithCis(
|
|
49
49
|
// @ts-expect-error
|
|
50
50
|
id, nativeJwe, cisBaseUrl, realm, providerId, isHybrid ? 'Hybrid' : 'Web', SDK_VERSION, {
|
|
51
|
+
adChoicesEnabled,
|
|
51
52
|
includeAdvertising,
|
|
52
53
|
vendors,
|
|
53
54
|
trackerId,
|
|
@@ -55,4 +56,4 @@ const cisSync = async (data, builders, config) => {
|
|
|
55
56
|
}
|
|
56
57
|
return { doTracking: true };
|
|
57
58
|
};
|
|
58
|
-
export {
|
|
59
|
+
export { cisSync, clearCookieJweIfStale, requireCisSyncCallForAdvertisingIds };
|
package/dist/ejs/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import T from './Tracker';
|
|
2
2
|
export default T;
|
|
3
3
|
export * as EventBuilders from './builders';
|
|
4
|
-
export * from './Tracker';
|
|
5
|
-
export { T as Tracker };
|
|
6
|
-
export * from '@schibsted/tpaas-schemas';
|
|
7
4
|
export { createPulseTracker } from './createPulseTracker';
|
|
8
5
|
export { getPulseTracker } from './getPulseTracker';
|
|
6
|
+
export * from './Tracker';
|
|
9
7
|
export { subscribe, subscribeOnce, subscribeWithState, unsubscribe } from './Tracker';
|
|
8
|
+
export * from './tpaas-schemas';
|
|
9
|
+
/* <-- end of Media Wrapper Types exports */
|
|
10
|
+
export { T as Tracker };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { isBrowser, isFunction, pulseMerge, throttle } from '@schibsted/pulse-utils';
|
|
2
1
|
import * as logger from 'loglevel';
|
|
3
2
|
import { BookmarkKeys } from '../Tracker';
|
|
3
|
+
import { isBrowser, isFunction, pulseMerge, throttle } from '../utils';
|
|
4
4
|
import { DEFAULT_ACTIVITY_DURATION, DEFAULT_LEAVE_EVENT_BUILDER, DEFAULT_PAGE_LEAVE_EVENT, DEFAULT_VIEWED_CONTENT, } from './constants';
|
|
5
5
|
import { BrowserEvents } from './types';
|
|
6
6
|
let pageLeaveListeners = [];
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
export const DEFAULT_ACTIVITY_DURATION = () => ({
|
|
2
|
-
value: 0,
|
|
3
|
-
interval: undefined,
|
|
4
|
-
timeSinceLastActivity: 0,
|
|
5
|
-
});
|
|
6
1
|
export const DEFAULT_PAGE_LEAVE_EVENT = () => ({
|
|
7
2
|
objectViewPercentage: 0,
|
|
8
3
|
maxObjectViewPercentage: 0,
|
|
@@ -11,3 +6,4 @@ export const DEFAULT_PAGE_LEAVE_EVENT = () => ({
|
|
|
11
6
|
pageScrollPosition: 0,
|
|
12
7
|
maxPageScrollPosition: 0,
|
|
13
8
|
});
|
|
9
|
+
export const ACTIVITY_DURATION_LIMIT_MS = 30000;
|