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.26.4 to 2.26.5

2

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

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

@@ -1,11 +0,29 @@

import {
AllUserAttributes,
IdentityCallback,
Product,
User,
} from '@mparticle/web-sdk';
import { AllUserAttributes, MPID, Product, User } from '@mparticle/web-sdk';
import { SDKIdentityTypeEnum } from './identity.interfaces';
import { MessageType } from './types.interfaces';
import { BaseEvent } from './sdkRuntimeModels';
import Constants from './constants';
const { HTTPCodes } = Constants;
// Cart is Deprecated and private to mParticle user in @mparticle/web-sdk
// but we need to expose it here for type safety in some of our tests
interface Cart {
/**
* @deprecated Cart persistence in mParticle has been deprecated. Please use mParticle.eCommerce.logProductAction(mParticle.ProductActionType.AddToCart, [products])
*/
add: (product: Product, logEventBoolean?: boolean) => void;
/**
* @deprecated Cart persistence in mParticle has been deprecated. Please use mParticle.eCommerce.logProductAction(mParticle.ProductActionType.RemoveFromCart, [products])
*/
remove: (product: Product, logEventBoolean?: boolean) => void;
/**
* @deprecated Cart persistence in mParticle has been deprecated.
*/
clear: () => void;
/**
* @deprecated Cart Products have been deprecated
*/
getCartProducts: () => Product[];
}
// https://go.mparticle.com/work/SQDSDKS-5033

@@ -18,2 +36,6 @@ // https://go.mparticle.com/work/SQDSDKS-6354

getUserAudiences?(callback?: IdentityCallback): void;
/*
* @deprecated
*/
getCart(): Cart;
}

@@ -57,2 +79,29 @@

// https://go.mparticle.com/work/SQDSDKS-6460
export interface IdentityCallback {
(result: IdentityResult): void;
}
export interface IdentityResult {
httpCode: typeof HTTPCodes;
getPreviousUser(): User;
getUser(): User;
body: IdentityResultBody | IdentityModifyResultBody;
}
export interface IdentityResultBody {
context: string | null;
is_ephemeral: boolean;
is_logged_in: boolean;
matched_identities: Record<string, unknown>;
mpid?: MPID;
}
export interface IdentityModifyResultBody {
change_results?: {
identity_type: SDKIdentityTypeEnum;
modified_mpid: MPID;
};
}
export interface mParticleUserCart {

@@ -59,0 +108,0 @@ add(product: Product, logEvent: boolean): void;

@@ -10,2 +10,4 @@ import Constants, { ONE_DAY_IN_SECONDS, MILLIS_IN_ONE_SEC } from './constants';

export type IdentityCache = BaseVault<Dictionary<ICachedIdentityCall>>;
export type IParseCachedIdentityResponse = (

@@ -73,3 +75,3 @@ cachedIdentity: ICachedIdentityCall,

expireTimestamp: number,
idCache: BaseVault<Dictionary<ICachedIdentityCall>>,
idCache: IdentityCache,
xhr: XMLHttpRequest

@@ -131,3 +133,3 @@ ): void => {

proposedUserIdentities: IKnownIdentities,
idCache?: BaseVault<Dictionary<ICachedIdentityCall>>
idCache?: IdentityCache,
): boolean => {

@@ -172,3 +174,3 @@ // There is an edge case where multiple identity calls are taking place

proposedUserIdentities: IKnownIdentities,
idCache: BaseVault<Dictionary<ICachedIdentityCall>>
idCache: IdentityCache,
): ICachedIdentityCall | null => {

@@ -222,3 +224,3 @@ const cacheKey: string = concatenateIdentities(

knownIdentities: IKnownIdentities,
idCache: BaseVault<Dictionary<ICachedIdentityCall>>,
idCache: IdentityCache,
parseIdentityResponse: IParseCachedIdentityResponse,

@@ -225,0 +227,0 @@ mpid: string,

@@ -1,7 +0,2 @@

import {
IdentityApiData,
IdentityCallback,
MPID,
UserIdentities,
} from '@mparticle/web-sdk';
import { IdentityApiData, MPID, UserIdentities } from '@mparticle/web-sdk';
import AudienceManager from './audienceManager';

@@ -13,2 +8,3 @@ import { ICachedIdentityCall, IKnownIdentities } from './identity-utils';

import {
IdentityCallback,
IUserAttributeChangeEvent,

@@ -82,2 +78,6 @@ IUserIdentityChangeEvent,

export interface IIdentityRequest {
combineUserIdentities(
previousUIByName: UserIdentities,
newUIByName: UserIdentities
): UserIdentities;
createIdentityRequest(

@@ -84,0 +84,0 @@ identityApiData: IdentityApiData,

import * as EventsApi from '@mparticle/event-models';
import { DataPlanVersion } from '@mparticle/data-planning-models';
import { MPConfiguration, MPID, Callback } from '@mparticle/web-sdk';
import {
MPConfiguration,
MPID,
Callback,
IdentityApiData,
} from '@mparticle/web-sdk';
import { IStore } from './store';

@@ -14,3 +19,3 @@ import Validators from './validators';

import { Kit, MPForwarder } from './forwarders.interfaces';
import { SDKIdentityApi } from './identity.interfaces';
import { IIdentity, SDKIdentityApi } from './identity.interfaces';
import {

@@ -21,3 +26,5 @@ ISDKUserAttributeChangeData,

ISDKUserIdentity,
IdentityCallback,
} from './identity-user-interfaces';
import { IIdentityType } from './types.interfaces';

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

addForwarder(mockForwarder: MPForwarder): void;
IdentityType: IIdentityType;
_Identity: IIdentity;
Identity: SDKIdentityApi;

@@ -166,10 +175,16 @@ Logger: SDKLoggerApi;

): void;
endSession(): void;
identifyRequest: IdentityApiData;
init(apiKey: string, config: SDKInitConfig, instanceName?: string): void;
_getActiveForwarders(): MPForwarder[];
getAppName(): string;
getAppVersion(): string;
getDeviceId(): string;
setDeviceId(deviceId: string): void;
getInstance(): MParticleWebSDK; // TODO: Create a new type for MParticleWebSDKInstance
ServerModel();
upload();
setLogLevel(logLevel: LogLevelType): void;
setPosition(lat: number | string, lng: number | string): void;
startNewSession(): void;
logEvent(

@@ -231,2 +246,5 @@ eventName: string,

isDevelopmentMode?: boolean;
// https://go.mparticle.com/work/SQDSDKS-6460
identityCallback?: IdentityCallback;
}

@@ -233,0 +251,0 @@

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

IdentifyRequest,
IdentityCallback,
SDKEventCustomFlags,

@@ -36,2 +35,3 @@ } from '@mparticle/web-sdk';

import { IPersistenceMinified } from './persistence.interfaces';
import { IdentityCallback } from './identity-user-interfaces';

@@ -76,2 +76,3 @@ // This represents the runtime configuration of the SDK AFTER

isIOS?: boolean;
maxAliasWindow: number;
maxProducts: number;

@@ -78,0 +79,0 @@ requestConfig?: boolean;

@@ -52,2 +52,6 @@ export enum EventTypeEnum {

PhoneNumber3 = 21,
}
}
export interface IIdentityType {
getIdentityType(identityType: string): IdentityType | null;
}

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