@rudderstack/analytics-js 3.0.0-beta.21 → 3.0.0-beta.23
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/CHANGELOG.md +16 -0
- package/dist/npm/index.d.ts +1 -0
- package/dist/npm/legacy/cjs/index.js +89 -85
- package/dist/npm/legacy/esm/index.js +89 -85
- package/dist/npm/legacy/umd/index.js +89 -85
- package/dist/npm/modern/bundled/cjs/index.js +86 -82
- package/dist/npm/modern/bundled/esm/index.js +86 -82
- package/dist/npm/modern/bundled/umd/index.js +86 -82
- package/dist/npm/modern/cjs/index.js +5 -5
- package/dist/npm/modern/content-script/cjs/index.js +85 -81
- package/dist/npm/modern/content-script/esm/index.js +85 -81
- package/dist/npm/modern/content-script/umd/index.js +85 -81
- package/dist/npm/modern/esm/index.js +5 -5
- package/dist/npm/modern/umd/index.js +5 -5
- package/package.json +2 -1
@@ -419,7 +419,7 @@
|
|
419
419
|
|
420
420
|
const CAPABILITIES_MANAGER='CapabilitiesManager';const CONFIG_MANAGER='ConfigManager';const EVENT_MANAGER='EventManager';const PLUGINS_MANAGER='PluginsManager';const USER_SESSION_MANAGER='UserSessionManager';const ERROR_HANDLER='ErrorHandler';const PLUGIN_ENGINE='PluginEngine';const STORE_MANAGER='StoreManager';const READY_API='readyApi';const EVENT_REPOSITORY='EventRepository';const EXTERNAL_SRC_LOADER='ExternalSrcLoader';const HTTP_CLIENT='HttpClient';const RS_APP='RudderStackApplication';const ANALYTICS_CORE='AnalyticsCore';
|
421
421
|
|
422
|
-
const APP_NAME='RudderLabs JavaScript SDK';const APP_VERSION='3.0.0-beta.
|
422
|
+
const APP_NAME='RudderLabs JavaScript SDK';const APP_VERSION='3.0.0-beta.23';const APP_NAMESPACE='com.rudderlabs.javascript';const MODULE_TYPE='npm';const ADBLOCK_PAGE_CATEGORY='RudderJS-Initiated';const ADBLOCK_PAGE_NAME='ad-block page request';const ADBLOCK_PAGE_PATH='/ad-blocked';const GLOBAL_PRELOAD_BUFFER='preloadedEventsBuffer';const CONSENT_TRACK_EVENT_NAME='Consent Management Interaction';
|
423
423
|
|
424
424
|
const QUERY_PARAM_TRAIT_PREFIX='ajs_trait_';const QUERY_PARAM_PROPERTY_PREFIX='ajs_prop_';const QUERY_PARAM_ANONYMOUS_ID_KEY='ajs_aid';const QUERY_PARAM_USER_ID_KEY='ajs_uid';const QUERY_PARAM_TRACK_EVENT_NAME_KEY='ajs_event';
|
425
425
|
|
@@ -866,160 +866,164 @@
|
|
866
866
|
// the configured resolution strategy
|
867
867
|
const matchPredicate=consent=>allowedConsentIds.includes(consent);switch(resolutionStrategy){case'or':return configuredConsents.some(matchPredicate)||configuredConsents.length===0;case'and':default:return configuredConsents.every(matchPredicate);}}catch(err){errorHandler?.onError(err,CUSTOM_CONSENT_MANAGER_PLUGIN,DESTINATION_CONSENT_STATUS_ERROR$2);return true;}}}});
|
868
868
|
|
869
|
-
const DIR_NAME$
|
869
|
+
const DIR_NAME$1d='AdobeAnalytics';const DISPLAY_NAME$1d='Adobe Analytics';
|
870
870
|
|
871
|
-
const DIR_NAME$
|
871
|
+
const DIR_NAME$1c='Amplitude';const DISPLAY_NAME$1c='Amplitude';
|
872
872
|
|
873
|
-
const DIR_NAME$
|
873
|
+
const DIR_NAME$1b='Appcues';const DISPLAY_NAME$1b='Appcues';
|
874
874
|
|
875
|
-
const DIR_NAME$
|
875
|
+
const DIR_NAME$1a='BingAds';const DISPLAY_NAME$1a='Bing Ads';
|
876
876
|
|
877
|
-
const DIR_NAME$
|
877
|
+
const DIR_NAME$19='Braze';const DISPLAY_NAME$19='Braze';
|
878
878
|
|
879
|
-
const DIR_NAME$
|
879
|
+
const DIR_NAME$18='Bugsnag';const DISPLAY_NAME$18='Bugsnag';
|
880
880
|
|
881
|
-
const DIR_NAME$
|
881
|
+
const DIR_NAME$17='Chartbeat';const DISPLAY_NAME$17='Chartbeat';
|
882
882
|
|
883
|
-
const DIR_NAME$
|
883
|
+
const DIR_NAME$16='Clevertap';const DISPLAY_NAME$16='CleverTap';
|
884
884
|
|
885
|
-
const DIR_NAME$
|
885
|
+
const DIR_NAME$15='Comscore';const DISPLAY_NAME$15='Comscore';
|
886
886
|
|
887
|
-
const DIR_NAME$
|
887
|
+
const DIR_NAME$14='Criteo';const DISPLAY_NAME$14='Criteo';
|
888
888
|
|
889
|
-
const DIR_NAME$
|
889
|
+
const DIR_NAME$13='CustomerIO';const DISPLAY_NAME$13='Customer IO';
|
890
890
|
|
891
|
-
const DIR_NAME$
|
891
|
+
const DIR_NAME$12='Drip';const DISPLAY_NAME$12='Drip';
|
892
892
|
|
893
|
-
const DIR_NAME
|
893
|
+
const DIR_NAME$11='FacebookPixel';const DISPLAY_NAME$11='Facebook Pixel';
|
894
894
|
|
895
|
-
const DIR_NAME$
|
895
|
+
const DIR_NAME$10='Fullstory';const DISPLAY_NAME$10='Fullstory';
|
896
896
|
|
897
|
-
const DIR_NAME
|
897
|
+
const DIR_NAME$$='GA';const DISPLAY_NAME$$='Google Analytics';
|
898
898
|
|
899
|
-
const DIR_NAME$
|
899
|
+
const DIR_NAME$_='GA4';const DISPLAY_NAME$_='Google Analytics 4 (GA4)';
|
900
900
|
|
901
|
-
const DIR_NAME$
|
901
|
+
const DIR_NAME$Z='GoogleAds';const DISPLAY_NAME$Z='Google Ads';
|
902
902
|
|
903
|
-
const DIR_NAME$
|
903
|
+
const DIR_NAME$Y='GoogleOptimize';const DISPLAY_NAME$Y='Google Optimize';
|
904
904
|
|
905
|
-
const DIR_NAME$
|
905
|
+
const DIR_NAME$X='GoogleTagManager';const DISPLAY_NAME$X='Google Tag Manager';
|
906
906
|
|
907
|
-
const DIR_NAME$
|
907
|
+
const DIR_NAME$W='Heap';const DISPLAY_NAME$W='Heap.io';
|
908
908
|
|
909
|
-
const DIR_NAME$
|
909
|
+
const DIR_NAME$V='Hotjar';const DISPLAY_NAME$V='Hotjar';
|
910
910
|
|
911
|
-
const DIR_NAME$
|
911
|
+
const DIR_NAME$U='HubSpot';const DISPLAY_NAME$U='HubSpot';
|
912
912
|
|
913
|
-
const DIR_NAME$
|
913
|
+
const DIR_NAME$T='INTERCOM';const DISPLAY_NAME$T='Intercom';
|
914
914
|
|
915
|
-
const DIR_NAME$
|
915
|
+
const DIR_NAME$S='Keen';const DISPLAY_NAME$S='Keen';
|
916
916
|
|
917
|
-
const DIR_NAME$
|
917
|
+
const DIR_NAME$R='Kissmetrics';const DISPLAY_NAME$R='Kiss Metrics';
|
918
918
|
|
919
|
-
const DIR_NAME$
|
919
|
+
const DIR_NAME$Q='Klaviyo';const DISPLAY_NAME$Q='Klaviyo';
|
920
920
|
|
921
|
-
const DIR_NAME$
|
921
|
+
const DIR_NAME$P='LaunchDarkly';const DISPLAY_NAME$P='LaunchDarkly';
|
922
922
|
|
923
|
-
const DIR_NAME$
|
923
|
+
const DIR_NAME$O='LinkedInInsightTag';const DISPLAY_NAME$O='Linkedin Insight Tag';
|
924
924
|
|
925
|
-
const DIR_NAME$
|
925
|
+
const DIR_NAME$N='Lotame';const DISPLAY_NAME$N='Lotame';
|
926
926
|
|
927
|
-
const DIR_NAME$
|
927
|
+
const DIR_NAME$M='Lytics';const DISPLAY_NAME$M='Lytics';
|
928
928
|
|
929
|
-
const DIR_NAME$
|
929
|
+
const DIR_NAME$L='Mixpanel';const DISPLAY_NAME$L='Mixpanel';
|
930
930
|
|
931
|
-
const DIR_NAME$
|
931
|
+
const DIR_NAME$K='MoEngage';const DISPLAY_NAME$K='MoEngage';
|
932
932
|
|
933
|
-
const DIR_NAME$
|
933
|
+
const DIR_NAME$J='Optimizely';const DISPLAY_NAME$J='Optimizely Web';
|
934
934
|
|
935
|
-
const DIR_NAME$
|
935
|
+
const DIR_NAME$I='Pendo';const DISPLAY_NAME$I='Pendo';
|
936
936
|
|
937
|
-
const DIR_NAME$
|
937
|
+
const DIR_NAME$H='PinterestTag';const DISPLAY_NAME$H='Pinterest Tag';
|
938
938
|
|
939
|
-
const DIR_NAME$
|
939
|
+
const DIR_NAME$G='PostAffiliatePro';const DISPLAY_NAME$G='Post Affiliate Pro';
|
940
940
|
|
941
|
-
const DIR_NAME$
|
941
|
+
const DIR_NAME$F='Posthog';const DISPLAY_NAME$F='PostHog';
|
942
942
|
|
943
|
-
const DIR_NAME$
|
943
|
+
const DIR_NAME$E='ProfitWell';const DISPLAY_NAME$E='ProfitWell';
|
944
944
|
|
945
|
-
const DIR_NAME$
|
945
|
+
const DIR_NAME$D='Qualtrics';const DISPLAY_NAME$D='Qualtrics';
|
946
946
|
|
947
|
-
const DIR_NAME$
|
947
|
+
const DIR_NAME$C='QuantumMetric';const DISPLAY_NAME$C='Quantum Metric';
|
948
948
|
|
949
|
-
const DIR_NAME$
|
949
|
+
const DIR_NAME$B='RedditPixel';const DISPLAY_NAME$B='Reddit Pixel';
|
950
950
|
|
951
|
-
const DIR_NAME$
|
951
|
+
const DIR_NAME$A='Sentry';const DISPLAY_NAME$A='Sentry';
|
952
952
|
|
953
|
-
const DIR_NAME$
|
953
|
+
const DIR_NAME$z='SnapPixel';const DISPLAY_NAME$z='Snap Pixel';
|
954
954
|
|
955
|
-
const DIR_NAME$
|
955
|
+
const DIR_NAME$y='TVSquared';const DISPLAY_NAME$y='TVSquared';
|
956
956
|
|
957
|
-
const DIR_NAME$
|
957
|
+
const DIR_NAME$x='VWO';const DISPLAY_NAME$x='VWO';
|
958
958
|
|
959
|
-
const DIR_NAME$
|
959
|
+
const DIR_NAME$w='GA360';const DISPLAY_NAME$w='Google Analytics 360';
|
960
960
|
|
961
|
-
const DIR_NAME$
|
961
|
+
const DIR_NAME$v='Adroll';const DISPLAY_NAME$v='Adroll';
|
962
962
|
|
963
|
-
const DIR_NAME$
|
963
|
+
const DIR_NAME$u='DCMFloodlight';const DISPLAY_NAME$u='DCM Floodlight';
|
964
964
|
|
965
|
-
const DIR_NAME$
|
965
|
+
const DIR_NAME$t='Matomo';const DISPLAY_NAME$t='Matomo';
|
966
966
|
|
967
|
-
const DIR_NAME$
|
967
|
+
const DIR_NAME$s='Vero';const DISPLAY_NAME$s='Vero';
|
968
968
|
|
969
|
-
const DIR_NAME$
|
969
|
+
const DIR_NAME$r='Mouseflow';const DISPLAY_NAME$r='Mouseflow';
|
970
970
|
|
971
|
-
const DIR_NAME$
|
971
|
+
const DIR_NAME$q='Rockerbox';const DISPLAY_NAME$q='Rockerbox';
|
972
972
|
|
973
|
-
const DIR_NAME$
|
973
|
+
const DIR_NAME$p='ConvertFlow';const DISPLAY_NAME$p='ConvertFlow';
|
974
974
|
|
975
|
-
const DIR_NAME$
|
975
|
+
const DIR_NAME$o='SnapEngage';const DISPLAY_NAME$o='SnapEngage';
|
976
976
|
|
977
|
-
const DIR_NAME$
|
977
|
+
const DIR_NAME$n='LiveChat';const DISPLAY_NAME$n='LiveChat';
|
978
978
|
|
979
|
-
const DIR_NAME$
|
979
|
+
const DIR_NAME$m='Shynet';const DISPLAY_NAME$m='Shynet';
|
980
980
|
|
981
|
-
const DIR_NAME$
|
981
|
+
const DIR_NAME$l='Woopra';const DISPLAY_NAME$l='Woopra';
|
982
982
|
|
983
|
-
const DIR_NAME$
|
983
|
+
const DIR_NAME$k='RollBar';const DISPLAY_NAME$k='RollBar';
|
984
984
|
|
985
|
-
const DIR_NAME$
|
985
|
+
const DIR_NAME$j='QuoraPixel';const DISPLAY_NAME$j='Quora Pixel';
|
986
986
|
|
987
|
-
const DIR_NAME$
|
987
|
+
const DIR_NAME$i='June';const DISPLAY_NAME$i='June';
|
988
988
|
|
989
|
-
const DIR_NAME$
|
989
|
+
const DIR_NAME$h='Engage';const DISPLAY_NAME$h='Engage';
|
990
990
|
|
991
|
-
const DIR_NAME$
|
991
|
+
const DIR_NAME$g='Iterable';const DISPLAY_NAME$g='Iterable';
|
992
992
|
|
993
|
-
const DIR_NAME$
|
993
|
+
const DIR_NAME$f='YandexMetrica';const DISPLAY_NAME$f='Yandex.Metrica';
|
994
994
|
|
995
|
-
const DIR_NAME$
|
995
|
+
const DIR_NAME$e='Refiner';const DISPLAY_NAME$e='Refiner';
|
996
996
|
|
997
|
-
const DIR_NAME$
|
997
|
+
const DIR_NAME$d='Qualaroo';const DISPLAY_NAME$d='Qualaroo';
|
998
998
|
|
999
|
-
const DIR_NAME$
|
999
|
+
const DIR_NAME$c='Podsights';const DISPLAY_NAME$c='Podsights';
|
1000
1000
|
|
1001
|
-
const DIR_NAME$
|
1001
|
+
const DIR_NAME$b='Axeptio';const DISPLAY_NAME$b='Axeptio';
|
1002
1002
|
|
1003
|
-
const DIR_NAME$
|
1003
|
+
const DIR_NAME$a='Satismeter';const DISPLAY_NAME$a='Satismeter';
|
1004
1004
|
|
1005
|
-
const DIR_NAME$
|
1005
|
+
const DIR_NAME$9='MicrosoftClarity';const DISPLAY_NAME$9='Microsoft Clarity';
|
1006
1006
|
|
1007
|
-
const DIR_NAME$
|
1007
|
+
const DIR_NAME$8='Sendinblue';const DISPLAY_NAME$8='Sendinblue';
|
1008
1008
|
|
1009
|
-
const DIR_NAME$
|
1009
|
+
const DIR_NAME$7='Olark';const DISPLAY_NAME$7='Olark';
|
1010
1010
|
|
1011
|
-
const DIR_NAME$
|
1011
|
+
const DIR_NAME$6='Lemnisk';const DISPLAY_NAME$6='Lemnisk';
|
1012
1012
|
|
1013
|
-
const DIR_NAME$
|
1013
|
+
const DIR_NAME$5='TiktokAds';const DISPLAY_NAME$5='TikTok Ads';
|
1014
1014
|
|
1015
|
-
const DIR_NAME$
|
1015
|
+
const DIR_NAME$4='ActiveCampaign';const DISPLAY_NAME$4='Active Campaign';
|
1016
1016
|
|
1017
|
-
const DIR_NAME$
|
1017
|
+
const DIR_NAME$3='Sprig';const DISPLAY_NAME$3='Sprig';
|
1018
1018
|
|
1019
|
-
const DIR_NAME='SpotifyPixel';const DISPLAY_NAME='Spotify Pixel';
|
1019
|
+
const DIR_NAME$2='SpotifyPixel';const DISPLAY_NAME$2='Spotify Pixel';
|
1020
|
+
|
1021
|
+
const DIR_NAME$1='CommandBar';const DISPLAY_NAME$1='CommandBar';
|
1022
|
+
|
1023
|
+
const DIR_NAME='Ninetailed';const DISPLAY_NAME='Ninetailed';
|
1020
1024
|
|
1021
1025
|
// map of the destination display names to the destination directory names
|
1022
|
-
const destDisplayNamesToFileNamesMap={[DISPLAY_NAME$
|
1026
|
+
const destDisplayNamesToFileNamesMap={[DISPLAY_NAME$U]:DIR_NAME$U,[DISPLAY_NAME$$]:DIR_NAME$$,[DISPLAY_NAME$V]:DIR_NAME$V,[DISPLAY_NAME$Z]:DIR_NAME$Z,[DISPLAY_NAME$x]:DIR_NAME$x,[DISPLAY_NAME$X]:DIR_NAME$X,[DISPLAY_NAME$19]:DIR_NAME$19,[DISPLAY_NAME$T]:DIR_NAME$T,[DISPLAY_NAME$S]:DIR_NAME$S,[DISPLAY_NAME$R]:DIR_NAME$R,[DISPLAY_NAME$13]:DIR_NAME$13,[DISPLAY_NAME$17]:DIR_NAME$17,[DISPLAY_NAME$15]:DIR_NAME$15,[DISPLAY_NAME$11]:DIR_NAME$11,[DISPLAY_NAME$N]:DIR_NAME$N,[DISPLAY_NAME$J]:DIR_NAME$J,[DISPLAY_NAME$18]:DIR_NAME$18,[DISPLAY_NAME$10]:DIR_NAME$10,[DISPLAY_NAME$y]:DIR_NAME$y,[DISPLAY_NAME$_]:DIR_NAME$_,[DISPLAY_NAME$K]:DIR_NAME$K,[DISPLAY_NAME$1c]:DIR_NAME$1c,[DISPLAY_NAME$I]:DIR_NAME$I,[DISPLAY_NAME$M]:DIR_NAME$M,[DISPLAY_NAME$1b]:DIR_NAME$1b,[DISPLAY_NAME$F]:DIR_NAME$F,[DISPLAY_NAME$Q]:DIR_NAME$Q,[DISPLAY_NAME$16]:DIR_NAME$16,[DISPLAY_NAME$1a]:DIR_NAME$1a,[DISPLAY_NAME$H]:DIR_NAME$H,[DISPLAY_NAME$1d]:DIR_NAME$1d,[DISPLAY_NAME$O]:DIR_NAME$O,[DISPLAY_NAME$B]:DIR_NAME$B,[DISPLAY_NAME$12]:DIR_NAME$12,[DISPLAY_NAME$W]:DIR_NAME$W,[DISPLAY_NAME$14]:DIR_NAME$14,[DISPLAY_NAME$L]:DIR_NAME$L,[DISPLAY_NAME$D]:DIR_NAME$D,[DISPLAY_NAME$E]:DIR_NAME$E,[DISPLAY_NAME$A]:DIR_NAME$A,[DISPLAY_NAME$C]:DIR_NAME$C,[DISPLAY_NAME$z]:DIR_NAME$z,[DISPLAY_NAME$G]:DIR_NAME$G,[DISPLAY_NAME$Y]:DIR_NAME$Y,[DISPLAY_NAME$P]:DIR_NAME$P,[DISPLAY_NAME$w]:DIR_NAME$w,[DISPLAY_NAME$v]:DIR_NAME$v,[DISPLAY_NAME$u]:DIR_NAME$u,[DISPLAY_NAME$t]:DIR_NAME$t,[DISPLAY_NAME$s]:DIR_NAME$s,[DISPLAY_NAME$r]:DIR_NAME$r,[DISPLAY_NAME$q]:DIR_NAME$q,[DISPLAY_NAME$p]:DIR_NAME$p,[DISPLAY_NAME$o]:DIR_NAME$o,[DISPLAY_NAME$n]:DIR_NAME$n,[DISPLAY_NAME$m]:DIR_NAME$m,[DISPLAY_NAME$l]:DIR_NAME$l,[DISPLAY_NAME$k]:DIR_NAME$k,[DISPLAY_NAME$j]:DIR_NAME$j,[DISPLAY_NAME$i]:DIR_NAME$i,[DISPLAY_NAME$h]:DIR_NAME$h,[DISPLAY_NAME$g]:DIR_NAME$g,[DISPLAY_NAME$f]:DIR_NAME$f,[DISPLAY_NAME$e]:DIR_NAME$e,[DISPLAY_NAME$d]:DIR_NAME$d,[DISPLAY_NAME$c]:DIR_NAME$c,[DISPLAY_NAME$b]:DIR_NAME$b,[DISPLAY_NAME$a]:DIR_NAME$a,[DISPLAY_NAME$9]:DIR_NAME$9,[DISPLAY_NAME$8]:DIR_NAME$8,[DISPLAY_NAME$7]:DIR_NAME$7,[DISPLAY_NAME$6]:DIR_NAME$6,[DISPLAY_NAME$5]:DIR_NAME$5,[DISPLAY_NAME$4]:DIR_NAME$4,[DISPLAY_NAME$3]:DIR_NAME$3,[DISPLAY_NAME$2]:DIR_NAME$2,[DISPLAY_NAME$1]:DIR_NAME$1,[DISPLAY_NAME]:DIR_NAME};
|
1023
1027
|
|
1024
1028
|
const DEFAULT_INTEGRATIONS_CONFIG={All:true};
|
1025
1029
|
|
@@ -2803,7 +2807,7 @@
|
|
2803
2807
|
const TOP_LEVEL_ELEMENTS=['integrations','anonymousId','originalTimestamp'];// Reserved elements in the context of standard RudderStack event spec
|
2804
2808
|
// Typically, these elements are not allowed to be overridden by the user
|
2805
2809
|
const CONTEXT_RESERVED_ELEMENTS=['library','consentManagement','userAgent','ua-ch','screen'];// Reserved elements in the standard RudderStack event spec
|
2806
|
-
const RESERVED_ELEMENTS=['
|
2810
|
+
const RESERVED_ELEMENTS=['id','anonymous_id','user_id','sent_at','timestamp','received_at','original_timestamp','event','event_text','channel','context_ip','context_request_ip','context_passed_ip','group_id','previous_id'];
|
2807
2811
|
|
2808
2812
|
const MIN_SESSION_ID_LENGTH=10;/**
|
2809
2813
|
* A function to validate current session and return true/false depending on that
|
@@ -2948,7 +2952,7 @@
|
|
2948
2952
|
* Initialize User session with values from storage
|
2949
2953
|
*/init(){this.syncStorageDataToState();// Register the effect to sync with storage
|
2950
2954
|
this.registerEffects();}syncStorageDataToState(){this.migrateStorageIfNeeded();this.migrateDataFromPreviousStorage();// get the values from storage and set it again
|
2951
|
-
this.setUserId(this.getUserId());this.setUserTraits(this.getUserTraits());this.setGroupId(this.getGroupId());this.setGroupTraits(this.getGroupTraits());this.setAnonymousId(this.getAnonymousId(
|
2955
|
+
this.setUserId(this.getUserId());this.setUserTraits(this.getUserTraits());this.setGroupId(this.getGroupId());this.setGroupTraits(this.getGroupTraits());const{externalAnonymousIdCookieName,anonymousIdOptions}=state.loadOptions.value;let externalAnonymousId;if(isDefinedAndNotNull(externalAnonymousIdCookieName)&&typeof externalAnonymousIdCookieName==='string'){externalAnonymousId=this.getExternalAnonymousIdByCookieName(externalAnonymousIdCookieName);}this.setAnonymousId(externalAnonymousId??this.getAnonymousId(anonymousIdOptions));this.setAuthToken(this.getAuthToken());this.setInitialReferrerInfo();this.configureSessionTracking();}configureSessionTracking(){let sessionInfo=this.getSessionInfo();if(this.isPersistenceEnabledForStorageEntry('sessionInfo')){const configuredSessionTrackingInfo=this.getConfiguredSessionTrackingInfo();const persistedSessionInfo=this.getSessionInfo()??defaultSessionInfo;sessionInfo={...persistedSessionInfo,...configuredSessionTrackingInfo,autoTrack:configuredSessionTrackingInfo.autoTrack&&persistedSessionInfo.manualTrack!==true};}this.setSessionInfo(sessionInfo);}setInitialReferrerInfo(){const persistedInitialReferrer=this.getInitialReferrer();const persistedInitialReferringDomain=this.getInitialReferringDomain();if(persistedInitialReferrer&&persistedInitialReferringDomain){this.setInitialReferrer(persistedInitialReferrer);this.setInitialReferringDomain(persistedInitialReferringDomain);}else {const initialReferrer=persistedInitialReferrer||getReferrer();this.setInitialReferrer(initialReferrer);this.setInitialReferringDomain(getReferringDomain(initialReferrer));}}isPersistenceEnabledForStorageEntry(entryName){return isStorageTypeValidForStoringData(state.storage.entries.value[entryName]?.type);}migrateDataFromPreviousStorage(){const entries=state.storage.entries.value;const storageTypesForMigration=[COOKIE_STORAGE,LOCAL_STORAGE,SESSION_STORAGE];Object.keys(entries).forEach(entry=>{const key=entry;const currentStorage=entries[key]?.type;const curStore=this.storeManager?.getStore(storageClientDataStoreNameMap[currentStorage]);if(curStore){storageTypesForMigration.forEach(storage=>{const store=this.storeManager?.getStore(storageClientDataStoreNameMap[storage]);if(store&&storage!==currentStorage){const value=store.get(USER_SESSION_STORAGE_KEYS[key]);if(isDefinedNotNullAndNotEmptyString(value)){curStore.set(USER_SESSION_STORAGE_KEYS[key],value);}store.remove(USER_SESSION_STORAGE_KEYS[key]);}});}});}migrateStorageIfNeeded(){if(!state.storage.migrate.value){return;}const persistentStoreNames=[CLIENT_DATA_STORE_COOKIE,CLIENT_DATA_STORE_LS,CLIENT_DATA_STORE_SESSION];const stores=[];persistentStoreNames.forEach(storeName=>{const store=this.storeManager?.getStore(storeName);if(store){stores.push(store);}});Object.keys(USER_SESSION_STORAGE_KEYS).forEach(storageKey=>{const storageEntry=USER_SESSION_STORAGE_KEYS[storageKey];stores.forEach(store=>{const migratedVal=this.pluginsManager?.invokeSingle('storage.migrate',storageEntry,store.engine,this.errorHandler,this.logger);// Skip setting the value if it is null or undefined
|
2952
2956
|
// as those values indicate there is no need for migration or
|
2953
2957
|
// migration failed
|
2954
2958
|
if(!isNullOrUndefined(migratedVal)){store.set(storageEntry,migratedVal);}});});}getConfiguredSessionTrackingInfo(){let autoTrack=state.loadOptions.value.sessions?.autoTrack!==false;// Do not validate any further if autoTrack is disabled
|
@@ -2977,7 +2981,7 @@
|
|
2977
2981
|
* @returns anonymousId
|
2978
2982
|
*/getAnonymousId(options){const storage=state.storage.entries.value.anonymousId?.type;// fetch the anonymousId from storage
|
2979
2983
|
if(isStorageTypeValidForStoringData(storage)){let persistedAnonymousId=this.getEntryValue('anonymousId');if(!persistedAnonymousId&&options){// fetch anonymousId from external source
|
2980
|
-
const autoCapturedAnonymousId=this.pluginsManager?.invokeSingle('storage.getAnonymousId',getStorageEngine,options);persistedAnonymousId=autoCapturedAnonymousId;}state.session.anonymousId.value=persistedAnonymousId||generateAnonymousId();}return state.session.anonymousId.value;}getEntryValue(sessionKey){const entries=state.storage.entries.value;const storageType=entries[sessionKey]?.type;if(isStorageTypeValidForStoringData(storageType)){const store=this.storeManager?.getStore(storageClientDataStoreNameMap[storageType]);const storageKey=entries[sessionKey]?.key;return store?.get(storageKey)??null;}return null;}/**
|
2984
|
+
const autoCapturedAnonymousId=this.pluginsManager?.invokeSingle('storage.getAnonymousId',getStorageEngine,options);persistedAnonymousId=autoCapturedAnonymousId;}state.session.anonymousId.value=persistedAnonymousId||generateAnonymousId();}return state.session.anonymousId.value;}getEntryValue(sessionKey){const entries=state.storage.entries.value;const storageType=entries[sessionKey]?.type;if(isStorageTypeValidForStoringData(storageType)){const store=this.storeManager?.getStore(storageClientDataStoreNameMap[storageType]);const storageKey=entries[sessionKey]?.key;return store?.get(storageKey)??null;}return null;}getExternalAnonymousIdByCookieName(key){const storageEngine=getStorageEngine(COOKIE_STORAGE);if(storageEngine?.isEnabled){return storageEngine.getItem(key)??null;}return null;}/**
|
2981
2985
|
* Fetches User Id
|
2982
2986
|
* @returns
|
2983
2987
|
*/getUserId(){return this.getEntryValue('userId');}/**
|
@@ -404,7 +404,7 @@ if(isDefined(payload.groupId)){payload.groupId=tryStringify(payload.groupId);}el
|
|
404
404
|
|
405
405
|
const CAPABILITIES_MANAGER='CapabilitiesManager';const CONFIG_MANAGER='ConfigManager';const EVENT_MANAGER='EventManager';const PLUGINS_MANAGER='PluginsManager';const USER_SESSION_MANAGER='UserSessionManager';const ERROR_HANDLER='ErrorHandler';const PLUGIN_ENGINE='PluginEngine';const STORE_MANAGER='StoreManager';const READY_API='readyApi';const EVENT_REPOSITORY='EventRepository';const EXTERNAL_SRC_LOADER='ExternalSrcLoader';const HTTP_CLIENT='HttpClient';const RS_APP='RudderStackApplication';const ANALYTICS_CORE='AnalyticsCore';
|
406
406
|
|
407
|
-
const APP_NAME='RudderLabs JavaScript SDK';const APP_VERSION='3.0.0-beta.
|
407
|
+
const APP_NAME='RudderLabs JavaScript SDK';const APP_VERSION='3.0.0-beta.23';const APP_NAMESPACE='com.rudderlabs.javascript';const MODULE_TYPE='npm';const ADBLOCK_PAGE_CATEGORY='RudderJS-Initiated';const ADBLOCK_PAGE_NAME='ad-block page request';const ADBLOCK_PAGE_PATH='/ad-blocked';const GLOBAL_PRELOAD_BUFFER='preloadedEventsBuffer';const CONSENT_TRACK_EVENT_NAME='Consent Management Interaction';
|
408
408
|
|
409
409
|
const QUERY_PARAM_TRAIT_PREFIX='ajs_trait_';const QUERY_PARAM_PROPERTY_PREFIX='ajs_prop_';const QUERY_PARAM_ANONYMOUS_ID_KEY='ajs_aid';const QUERY_PARAM_USER_ID_KEY='ajs_uid';const QUERY_PARAM_TRACK_EVENT_NAME_KEY='ajs_event';
|
410
410
|
|
@@ -649,7 +649,7 @@ destination.config.useNativeSDK===true);const isHybridModeDestination=destinatio
|
|
649
649
|
*/const pluginNamesList=['BeaconQueue','Bugsnag','CustomConsentManager','DeviceModeDestinations','DeviceModeTransformation','ErrorReporting','ExternalAnonymousId','GoogleLinker','KetchConsentManager','NativeDestinationQueue','OneTrustConsentManager','StorageEncryption','StorageEncryptionLegacy','StorageMigrator','XhrQueue'];
|
650
650
|
|
651
651
|
const remotesMap = {
|
652
|
-
'rudderAnalyticsRemotePlugins':{url:()=>Promise.resolve(window.RudderStackGlobals && window.RudderStackGlobals.app && window.RudderStackGlobals.app.pluginsCDNPath ? "" + window.RudderStackGlobals.app.pluginsCDNPath + "/rsa-plugins.js" : "https://cdn.rudderlabs.com/3.0.0-beta.
|
652
|
+
'rudderAnalyticsRemotePlugins':{url:()=>Promise.resolve(window.RudderStackGlobals && window.RudderStackGlobals.app && window.RudderStackGlobals.app.pluginsCDNPath ? "" + window.RudderStackGlobals.app.pluginsCDNPath + "/rsa-plugins.js" : "https://cdn.rudderlabs.com/3.0.0-beta.23/modern/plugins/rsa-plugins.js"),format:'esm',from:'vite'}
|
653
653
|
};
|
654
654
|
const loadJS = async (url, fn) => {
|
655
655
|
const resolvedUrl = typeof url === 'function' ? await url() : url;
|
@@ -1254,7 +1254,7 @@ const CHANNEL='web';// These are the top-level elements in the standard RudderSt
|
|
1254
1254
|
const TOP_LEVEL_ELEMENTS=['integrations','anonymousId','originalTimestamp'];// Reserved elements in the context of standard RudderStack event spec
|
1255
1255
|
// Typically, these elements are not allowed to be overridden by the user
|
1256
1256
|
const CONTEXT_RESERVED_ELEMENTS=['library','consentManagement','userAgent','ua-ch','screen'];// Reserved elements in the standard RudderStack event spec
|
1257
|
-
const RESERVED_ELEMENTS=['
|
1257
|
+
const RESERVED_ELEMENTS=['id','anonymous_id','user_id','sent_at','timestamp','received_at','original_timestamp','event','event_text','channel','context_ip','context_request_ip','context_passed_ip','group_id','previous_id'];
|
1258
1258
|
|
1259
1259
|
const MIN_SESSION_ID_LENGTH=10;/**
|
1260
1260
|
* A function to validate current session and return true/false depending on that
|
@@ -1399,7 +1399,7 @@ class UserSessionManager{constructor(errorHandler,logger,pluginsManager,storeMan
|
|
1399
1399
|
* Initialize User session with values from storage
|
1400
1400
|
*/init(){this.syncStorageDataToState();// Register the effect to sync with storage
|
1401
1401
|
this.registerEffects();}syncStorageDataToState(){this.migrateStorageIfNeeded();this.migrateDataFromPreviousStorage();// get the values from storage and set it again
|
1402
|
-
this.setUserId(this.getUserId());this.setUserTraits(this.getUserTraits());this.setGroupId(this.getGroupId());this.setGroupTraits(this.getGroupTraits());this.setAnonymousId(this.getAnonymousId(
|
1402
|
+
this.setUserId(this.getUserId());this.setUserTraits(this.getUserTraits());this.setGroupId(this.getGroupId());this.setGroupTraits(this.getGroupTraits());const{externalAnonymousIdCookieName,anonymousIdOptions}=state.loadOptions.value;let externalAnonymousId;if(isDefinedAndNotNull(externalAnonymousIdCookieName)&&typeof externalAnonymousIdCookieName==='string'){externalAnonymousId=this.getExternalAnonymousIdByCookieName(externalAnonymousIdCookieName);}this.setAnonymousId(externalAnonymousId??this.getAnonymousId(anonymousIdOptions));this.setAuthToken(this.getAuthToken());this.setInitialReferrerInfo();this.configureSessionTracking();}configureSessionTracking(){let sessionInfo=this.getSessionInfo();if(this.isPersistenceEnabledForStorageEntry('sessionInfo')){const configuredSessionTrackingInfo=this.getConfiguredSessionTrackingInfo();const persistedSessionInfo=this.getSessionInfo()??defaultSessionInfo;sessionInfo={...persistedSessionInfo,...configuredSessionTrackingInfo,autoTrack:configuredSessionTrackingInfo.autoTrack&&persistedSessionInfo.manualTrack!==true};}this.setSessionInfo(sessionInfo);}setInitialReferrerInfo(){const persistedInitialReferrer=this.getInitialReferrer();const persistedInitialReferringDomain=this.getInitialReferringDomain();if(persistedInitialReferrer&&persistedInitialReferringDomain){this.setInitialReferrer(persistedInitialReferrer);this.setInitialReferringDomain(persistedInitialReferringDomain);}else {const initialReferrer=persistedInitialReferrer||getReferrer();this.setInitialReferrer(initialReferrer);this.setInitialReferringDomain(getReferringDomain(initialReferrer));}}isPersistenceEnabledForStorageEntry(entryName){return isStorageTypeValidForStoringData(state.storage.entries.value[entryName]?.type);}migrateDataFromPreviousStorage(){const entries=state.storage.entries.value;const storageTypesForMigration=[COOKIE_STORAGE,LOCAL_STORAGE,SESSION_STORAGE];Object.keys(entries).forEach(entry=>{const key=entry;const currentStorage=entries[key]?.type;const curStore=this.storeManager?.getStore(storageClientDataStoreNameMap[currentStorage]);if(curStore){storageTypesForMigration.forEach(storage=>{const store=this.storeManager?.getStore(storageClientDataStoreNameMap[storage]);if(store&&storage!==currentStorage){const value=store.get(USER_SESSION_STORAGE_KEYS[key]);if(isDefinedNotNullAndNotEmptyString(value)){curStore.set(USER_SESSION_STORAGE_KEYS[key],value);}store.remove(USER_SESSION_STORAGE_KEYS[key]);}});}});}migrateStorageIfNeeded(){if(!state.storage.migrate.value){return;}const persistentStoreNames=[CLIENT_DATA_STORE_COOKIE,CLIENT_DATA_STORE_LS,CLIENT_DATA_STORE_SESSION];const stores=[];persistentStoreNames.forEach(storeName=>{const store=this.storeManager?.getStore(storeName);if(store){stores.push(store);}});Object.keys(USER_SESSION_STORAGE_KEYS).forEach(storageKey=>{const storageEntry=USER_SESSION_STORAGE_KEYS[storageKey];stores.forEach(store=>{const migratedVal=this.pluginsManager?.invokeSingle('storage.migrate',storageEntry,store.engine,this.errorHandler,this.logger);// Skip setting the value if it is null or undefined
|
1403
1403
|
// as those values indicate there is no need for migration or
|
1404
1404
|
// migration failed
|
1405
1405
|
if(!isNullOrUndefined(migratedVal)){store.set(storageEntry,migratedVal);}});});}getConfiguredSessionTrackingInfo(){let autoTrack=state.loadOptions.value.sessions?.autoTrack!==false;// Do not validate any further if autoTrack is disabled
|
@@ -1428,7 +1428,7 @@ USER_SESSION_KEYS.forEach(sessionKey=>{O(()=>{this.syncValueToStorage(sessionKey
|
|
1428
1428
|
* @returns anonymousId
|
1429
1429
|
*/getAnonymousId(options){const storage=state.storage.entries.value.anonymousId?.type;// fetch the anonymousId from storage
|
1430
1430
|
if(isStorageTypeValidForStoringData(storage)){let persistedAnonymousId=this.getEntryValue('anonymousId');if(!persistedAnonymousId&&options){// fetch anonymousId from external source
|
1431
|
-
const autoCapturedAnonymousId=this.pluginsManager?.invokeSingle('storage.getAnonymousId',getStorageEngine,options);persistedAnonymousId=autoCapturedAnonymousId;}state.session.anonymousId.value=persistedAnonymousId||generateAnonymousId();}return state.session.anonymousId.value;}getEntryValue(sessionKey){const entries=state.storage.entries.value;const storageType=entries[sessionKey]?.type;if(isStorageTypeValidForStoringData(storageType)){const store=this.storeManager?.getStore(storageClientDataStoreNameMap[storageType]);const storageKey=entries[sessionKey]?.key;return store?.get(storageKey)??null;}return null;}/**
|
1431
|
+
const autoCapturedAnonymousId=this.pluginsManager?.invokeSingle('storage.getAnonymousId',getStorageEngine,options);persistedAnonymousId=autoCapturedAnonymousId;}state.session.anonymousId.value=persistedAnonymousId||generateAnonymousId();}return state.session.anonymousId.value;}getEntryValue(sessionKey){const entries=state.storage.entries.value;const storageType=entries[sessionKey]?.type;if(isStorageTypeValidForStoringData(storageType)){const store=this.storeManager?.getStore(storageClientDataStoreNameMap[storageType]);const storageKey=entries[sessionKey]?.key;return store?.get(storageKey)??null;}return null;}getExternalAnonymousIdByCookieName(key){const storageEngine=getStorageEngine(COOKIE_STORAGE);if(storageEngine?.isEnabled){return storageEngine.getItem(key)??null;}return null;}/**
|
1432
1432
|
* Fetches User Id
|
1433
1433
|
* @returns
|
1434
1434
|
*/getUserId(){return this.getEntryValue('userId');}/**
|
@@ -410,7 +410,7 @@
|
|
410
410
|
|
411
411
|
const CAPABILITIES_MANAGER='CapabilitiesManager';const CONFIG_MANAGER='ConfigManager';const EVENT_MANAGER='EventManager';const PLUGINS_MANAGER='PluginsManager';const USER_SESSION_MANAGER='UserSessionManager';const ERROR_HANDLER='ErrorHandler';const PLUGIN_ENGINE='PluginEngine';const STORE_MANAGER='StoreManager';const READY_API='readyApi';const EVENT_REPOSITORY='EventRepository';const EXTERNAL_SRC_LOADER='ExternalSrcLoader';const HTTP_CLIENT='HttpClient';const RS_APP='RudderStackApplication';const ANALYTICS_CORE='AnalyticsCore';
|
412
412
|
|
413
|
-
const APP_NAME='RudderLabs JavaScript SDK';const APP_VERSION='3.0.0-beta.
|
413
|
+
const APP_NAME='RudderLabs JavaScript SDK';const APP_VERSION='3.0.0-beta.23';const APP_NAMESPACE='com.rudderlabs.javascript';const MODULE_TYPE='npm';const ADBLOCK_PAGE_CATEGORY='RudderJS-Initiated';const ADBLOCK_PAGE_NAME='ad-block page request';const ADBLOCK_PAGE_PATH='/ad-blocked';const GLOBAL_PRELOAD_BUFFER='preloadedEventsBuffer';const CONSENT_TRACK_EVENT_NAME='Consent Management Interaction';
|
414
414
|
|
415
415
|
const QUERY_PARAM_TRAIT_PREFIX='ajs_trait_';const QUERY_PARAM_PROPERTY_PREFIX='ajs_prop_';const QUERY_PARAM_ANONYMOUS_ID_KEY='ajs_aid';const QUERY_PARAM_USER_ID_KEY='ajs_uid';const QUERY_PARAM_TRACK_EVENT_NAME_KEY='ajs_event';
|
416
416
|
|
@@ -655,7 +655,7 @@
|
|
655
655
|
*/const pluginNamesList=['BeaconQueue','Bugsnag','CustomConsentManager','DeviceModeDestinations','DeviceModeTransformation','ErrorReporting','ExternalAnonymousId','GoogleLinker','KetchConsentManager','NativeDestinationQueue','OneTrustConsentManager','StorageEncryption','StorageEncryptionLegacy','StorageMigrator','XhrQueue'];
|
656
656
|
|
657
657
|
const remotesMap = {
|
658
|
-
'rudderAnalyticsRemotePlugins':{url:()=>Promise.resolve(window.RudderStackGlobals && window.RudderStackGlobals.app && window.RudderStackGlobals.app.pluginsCDNPath ? "" + window.RudderStackGlobals.app.pluginsCDNPath + "/rsa-plugins.js" : "https://cdn.rudderlabs.com/3.0.0-beta.
|
658
|
+
'rudderAnalyticsRemotePlugins':{url:()=>Promise.resolve(window.RudderStackGlobals && window.RudderStackGlobals.app && window.RudderStackGlobals.app.pluginsCDNPath ? "" + window.RudderStackGlobals.app.pluginsCDNPath + "/rsa-plugins.js" : "https://cdn.rudderlabs.com/3.0.0-beta.23/modern/plugins/rsa-plugins.js"),format:'esm',from:'vite'}
|
659
659
|
};
|
660
660
|
const loadJS = async (url, fn) => {
|
661
661
|
const resolvedUrl = typeof url === 'function' ? await url() : url;
|
@@ -1260,7 +1260,7 @@
|
|
1260
1260
|
const TOP_LEVEL_ELEMENTS=['integrations','anonymousId','originalTimestamp'];// Reserved elements in the context of standard RudderStack event spec
|
1261
1261
|
// Typically, these elements are not allowed to be overridden by the user
|
1262
1262
|
const CONTEXT_RESERVED_ELEMENTS=['library','consentManagement','userAgent','ua-ch','screen'];// Reserved elements in the standard RudderStack event spec
|
1263
|
-
const RESERVED_ELEMENTS=['
|
1263
|
+
const RESERVED_ELEMENTS=['id','anonymous_id','user_id','sent_at','timestamp','received_at','original_timestamp','event','event_text','channel','context_ip','context_request_ip','context_passed_ip','group_id','previous_id'];
|
1264
1264
|
|
1265
1265
|
const MIN_SESSION_ID_LENGTH=10;/**
|
1266
1266
|
* A function to validate current session and return true/false depending on that
|
@@ -1405,7 +1405,7 @@
|
|
1405
1405
|
* Initialize User session with values from storage
|
1406
1406
|
*/init(){this.syncStorageDataToState();// Register the effect to sync with storage
|
1407
1407
|
this.registerEffects();}syncStorageDataToState(){this.migrateStorageIfNeeded();this.migrateDataFromPreviousStorage();// get the values from storage and set it again
|
1408
|
-
this.setUserId(this.getUserId());this.setUserTraits(this.getUserTraits());this.setGroupId(this.getGroupId());this.setGroupTraits(this.getGroupTraits());this.setAnonymousId(this.getAnonymousId(
|
1408
|
+
this.setUserId(this.getUserId());this.setUserTraits(this.getUserTraits());this.setGroupId(this.getGroupId());this.setGroupTraits(this.getGroupTraits());const{externalAnonymousIdCookieName,anonymousIdOptions}=state.loadOptions.value;let externalAnonymousId;if(isDefinedAndNotNull(externalAnonymousIdCookieName)&&typeof externalAnonymousIdCookieName==='string'){externalAnonymousId=this.getExternalAnonymousIdByCookieName(externalAnonymousIdCookieName);}this.setAnonymousId(externalAnonymousId??this.getAnonymousId(anonymousIdOptions));this.setAuthToken(this.getAuthToken());this.setInitialReferrerInfo();this.configureSessionTracking();}configureSessionTracking(){let sessionInfo=this.getSessionInfo();if(this.isPersistenceEnabledForStorageEntry('sessionInfo')){const configuredSessionTrackingInfo=this.getConfiguredSessionTrackingInfo();const persistedSessionInfo=this.getSessionInfo()??defaultSessionInfo;sessionInfo={...persistedSessionInfo,...configuredSessionTrackingInfo,autoTrack:configuredSessionTrackingInfo.autoTrack&&persistedSessionInfo.manualTrack!==true};}this.setSessionInfo(sessionInfo);}setInitialReferrerInfo(){const persistedInitialReferrer=this.getInitialReferrer();const persistedInitialReferringDomain=this.getInitialReferringDomain();if(persistedInitialReferrer&&persistedInitialReferringDomain){this.setInitialReferrer(persistedInitialReferrer);this.setInitialReferringDomain(persistedInitialReferringDomain);}else {const initialReferrer=persistedInitialReferrer||getReferrer();this.setInitialReferrer(initialReferrer);this.setInitialReferringDomain(getReferringDomain(initialReferrer));}}isPersistenceEnabledForStorageEntry(entryName){return isStorageTypeValidForStoringData(state.storage.entries.value[entryName]?.type);}migrateDataFromPreviousStorage(){const entries=state.storage.entries.value;const storageTypesForMigration=[COOKIE_STORAGE,LOCAL_STORAGE,SESSION_STORAGE];Object.keys(entries).forEach(entry=>{const key=entry;const currentStorage=entries[key]?.type;const curStore=this.storeManager?.getStore(storageClientDataStoreNameMap[currentStorage]);if(curStore){storageTypesForMigration.forEach(storage=>{const store=this.storeManager?.getStore(storageClientDataStoreNameMap[storage]);if(store&&storage!==currentStorage){const value=store.get(USER_SESSION_STORAGE_KEYS[key]);if(isDefinedNotNullAndNotEmptyString(value)){curStore.set(USER_SESSION_STORAGE_KEYS[key],value);}store.remove(USER_SESSION_STORAGE_KEYS[key]);}});}});}migrateStorageIfNeeded(){if(!state.storage.migrate.value){return;}const persistentStoreNames=[CLIENT_DATA_STORE_COOKIE,CLIENT_DATA_STORE_LS,CLIENT_DATA_STORE_SESSION];const stores=[];persistentStoreNames.forEach(storeName=>{const store=this.storeManager?.getStore(storeName);if(store){stores.push(store);}});Object.keys(USER_SESSION_STORAGE_KEYS).forEach(storageKey=>{const storageEntry=USER_SESSION_STORAGE_KEYS[storageKey];stores.forEach(store=>{const migratedVal=this.pluginsManager?.invokeSingle('storage.migrate',storageEntry,store.engine,this.errorHandler,this.logger);// Skip setting the value if it is null or undefined
|
1409
1409
|
// as those values indicate there is no need for migration or
|
1410
1410
|
// migration failed
|
1411
1411
|
if(!isNullOrUndefined(migratedVal)){store.set(storageEntry,migratedVal);}});});}getConfiguredSessionTrackingInfo(){let autoTrack=state.loadOptions.value.sessions?.autoTrack!==false;// Do not validate any further if autoTrack is disabled
|
@@ -1434,7 +1434,7 @@
|
|
1434
1434
|
* @returns anonymousId
|
1435
1435
|
*/getAnonymousId(options){const storage=state.storage.entries.value.anonymousId?.type;// fetch the anonymousId from storage
|
1436
1436
|
if(isStorageTypeValidForStoringData(storage)){let persistedAnonymousId=this.getEntryValue('anonymousId');if(!persistedAnonymousId&&options){// fetch anonymousId from external source
|
1437
|
-
const autoCapturedAnonymousId=this.pluginsManager?.invokeSingle('storage.getAnonymousId',getStorageEngine,options);persistedAnonymousId=autoCapturedAnonymousId;}state.session.anonymousId.value=persistedAnonymousId||generateAnonymousId();}return state.session.anonymousId.value;}getEntryValue(sessionKey){const entries=state.storage.entries.value;const storageType=entries[sessionKey]?.type;if(isStorageTypeValidForStoringData(storageType)){const store=this.storeManager?.getStore(storageClientDataStoreNameMap[storageType]);const storageKey=entries[sessionKey]?.key;return store?.get(storageKey)??null;}return null;}/**
|
1437
|
+
const autoCapturedAnonymousId=this.pluginsManager?.invokeSingle('storage.getAnonymousId',getStorageEngine,options);persistedAnonymousId=autoCapturedAnonymousId;}state.session.anonymousId.value=persistedAnonymousId||generateAnonymousId();}return state.session.anonymousId.value;}getEntryValue(sessionKey){const entries=state.storage.entries.value;const storageType=entries[sessionKey]?.type;if(isStorageTypeValidForStoringData(storageType)){const store=this.storeManager?.getStore(storageClientDataStoreNameMap[storageType]);const storageKey=entries[sessionKey]?.key;return store?.get(storageKey)??null;}return null;}getExternalAnonymousIdByCookieName(key){const storageEngine=getStorageEngine(COOKIE_STORAGE);if(storageEngine?.isEnabled){return storageEngine.getItem(key)??null;}return null;}/**
|
1438
1438
|
* Fetches User Id
|
1439
1439
|
* @returns
|
1440
1440
|
*/getUserId(){return this.getEntryValue('userId');}/**
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@rudderstack/analytics-js",
|
3
|
-
"version": "3.0.0-beta.
|
3
|
+
"version": "3.0.0-beta.23",
|
4
4
|
"description": "RudderStack Javascript SDK",
|
5
5
|
"main": "dist/npm/modern/cjs/index.js",
|
6
6
|
"module": "dist/npm/modern/esm/index.js",
|
@@ -76,6 +76,7 @@
|
|
76
76
|
"check:support:modern": "NODE_ENV=modern npx browserslist --mobile-to-desktop",
|
77
77
|
"check:duplicates": "jscpd src",
|
78
78
|
"check:security": "npm audit --recursive --audit-level=high",
|
79
|
+
"check:pub": "npx publint",
|
79
80
|
"build:modern": "npm run build:browser:modern && npm run build:npm:modern",
|
80
81
|
"package": "npm pack",
|
81
82
|
"release": "npm publish",
|