@mparticle/web-sdk
Advanced tools
Comparing version 2.15.5 to 2.16.0
{ | ||
"name": "@mparticle/web-sdk", | ||
"version": "2.15.5", | ||
"version": "2.16.0", | ||
"description": "mParticle core SDK for web applications", | ||
@@ -71,3 +71,3 @@ "license": "Apache-2.0", | ||
"@mparticle/data-planning-models": "^0.1.0", | ||
"@mparticle/event-models": "^1.1.2", | ||
"@mparticle/event-models": "^1.1.4", | ||
"@rollup/plugin-json": "^4.1.0", | ||
@@ -74,0 +74,0 @@ "@semantic-release/changelog": "^5.0.1", |
@@ -134,6 +134,13 @@ import { Batch } from '@mparticle/event-models'; | ||
for (const entry of Array.from(eventsBySession.entries())) { | ||
const upload = convertEvents(mpid, entry[1], mpInstance); | ||
if (upload) { | ||
newUploads.push(upload); | ||
let uploadBatchObject = convertEvents(mpid, entry[1], mpInstance); | ||
const onCreateBatchCallback = mpInstance._Store.SDKConfig.onCreateBatch; | ||
if (onCreateBatchCallback) { | ||
uploadBatchObject = onCreateBatchCallback(uploadBatchObject); | ||
uploadBatchObject.mutated = true; | ||
} | ||
if (uploadBatchObject) { | ||
newUploads.push(uploadBatchObject); | ||
} | ||
} | ||
@@ -140,0 +147,0 @@ } |
@@ -27,2 +27,3 @@ import * as EventsApi from '@mparticle/event-models'; | ||
AppName?: string; | ||
Package?: string; | ||
ConsentState?: SDKConsentState; | ||
@@ -146,4 +147,6 @@ IntegrationAttributes?: { [key: string]: { [key: string]: string } }; | ||
}; | ||
onCreateBatch(batch: EventsApi.Batch): EventsApi.Batch; | ||
dataPlan: DataPlanConfig; | ||
appVersion?: string; | ||
package?: string; | ||
flags?: { [key: string]: string | number }; | ||
@@ -207,2 +210,3 @@ kitConfigs: any; | ||
appVersion?: string; | ||
onCreateBatch(batch: EventsApi.Batch): EventsApi.Batch | ||
} | ||
@@ -209,0 +213,0 @@ export interface MParticleUser { |
@@ -58,2 +58,3 @@ import { | ||
application_name: lastEvent.AppName, | ||
package: lastEvent.Package, | ||
}, | ||
@@ -60,0 +61,0 @@ device_info: { |
@@ -210,2 +210,3 @@ import Types from './types'; | ||
AppName: mpInstance.getAppName(), | ||
Package: mpInstance._Store.SDKConfig.package, | ||
ClientGeneratedId: mpInstance._Store.clientId, | ||
@@ -212,0 +213,0 @@ DeviceId: mpInstance._Store.deviceId, |
@@ -157,2 +157,6 @@ import Constants from './constants'; | ||
if (config.hasOwnProperty('package')) { | ||
this.SDKConfig.package = config.package; | ||
} | ||
if (config.hasOwnProperty('integrationDelayTimeout')) { | ||
@@ -268,2 +272,14 @@ this.SDKConfig.integrationDelayTimeout = | ||
if (config.hasOwnProperty('onCreateBatch')) { | ||
if (typeof config.onCreateBatch === 'function') { | ||
this.SDKConfig.onCreateBatch = config.onCreateBatch; | ||
} else { | ||
mpInstance.Logger.error( | ||
'config.onCreateBatch must be a function' | ||
); | ||
// set to undefined because all items are set on createSDKConfig | ||
this.SDKConfig.onCreateBatch = undefined; | ||
} | ||
} | ||
if (!config.hasOwnProperty('flags')) { | ||
@@ -270,0 +286,0 @@ this.SDKConfig.flags = {}; |
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
1541557
28043