Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 15 additions & 84 deletions dist/mparticle.common.js

Large diffs are not rendered by default.

99 changes: 15 additions & 84 deletions dist/mparticle.esm.js

Large diffs are not rendered by default.

274 changes: 6 additions & 268 deletions dist/mparticle.js

Large diffs are not rendered by default.

15 changes: 0 additions & 15 deletions dist/mparticle.stub.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,11 @@ var mParticle = (function () {
createProduct: returnProduct,
createPromotion: returnPromotion,
createTransactionAttributes: returnTransactionAttributes,
logCheckout: voidFunction,
logImpression: voidFunction,
logProductAction: voidFunction,
logPromotion: voidFunction,
logPurchase: voidFunction,
logRefund: voidFunction,
setCurrencyCode: voidFunction,
Cart: new Cart(),
},
Consent: {
createConsentState: createConsentState,
Expand Down Expand Up @@ -90,7 +87,6 @@ var mParticle = (function () {
removeAllUserAttributes: voidFunction,
getUserAttributesLists: returnObject,
getAllUserAttributes: returnObject,
getCart: Cart,
getConsentState: createConsentState,
setConsentState: voidFunction,
};
Expand All @@ -100,17 +96,6 @@ var mParticle = (function () {
return [returnUser()];
}

function Cart() {
return {
add: voidFunction,
clear: voidFunction,
remove: voidFunction,
getCartProducts: function() {
return [returnProduct()];
},
};
}

function returnImpression() {
return {
Name: 'name',
Expand Down
3 changes: 0 additions & 3 deletions dist/types/src/consent.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ export interface IConsentRules {
includeOnMatch: boolean;
values: IConsentRulesValues[];
}
export interface IConsentState extends ConsentState {
removeCCPAState: () => ConsentState;
}
export interface IConsent {
isEnabledForUserConsent: (consentRules: IConsentRules, user: IMParticleUser) => boolean;
createPrivacyConsent: ICreatePrivacyConsentFunction;
Expand Down
6 changes: 0 additions & 6 deletions dist/types/src/constants.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ declare const Constants: {
readonly SetUserAttribute: "setUserAttribute";
readonly RemoveUserAttribute: "removeUserAttribute";
readonly SetSessionAttribute: "setSessionAttribute";
readonly AddToCart: "addToCart";
readonly RemoveFromCart: "removeFromCart";
readonly ClearCart: "clearCart";
readonly LogOut: "logOut";
readonly SetUserAttributeList: "setUserAttributeList";
readonly RemoveAllUserAttributes: "removeAllUserAttributes";
Expand All @@ -95,18 +92,15 @@ declare const Constants: {
readonly cookieNameV2: "mprtcl-v2";
readonly cookieNameV3: "mprtcl-v3";
readonly localStorageNameV4: "mprtcl-v4";
readonly localStorageProductsV4: "mprtcl-prodv4";
readonly cookieNameV4: "mprtcl-v4";
readonly currentStorageName: "mprtcl-v4";
readonly currentStorageProductsName: "mprtcl-prodv4";
};
readonly DefaultConfig: {
readonly cookieDomain: any;
readonly cookieExpiration: 365;
readonly logLevel: any;
readonly timeout: 300;
readonly sessionTimeout: 30;
readonly maxProducts: 20;
readonly forwarderStatsTimeout: 5000;
readonly integrationDelayTimeout: 5000;
readonly maxCookieSize: 3000;
Expand Down
12 changes: 3 additions & 9 deletions dist/types/src/ecommerce.interfaces.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,15 @@ interface IECommerceShared {
createTransactionAttributes(id: string | number, affiliation?: string, couponCode?: string, revenue?: string | number, shipping?: string | number, tax?: number): TransactionAttributes | null;
expandCommerceEvent(event: SDKEvent): SDKEvent[] | null;
}
export interface SDKCart {
add(product: SDKProduct | SDKProduct[], logEvent?: boolean): void;
remove(product: SDKProduct | SDKProduct[], logEvent?: boolean): void;
clear(): void;
}
export interface SDKECommerceAPI extends IECommerceShared {
logCheckout(step: number, option?: string, attrs?: SDKEventAttrs, customFlags?: SDKEventCustomFlags): void;
logImpression(impression: SDKImpression | SDKImpression[], attrs?: SDKEventAttrs, customFlags?: SDKEventCustomFlags, eventOptions?: SDKEventOptions): void;
logProductAction(productActionType: valueof<typeof ProductActionType>, product: SDKProduct | SDKProduct[], attrs?: SDKEventAttrs, customFlags?: SDKEventCustomFlags, transactionAttributes?: TransactionAttributes, eventOptions?: SDKEventOptions): void;
logPromotion(type: valueof<typeof PromotionActionType>, promotion: SDKPromotion | SDKPromotion[], attrs?: SDKEventAttrs, customFlags?: SDKEventCustomFlags, eventOptions?: SDKEventOptions): void;
setCurrencyCode(code: string): void;
Cart: SDKCart;
/**
* @deprecated Use `logProductAction` with `ProductActionType.Purchase` instead.
*/
logPurchase(transactionAttributes: TransactionAttributes, product: SDKProduct | SDKProduct[], clearCart?: boolean, attrs?: SDKEventAttrs, customFlags?: SDKEventCustomFlags): void;
logRefund(transactionAttributes: TransactionAttributes, product: SDKProduct | SDKProduct[], clearCart?: boolean, attrs?: SDKEventAttrs, customFlags?: SDKEventCustomFlags): void;
}
interface ExtractedActionAttributes {
Affiliation?: string;
Expand Down Expand Up @@ -56,7 +51,6 @@ interface ExtractedTransactionId {
'Transaction ID'?: string;
}
export interface IECommerce extends IECommerceShared {
buildProductList(event: SDKEvent, product: SDKProduct | SDKProduct[]): SDKProduct[];
convertProductActionToEventType(productActionType: valueof<typeof ProductActionType>): // https://go.mparticle.com/work/SQDSDKS-4801
number | null;
convertPromotionActionToEventType(promotionActionType: valueof<typeof PromotionActionType>): number | null;
Expand Down
2 changes: 0 additions & 2 deletions dist/types/src/events.interfaces.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ type EventHandlerFunction<T> = (element: HTMLLinkElement | HTMLFormElement) => T
export interface IEvents {
addEventHandler(domEvent: string, selector: string | Node, eventName: EventHandlerFunction<string> | string, data: EventHandlerFunction<SDKEventAttrs> | SDKEventAttrs, eventType: valueof<typeof EventType>): void;
logAST(): void;
logCheckoutEvent(step: number, option?: string, attrs?: SDKEventAttrs, customFlags?: SDKEventCustomFlags): void;
logCommerceEvent(commerceEvent: SDKEvent, attrs?: SDKEventAttrs, options?: SDKEventOptions): void;
logEvent(event: BaseEvent, eventOptions?: SDKEventOptions): void;
logImpressionEvent(impression: SDKImpression | SDKImpression[], attrs?: SDKEventAttrs, customFlags?: SDKEventCustomFlags, eventOptions?: SDKEventOptions): void;
Expand All @@ -15,7 +14,6 @@ export interface IEvents {
logProductActionEvent(productActionType: valueof<typeof ProductActionType>, product: SDKProduct | SDKProduct[], attrs?: SDKEventAttrs, customFlags?: SDKEventCustomFlags, transactionAttributes?: TransactionAttributes, eventOptions?: SDKEventOptions): void;
logPromotionEvent(promotionType: valueof<typeof PromotionActionType>, promotion: SDKPromotion | SDKPromotion[], attrs?: SDKEventAttrs, customFlags?: SDKEventCustomFlags, eventOptions?: SDKEventOptions): void;
logPurchaseEvent(transactionAttributes: TransactionAttributes, product: SDKProduct | SDKProduct[], attrs?: SDKEventAttrs, customFlags?: SDKEventCustomFlags): void;
logRefundEvent(transactionAttributes: TransactionAttributes, product: SDKProduct | SDKProduct[], attrs?: SDKEventAttrs, customFlags?: SDKEventCustomFlags): void;
startTracking(callback: Callback): void;
stopTracking(): void;
}
Expand Down
29 changes: 2 additions & 27 deletions dist/types/src/identity-user-interfaces.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AllUserAttributes, MPID, User } from '@mparticle/web-sdk';
import { SDKIdentityTypeEnum } from './identity.interfaces';
import { MessageType } from './types';
import { BaseEvent, SDKProduct } from './sdkRuntimeModels';
import { BaseEvent } from './sdkRuntimeModels';
declare const HTTPCodes: {
readonly noHttpCoverage: -1;
readonly activeIdentityRequest: -2;
Expand All @@ -11,30 +11,11 @@ declare const HTTPCodes: {
readonly loggingDisabledOrMissingAPIKey: -6;
readonly tooManyRequests: 429;
};
interface ICart {
/**
* @deprecated Cart persistence in mParticle has been deprecated. Please use mParticle.eCommerce.logProductAction(mParticle.ProductActionType.AddToCart, [products])
*/
add: (product: SDKProduct, logEventBoolean?: boolean) => void;
/**
* @deprecated Cart persistence in mParticle has been deprecated. Please use mParticle.eCommerce.logProductAction(mParticle.ProductActionType.RemoveFromCart, [products])
*/
remove: (product: SDKProduct, logEventBoolean?: boolean) => void;
/**
* @deprecated Cart persistence in mParticle has been deprecated.
*/
clear: () => void;
/**
* @deprecated Cart Products have been deprecated
*/
getCartProducts: () => SDKProduct[];
}
export interface IMParticleUser extends User {
export interface IMParticleUser extends Omit<User, 'getCart'> {
getAllUserAttributes(): any;
setUserTag(tagName: string, value?: any): void;
setUserAttribute(key: string, value: any): void;
getUserAudiences?(callback?: IdentityCallback): void;
getCart(): ICart;
}
export interface ISDKUserIdentity {
Identity: string;
Expand Down Expand Up @@ -96,11 +77,5 @@ export interface IdentityModifyResultBody {
modified_mpid: MPID;
};
}
export interface mParticleUserCart {
add(): void;
remove(): void;
clear(): void;
getCartProducts(): SDKProduct[];
}
export type UserAttributes = AllUserAttributes;
export {};
6 changes: 1 addition & 5 deletions dist/types/src/identity.interfaces.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ICachedIdentityCall, IKnownIdentities } from './identity-utils';
import { BaseVault } from './vault';
import { Dictionary, Environment, valueof } from './utils';
import Constants from './constants';
import { IdentityCallback, IUserAttributeChangeEvent, IUserIdentityChangeEvent, IMParticleUser, mParticleUserCart, IIdentityResponse } from './identity-user-interfaces';
import { IdentityCallback, IUserAttributeChangeEvent, IUserIdentityChangeEvent, IMParticleUser, IIdentityResponse } from './identity-user-interfaces';
import { IdentitySearchCallback } from './identity/search';
declare const HTTPCodes: {
readonly noHttpCoverage: -1;
Expand Down Expand Up @@ -180,8 +180,4 @@ export interface IIdentity {
sendUserIdentityChangeEvent(newUserIdentities: UserIdentities, method: IdentityAPIMethod, mpid: MPID, prevUserIdentities: UserIdentities): void;
reinitForwardersOnUserChange(prevUser: IMParticleUser, newUser: IMParticleUser): void;
setForwarderCallbacks(user: IMParticleUser, method: IdentityAPIMethod): void;
/**
* @deprecated
*/
mParticleUserCart(): mParticleUserCart;
}
2 changes: 1 addition & 1 deletion dist/types/src/internal-types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ export type { KitInterface, } from './forwarders.interfaces';
export type { RoktAttributeValue, RoktAttributeValueType, RoktAttributeValueArray, RoktAttributes, IRoktPartnerExtensionData, IRoktSelectPlacementsOptions, IRoktSelection, IRoktLauncher, IRoktMessage, RoktKitFilterSettings, IRoktKitSettings, IRoktKit, IRoktOptions, IRoktLauncherOptions, } from './roktManager';
export type { ErrorCodes, WSDKErrorSeverity, } from './reporting/types';
export type { ISDKError, ISDKLogEntry, IErrorReportingService, ILoggingService, } from './reporting/types';
export type { SDKEvent, SDKProductAction, SDKProductActionType, SDKPromotionAction, SDKShoppingCart, SDKGeoLocation, SDKDataPlan, SDKLoggerApi, SDKConfigApi, IMParticleInstanceManager, } from './sdkRuntimeModels';
export type { SDKEvent, SDKProductAction, SDKProductActionType, SDKPromotionAction, SDKGeoLocation, SDKDataPlan, SDKLoggerApi, SDKConfigApi, IMParticleInstanceManager, } from './sdkRuntimeModels';
2 changes: 0 additions & 2 deletions dist/types/src/kitBlocking.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export default class KitBlocker {
ProductAction?: import("./sdkRuntimeModels").SDKProductAction;
PromotionAction?: import("./sdkRuntimeModels").SDKPromotionAction;
ProductImpressions?: import("./sdkRuntimeModels").SDKProductImpression[];
ShoppingCart?: import("./sdkRuntimeModels").SDKShoppingCart;
UserIdentityChanges?: import("./identity-user-interfaces").ISDKUserIdentityChanges;
UserAttributeChanges?: import("./identity-user-interfaces").ISDKUserAttributeChangeData;
CurrencyCode: string;
Expand Down Expand Up @@ -104,7 +103,6 @@ export default class KitBlocker {
ProductAction?: import("./sdkRuntimeModels").SDKProductAction;
PromotionAction?: import("./sdkRuntimeModels").SDKPromotionAction;
ProductImpressions?: import("./sdkRuntimeModels").SDKProductImpression[];
ShoppingCart?: import("./sdkRuntimeModels").SDKShoppingCart;
UserIdentityChanges?: import("./identity-user-interfaces").ISDKUserIdentityChanges;
UserAttributeChanges?: import("./identity-user-interfaces").ISDKUserAttributeChangeData;
CurrencyCode: string;
Expand Down
2 changes: 1 addition & 1 deletion dist/types/src/public-types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export type { EventType, CommerceEventType, IdentityType, ProductActionType, Pro
export type { SDKInitConfig, DataPlanConfig, BaseEvent, SDKEventCustomFlags, LogLevelType, MParticleWebSDK, } from './sdkRuntimeModels';
export type { IMParticleUser, IdentityCallback, IdentityResult, IdentityResultBody, IdentityModifyResultBody, ISDKUserIdentity, ISDKUserAttributes, } from './identity-user-interfaces';
export type { SDKIdentityApi, IAliasRequest, IAliasCallback, IAliasResult, SDKIdentityTypeEnum, IIdentitySearchResult, IIdentitySearchResponseBody, IdentitySearchCallback, IUserIdentities } from './identity.interfaces';
export type { SDKECommerceAPI, SDKCart, } from './ecommerce.interfaces';
export type { SDKECommerceAPI, } from './ecommerce.interfaces';
export type { SDKProduct, SDKPromotion, SDKImpression, SDKProductImpression, } from './sdkRuntimeModels';
export type { SDKConsentApi, SDKConsentState, SDKConsentStateData, SDKGDPRConsentState, SDKCCPAConsentState, } from './consent';
export type { Dictionary, valueof } from './utils';
5 changes: 0 additions & 5 deletions dist/types/src/sdkRuntimeModels.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export interface SDKEvent {
ProductAction?: SDKProductAction;
PromotionAction?: SDKPromotionAction;
ProductImpressions?: SDKProductImpression[];
ShoppingCart?: SDKShoppingCart;
UserIdentityChanges?: ISDKUserIdentityChanges;
UserAttributeChanges?: ISDKUserAttributeChangeData;
CurrencyCode: string;
Expand All @@ -73,9 +72,6 @@ export interface SDKDataPlan {
PlanVersion?: number | null;
PlanId?: string | null;
}
export interface SDKShoppingCart {
ProductList?: SDKProduct[];
}
export interface SDKPromotionAction {
PromotionActionType: string;
PromotionList?: SDKPromotion[];
Expand Down Expand Up @@ -233,7 +229,6 @@ export interface SDKInitConfig extends Omit<MPConfiguration, 'dataPlan' | 'logLe
identityUrl?: string;
integrationDelayTimeout?: number;
isIOS?: boolean;
maxProducts?: number;
requestConfig?: boolean;
sessionTimeout?: number;
useNativeSdk?: boolean;
Expand Down
1 change: 0 additions & 1 deletion dist/types/src/sdkToEventsApiConverter.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export declare function convertProducts(sdkProducts: SDKProduct[]): EventsApi.Pr
export declare function convertPromotionAction(sdkEvent: SDKEvent): EventsApi.PromotionAction | null;
export declare function convertPromotions(sdkPromotions: SDKPromotion[]): EventsApi.Promotion[] | null;
export declare function convertImpressions(sdkEvent: SDKEvent): EventsApi.ProductImpression[] | null;
export declare function convertShoppingCart(sdkEvent: SDKEvent): EventsApi.ShoppingCart | null;
export declare function convertCommerceEvent(sdkEvent: SDKEvent): EventsApi.CommerceEvent;
export declare function convertCrashReportEvent(sdkEvent: SDKEvent): EventsApi.CrashReportEvent;
export declare function convertAST(sdkEvent: SDKEvent): EventsApi.ApplicationStateTransitionEvent;
Expand Down
1 change: 0 additions & 1 deletion dist/types/src/store.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export interface SDKConfig {
userAudienceUrl?: string;
isIOS?: boolean;
maxAliasWindow: number;
maxProducts: number;
requestConfig?: boolean;
sessionTimeout?: number;
timeout?: number;
Expand Down
23 changes: 0 additions & 23 deletions dist/types/src/stub/mparticle.stub.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,11 @@ declare namespace mParticle {
export { returnProduct as createProduct };
export { returnPromotion as createPromotion };
export { returnTransactionAttributes as createTransactionAttributes };
export { voidFunction as logCheckout };
export { voidFunction as logImpression };
export { voidFunction as logProductAction };
export { voidFunction as logPromotion };
export { voidFunction as logPurchase };
export { voidFunction as logRefund };
export { voidFunction as setCurrencyCode };
export let Cart: any;
}
export namespace Consent {
export { createConsentState };
Expand Down Expand Up @@ -140,7 +137,6 @@ declare function returnUser(): {
removeAllUserAttributes: typeof voidFunction;
getUserAttributesLists: typeof returnObject;
getAllUserAttributes: typeof returnObject;
getCart: typeof Cart;
getConsentState: typeof createConsentState;
setConsentState: typeof voidFunction;
};
Expand All @@ -158,27 +154,8 @@ declare function returnUsers(): {
removeAllUserAttributes: typeof voidFunction;
getUserAttributesLists: typeof returnObject;
getAllUserAttributes: typeof returnObject;
getCart: typeof Cart;
getConsentState: typeof createConsentState;
setConsentState: typeof voidFunction;
}[];
declare function returnThis(): any;
declare function returnObject(): {};
declare function Cart_1(): {
add: typeof voidFunction;
clear: typeof voidFunction;
remove: typeof voidFunction;
getCartProducts: () => {
Name: string;
Sku: string;
Price: number;
Quantity: number;
Brand: string;
Variant: string;
Category: string;
Position: string;
CouponCode: string;
TotalAmount: number;
Attributes: {};
}[];
};
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mparticle/web-sdk",
"version": "2.81.0",
"version": "3.0.0",
"description": "mParticle core SDK for web applications",
"license": "Apache-2.0",
"keywords": [
Expand Down
Loading