@mparticle/web-sdk 2.81.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/mparticle.js CHANGED
@@ -204,7 +204,7 @@ var mParticle = (function () {
204
204
  Base64: Base64$1
205
205
  };
206
206
 
207
- var version = "2.81.0";
207
+ var version = "3.0.0";
208
208
 
209
209
  var Constants = {
210
210
  sdkVersion: version,
@@ -281,9 +281,6 @@ var mParticle = (function () {
281
281
  SetUserAttribute: 'setUserAttribute',
282
282
  RemoveUserAttribute: 'removeUserAttribute',
283
283
  SetSessionAttribute: 'setSessionAttribute',
284
- AddToCart: 'addToCart',
285
- RemoveFromCart: 'removeFromCart',
286
- ClearCart: 'clearCart',
287
284
  LogOut: 'logOut',
288
285
  SetUserAttributeList: 'setUserAttributeList',
289
286
  RemoveAllUserAttributes: 'removeAllUserAttributes',
@@ -303,10 +300,8 @@ var mParticle = (function () {
303
300
  cookieNameV2: 'mprtcl-v2',
304
301
  cookieNameV3: 'mprtcl-v3',
305
302
  localStorageNameV4: 'mprtcl-v4',
306
- localStorageProductsV4: 'mprtcl-prodv4',
307
303
  cookieNameV4: 'mprtcl-v4',
308
- currentStorageName: 'mprtcl-v4',
309
- currentStorageProductsName: 'mprtcl-prodv4'
304
+ currentStorageName: 'mprtcl-v4'
310
305
  },
311
306
  DefaultConfig: {
312
307
  cookieDomain: null,
@@ -314,7 +309,6 @@ var mParticle = (function () {
314
309
  logLevel: null,
315
310
  timeout: 300,
316
311
  sessionTimeout: 30,
317
- maxProducts: 20,
318
312
  forwarderStatsTimeout: 5000,
319
313
  integrationDelayTimeout: 5000,
320
314
  maxCookieSize: 3000,
@@ -2113,15 +2107,6 @@ var mParticle = (function () {
2113
2107
  }
2114
2108
  return impressions;
2115
2109
  }
2116
- function convertShoppingCart(sdkEvent) {
2117
- if (!sdkEvent.ShoppingCart || !sdkEvent.ShoppingCart.ProductList || !sdkEvent.ShoppingCart.ProductList.length) {
2118
- return null;
2119
- }
2120
- var shoppingCart = {
2121
- products: convertProducts(sdkEvent.ShoppingCart.ProductList)
2122
- };
2123
- return shoppingCart;
2124
- }
2125
2110
  function convertCommerceEvent(sdkEvent) {
2126
2111
  var commonEventData = convertBaseEventData(sdkEvent);
2127
2112
  var commerceEventData = {
@@ -2129,7 +2114,6 @@ var mParticle = (function () {
2129
2114
  product_action: convertProductAction(sdkEvent),
2130
2115
  promotion_action: convertPromotionAction(sdkEvent),
2131
2116
  product_impressions: convertImpressions(sdkEvent),
2132
- shopping_cart: convertShoppingCart(sdkEvent),
2133
2117
  currency_code: sdkEvent.CurrencyCode
2134
2118
  };
2135
2119
  commerceEventData = Object.assign(commerceEventData, commonEventData);
@@ -4699,15 +4683,6 @@ var mParticle = (function () {
4699
4683
  attributes['Position'] = promotion.Position;
4700
4684
  }
4701
4685
  };
4702
- this.buildProductList = function (event, product) {
4703
- if (product) {
4704
- if (Array.isArray(product)) {
4705
- return product;
4706
- }
4707
- return [product];
4708
- }
4709
- return event.ShoppingCart.ProductList;
4710
- };
4711
4686
  this.createProduct = function (name, sku, price, quantity, variant, category, brand, position, couponCode, attributes) {
4712
4687
  attributes = mpInstance._Helpers.sanitizeAttributes(attributes, name);
4713
4688
  if (typeof name !== 'string') {
@@ -4899,7 +4874,6 @@ var mParticle = (function () {
4899
4874
  });
4900
4875
  baseEvent.EventName = 'eCommerce - ';
4901
4876
  baseEvent.CurrencyCode = mpInstance._Store.currencyCode;
4902
- baseEvent.ShoppingCart = [];
4903
4877
  baseEvent.CustomFlags = extend(baseEvent.CustomFlags, customFlags);
4904
4878
  return baseEvent;
4905
4879
  } else {
@@ -5156,11 +5130,6 @@ var mParticle = (function () {
5156
5130
  } else {
5157
5131
  this.SDKConfig.useCookieStorage = false;
5158
5132
  }
5159
- if (config.hasOwnProperty('maxProducts')) {
5160
- this.SDKConfig.maxProducts = config.maxProducts;
5161
- } else {
5162
- this.SDKConfig.maxProducts = Constants.DefaultConfig.maxProducts;
5163
- }
5164
5133
  if (config.hasOwnProperty('maxCookieSize')) {
5165
5134
  this.SDKConfig.maxCookieSize = config.maxCookieSize;
5166
5135
  } else {
@@ -6902,20 +6871,6 @@ var mParticle = (function () {
6902
6871
  eventType: Types.EventType.Unknown
6903
6872
  });
6904
6873
  };
6905
- this.logCheckoutEvent = function (step, option, attrs, customFlags) {
6906
- var event = mpInstance._Ecommerce.createCommerceEventObject(customFlags);
6907
- if (event) {
6908
- event.EventName += mpInstance._Ecommerce.getProductActionEventName(Types.ProductActionType.Checkout);
6909
- event.EventCategory = Types.CommerceEventType.ProductCheckout;
6910
- event.ProductAction = {
6911
- ProductActionType: Types.ProductActionType.Checkout,
6912
- CheckoutStep: step,
6913
- CheckoutOptions: option,
6914
- ProductList: []
6915
- };
6916
- self.logCommerceEvent(event, attrs);
6917
- }
6918
- };
6919
6874
  this.logProductActionEvent = function (productActionType, product, customAttrs, customFlags, transactionAttributes, options) {
6920
6875
  var event = mpInstance._Ecommerce.createCommerceEventObject(customFlags, options);
6921
6876
  var productList = Array.isArray(product) ? product : [product];
@@ -6956,26 +6911,9 @@ var mParticle = (function () {
6956
6911
  event.EventName += mpInstance._Ecommerce.getProductActionEventName(Types.ProductActionType.Purchase);
6957
6912
  event.EventCategory = Types.CommerceEventType.ProductPurchase;
6958
6913
  event.ProductAction = {
6959
- ProductActionType: Types.ProductActionType.Purchase
6960
- };
6961
- event.ProductAction.ProductList = mpInstance._Ecommerce.buildProductList(event, product);
6962
- mpInstance._Ecommerce.convertTransactionAttributesToProductAction(transactionAttributes, event.ProductAction);
6963
- self.logCommerceEvent(event, attrs);
6964
- }
6965
- };
6966
- this.logRefundEvent = function (transactionAttributes, product, attrs, customFlags) {
6967
- if (!transactionAttributes) {
6968
- mpInstance.Logger.error(Messages$3.ErrorMessages.TransactionRequired);
6969
- return;
6970
- }
6971
- var event = mpInstance._Ecommerce.createCommerceEventObject(customFlags);
6972
- if (event) {
6973
- event.EventName += mpInstance._Ecommerce.getProductActionEventName(Types.ProductActionType.Refund);
6974
- event.EventCategory = Types.CommerceEventType.ProductRefund;
6975
- event.ProductAction = {
6976
- ProductActionType: Types.ProductActionType.Refund
6914
+ ProductActionType: Types.ProductActionType.Purchase,
6915
+ ProductList: Array.isArray(product) ? product : [product]
6977
6916
  };
6978
- event.ProductAction.ProductList = mpInstance._Ecommerce.buildProductList(event, product);
6979
6917
  mpInstance._Ecommerce.convertTransactionAttributesToProductAction(transactionAttributes, event.ProductAction);
6980
6918
  self.logCommerceEvent(event, attrs);
6981
6919
  }
@@ -7022,10 +6960,6 @@ var mParticle = (function () {
7022
6960
  }
7023
6961
  var sanitizedAttrs = mpInstance._Helpers.sanitizeAttributes(attrs, commerceEvent.EventName);
7024
6962
  if (mpInstance._Helpers.canLog()) {
7025
- if (mpInstance._Store.webviewBridgeEnabled) {
7026
- // Don't send shopping cart to parent sdks
7027
- commerceEvent.ShoppingCart = {};
7028
- }
7029
6963
  if (sanitizedAttrs) {
7030
6964
  commerceEvent.EventAttributes = sanitizedAttrs;
7031
6965
  }
@@ -7892,12 +7826,6 @@ var mParticle = (function () {
7892
7826
  }
7893
7827
  if (event.EventDataType === MessageType.Commerce) {
7894
7828
  dto.cu = event.CurrencyCode;
7895
- // TODO: If Cart is deprecated, we should deprecate this too
7896
- if (event.ShoppingCart) {
7897
- dto.sc = {
7898
- pl: convertProductListToV2DTO(event.ShoppingCart.ProductList)
7899
- };
7900
- }
7901
7829
  if (event.ProductAction) {
7902
7830
  dto.pd = {
7903
7831
  an: event.ProductAction.ProductActionType,
@@ -8872,18 +8800,6 @@ var mParticle = (function () {
8872
8800
  }
8873
8801
  return userAttributesCopy;
8874
8802
  },
8875
- /**
8876
- * Returns the cart object for the current user
8877
- * @method getCart
8878
- * @return a cart object
8879
- */
8880
- getCart: function getCart() {
8881
- logDeprecatedMethodUsage({
8882
- methodName: 'Identity.getCurrentUser().getCart()',
8883
- warningMessage: 'Deprecated function Identity.getCurrentUser().getCart() will be removed in future releases'
8884
- }, mpInstance.Logger, mpInstance._ErrorReportingDispatcher);
8885
- return self.mParticleUserCart();
8886
- },
8887
8803
  /**
8888
8804
  * Returns the Consent State stored locally for this user.
8889
8805
  * @method getConsentState
@@ -8930,62 +8846,6 @@ var mParticle = (function () {
8930
8846
  }
8931
8847
  };
8932
8848
  };
8933
- /**
8934
- * Invoke these methods on the mParticle.Identity.getCurrentUser().getCart() object.
8935
- * Example: mParticle.Identity.getCurrentUser().getCart().add(...);
8936
- * @class mParticle.Identity.getCurrentUser().getCart()
8937
- * @deprecated
8938
- */
8939
- this.mParticleUserCart = function () {
8940
- return {
8941
- /**
8942
- * Adds a cart product to the user cart
8943
- * @method add
8944
- * @deprecated
8945
- */
8946
- add: function add() {
8947
- logDeprecatedMethodUsage({
8948
- methodName: 'Identity.getCurrentUser().getCart().add()',
8949
- warningMessage: generateDeprecationMessage('Identity.getCurrentUser().getCart().add()', true, 'eCommerce.logProductAction()', 'https://docs.mparticle.com/developers/sdk/web/commerce-tracking')
8950
- }, mpInstance.Logger, mpInstance._ErrorReportingDispatcher);
8951
- },
8952
- /**
8953
- * Removes a cart product from the current user cart
8954
- * @method remove
8955
- * @deprecated
8956
- */
8957
- remove: function remove() {
8958
- logDeprecatedMethodUsage({
8959
- methodName: 'Identity.getCurrentUser().getCart().remove()',
8960
- warningMessage: generateDeprecationMessage('Identity.getCurrentUser().getCart().remove()', true, 'eCommerce.logProductAction()', 'https://docs.mparticle.com/developers/sdk/web/commerce-tracking')
8961
- }, mpInstance.Logger, mpInstance._ErrorReportingDispatcher);
8962
- },
8963
- /**
8964
- * Clears the user's cart
8965
- * @method clear
8966
- * @deprecated
8967
- */
8968
- clear: function clear() {
8969
- logDeprecatedMethodUsage({
8970
- methodName: 'Identity.getCurrentUser().getCart().clear()',
8971
- warningMessage: generateDeprecationMessage('Identity.getCurrentUser().getCart().clear()', true, '', 'https://docs.mparticle.com/developers/sdk/web/commerce-tracking')
8972
- }, mpInstance.Logger, mpInstance._ErrorReportingDispatcher);
8973
- },
8974
- /**
8975
- * Returns all cart products
8976
- * @method getCartProducts
8977
- * @return {Array} array of cart products
8978
- * @deprecated
8979
- */
8980
- getCartProducts: function getCartProducts() {
8981
- logDeprecatedMethodUsage({
8982
- methodName: 'Identity.getCurrentUser().getCart().getCartProducts()',
8983
- warningMessage: generateDeprecationMessage('Identity.getCurrentUser().getCart().getCartProducts()', true, 'eCommerce.logProductAction()', 'https://docs.mparticle.com/developers/sdk/web/commerce-tracking')
8984
- }, mpInstance.Logger, mpInstance._ErrorReportingDispatcher);
8985
- return [];
8986
- }
8987
- };
8988
- };
8989
8849
  // https://go.mparticle.com/work/SQDSDKS-6355
8990
8850
  this.parseIdentityResponse = function (identityResponse, previousMPID, callback, identityApiData, method, knownIdentities, parsingCachedResponse) {
8991
8851
  var _a, _b, _c;
@@ -9342,7 +9202,6 @@ var mParticle = (function () {
9342
9202
  var consentStateCopy = self.createConsentState();
9343
9203
  consentStateCopy.setGDPRConsentState(consentState.getGDPRConsentState());
9344
9204
  consentStateCopy.setCCPAConsentState(consentState.getCCPAConsentState());
9345
- // TODO: Remove casting once `removeCCPAState` is removed;
9346
9205
  return consentStateCopy;
9347
9206
  }
9348
9207
  function canonicalizeForDeduplication(purpose) {
@@ -9458,15 +9317,6 @@ var mParticle = (function () {
9458
9317
  delete ccpa[CCPAPurpose];
9459
9318
  return this;
9460
9319
  }
9461
- // TODO: Can we remove this? It is deprecated.
9462
- function removeCCPAState() {
9463
- logDeprecatedMethodUsage({
9464
- methodName: 'Consent.removeCCPAState',
9465
- warningMessage: 'removeCCPAState is deprecated and will be removed in a future release; use removeCCPAConsentState instead'
9466
- }, mpInstance.Logger, mpInstance._ErrorReportingDispatcher);
9467
- // @ts-ignore
9468
- return removeCCPAConsentState();
9469
- }
9470
9320
  return {
9471
9321
  setGDPRConsentState: setGDPRConsentState,
9472
9322
  addGDPRConsentState: addGDPRConsentState,
@@ -9474,7 +9324,6 @@ var mParticle = (function () {
9474
9324
  getCCPAConsentState: getCCPAConsentState,
9475
9325
  getGDPRConsentState: getGDPRConsentState,
9476
9326
  removeGDPRConsentState: removeGDPRConsentState,
9477
- removeCCPAState: removeCCPAState,
9478
9327
  removeCCPAConsentState: removeCCPAConsentState
9479
9328
  };
9480
9329
  };
@@ -11811,51 +11660,6 @@ var mParticle = (function () {
11811
11660
  * @class mParticle.eCommerce
11812
11661
  */
11813
11662
  this.eCommerce = {
11814
- /**
11815
- * Invoke these methods on the mParticle.eCommerce.Cart object.
11816
- * Example: mParticle.eCommerce.Cart.add(...)
11817
- * @class mParticle.eCommerce.Cart
11818
- * @deprecated
11819
- */
11820
- Cart: {
11821
- /**
11822
- * Adds a product to the cart
11823
- * @method add
11824
- * @param {Object} product The product you want to add to the cart
11825
- * @param {Boolean} [logEventBoolean] Option to log the event to mParticle's servers. If blank, no logging occurs.
11826
- * @deprecated
11827
- */
11828
- add: function add(product, logEventBoolean) {
11829
- logDeprecatedMethodUsage({
11830
- methodName: 'mPInstance.eCommerce.Cart.add()',
11831
- warningMessage: generateDeprecationMessage('eCommerce.Cart.add()', true, 'eCommerce.logProductAction()', 'https://docs.mparticle.com/developers/sdk/web/commerce-tracking')
11832
- }, self.Logger, self._ErrorReportingDispatcher);
11833
- },
11834
- /**
11835
- * Removes a product from the cart
11836
- * @method remove
11837
- * @param {Object} product The product you want to add to the cart
11838
- * @param {Boolean} [logEventBoolean] Option to log the event to mParticle's servers. If blank, no logging occurs.
11839
- * @deprecated
11840
- */
11841
- remove: function remove(product, logEventBoolean) {
11842
- logDeprecatedMethodUsage({
11843
- methodName: 'mPInstance.eCommerce.Cart.remove()',
11844
- warningMessage: generateDeprecationMessage('eCommerce.Cart.remove()', true, 'eCommerce.logProductAction()', 'https://docs.mparticle.com/developers/sdk/web/commerce-tracking')
11845
- }, self.Logger, self._ErrorReportingDispatcher);
11846
- },
11847
- /**
11848
- * Clears the cart
11849
- * @method clear
11850
- * @deprecated
11851
- */
11852
- clear: function clear() {
11853
- logDeprecatedMethodUsage({
11854
- methodName: 'mPInstance.eCommerce.Cart.clear()',
11855
- warningMessage: generateDeprecationMessage('eCommerce.Cart.clear()', true, '', 'https://docs.mparticle.com/developers/sdk/web/commerce-tracking')
11856
- }, self.Logger, self._ErrorReportingDispatcher);
11857
- }
11858
- },
11859
11663
  /**
11860
11664
  * Sets the currency code
11861
11665
  * @for mParticle.eCommerce
@@ -11928,30 +11732,6 @@ var mParticle = (function () {
11928
11732
  createTransactionAttributes: function createTransactionAttributes(id, affiliation, couponCode, revenue, shipping, tax) {
11929
11733
  return self._Ecommerce.createTransactionAttributes(id, affiliation, couponCode, revenue, shipping, tax);
11930
11734
  },
11931
- /**
11932
- * Logs a checkout action
11933
- * @for mParticle.eCommerce
11934
- * @method logCheckout
11935
- * @param {Number} step checkout step number
11936
- * @param {String} checkout option string
11937
- * @param {Object} attrs
11938
- * @param {Object} [customFlags] Custom flags for the event
11939
- * @deprecated
11940
- */
11941
- logCheckout: function logCheckout(step, option, attrs, customFlags) {
11942
- logDeprecatedMethodUsage({
11943
- methodName: 'mParticle.logCheckout',
11944
- warningMessage: 'mParticle.logCheckout is deprecated, please use mParticle.logProductAction instead'
11945
- }, self.Logger, self._ErrorReportingDispatcher);
11946
- if (!self._Store.isInitialized) {
11947
- self.ready(function () {
11948
- self.eCommerce.logCheckout(step, option, attrs, customFlags);
11949
- });
11950
- return;
11951
- }
11952
- self._SessionManager.resetSessionTimer();
11953
- self._Events.logCheckoutEvent(step, option, attrs, customFlags);
11954
- },
11955
11735
  /**
11956
11736
  * Logs a product action
11957
11737
  * @for mParticle.eCommerce
@@ -11980,12 +11760,12 @@ var mParticle = (function () {
11980
11760
  * @param {Boolean} [clearCart] boolean to clear the cart after logging or not. Defaults to false
11981
11761
  * @param {Object} [attrs] other attributes related to the product purchase
11982
11762
  * @param {Object} [customFlags] Custom flags for the event
11983
- * @deprecated
11763
+ * @deprecated Use `logProductAction` with `ProductActionType.Purchase` instead.
11984
11764
  */
11985
11765
  logPurchase: function logPurchase(transactionAttributes, product, clearCart, attrs, customFlags) {
11986
11766
  logDeprecatedMethodUsage({
11987
11767
  methodName: 'mParticle.logPurchase',
11988
- warningMessage: 'mParticle.logPurchase is deprecated, please use mParticle.logProductAction instead'
11768
+ warningMessage: 'mParticle.logPurchase is deprecated, please use mParticle.logProductAction with ProductActionType.Purchase instead'
11989
11769
  }, self.Logger, self._ErrorReportingDispatcher);
11990
11770
  if (!self._Store.isInitialized) {
11991
11771
  self.ready(function () {
@@ -12035,31 +11815,6 @@ var mParticle = (function () {
12035
11815
  self._SessionManager.resetSessionTimer();
12036
11816
  self._Events.logImpressionEvent(impression, attrs, customFlags, eventOptions);
12037
11817
  },
12038
- /**
12039
- * Logs a refund
12040
- * @for mParticle.eCommerce
12041
- * @method logRefund
12042
- * @param {Object} transactionAttributes transaction attributes related to the refund
12043
- * @param {Object} product product being refunded
12044
- * @param {Boolean} [clearCart] boolean to clear the cart after refund is logged. Defaults to false.
12045
- * @param {Object} [attrs] attributes related to the refund
12046
- * @param {Object} [customFlags] Custom flags for the event
12047
- * @deprecated
12048
- */
12049
- logRefund: function logRefund(transactionAttributes, product, clearCart, attrs, customFlags) {
12050
- logDeprecatedMethodUsage({
12051
- methodName: 'mParticle.logRefund',
12052
- warningMessage: 'mParticle.logRefund is deprecated, please use mParticle.logProductAction instead'
12053
- }, self.Logger, self._ErrorReportingDispatcher);
12054
- if (!self._Store.isInitialized) {
12055
- self.ready(function () {
12056
- self.eCommerce.logRefund(transactionAttributes, product, clearCart, attrs, customFlags);
12057
- });
12058
- return;
12059
- }
12060
- self._SessionManager.resetSessionTimer();
12061
- self._Events.logRefundEvent(transactionAttributes, product, attrs, customFlags);
12062
- },
12063
11818
  expandCommerceEvent: function expandCommerceEvent(event) {
12064
11819
  return self._Ecommerce.expandCommerceEvent(event);
12065
11820
  }
@@ -12868,17 +12623,6 @@ var mParticle = (function () {
12868
12623
  self.getInstance().upload();
12869
12624
  };
12870
12625
  this.eCommerce = {
12871
- Cart: {
12872
- add: function add(product, logEventBoolean) {
12873
- self.getInstance().eCommerce.Cart.add(product, logEventBoolean);
12874
- },
12875
- remove: function remove(product, logEventBoolean) {
12876
- self.getInstance().eCommerce.Cart.remove(product, logEventBoolean);
12877
- },
12878
- clear: function clear() {
12879
- self.getInstance().eCommerce.Cart.clear();
12880
- }
12881
- },
12882
12626
  setCurrencyCode: function setCurrencyCode(code) {
12883
12627
  self.getInstance().eCommerce.setCurrencyCode(code);
12884
12628
  },
@@ -12894,9 +12638,6 @@ var mParticle = (function () {
12894
12638
  createTransactionAttributes: function createTransactionAttributes(id, affiliation, couponCode, revenue, shipping, tax) {
12895
12639
  return self.getInstance().eCommerce.createTransactionAttributes(id, affiliation, couponCode, revenue, shipping, tax);
12896
12640
  },
12897
- logCheckout: function logCheckout(step, options, attrs, customFlags) {
12898
- self.getInstance().eCommerce.logCheckout(step, options, attrs, customFlags);
12899
- },
12900
12641
  logProductAction: function logProductAction(productActionType, product, attrs, customFlags, transactionAttributes, eventOptions) {
12901
12642
  self.getInstance().eCommerce.logProductAction(productActionType, product, attrs, customFlags, transactionAttributes, eventOptions);
12902
12643
  },
@@ -12909,9 +12650,6 @@ var mParticle = (function () {
12909
12650
  logImpression: function logImpression(impression, attrs, customFlags, eventOptions) {
12910
12651
  self.getInstance().eCommerce.logImpression(impression, attrs, customFlags, eventOptions);
12911
12652
  },
12912
- logRefund: function logRefund(transactionAttributes, product, clearCart, attrs, customFlags) {
12913
- self.getInstance().eCommerce.logRefund(transactionAttributes, product, clearCart, attrs, customFlags);
12914
- },
12915
12653
  expandCommerceEvent: function expandCommerceEvent(event) {
12916
12654
  return self.getInstance().eCommerce.expandCommerceEvent(event);
12917
12655
  }
@@ -58,9 +58,6 @@ export interface IConsentRules {
58
58
  includeOnMatch: boolean;
59
59
  values: IConsentRulesValues[];
60
60
  }
61
- export interface IConsentState extends ConsentState {
62
- removeCCPAState: () => ConsentState;
63
- }
64
61
  export interface IConsent {
65
62
  isEnabledForUserConsent: (consentRules: IConsentRules, user: IMParticleUser) => boolean;
66
63
  createPrivacyConsent: ICreatePrivacyConsentFunction;
@@ -73,9 +73,6 @@ declare const Constants: {
73
73
  readonly SetUserAttribute: "setUserAttribute";
74
74
  readonly RemoveUserAttribute: "removeUserAttribute";
75
75
  readonly SetSessionAttribute: "setSessionAttribute";
76
- readonly AddToCart: "addToCart";
77
- readonly RemoveFromCart: "removeFromCart";
78
- readonly ClearCart: "clearCart";
79
76
  readonly LogOut: "logOut";
80
77
  readonly SetUserAttributeList: "setUserAttributeList";
81
78
  readonly RemoveAllUserAttributes: "removeAllUserAttributes";
@@ -95,10 +92,8 @@ declare const Constants: {
95
92
  readonly cookieNameV2: "mprtcl-v2";
96
93
  readonly cookieNameV3: "mprtcl-v3";
97
94
  readonly localStorageNameV4: "mprtcl-v4";
98
- readonly localStorageProductsV4: "mprtcl-prodv4";
99
95
  readonly cookieNameV4: "mprtcl-v4";
100
96
  readonly currentStorageName: "mprtcl-v4";
101
- readonly currentStorageProductsName: "mprtcl-prodv4";
102
97
  };
103
98
  readonly DefaultConfig: {
104
99
  readonly cookieDomain: any;
@@ -106,7 +101,6 @@ declare const Constants: {
106
101
  readonly logLevel: any;
107
102
  readonly timeout: 300;
108
103
  readonly sessionTimeout: 30;
109
- readonly maxProducts: 20;
110
104
  readonly forwarderStatsTimeout: 5000;
111
105
  readonly integrationDelayTimeout: 5000;
112
106
  readonly maxCookieSize: 3000;
@@ -9,20 +9,15 @@ interface IECommerceShared {
9
9
  createTransactionAttributes(id: string | number, affiliation?: string, couponCode?: string, revenue?: string | number, shipping?: string | number, tax?: number): TransactionAttributes | null;
10
10
  expandCommerceEvent(event: SDKEvent): SDKEvent[] | null;
11
11
  }
12
- export interface SDKCart {
13
- add(product: SDKProduct | SDKProduct[], logEvent?: boolean): void;
14
- remove(product: SDKProduct | SDKProduct[], logEvent?: boolean): void;
15
- clear(): void;
16
- }
17
12
  export interface SDKECommerceAPI extends IECommerceShared {
18
- logCheckout(step: number, option?: string, attrs?: SDKEventAttrs, customFlags?: SDKEventCustomFlags): void;
19
13
  logImpression(impression: SDKImpression | SDKImpression[], attrs?: SDKEventAttrs, customFlags?: SDKEventCustomFlags, eventOptions?: SDKEventOptions): void;
20
14
  logProductAction(productActionType: valueof<typeof ProductActionType>, product: SDKProduct | SDKProduct[], attrs?: SDKEventAttrs, customFlags?: SDKEventCustomFlags, transactionAttributes?: TransactionAttributes, eventOptions?: SDKEventOptions): void;
21
15
  logPromotion(type: valueof<typeof PromotionActionType>, promotion: SDKPromotion | SDKPromotion[], attrs?: SDKEventAttrs, customFlags?: SDKEventCustomFlags, eventOptions?: SDKEventOptions): void;
22
16
  setCurrencyCode(code: string): void;
23
- Cart: SDKCart;
17
+ /**
18
+ * @deprecated Use `logProductAction` with `ProductActionType.Purchase` instead.
19
+ */
24
20
  logPurchase(transactionAttributes: TransactionAttributes, product: SDKProduct | SDKProduct[], clearCart?: boolean, attrs?: SDKEventAttrs, customFlags?: SDKEventCustomFlags): void;
25
- logRefund(transactionAttributes: TransactionAttributes, product: SDKProduct | SDKProduct[], clearCart?: boolean, attrs?: SDKEventAttrs, customFlags?: SDKEventCustomFlags): void;
26
21
  }
27
22
  interface ExtractedActionAttributes {
28
23
  Affiliation?: string;
@@ -56,7 +51,6 @@ interface ExtractedTransactionId {
56
51
  'Transaction ID'?: string;
57
52
  }
58
53
  export interface IECommerce extends IECommerceShared {
59
- buildProductList(event: SDKEvent, product: SDKProduct | SDKProduct[]): SDKProduct[];
60
54
  convertProductActionToEventType(productActionType: valueof<typeof ProductActionType>): // https://go.mparticle.com/work/SQDSDKS-4801
61
55
  number | null;
62
56
  convertPromotionActionToEventType(promotionActionType: valueof<typeof PromotionActionType>): number | null;
@@ -6,7 +6,6 @@ type EventHandlerFunction<T> = (element: HTMLLinkElement | HTMLFormElement) => T
6
6
  export interface IEvents {
7
7
  addEventHandler(domEvent: string, selector: string | Node, eventName: EventHandlerFunction<string> | string, data: EventHandlerFunction<SDKEventAttrs> | SDKEventAttrs, eventType: valueof<typeof EventType>): void;
8
8
  logAST(): void;
9
- logCheckoutEvent(step: number, option?: string, attrs?: SDKEventAttrs, customFlags?: SDKEventCustomFlags): void;
10
9
  logCommerceEvent(commerceEvent: SDKEvent, attrs?: SDKEventAttrs, options?: SDKEventOptions): void;
11
10
  logEvent(event: BaseEvent, eventOptions?: SDKEventOptions): void;
12
11
  logImpressionEvent(impression: SDKImpression | SDKImpression[], attrs?: SDKEventAttrs, customFlags?: SDKEventCustomFlags, eventOptions?: SDKEventOptions): void;
@@ -15,7 +14,6 @@ export interface IEvents {
15
14
  logProductActionEvent(productActionType: valueof<typeof ProductActionType>, product: SDKProduct | SDKProduct[], attrs?: SDKEventAttrs, customFlags?: SDKEventCustomFlags, transactionAttributes?: TransactionAttributes, eventOptions?: SDKEventOptions): void;
16
15
  logPromotionEvent(promotionType: valueof<typeof PromotionActionType>, promotion: SDKPromotion | SDKPromotion[], attrs?: SDKEventAttrs, customFlags?: SDKEventCustomFlags, eventOptions?: SDKEventOptions): void;
17
16
  logPurchaseEvent(transactionAttributes: TransactionAttributes, product: SDKProduct | SDKProduct[], attrs?: SDKEventAttrs, customFlags?: SDKEventCustomFlags): void;
18
- logRefundEvent(transactionAttributes: TransactionAttributes, product: SDKProduct | SDKProduct[], attrs?: SDKEventAttrs, customFlags?: SDKEventCustomFlags): void;
19
17
  startTracking(callback: Callback): void;
20
18
  stopTracking(): void;
21
19
  }
@@ -1,7 +1,7 @@
1
1
  import { AllUserAttributes, MPID, User } from '@mparticle/web-sdk';
2
2
  import { SDKIdentityTypeEnum } from './identity.interfaces';
3
3
  import { MessageType } from './types';
4
- import { BaseEvent, SDKProduct } from './sdkRuntimeModels';
4
+ import { BaseEvent } from './sdkRuntimeModels';
5
5
  declare const HTTPCodes: {
6
6
  readonly noHttpCoverage: -1;
7
7
  readonly activeIdentityRequest: -2;
@@ -11,30 +11,11 @@ declare const HTTPCodes: {
11
11
  readonly loggingDisabledOrMissingAPIKey: -6;
12
12
  readonly tooManyRequests: 429;
13
13
  };
14
- interface ICart {
15
- /**
16
- * @deprecated Cart persistence in mParticle has been deprecated. Please use mParticle.eCommerce.logProductAction(mParticle.ProductActionType.AddToCart, [products])
17
- */
18
- add: (product: SDKProduct, logEventBoolean?: boolean) => void;
19
- /**
20
- * @deprecated Cart persistence in mParticle has been deprecated. Please use mParticle.eCommerce.logProductAction(mParticle.ProductActionType.RemoveFromCart, [products])
21
- */
22
- remove: (product: SDKProduct, logEventBoolean?: boolean) => void;
23
- /**
24
- * @deprecated Cart persistence in mParticle has been deprecated.
25
- */
26
- clear: () => void;
27
- /**
28
- * @deprecated Cart Products have been deprecated
29
- */
30
- getCartProducts: () => SDKProduct[];
31
- }
32
- export interface IMParticleUser extends User {
14
+ export interface IMParticleUser extends Omit<User, 'getCart'> {
33
15
  getAllUserAttributes(): any;
34
16
  setUserTag(tagName: string, value?: any): void;
35
17
  setUserAttribute(key: string, value: any): void;
36
18
  getUserAudiences?(callback?: IdentityCallback): void;
37
- getCart(): ICart;
38
19
  }
39
20
  export interface ISDKUserIdentity {
40
21
  Identity: string;
@@ -96,11 +77,5 @@ export interface IdentityModifyResultBody {
96
77
  modified_mpid: MPID;
97
78
  };
98
79
  }
99
- export interface mParticleUserCart {
100
- add(): void;
101
- remove(): void;
102
- clear(): void;
103
- getCartProducts(): SDKProduct[];
104
- }
105
80
  export type UserAttributes = AllUserAttributes;
106
81
  export {};
@@ -4,7 +4,7 @@ import { ICachedIdentityCall, IKnownIdentities } from './identity-utils';
4
4
  import { BaseVault } from './vault';
5
5
  import { Dictionary, Environment, valueof } from './utils';
6
6
  import Constants from './constants';
7
- import { IdentityCallback, IUserAttributeChangeEvent, IUserIdentityChangeEvent, IMParticleUser, mParticleUserCart, IIdentityResponse } from './identity-user-interfaces';
7
+ import { IdentityCallback, IUserAttributeChangeEvent, IUserIdentityChangeEvent, IMParticleUser, IIdentityResponse } from './identity-user-interfaces';
8
8
  import { IdentitySearchCallback } from './identity/search';
9
9
  declare const HTTPCodes: {
10
10
  readonly noHttpCoverage: -1;
@@ -180,8 +180,4 @@ export interface IIdentity {
180
180
  sendUserIdentityChangeEvent(newUserIdentities: UserIdentities, method: IdentityAPIMethod, mpid: MPID, prevUserIdentities: UserIdentities): void;
181
181
  reinitForwardersOnUserChange(prevUser: IMParticleUser, newUser: IMParticleUser): void;
182
182
  setForwarderCallbacks(user: IMParticleUser, method: IdentityAPIMethod): void;
183
- /**
184
- * @deprecated
185
- */
186
- mParticleUserCart(): mParticleUserCart;
187
183
  }
@@ -17,4 +17,4 @@ export type { KitInterface, } from './forwarders.interfaces';
17
17
  export type { RoktAttributeValue, RoktAttributeValueType, RoktAttributeValueArray, RoktAttributes, IRoktPartnerExtensionData, IRoktSelectPlacementsOptions, IRoktSelection, IRoktLauncher, IRoktMessage, RoktKitFilterSettings, IRoktKitSettings, IRoktKit, IRoktOptions, IRoktLauncherOptions, } from './roktManager';
18
18
  export type { ErrorCodes, WSDKErrorSeverity, } from './reporting/types';
19
19
  export type { ISDKError, ISDKLogEntry, IErrorReportingService, ILoggingService, } from './reporting/types';
20
- export type { SDKEvent, SDKProductAction, SDKProductActionType, SDKPromotionAction, SDKShoppingCart, SDKGeoLocation, SDKDataPlan, SDKLoggerApi, SDKConfigApi, IMParticleInstanceManager, } from './sdkRuntimeModels';
20
+ export type { SDKEvent, SDKProductAction, SDKProductActionType, SDKPromotionAction, SDKGeoLocation, SDKDataPlan, SDKLoggerApi, SDKConfigApi, IMParticleInstanceManager, } from './sdkRuntimeModels';
@@ -58,7 +58,6 @@ export default class KitBlocker {
58
58
  ProductAction?: import("./sdkRuntimeModels").SDKProductAction;
59
59
  PromotionAction?: import("./sdkRuntimeModels").SDKPromotionAction;
60
60
  ProductImpressions?: import("./sdkRuntimeModels").SDKProductImpression[];
61
- ShoppingCart?: import("./sdkRuntimeModels").SDKShoppingCart;
62
61
  UserIdentityChanges?: import("./identity-user-interfaces").ISDKUserIdentityChanges;
63
62
  UserAttributeChanges?: import("./identity-user-interfaces").ISDKUserAttributeChangeData;
64
63
  CurrencyCode: string;
@@ -104,7 +103,6 @@ export default class KitBlocker {
104
103
  ProductAction?: import("./sdkRuntimeModels").SDKProductAction;
105
104
  PromotionAction?: import("./sdkRuntimeModels").SDKPromotionAction;
106
105
  ProductImpressions?: import("./sdkRuntimeModels").SDKProductImpression[];
107
- ShoppingCart?: import("./sdkRuntimeModels").SDKShoppingCart;
108
106
  UserIdentityChanges?: import("./identity-user-interfaces").ISDKUserIdentityChanges;
109
107
  UserAttributeChanges?: import("./identity-user-interfaces").ISDKUserAttributeChangeData;
110
108
  CurrencyCode: string;
@@ -17,7 +17,7 @@ export type { EventType, CommerceEventType, IdentityType, ProductActionType, Pro
17
17
  export type { SDKInitConfig, DataPlanConfig, BaseEvent, SDKEventCustomFlags, LogLevelType, MParticleWebSDK, } from './sdkRuntimeModels';
18
18
  export type { IMParticleUser, IdentityCallback, IdentityResult, IdentityResultBody, IdentityModifyResultBody, ISDKUserIdentity, ISDKUserAttributes, } from './identity-user-interfaces';
19
19
  export type { SDKIdentityApi, IAliasRequest, IAliasCallback, IAliasResult, SDKIdentityTypeEnum, IIdentitySearchResult, IIdentitySearchResponseBody, IdentitySearchCallback, IUserIdentities } from './identity.interfaces';
20
- export type { SDKECommerceAPI, SDKCart, } from './ecommerce.interfaces';
20
+ export type { SDKECommerceAPI, } from './ecommerce.interfaces';
21
21
  export type { SDKProduct, SDKPromotion, SDKImpression, SDKProductImpression, } from './sdkRuntimeModels';
22
22
  export type { SDKConsentApi, SDKConsentState, SDKConsentStateData, SDKGDPRConsentState, SDKCCPAConsentState, } from './consent';
23
23
  export type { Dictionary, valueof } from './utils';