@mparticle/web-sdk 2.79.3 → 2.80.1
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/mparticle.common.js +220 -574
- package/dist/mparticle.esm.js +220 -574
- package/dist/mparticle.js +1489 -1793
- package/dist/types/src/configAPIClient.d.ts +1 -0
- package/dist/types/src/ecommerce.d.ts +3 -53
- package/dist/types/src/ecommerce.interfaces.d.ts +11 -12
- package/dist/types/src/events.interfaces.d.ts +1 -1
- package/dist/types/src/forwarders.d.ts +4 -26
- package/dist/types/src/forwarders.interfaces.d.ts +41 -10
- package/dist/types/src/identity-utils.d.ts +3 -3
- package/dist/types/src/identity.d.ts +3 -0
- package/dist/types/src/identity.interfaces.d.ts +45 -11
- package/dist/types/src/identityApiClient.d.ts +5 -4
- package/dist/types/src/mp-instance.d.ts +2 -2
- package/dist/types/src/pageViewTracker.d.ts +12 -5
- package/dist/types/src/persistence.d.ts +3 -44
- package/dist/types/src/persistence.interfaces.d.ts +12 -13
- package/dist/types/src/sdkRuntimeModels.d.ts +3 -2
- package/dist/types/src/store.d.ts +5 -3
- package/package.json +1 -1
- package/src/configAPIClient.ts +1 -0
- package/src/ecommerce.interfaces.ts +12 -21
- package/src/{ecommerce.js → ecommerce.ts} +144 -73
- package/src/events.interfaces.ts +1 -1
- package/src/events.ts +10 -2
- package/src/forwarders.interfaces.ts +73 -10
- package/src/{forwarders.js → forwarders.ts} +214 -176
- package/src/helpers.ts +7 -3
- package/src/identity-utils.ts +2 -2
- package/src/identity.interfaces.ts +58 -14
- package/src/{identity.js → identity.ts} +237 -192
- package/src/identityApiClient.ts +9 -9
- package/src/mp-instance.ts +2 -2
- package/src/pageViewTracker.ts +176 -42
- package/src/persistence.interfaces.ts +12 -13
- package/src/persistence.ts +1210 -0
- package/src/sdkRuntimeModels.ts +3 -1
- package/src/store.ts +5 -3
- package/src/persistence.js +0 -985
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
import { SDKEvent, SDKEventCustomFlags } from './sdkRuntimeModels';
|
|
1
|
+
import { SDKEvent, SDKEventCustomFlags, SDKInitConfig, SDKLoggerApi } from './sdkRuntimeModels';
|
|
2
2
|
import { Dictionary } from './utils';
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
IKitConfigs,
|
|
5
|
+
IKitFilterSettings,
|
|
6
|
+
IFilteringUserAttributeValue,
|
|
7
|
+
} from './configAPIClient';
|
|
8
|
+
import { IdentityApiData, IdentityType, UserIdentities } from '@mparticle/web-sdk';
|
|
5
9
|
import { Batch } from '@mparticle/event-models';
|
|
10
|
+
import { IForwardingStatsData } from './apiClient';
|
|
11
|
+
import { AsyncUploader } from './uploaders';
|
|
12
|
+
import { IPixelConfiguration } from './cookieSyncManager';
|
|
6
13
|
|
|
7
14
|
import {
|
|
8
15
|
IMParticleUser,
|
|
9
16
|
ISDKUserIdentity,
|
|
10
17
|
UserAttributes,
|
|
11
18
|
} from './identity-user-interfaces';
|
|
19
|
+
import type { IFilteredMparticleUser } from './filteredMparticleUser';
|
|
12
20
|
|
|
13
21
|
// TODO: https://go.mparticle.com/work/SQDSDKS-4475
|
|
14
22
|
export type MPForwarder = Dictionary;
|
|
@@ -57,38 +65,41 @@ export interface ConfiguredKit
|
|
|
57
65
|
testMode: boolean,
|
|
58
66
|
trackerId: string | null,
|
|
59
67
|
userAttributes: UserAttributes,
|
|
60
|
-
userIdentities: ISDKUserIdentity,
|
|
68
|
+
userIdentities: ISDKUserIdentity[],
|
|
61
69
|
appVersion: string,
|
|
62
70
|
appName: string,
|
|
63
71
|
customFlags: SDKEventCustomFlags,
|
|
64
72
|
clientId: string
|
|
65
73
|
): string;
|
|
66
74
|
onIdentifyComplete(
|
|
67
|
-
user:
|
|
75
|
+
user: IFilteredMparticleUser,
|
|
68
76
|
filteredIdentityRequest: IdentityApiData
|
|
69
77
|
): string;
|
|
70
78
|
onLoginComplete(
|
|
71
|
-
user:
|
|
79
|
+
user: IFilteredMparticleUser,
|
|
72
80
|
filteredIdentityRequest: IdentityApiData
|
|
73
81
|
): string;
|
|
74
82
|
onLogoutComplete(
|
|
75
|
-
user:
|
|
83
|
+
user: IFilteredMparticleUser,
|
|
76
84
|
filteredIdentityRequest: IdentityApiData
|
|
77
85
|
): string;
|
|
78
86
|
onModifyComplete(
|
|
79
|
-
user:
|
|
87
|
+
user: IFilteredMparticleUser,
|
|
80
88
|
filteredIdentityRequest: IdentityApiData
|
|
81
89
|
): string;
|
|
82
|
-
onUserIdentified(user:
|
|
90
|
+
onUserIdentified(user: IFilteredMparticleUser): string;
|
|
83
91
|
process(event: SDKEvent): string;
|
|
84
92
|
setOptOut(isOptingOut: boolean): string;
|
|
85
93
|
removeUserAttribute(key: string): string;
|
|
86
94
|
setUserAttribute(key: string, value: string): string;
|
|
87
|
-
setUserIdentity(id: UserIdentityId, type: UserIdentityType): void;
|
|
95
|
+
setUserIdentity(id: UserIdentityId, type: UserIdentityType): string | void;
|
|
96
|
+
logOut?(evt: SDKEvent): void;
|
|
88
97
|
|
|
89
98
|
// TODO: https://go.mparticle.com/work/SQDSDKS-5156
|
|
90
99
|
isSandbox: boolean;
|
|
91
100
|
hasSandbox: boolean;
|
|
101
|
+
initialized?: boolean;
|
|
102
|
+
logger?: SDKLoggerApi;
|
|
92
103
|
}
|
|
93
104
|
|
|
94
105
|
export interface KitInterface {
|
|
@@ -140,3 +151,55 @@ export type forwardingStatsCallback = (
|
|
|
140
151
|
forwarder: ConfiguredKit,
|
|
141
152
|
event: SDKEvent
|
|
142
153
|
) => void;
|
|
154
|
+
|
|
155
|
+
export interface IForwarders {
|
|
156
|
+
forwarderStatsUploader: AsyncUploader;
|
|
157
|
+
initForwarders(
|
|
158
|
+
userIdentities: UserIdentities,
|
|
159
|
+
forwardingStatsCallback: forwardingStatsCallback
|
|
160
|
+
): void;
|
|
161
|
+
isEnabledForUserAttributes(
|
|
162
|
+
filterObject: Partial<IFilteringUserAttributeValue>,
|
|
163
|
+
user: IMParticleUser
|
|
164
|
+
): boolean;
|
|
165
|
+
isEnabledForUnknownUser(
|
|
166
|
+
excludeAnonymousUserBoolean: boolean,
|
|
167
|
+
user: IMParticleUser
|
|
168
|
+
): boolean;
|
|
169
|
+
applyToForwarders(functionName: string, functionArgs: unknown): void;
|
|
170
|
+
sendEventToForwarders(event: SDKEvent): void;
|
|
171
|
+
handleForwarderUserAttributes(
|
|
172
|
+
functionNameKey: string,
|
|
173
|
+
key: string,
|
|
174
|
+
value: string
|
|
175
|
+
): void;
|
|
176
|
+
setForwarderUserIdentities(userIdentities: UserIdentities): void;
|
|
177
|
+
setForwarderOnUserIdentified(user: IMParticleUser): void;
|
|
178
|
+
setForwarderOnIdentityComplete(
|
|
179
|
+
user: IMParticleUser,
|
|
180
|
+
identityMethod: string
|
|
181
|
+
): void;
|
|
182
|
+
getForwarderStatsQueue(): IForwardingStatsData[];
|
|
183
|
+
setForwarderStatsQueue(queue: IForwardingStatsData[]): void;
|
|
184
|
+
processForwarders(
|
|
185
|
+
config: SDKInitConfig,
|
|
186
|
+
forwardingStatsCallback: forwardingStatsCallback
|
|
187
|
+
): void;
|
|
188
|
+
processUIEnabledKits(config: SDKInitConfig): void;
|
|
189
|
+
returnKitConstructors(): Dictionary<RegisteredKit>;
|
|
190
|
+
configureUIEnabledKit(
|
|
191
|
+
configuration: IKitConfigs,
|
|
192
|
+
kits: Dictionary<RegisteredKit>
|
|
193
|
+
): void;
|
|
194
|
+
processSideloadedKits(mpConfig: SDKInitConfig): void;
|
|
195
|
+
configureSideloadedKit(kitConstructor: RegisteredKit): void;
|
|
196
|
+
returnConfiguredKit(
|
|
197
|
+
forwarder: RegisteredKit,
|
|
198
|
+
config?: Partial<IKitConfigs>
|
|
199
|
+
): ConfiguredKit;
|
|
200
|
+
configurePixel(settings: IPixelConfiguration): void;
|
|
201
|
+
processPixelConfigs(config: SDKInitConfig): void;
|
|
202
|
+
sendSingleForwardingStatsToServer(
|
|
203
|
+
forwardingStatsData: IForwardingStatsData
|
|
204
|
+
): Promise<void>;
|
|
205
|
+
}
|