@mparticle/web-sdk 2.79.1 → 2.79.3
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/README.md +52 -0
- package/dist/mparticle.common.js +69 -17
- package/dist/mparticle.esm.js +69 -17
- package/dist/mparticle.js +390 -201
- package/dist/types/src/filteredMparticleUser.d.ts +15 -7
- package/dist/types/src/forwardingStatsUploader.d.ts +4 -4
- package/dist/types/src/mp-instance.d.ts +3 -2
- package/dist/types/src/nativeSdkHelpers.d.ts +3 -12
- package/dist/types/src/nativeSdkHelpers.interfaces.d.ts +15 -1
- package/dist/types/src/pageViewTracker.d.ts +28 -11
- package/dist/types/src/sdkRuntimeModels.d.ts +4 -3
- package/dist/types/src/store.d.ts +2 -0
- package/package.json +1 -1
- package/src/filteredMparticleUser.ts +160 -0
- package/src/{forwardingStatsUploader.js → forwardingStatsUploader.ts} +25 -12
- package/src/mp-instance.ts +37 -5
- package/src/nativeSdkHelpers.interfaces.ts +21 -1
- package/src/{nativeSdkHelpers.js → nativeSdkHelpers.ts} +59 -34
- package/src/pageViewTracker.ts +356 -181
- package/src/sdkRuntimeModels.ts +4 -3
- package/src/store.ts +2 -0
- package/src/filteredMparticleUser.js +0 -101
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import Types from './types';
|
|
2
|
-
|
|
3
|
-
export default function filteredMparticleUser(
|
|
4
|
-
mpid,
|
|
5
|
-
forwarder,
|
|
6
|
-
mpInstance,
|
|
7
|
-
kitBlocker
|
|
8
|
-
) {
|
|
9
|
-
var self = this;
|
|
10
|
-
return {
|
|
11
|
-
getUserIdentities: function() {
|
|
12
|
-
var currentUserIdentities = {};
|
|
13
|
-
var identities = mpInstance._Store.getUserIdentities(mpid);
|
|
14
|
-
|
|
15
|
-
for (var identityType in identities) {
|
|
16
|
-
if (identities.hasOwnProperty(identityType)) {
|
|
17
|
-
var identityName = Types.IdentityType.getIdentityName(
|
|
18
|
-
mpInstance._Helpers.parseNumber(identityType)
|
|
19
|
-
);
|
|
20
|
-
if (
|
|
21
|
-
!kitBlocker ||
|
|
22
|
-
(kitBlocker &&
|
|
23
|
-
!kitBlocker.isIdentityBlocked(identityName))
|
|
24
|
-
)
|
|
25
|
-
//if identity type is not blocked
|
|
26
|
-
currentUserIdentities[identityName] =
|
|
27
|
-
identities[identityType];
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
currentUserIdentities = mpInstance._Helpers.filterUserIdentitiesForForwarders(
|
|
32
|
-
currentUserIdentities,
|
|
33
|
-
forwarder.userIdentityFilters
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
return {
|
|
37
|
-
userIdentities: currentUserIdentities,
|
|
38
|
-
};
|
|
39
|
-
},
|
|
40
|
-
getMPID: function() {
|
|
41
|
-
return mpid;
|
|
42
|
-
},
|
|
43
|
-
getUserAttributesLists: function(forwarder) {
|
|
44
|
-
var userAttributes,
|
|
45
|
-
userAttributesLists = {};
|
|
46
|
-
|
|
47
|
-
userAttributes = self.getAllUserAttributes();
|
|
48
|
-
for (var key in userAttributes) {
|
|
49
|
-
if (
|
|
50
|
-
userAttributes.hasOwnProperty(key) &&
|
|
51
|
-
Array.isArray(userAttributes[key])
|
|
52
|
-
) {
|
|
53
|
-
if (
|
|
54
|
-
!kitBlocker ||
|
|
55
|
-
(kitBlocker && !kitBlocker.isAttributeKeyBlocked(key))
|
|
56
|
-
) {
|
|
57
|
-
userAttributesLists[key] = userAttributes[key].slice();
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
userAttributesLists = mpInstance._Helpers.filterUserAttributes(
|
|
63
|
-
userAttributesLists,
|
|
64
|
-
forwarder.userAttributeFilters
|
|
65
|
-
);
|
|
66
|
-
|
|
67
|
-
return userAttributesLists;
|
|
68
|
-
},
|
|
69
|
-
getAllUserAttributes: function() {
|
|
70
|
-
var userAttributesCopy = {};
|
|
71
|
-
var userAttributes = mpInstance._Store.getUserAttributes(mpid);
|
|
72
|
-
|
|
73
|
-
if (userAttributes) {
|
|
74
|
-
for (var prop in userAttributes) {
|
|
75
|
-
if (userAttributes.hasOwnProperty(prop)) {
|
|
76
|
-
if (
|
|
77
|
-
!kitBlocker ||
|
|
78
|
-
(kitBlocker &&
|
|
79
|
-
!kitBlocker.isAttributeKeyBlocked(prop))
|
|
80
|
-
) {
|
|
81
|
-
if (Array.isArray(userAttributes[prop])) {
|
|
82
|
-
userAttributesCopy[prop] = userAttributes[
|
|
83
|
-
prop
|
|
84
|
-
].slice();
|
|
85
|
-
} else {
|
|
86
|
-
userAttributesCopy[prop] = userAttributes[prop];
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
userAttributesCopy = mpInstance._Helpers.filterUserAttributes(
|
|
94
|
-
userAttributesCopy,
|
|
95
|
-
forwarder.userAttributeFilters
|
|
96
|
-
);
|
|
97
|
-
|
|
98
|
-
return userAttributesCopy;
|
|
99
|
-
},
|
|
100
|
-
};
|
|
101
|
-
}
|