@mparticle/web-sdk
Advanced tools
Comparing version 2.26.8 to 2.26.9
{ | ||
"name": "@mparticle/web-sdk", | ||
"version": "2.26.8", | ||
"version": "2.26.9", | ||
"description": "mParticle core SDK for web applications", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
@@ -71,5 +71,3 @@ import Types from './types'; | ||
var userAttributesCopy = {}; | ||
var userAttributes = mpInstance._Persistence.getAllUserAttributes( | ||
mpid | ||
); | ||
var userAttributes = mpInstance._Store.getUserAttributes(mpid); | ||
@@ -76,0 +74,0 @@ if (userAttributes) { |
@@ -65,2 +65,6 @@ import { AllUserAttributes, MPID, Product, User } from '@mparticle/web-sdk'; | ||
export interface ISDKUserAttributes { | ||
[key: string]: string | string[] | null; | ||
} | ||
export interface ISDKUserAttributeChangeData { | ||
@@ -67,0 +71,0 @@ UserAttributeName: string; |
import { Context } from '@mparticle/event-models'; | ||
import { | ||
AllUserAttributes, | ||
ConsentState, | ||
IdentityApiData, | ||
@@ -125,3 +124,2 @@ MPID, | ||
getUserIdentities(mpid: MPID): UserIdentities; | ||
getAllUserAttributes(mpid: MPID): AllUserAttributes; | ||
getCartProducts(mpid: MPID): Product[]; | ||
@@ -133,6 +131,2 @@ setCartProducts(allProducts: Product[]): void; | ||
): void; | ||
saveUserAttributesToPersistence( | ||
mpid: MPID, | ||
userAttributes: UserAttributes | ||
): void; | ||
saveUserCookieSyncDatesToPersistence(mpid: MPID, csd: CookieSyncDate): void; | ||
@@ -139,0 +133,0 @@ savePersistence(persistance: IPersistenceMinified): void; |
@@ -895,12 +895,2 @@ import Constants from './constants'; | ||
this.getAllUserAttributes = function(mpid) { | ||
var persistence = self.getPersistence(); | ||
if (persistence && persistence[mpid] && persistence[mpid].ua) { | ||
return persistence[mpid].ua; | ||
} else { | ||
return {}; | ||
} | ||
}; | ||
this.getCartProducts = function(mpid) { | ||
@@ -958,21 +948,2 @@ var allCartProducts, | ||
this.saveUserAttributesToPersistence = function(mpid, userAttributes) { | ||
var persistence = self.getPersistence(); | ||
if (userAttributes) { | ||
if (persistence) { | ||
if (persistence[mpid]) { | ||
// TODO: Investigate why setting this to UI still shows up as UA | ||
// when running `mParticle.getInstance()._Persistence.getLocalStorage()` | ||
// https://go.mparticle.com/work/SQDSDKS-5195 | ||
persistence[mpid].ui = userAttributes; | ||
} else { | ||
persistence[mpid] = { | ||
ui: userAttributes, | ||
}; | ||
} | ||
} | ||
self.savePersistence(persistence); | ||
} | ||
}; | ||
this.saveUserCookieSyncDatesToPersistence = function(mpid, csd) { | ||
@@ -979,0 +950,0 @@ if (csd) { |
@@ -26,2 +26,3 @@ import * as EventsApi from '@mparticle/event-models'; | ||
IdentityCallback, | ||
ISDKUserAttributes, | ||
} from './identity-user-interfaces'; | ||
@@ -38,6 +39,3 @@ import { IIdentityType } from './types.interfaces'; | ||
EventCategory: number; | ||
// https://go.mparticle.com/work/SQDSDKS-5196 | ||
UserAttributes?: { [key: string]: string | string[] | null }; | ||
UserAttributes?: ISDKUserAttributes; | ||
UserIdentities?: ISDKUserIdentity[]; | ||
@@ -44,0 +42,0 @@ SourceMessageId: string; |
@@ -34,3 +34,3 @@ import { Batch, Context } from '@mparticle/event-models'; | ||
import { Kit, MPForwarder } from './forwarders.interfaces'; | ||
import { IdentityCallback } from './identity-user-interfaces'; | ||
import { IdentityCallback, UserAttributes } from './identity-user-interfaces'; | ||
import { | ||
@@ -199,2 +199,4 @@ IGlobalStoreV2MinifiedKeys, | ||
setLastSeenTime?(mpid: MPID, time?: number): void; | ||
getUserAttributes?(mpid: MPID): UserAttributes; | ||
setUserAttributes?(mpid: MPID, attributes: UserAttributes): void; | ||
@@ -622,2 +624,10 @@ addMpidToSessionHistory?(mpid: MPID, previousMpid?: MPID): void; | ||
this.getUserAttributes = (mpid: MPID): UserAttributes => | ||
this._getFromPersistence(mpid, 'ua') || {}; | ||
this.setUserAttributes = ( | ||
mpid: MPID, | ||
userAttributes: UserAttributes | ||
): void => this._setPersistence(mpid, 'ua', userAttributes); | ||
this.addMpidToSessionHistory = (mpid: MPID, previousMPID?: MPID): void => { | ||
@@ -624,0 +634,0 @@ const indexOfMPID = this.currentSessionMPIDs.indexOf(mpid); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1543353
27818