Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mparticle/web-sdk

Package Overview
Dependencies
Maintainers
10
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mparticle/web-sdk - npm Package Compare versions

Comparing version 2.24.0 to 2.25.0

src/identity-utils.ts

2

package.json
{
"name": "@mparticle/web-sdk",
"version": "2.24.0",
"version": "2.25.0",
"description": "mParticle core SDK for web applications",

@@ -5,0 +5,0 @@ "license": "Apache-2.0",

@@ -172,2 +172,3 @@ import { version } from '../package.json';

DirectUrlRouting: 'directURLRouting',
CacheIdentity: 'cacheIdentity',
},

@@ -185,1 +186,5 @@ DefaultInstance: 'default_instance',

export default Constants;
// https://go.mparticle.com/work/SQDSDKS-6080
export const ONE_DAY_IN_SECONDS = 60 * 60 * 24;
export const MILLIS_IN_ONE_SEC = 1000;

@@ -69,3 +69,4 @@ import Constants from './constants';

parseIdentityResponse,
mpid
mpid,
knownIdentities
) {

@@ -84,3 +85,5 @@ var xhr,

originalIdentityApiData,
method
method,
knownIdentities,
false
);

@@ -87,0 +90,0 @@ }

@@ -15,3 +15,3 @@ // This file is used ONLY for the mParticle ESLint plugin. It should NOT be used otherwise!

private getMPInstance() {
return {
return ({
// Certain Helper, Store, and Identity properties need to be mocked to be used in the `returnBatch` method

@@ -123,3 +123,3 @@ _Helpers: {

upload: mockFunction,
} as MParticleWebSDK;
} as unknown) as MParticleWebSDK;
}

@@ -126,0 +126,0 @@

@@ -39,2 +39,4 @@ //

import IdentityAPIClient from './identityApiClient';
import { LocalStorageVault } from './vault';
import { removeExpiredIdentityCacheDates } from './identity-utils';

@@ -1306,2 +1308,3 @@ var Messages = Constants.Messages,

// add a new function to apply items to the store that require config to be returned
mpInstance._Store.storageName = mpInstance._Helpers.createMainStorageName(

@@ -1313,2 +1316,16 @@ config.workspaceToken

);
// idCache is instantiated here as opposed to when _Identity is instantiated
// because it depends on _Store.storageName, which is not sent until above
// because it is a setting on config which returns asyncronously
// in self hosted mode
mpInstance._Identity.idCache = new LocalStorageVault(
`${mpInstance._Store.storageName}-id-cache`,
{
logger: mpInstance.Logger,
}
);
removeExpiredIdentityCacheDates(mpInstance._Identity.idCache);
if (config.hasOwnProperty('workspaceToken')) {

@@ -1315,0 +1332,0 @@ mpInstance._Store.SDKConfig.workspaceToken = config.workspaceToken;

@@ -358,3 +358,3 @@ import Polyfill from './polyfill';

this.Identity = {
HTTPCodes: self.getInstance().Identity.HTTPCodes,
HTTPCodes: Constants.HTTPCodes,
aliasUsers: function(aliasRequest, callback) {

@@ -361,0 +361,0 @@ self.getInstance().Identity.aliasUsers(aliasRequest, callback);

@@ -6,3 +6,3 @@ import * as EventsApi from '@mparticle/event-models';

import Validators from './validators';
import { Dictionary } from './utils';
import { Dictionary, valueof } from './utils';
import { IServerModel } from './serverModel';

@@ -15,2 +15,3 @@ import { IKitConfigs } from './configAPIClient';

import { Kit, MPForwarder } from './forwarders.interfaces';
import Constants from './constants';

@@ -57,2 +58,4 @@ // TODO: Resolve this with version in @mparticle/web-sdk

export type IdentityAPIMethod = valueof<typeof Constants.IdentityMethods>;
export interface SDKGeoLocation {

@@ -244,2 +247,3 @@ lat: number | string;

modify;
getUser(mpid: string): MParticleUser;
}

@@ -246,0 +250,0 @@

@@ -119,2 +119,3 @@ import { Batch } from '@mparticle/event-models';

directURLRouting?: boolean;
cacheIdentity?: boolean;
}

@@ -433,2 +434,3 @@

DirectUrlRouting,
CacheIdentity,
} = Constants.FeatureFlags;

@@ -448,2 +450,3 @@

flags[DirectUrlRouting] = config.flags[DirectUrlRouting] === 'True';
flags[CacheIdentity] = config.flags[CacheIdentity] === 'True';

@@ -450,0 +453,0 @@ return flags;

@@ -11,5 +11,4 @@ import Types from './types';

import { IdentityApiData } from '@mparticle/web-sdk';
import { IdentityAPIMethod } from './sdkRuntimeModels';
type IdentityAPIMethod = 'login' | 'logout' | 'identify' | 'modify';
type ValidationIdentitiesReturn = {

@@ -16,0 +15,0 @@ valid: boolean;

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc