@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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../../../src/storage/storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoB,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAE7E,MAAM,UAAU,GAAG,CAAC,cAA2B,cAAc,EAAE,EAAE;IAC/D,MAAM,OAAO,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;IAEpC,MAAM,OAAO,GAAG,CAAC,GAAW,EAA6B,EAAE;QACzD,OAAO,SAAS,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACjE,CAAC,CAAC;IAEF,MAAM,OAAO,GAAG,CAAC,GAAW,EAAE,KAAa,EAAQ,EAAE;QACnD,IAAI,SAAS,IAAI,OAAO;YAAE,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACxD,CAAC,CAAC;IAEF,OAAO;QACL,OAAO;QACP,OAAO;KACR,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated Advertising Identifiers methods will be removed in the next major version.
|
|
3
|
-
*/
|
|
4
|
-
export type AdvertisingVendor = 'xandr' | 'delta' | 'adform' | (string & {});
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated Advertising Identifiers methods will be removed in the next major version.
|
|
7
|
-
*/
|
|
8
|
-
type PPIDs = {
|
|
9
|
-
ppId1?: string;
|
|
10
|
-
ppId2: string;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated Advertising Identifiers methods will be removed in the next major version.
|
|
14
|
-
*/
|
|
15
|
-
export type PPIDsByVendor = Partial<Record<AdvertisingVendor, PPIDs>>;
|
|
16
|
-
/**
|
|
17
|
-
* @deprecated Advertising Identifiers methods will be removed in the next major version.
|
|
18
|
-
*/
|
|
19
|
-
export type AdvertisingIdentifiers = PPIDsByVendor & {
|
|
20
|
-
xandr?: PPIDs & {
|
|
21
|
-
adId?: string;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Entry point to module on Node.js
|
|
3
|
-
*
|
|
4
|
-
* This **have not been implemented** on Node.js because CIS expects a normal
|
|
5
|
-
* browser environment with cookies.
|
|
6
|
-
*
|
|
7
|
-
* @returns rejected promise
|
|
8
|
-
*/
|
|
9
|
-
import type { PulseStorage } from './storage/pulseStorage';
|
|
10
|
-
export declare function syncWithCis(): Promise<PulseStorage>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
type EventType = 'environmentIdSet' | 'jweSet';
|
|
2
|
-
type EventCallback = (event: string) => void;
|
|
3
|
-
export default class EventEmitter {
|
|
4
|
-
events: {
|
|
5
|
-
[key: string]: unknown[];
|
|
6
|
-
};
|
|
7
|
-
constructor();
|
|
8
|
-
on(event: EventType, callback: EventCallback): void;
|
|
9
|
-
off(event: EventType, callback: EventCallback): void;
|
|
10
|
-
removeListener(event: EventType, callback: EventCallback): void;
|
|
11
|
-
removeAllListeners(): void;
|
|
12
|
-
emit(event: EventType, value: string): void;
|
|
13
|
-
}
|
|
14
|
-
export {};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { syncWithCis } from './cis';
|
|
2
|
-
export { clearCookieAdvertisingIds, clearCookieJweIfStale, eventEmitter, parsePulseCookies, resetRefreshAfter, } from './pulse-cookie';
|
|
3
|
-
export type { PulseCookie, PulseStorage } from './storage/pulseStorage';
|
|
4
|
-
export type { AdvertisingIdentifiers, AdvertisingVendor, PPIDsByVendor } from './types';
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import EventEmitter from './eventEmitter';
|
|
2
|
-
import type { PulseStorage } from './storage/pulseStorage';
|
|
3
|
-
import type { AdvertisingVendor } from './types';
|
|
4
|
-
/**
|
|
5
|
-
* Responsible for subscribing to, and emitting events.
|
|
6
|
-
*/
|
|
7
|
-
export declare const eventEmitter: EventEmitter;
|
|
8
|
-
export declare function cacheOldEnvironmentId(id: string): void;
|
|
9
|
-
export declare function parsePulseCookies(cookie?: string): PulseStorage;
|
|
10
|
-
export declare function serializePulseCookie(input?: PulseStorage): void;
|
|
11
|
-
export declare enum CisSyncReason {
|
|
12
|
-
Initialise = "initialise",
|
|
13
|
-
Login = "login",
|
|
14
|
-
Logout = "logout",
|
|
15
|
-
Refresh = "refresh",
|
|
16
|
-
includeAdvertisingChange = "includeAdvertisingChange"
|
|
17
|
-
}
|
|
18
|
-
export type SyncState = {
|
|
19
|
-
syncWithCis: boolean;
|
|
20
|
-
waitForCis?: boolean;
|
|
21
|
-
syncWithCisReason?: CisSyncReason;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Clears all relevant advertisement identifiers from cookie storage, returning the new storage state
|
|
25
|
-
* @returns {PulseCookie}
|
|
26
|
-
* @deprecated Advertising Identifiers methods will be removed in the next major version.
|
|
27
|
-
*/
|
|
28
|
-
export declare function clearCookieAdvertisingIds(): PulseStorage;
|
|
29
|
-
/**
|
|
30
|
-
* Runs actions related to a new JWE, divergent from the one persisted in the browser storage
|
|
31
|
-
* @param jwe
|
|
32
|
-
*
|
|
33
|
-
* @privateRemarks
|
|
34
|
-
* if there is no jwe, or in other words, no nativeJwe was provided in config, no action will be taken. That's the
|
|
35
|
-
* behaviour with plain Web applications. The scenario not covered here is when we do have a hybrid app, and they don't
|
|
36
|
-
* send any nativeJwe in config.
|
|
37
|
-
* @deprecated Advertising Identifiers methods will be removed in the next major version.
|
|
38
|
-
*/
|
|
39
|
-
export declare function clearCookieJweIfStale(jwe?: string): void;
|
|
40
|
-
/**
|
|
41
|
-
* Runs actions related to a new JWE, divergent from the one persisted in the browser storage
|
|
42
|
-
* @param refreshAfterDateTime
|
|
43
|
-
*/
|
|
44
|
-
export declare function resetRefreshAfter(refreshAfterDateTime?: Date): PulseStorage;
|
|
45
|
-
/**
|
|
46
|
-
* Determines whether CIS should be called to update identity values.
|
|
47
|
-
* @param userId
|
|
48
|
-
* @param options
|
|
49
|
-
* @returns {SyncState}
|
|
50
|
-
*/
|
|
51
|
-
export declare function getSyncState(userId?: string | number, options?: {
|
|
52
|
-
cookie?: string;
|
|
53
|
-
includeAdvertising?: boolean;
|
|
54
|
-
vendors?: AdvertisingVendor[];
|
|
55
|
-
}): SyncState;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated Advertising Identifiers methods will be removed in the next major version.
|
|
3
|
-
*/
|
|
4
|
-
export type AdvertisingVendor = 'xandr' | 'delta' | 'adform' | (string & {});
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated Advertising Identifiers methods will be removed in the next major version.
|
|
7
|
-
*/
|
|
8
|
-
type PPIDs = {
|
|
9
|
-
ppId1?: string;
|
|
10
|
-
ppId2: string;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated Advertising Identifiers methods will be removed in the next major version.
|
|
14
|
-
*/
|
|
15
|
-
export type PPIDsByVendor = Partial<Record<AdvertisingVendor, PPIDs>>;
|
|
16
|
-
/**
|
|
17
|
-
* @deprecated Advertising Identifiers methods will be removed in the next major version.
|
|
18
|
-
*/
|
|
19
|
-
export type AdvertisingIdentifiers = PPIDsByVendor & {
|
|
20
|
-
xandr?: PPIDs & {
|
|
21
|
-
adId?: string;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
export {};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@schibsted/pulse-cis-sync",
|
|
3
|
-
"version": "2.0.18",
|
|
4
|
-
"author": "Schibsted Data&Tech",
|
|
5
|
-
"license": "UNLICENSED",
|
|
6
|
-
"repository": {
|
|
7
|
-
"type": "git",
|
|
8
|
-
"url": "https://schibsted.ghe.com/data-platform/pulse-sdk-js.git",
|
|
9
|
-
"directory": "workspaces/cis-sync"
|
|
10
|
-
},
|
|
11
|
-
"main": "dist/cjs/index.js",
|
|
12
|
-
"module": "dist/ejs/index.js",
|
|
13
|
-
"types": "./dist/types/index.d.ts",
|
|
14
|
-
"browser": {
|
|
15
|
-
"./dist/cjs/cis.js": "./dist/cjs/cis-browser.js",
|
|
16
|
-
"./dist/ejs/cis.js": "./dist/ejs/cis-browser.js"
|
|
17
|
-
},
|
|
18
|
-
"files": [
|
|
19
|
-
"dist"
|
|
20
|
-
],
|
|
21
|
-
"dependencies": {
|
|
22
|
-
"@schibsted/pulse-utils": "workspace:*",
|
|
23
|
-
"loglevel": "1.9.2"
|
|
24
|
-
},
|
|
25
|
-
"devDependencies": {
|
|
26
|
-
"@types/node": "24.10.13",
|
|
27
|
-
"typescript": "5.9.3"
|
|
28
|
-
},
|
|
29
|
-
"bundledDependencies": [
|
|
30
|
-
"@schibsted/pulse-utils"
|
|
31
|
-
],
|
|
32
|
-
"scripts": {
|
|
33
|
-
"build": "pnpm run build:ejs && pnpm run build:cjs && pnpm run build:types",
|
|
34
|
-
"build:clean": "rm -rf dist/",
|
|
35
|
-
"build:ejs": "tsc --project tsconfig.ejs.json",
|
|
36
|
-
"build:cjs": "tsc",
|
|
37
|
-
"build:types": "tsc --project tsconfig.types.json",
|
|
38
|
-
"dev": "tsc --watch",
|
|
39
|
-
"test": "pnpm run test:lint && pnpm run test:unit",
|
|
40
|
-
"test:lint": "biome check",
|
|
41
|
-
"test:lint:fix": "biome check --write",
|
|
42
|
-
"test:unit": "vitest run"
|
|
43
|
-
}
|
|
44
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@schibsted/pulse-utils",
|
|
3
|
-
"version": "1.0.2",
|
|
4
|
-
"description": "Common js utils",
|
|
5
|
-
"author": "Schibsted Data&Tech",
|
|
6
|
-
"license": "UNLICENSED",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "https://schibsted.ghe.com/data-platform/pulse-sdk-js.git",
|
|
10
|
-
"directory": "workspaces/sdk"
|
|
11
|
-
},
|
|
12
|
-
"main": "./dist/cjs/index.js",
|
|
13
|
-
"module": "./dist/ejs/index.js",
|
|
14
|
-
"types": "./dist/types/index.d.ts",
|
|
15
|
-
"files": [
|
|
16
|
-
"dist"
|
|
17
|
-
],
|
|
18
|
-
"scripts": {
|
|
19
|
-
"build": "pnpm run build:cjs && pnpm run build:ejs && pnpm run build:types",
|
|
20
|
-
"build:clean": "rm -fr dist",
|
|
21
|
-
"build:ejs": "tsc --project tsconfig.ejs.json",
|
|
22
|
-
"build:types": "tsc --project tsconfig.types.json",
|
|
23
|
-
"build:cjs": "tsc",
|
|
24
|
-
"dev": "tsc --watch",
|
|
25
|
-
"test": "pnpm run test:lint && pnpm run test:unit",
|
|
26
|
-
"test:lint": "biome check",
|
|
27
|
-
"test:lint:fix": "biome check --write",
|
|
28
|
-
"test:unit": "vitest run"
|
|
29
|
-
},
|
|
30
|
-
"devDependencies": {
|
|
31
|
-
"@types/lodash": "4.17.24",
|
|
32
|
-
"@types/node": "24.10.13",
|
|
33
|
-
"lodash": "4.17.23",
|
|
34
|
-
"typescript": "5.9.3"
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
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) {
|
|
6
|
-
return {
|
|
7
|
-
provider: {
|
|
8
|
-
providerId,
|
|
9
|
-
providerSdrn: generateProviderSDRN(providerId),
|
|
10
|
-
},
|
|
11
|
-
};
|
|
12
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.builder = void 0;
|
|
4
|
-
const pulse_utils_1 = require("@schibsted/pulse-utils");
|
|
5
|
-
const builder = () => {
|
|
6
|
-
if (pulse_utils_1.isBrowser && document.referrer) {
|
|
7
|
-
return {
|
|
8
|
-
page: {
|
|
9
|
-
referrer: {
|
|
10
|
-
url: document.referrer,
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
return {
|
|
16
|
-
page: {},
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
exports.builder = builder;
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.readSession = exports.readAndParse = exports.builder = void 0;
|
|
4
|
-
const pulse_utils_1 = require("@schibsted/pulse-utils");
|
|
5
|
-
const uuid_1 = require("uuid");
|
|
6
|
-
const { USE_LOCALSTORAGE } = pulse_utils_1.cookieConfig;
|
|
7
|
-
const SESSION_STORAGE_KEY = '_pulsesession';
|
|
8
|
-
// 1. there are pros and cons to outputting { session: ISession } instead of just ISession
|
|
9
|
-
// this allows us to always have the session builde populate the same property (in this case '.session')
|
|
10
|
-
// 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
|
|
11
|
-
// 2. we don't need builder-level "isBrowser" checks. If an event is not supposed to be fired from the browser, then the builder shouldn't be assigned to it in buildersByEventType in index.ts
|
|
12
|
-
// however, we should keep minimal "isBrowser" checks before webApi calls because the code might run in SSR environments
|
|
13
|
-
const builder = (createdAt) => {
|
|
14
|
-
const oldSession = (0, exports.readSession)();
|
|
15
|
-
const newSession = updateSession(createdAt, oldSession);
|
|
16
|
-
writeSession(newSession);
|
|
17
|
-
const { sessionId, startTime, isFirstEvent } = newSession;
|
|
18
|
-
return {
|
|
19
|
-
session: {
|
|
20
|
-
isFirstEvent,
|
|
21
|
-
sessionId,
|
|
22
|
-
startTime,
|
|
23
|
-
xDomainId: getXDomainId(),
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
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
|
-
// Return parsed json from cookie (or localStorage if enabled), or undefined.
|
|
38
|
-
// exported for testing purposes.
|
|
39
|
-
const readAndParse = (storageKey) => {
|
|
40
|
-
try {
|
|
41
|
-
const storedSession = (0, pulse_utils_1.readCookie)(storageKey);
|
|
42
|
-
if (storedSession) {
|
|
43
|
-
return JSON.parse(storedSession);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
catch (_e) {
|
|
47
|
-
// If localStorage/cookie is not available, we treat it as if
|
|
48
|
-
// the value is undefined.
|
|
49
|
-
// If data is unparseable, we also ignore it.
|
|
50
|
-
return undefined;
|
|
51
|
-
}
|
|
52
|
-
return undefined;
|
|
53
|
-
};
|
|
54
|
-
exports.readAndParse = readAndParse;
|
|
55
|
-
// Read and parse session data from localStorage.
|
|
56
|
-
// Any invalid or unreadable data is ignored.
|
|
57
|
-
const readSession = () => {
|
|
58
|
-
const storedSession = (0, exports.readAndParse)(SESSION_STORAGE_KEY);
|
|
59
|
-
if (storedSession) {
|
|
60
|
-
const [sessionId, startTimeMs, lastEventTimeMs] = storedSession;
|
|
61
|
-
const startTime = new Date(startTimeMs);
|
|
62
|
-
const lastEventTime = new Date(lastEventTimeMs);
|
|
63
|
-
if (sessionId &&
|
|
64
|
-
startTime &&
|
|
65
|
-
lastEventTime &&
|
|
66
|
-
!Number.isNaN(startTime.getTime()) &&
|
|
67
|
-
!Number.isNaN(lastEventTime.getTime())) {
|
|
68
|
-
return { sessionId, startTime: startTime.toISOString(), lastEventTime, isFirstEvent: false };
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return undefined;
|
|
72
|
-
};
|
|
73
|
-
exports.readSession = readSession;
|
|
74
|
-
// Write session data to localStorage
|
|
75
|
-
const writeSession = (session) => {
|
|
76
|
-
const { sessionId, startTime, lastEventTime } = session;
|
|
77
|
-
try {
|
|
78
|
-
const sessionToStore = [sessionId, new Date(startTime).getTime(), lastEventTime.getTime()];
|
|
79
|
-
const halfHourInDays = 1.0 / (24 * 2);
|
|
80
|
-
(0, pulse_utils_1.writeCookie)(SESSION_STORAGE_KEY, JSON.stringify(sessionToStore), (0, pulse_utils_1.getRootDomain)(), halfHourInDays);
|
|
81
|
-
// Delete old localStorage-based session if needed
|
|
82
|
-
if (!USE_LOCALSTORAGE) {
|
|
83
|
-
// removeItem will do nothing to a non-existing item.
|
|
84
|
-
// use webApi.localStorage instead of window.localStorage
|
|
85
|
-
pulse_utils_1.webApi.localStorage?.removeItem(SESSION_STORAGE_KEY);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
catch (_e) {
|
|
89
|
-
// If we can't write the session, we just move on in life
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
const createSession = (eventCreationDate) => {
|
|
93
|
-
const now = eventCreationDate ?? new Date();
|
|
94
|
-
return {
|
|
95
|
-
sessionId: (0, uuid_1.v4)(),
|
|
96
|
-
startTime: now.toISOString(),
|
|
97
|
-
lastEventTime: now,
|
|
98
|
-
isFirstEvent: true,
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
const updateSession = (eventCreationDate, session) => {
|
|
102
|
-
const sessionMaxInterval = 30 * 60 * 1000; // 30 minutes in milliseconds
|
|
103
|
-
if (!session || session.lastEventTime.getTime() < eventCreationDate.getTime() - sessionMaxInterval) {
|
|
104
|
-
return createSession(eventCreationDate);
|
|
105
|
-
}
|
|
106
|
-
return {
|
|
107
|
-
...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
|
-
isFirstEvent: false,
|
|
112
|
-
lastEventTime: eventCreationDate,
|
|
113
|
-
};
|
|
114
|
-
};
|