@mparticle/web-sdk
Advanced tools
Comparing version 2.11.12 to 2.11.13
@@ -5,2 +5,6 @@ ## Releases | ||
#### 2.11.13 - 2020-06-17 | ||
- Bugfix - prevent null CCPA consent on events v3 endpoint | ||
#### 2.11.12 - 2020-06-03 | ||
@@ -7,0 +11,0 @@ |
{ | ||
"name": "@mparticle/web-sdk", | ||
"version": "2.11.12", | ||
"version": "2.11.13", | ||
"description": "mParticle core SDK for web applications", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
var Constants = { | ||
sdkVersion: '2.11.12', | ||
sdkVersion: '2.11.13', | ||
sdkVendor: 'mparticle', | ||
@@ -4,0 +4,0 @@ platform: 'web', |
@@ -180,7 +180,11 @@ import * as EventsApi from '@mparticle/event-models'; | ||
export interface SDKConsentState { | ||
getGDPRConsentState(): { [key: string]: SDKGDPRConsentState }; | ||
getCCPAConsentState(): { [key: string]: SDKCCPAConsentState }; | ||
getGDPRConsentState(): SDKGDPRConsentState; | ||
getCCPAConsentState(): SDKCCPAConsentState; | ||
} | ||
export interface SDKGDPRConsentState { | ||
[key: string]: SDKConsentStateData; | ||
} | ||
export interface SDKConsentStateData { | ||
Consented: boolean; | ||
@@ -193,3 +197,3 @@ Timestamp?: number; | ||
export interface SDKCCPAConsentState extends SDKGDPRConsentState {} | ||
export interface SDKCCPAConsentState extends SDKConsentStateData {} | ||
@@ -202,3 +206,3 @@ export interface SDKUserIdentityChangeData { | ||
export interface Identity { | ||
IdentityType: EventsApi.identityType; | ||
IdentityType: EventsApi.IdentityType; | ||
Identity: string; | ||
@@ -205,0 +209,0 @@ Timestamp: number; |
@@ -91,5 +91,5 @@ import { | ||
export function convertGdprConsentState(sdkGdprConsentState: { | ||
[key: string]: SDKGDPRConsentState; | ||
}): { [key: string]: EventsApi.GDPRConsentState | null } { | ||
export function convertGdprConsentState( | ||
sdkGdprConsentState: SDKGDPRConsentState | ||
): { [key: string]: EventsApi.GDPRConsentState | null } { | ||
if (!sdkGdprConsentState) { | ||
@@ -114,4 +114,4 @@ return null; | ||
export function convertCcpaConsentState( | ||
sdkCcpaConsentState: Record<string, SDKCCPAConsentState> | ||
): Record<string, EventsApi.GDPRConsentState> { | ||
sdkCcpaConsentState: SDKCCPAConsentState | ||
): { data_sale_opt_out: EventsApi.CCPAConsentState } { | ||
if (!sdkCcpaConsentState) { | ||
@@ -121,14 +121,10 @@ return null; | ||
const state: { data_sale_opt_out: EventsApi.CCPAConsentState } = { | ||
data_sale_opt_out: null, | ||
data_sale_opt_out: { | ||
consented: sdkCcpaConsentState.Consented, | ||
hardware_id: sdkCcpaConsentState.HardwareId, | ||
document: sdkCcpaConsentState.ConsentDocument, | ||
timestamp_unixtime_ms: sdkCcpaConsentState.Timestamp, | ||
location: sdkCcpaConsentState.Location, | ||
}, | ||
}; | ||
if (sdkCcpaConsentState.hasOwnProperty('data_sale_opt_out')) { | ||
state.data_sale_opt_out = { | ||
consented: sdkCcpaConsentState['data_sale_opt_out'].Consented, | ||
hardware_id: sdkCcpaConsentState['data_sale_opt_out'].HardwareId, | ||
document: sdkCcpaConsentState['data_sale_opt_out'].ConsentDocument, | ||
timestamp_unixtime_ms: | ||
sdkCcpaConsentState['data_sale_opt_out'].Timestamp, | ||
location: sdkCcpaConsentState['data_sale_opt_out'].Location, | ||
}; | ||
} | ||
@@ -202,3 +198,2 @@ return state; | ||
case Types.IdentityType.PhoneNumber3: | ||
debugger; | ||
batchIdentities.phone_number_3 = identity.Identity; | ||
@@ -205,0 +200,0 @@ break; |
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
1346442
25028