@mparticle/web-sdk 2.80.1 → 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.common.js +16 -85
- package/dist/mparticle.esm.js +16 -85
- package/dist/mparticle.js +60 -271
- package/dist/types/src/consent.d.ts +0 -3
- package/dist/types/src/constants.d.ts +0 -6
- package/dist/types/src/ecommerce.interfaces.d.ts +3 -9
- package/dist/types/src/events.interfaces.d.ts +0 -2
- package/dist/types/src/identity-user-interfaces.d.ts +2 -27
- package/dist/types/src/identity.interfaces.d.ts +1 -5
- package/dist/types/src/internal-types.d.ts +1 -1
- package/dist/types/src/kitBlocking.d.ts +0 -2
- package/dist/types/src/public-types.d.ts +1 -1
- package/dist/types/src/roktManager.d.ts +18 -0
- package/dist/types/src/sdkRuntimeModels.d.ts +0 -5
- package/dist/types/src/sdkToEventsApiConverter.d.ts +0 -1
- package/dist/types/src/store.d.ts +0 -1
- package/dist/types/src/stub/mparticle.stub.d.ts +0 -23
- package/package.json +2 -3
- package/src/consent.ts +2 -24
- package/src/constants.ts +0 -6
- package/src/ecommerce.interfaces.ts +2 -33
- package/src/ecommerce.ts +0 -16
- package/src/events.interfaces.ts +0 -17
- package/src/events.ts +1 -74
- package/src/identity-user-interfaces.ts +2 -33
- package/src/identity.interfaces.ts +0 -6
- package/src/identity.ts +0 -115
- package/src/internal-types.ts +0 -1
- package/src/mp-instance.ts +2 -156
- package/src/mparticle-instance-manager.ts +0 -37
- package/src/public-types.ts +0 -1
- package/src/roktManager.ts +37 -0
- package/src/sdkRuntimeModels.ts +0 -6
- package/src/sdkToEventsApiConverter.ts +0 -17
- package/src/serverModel.ts +0 -9
- package/src/store.ts +0 -7
- package/src/stub/mparticle.stub.js +0 -15
package/src/identity.ts
CHANGED
|
@@ -27,7 +27,6 @@ import {
|
|
|
27
27
|
IdentityCallback,
|
|
28
28
|
IIdentityResponse,
|
|
29
29
|
IMParticleUser,
|
|
30
|
-
mParticleUserCart,
|
|
31
30
|
} from './identity-user-interfaces';
|
|
32
31
|
import {
|
|
33
32
|
IIdentity,
|
|
@@ -1283,24 +1282,6 @@ export default function Identity(
|
|
|
1283
1282
|
|
|
1284
1283
|
return userAttributesCopy;
|
|
1285
1284
|
},
|
|
1286
|
-
/**
|
|
1287
|
-
* Returns the cart object for the current user
|
|
1288
|
-
* @method getCart
|
|
1289
|
-
* @return a cart object
|
|
1290
|
-
*/
|
|
1291
|
-
getCart: function() {
|
|
1292
|
-
logDeprecatedMethodUsage(
|
|
1293
|
-
{
|
|
1294
|
-
methodName: 'Identity.getCurrentUser().getCart()',
|
|
1295
|
-
warningMessage:
|
|
1296
|
-
'Deprecated function Identity.getCurrentUser().getCart() will be removed in future releases',
|
|
1297
|
-
},
|
|
1298
|
-
mpInstance.Logger,
|
|
1299
|
-
mpInstance._ErrorReportingDispatcher
|
|
1300
|
-
);
|
|
1301
|
-
return self.mParticleUserCart();
|
|
1302
|
-
},
|
|
1303
|
-
|
|
1304
1285
|
/**
|
|
1305
1286
|
* Returns the Consent State stored locally for this user.
|
|
1306
1287
|
* @method getConsentState
|
|
@@ -1365,102 +1346,6 @@ export default function Identity(
|
|
|
1365
1346
|
};
|
|
1366
1347
|
};
|
|
1367
1348
|
|
|
1368
|
-
/**
|
|
1369
|
-
* Invoke these methods on the mParticle.Identity.getCurrentUser().getCart() object.
|
|
1370
|
-
* Example: mParticle.Identity.getCurrentUser().getCart().add(...);
|
|
1371
|
-
* @class mParticle.Identity.getCurrentUser().getCart()
|
|
1372
|
-
* @deprecated
|
|
1373
|
-
*/
|
|
1374
|
-
this.mParticleUserCart = function(): mParticleUserCart {
|
|
1375
|
-
return {
|
|
1376
|
-
/**
|
|
1377
|
-
* Adds a cart product to the user cart
|
|
1378
|
-
* @method add
|
|
1379
|
-
* @deprecated
|
|
1380
|
-
*/
|
|
1381
|
-
add: function() {
|
|
1382
|
-
logDeprecatedMethodUsage(
|
|
1383
|
-
{
|
|
1384
|
-
methodName: 'Identity.getCurrentUser().getCart().add()',
|
|
1385
|
-
warningMessage: generateDeprecationMessage(
|
|
1386
|
-
'Identity.getCurrentUser().getCart().add()',
|
|
1387
|
-
true,
|
|
1388
|
-
'eCommerce.logProductAction()',
|
|
1389
|
-
'https://docs.mparticle.com/developers/sdk/web/commerce-tracking'
|
|
1390
|
-
),
|
|
1391
|
-
},
|
|
1392
|
-
mpInstance.Logger,
|
|
1393
|
-
mpInstance._ErrorReportingDispatcher
|
|
1394
|
-
);
|
|
1395
|
-
},
|
|
1396
|
-
/**
|
|
1397
|
-
* Removes a cart product from the current user cart
|
|
1398
|
-
* @method remove
|
|
1399
|
-
* @deprecated
|
|
1400
|
-
*/
|
|
1401
|
-
remove: function() {
|
|
1402
|
-
logDeprecatedMethodUsage(
|
|
1403
|
-
{
|
|
1404
|
-
methodName:
|
|
1405
|
-
'Identity.getCurrentUser().getCart().remove()',
|
|
1406
|
-
warningMessage: generateDeprecationMessage(
|
|
1407
|
-
'Identity.getCurrentUser().getCart().remove()',
|
|
1408
|
-
true,
|
|
1409
|
-
'eCommerce.logProductAction()',
|
|
1410
|
-
'https://docs.mparticle.com/developers/sdk/web/commerce-tracking'
|
|
1411
|
-
),
|
|
1412
|
-
},
|
|
1413
|
-
mpInstance.Logger,
|
|
1414
|
-
mpInstance._ErrorReportingDispatcher
|
|
1415
|
-
);
|
|
1416
|
-
},
|
|
1417
|
-
/**
|
|
1418
|
-
* Clears the user's cart
|
|
1419
|
-
* @method clear
|
|
1420
|
-
* @deprecated
|
|
1421
|
-
*/
|
|
1422
|
-
clear: function() {
|
|
1423
|
-
logDeprecatedMethodUsage(
|
|
1424
|
-
{
|
|
1425
|
-
methodName:
|
|
1426
|
-
'Identity.getCurrentUser().getCart().clear()',
|
|
1427
|
-
warningMessage: generateDeprecationMessage(
|
|
1428
|
-
'Identity.getCurrentUser().getCart().clear()',
|
|
1429
|
-
true,
|
|
1430
|
-
'',
|
|
1431
|
-
'https://docs.mparticle.com/developers/sdk/web/commerce-tracking'
|
|
1432
|
-
),
|
|
1433
|
-
},
|
|
1434
|
-
mpInstance.Logger,
|
|
1435
|
-
mpInstance._ErrorReportingDispatcher
|
|
1436
|
-
);
|
|
1437
|
-
},
|
|
1438
|
-
/**
|
|
1439
|
-
* Returns all cart products
|
|
1440
|
-
* @method getCartProducts
|
|
1441
|
-
* @return {Array} array of cart products
|
|
1442
|
-
* @deprecated
|
|
1443
|
-
*/
|
|
1444
|
-
getCartProducts: function() {
|
|
1445
|
-
logDeprecatedMethodUsage(
|
|
1446
|
-
{
|
|
1447
|
-
methodName:
|
|
1448
|
-
'Identity.getCurrentUser().getCart().getCartProducts()',
|
|
1449
|
-
warningMessage: generateDeprecationMessage(
|
|
1450
|
-
'Identity.getCurrentUser().getCart().getCartProducts()',
|
|
1451
|
-
true,
|
|
1452
|
-
'eCommerce.logProductAction()',
|
|
1453
|
-
'https://docs.mparticle.com/developers/sdk/web/commerce-tracking'
|
|
1454
|
-
),
|
|
1455
|
-
},
|
|
1456
|
-
mpInstance.Logger,
|
|
1457
|
-
mpInstance._ErrorReportingDispatcher
|
|
1458
|
-
);
|
|
1459
|
-
return [];
|
|
1460
|
-
},
|
|
1461
|
-
};
|
|
1462
|
-
};
|
|
1463
|
-
|
|
1464
1349
|
// https://go.mparticle.com/work/SQDSDKS-6355
|
|
1465
1350
|
this.parseIdentityResponse = function(
|
|
1466
1351
|
identityResponse: IIdentityResponse,
|
package/src/internal-types.ts
CHANGED
package/src/mp-instance.ts
CHANGED
|
@@ -780,78 +780,6 @@ export default function mParticleInstance(this: IMParticleWebSDKInstance, instan
|
|
|
780
780
|
* @class mParticle.eCommerce
|
|
781
781
|
*/
|
|
782
782
|
this.eCommerce = {
|
|
783
|
-
/**
|
|
784
|
-
* Invoke these methods on the mParticle.eCommerce.Cart object.
|
|
785
|
-
* Example: mParticle.eCommerce.Cart.add(...)
|
|
786
|
-
* @class mParticle.eCommerce.Cart
|
|
787
|
-
* @deprecated
|
|
788
|
-
*/
|
|
789
|
-
Cart: {
|
|
790
|
-
/**
|
|
791
|
-
* Adds a product to the cart
|
|
792
|
-
* @method add
|
|
793
|
-
* @param {Object} product The product you want to add to the cart
|
|
794
|
-
* @param {Boolean} [logEventBoolean] Option to log the event to mParticle's servers. If blank, no logging occurs.
|
|
795
|
-
* @deprecated
|
|
796
|
-
*/
|
|
797
|
-
add: function(product, logEventBoolean) {
|
|
798
|
-
logDeprecatedMethodUsage(
|
|
799
|
-
{
|
|
800
|
-
methodName: 'mPInstance.eCommerce.Cart.add()',
|
|
801
|
-
warningMessage: generateDeprecationMessage(
|
|
802
|
-
'eCommerce.Cart.add()',
|
|
803
|
-
true,
|
|
804
|
-
'eCommerce.logProductAction()',
|
|
805
|
-
'https://docs.mparticle.com/developers/sdk/web/commerce-tracking'
|
|
806
|
-
),
|
|
807
|
-
},
|
|
808
|
-
self.Logger,
|
|
809
|
-
self._ErrorReportingDispatcher
|
|
810
|
-
);
|
|
811
|
-
},
|
|
812
|
-
/**
|
|
813
|
-
* Removes a product from the cart
|
|
814
|
-
* @method remove
|
|
815
|
-
* @param {Object} product The product you want to add to the cart
|
|
816
|
-
* @param {Boolean} [logEventBoolean] Option to log the event to mParticle's servers. If blank, no logging occurs.
|
|
817
|
-
* @deprecated
|
|
818
|
-
*/
|
|
819
|
-
remove: function(product, logEventBoolean) {
|
|
820
|
-
logDeprecatedMethodUsage(
|
|
821
|
-
{
|
|
822
|
-
methodName: 'mPInstance.eCommerce.Cart.remove()',
|
|
823
|
-
warningMessage: generateDeprecationMessage(
|
|
824
|
-
'eCommerce.Cart.remove()',
|
|
825
|
-
true,
|
|
826
|
-
'eCommerce.logProductAction()',
|
|
827
|
-
'https://docs.mparticle.com/developers/sdk/web/commerce-tracking'
|
|
828
|
-
),
|
|
829
|
-
},
|
|
830
|
-
self.Logger,
|
|
831
|
-
self._ErrorReportingDispatcher
|
|
832
|
-
);
|
|
833
|
-
},
|
|
834
|
-
/**
|
|
835
|
-
* Clears the cart
|
|
836
|
-
* @method clear
|
|
837
|
-
* @deprecated
|
|
838
|
-
*/
|
|
839
|
-
clear: function() {
|
|
840
|
-
logDeprecatedMethodUsage(
|
|
841
|
-
{
|
|
842
|
-
methodName: 'mPInstance.eCommerce.Cart.clear()',
|
|
843
|
-
warningMessage: generateDeprecationMessage(
|
|
844
|
-
'eCommerce.Cart.clear()',
|
|
845
|
-
true,
|
|
846
|
-
'',
|
|
847
|
-
'https://docs.mparticle.com/developers/sdk/web/commerce-tracking'
|
|
848
|
-
),
|
|
849
|
-
},
|
|
850
|
-
self.Logger,
|
|
851
|
-
self._ErrorReportingDispatcher
|
|
852
|
-
);
|
|
853
|
-
},
|
|
854
|
-
},
|
|
855
783
|
/**
|
|
856
784
|
* Sets the currency code
|
|
857
785
|
* @for mParticle.eCommerce
|
|
@@ -967,42 +895,6 @@ export default function mParticleInstance(this: IMParticleWebSDKInstance, instan
|
|
|
967
895
|
tax
|
|
968
896
|
);
|
|
969
897
|
},
|
|
970
|
-
/**
|
|
971
|
-
* Logs a checkout action
|
|
972
|
-
* @for mParticle.eCommerce
|
|
973
|
-
* @method logCheckout
|
|
974
|
-
* @param {Number} step checkout step number
|
|
975
|
-
* @param {String} checkout option string
|
|
976
|
-
* @param {Object} attrs
|
|
977
|
-
* @param {Object} [customFlags] Custom flags for the event
|
|
978
|
-
* @deprecated
|
|
979
|
-
*/
|
|
980
|
-
logCheckout: function(step, option, attrs, customFlags) {
|
|
981
|
-
logDeprecatedMethodUsage(
|
|
982
|
-
{
|
|
983
|
-
methodName: 'mParticle.logCheckout',
|
|
984
|
-
warningMessage: 'mParticle.logCheckout is deprecated, please use mParticle.logProductAction instead',
|
|
985
|
-
},
|
|
986
|
-
self.Logger,
|
|
987
|
-
self._ErrorReportingDispatcher
|
|
988
|
-
);
|
|
989
|
-
|
|
990
|
-
if (!self._Store.isInitialized) {
|
|
991
|
-
self.ready(function() {
|
|
992
|
-
self.eCommerce.logCheckout(
|
|
993
|
-
step,
|
|
994
|
-
option,
|
|
995
|
-
attrs,
|
|
996
|
-
customFlags
|
|
997
|
-
);
|
|
998
|
-
});
|
|
999
|
-
|
|
1000
|
-
return;
|
|
1001
|
-
}
|
|
1002
|
-
|
|
1003
|
-
self._SessionManager.resetSessionTimer();
|
|
1004
|
-
self._Events.logCheckoutEvent(step, option, attrs, customFlags);
|
|
1005
|
-
},
|
|
1006
898
|
/**
|
|
1007
899
|
* Logs a product action
|
|
1008
900
|
* @for mParticle.eCommerce
|
|
@@ -1054,7 +946,7 @@ export default function mParticleInstance(this: IMParticleWebSDKInstance, instan
|
|
|
1054
946
|
* @param {Boolean} [clearCart] boolean to clear the cart after logging or not. Defaults to false
|
|
1055
947
|
* @param {Object} [attrs] other attributes related to the product purchase
|
|
1056
948
|
* @param {Object} [customFlags] Custom flags for the event
|
|
1057
|
-
* @deprecated
|
|
949
|
+
* @deprecated Use `logProductAction` with `ProductActionType.Purchase` instead.
|
|
1058
950
|
*/
|
|
1059
951
|
logPurchase: function(
|
|
1060
952
|
transactionAttributes,
|
|
@@ -1066,7 +958,7 @@ export default function mParticleInstance(this: IMParticleWebSDKInstance, instan
|
|
|
1066
958
|
logDeprecatedMethodUsage(
|
|
1067
959
|
{
|
|
1068
960
|
methodName: 'mParticle.logPurchase',
|
|
1069
|
-
warningMessage: 'mParticle.logPurchase is deprecated, please use mParticle.logProductAction instead',
|
|
961
|
+
warningMessage: 'mParticle.logPurchase is deprecated, please use mParticle.logProductAction with ProductActionType.Purchase instead',
|
|
1070
962
|
},
|
|
1071
963
|
self.Logger,
|
|
1072
964
|
self._ErrorReportingDispatcher
|
|
@@ -1162,52 +1054,6 @@ export default function mParticleInstance(this: IMParticleWebSDKInstance, instan
|
|
|
1162
1054
|
eventOptions
|
|
1163
1055
|
);
|
|
1164
1056
|
},
|
|
1165
|
-
/**
|
|
1166
|
-
* Logs a refund
|
|
1167
|
-
* @for mParticle.eCommerce
|
|
1168
|
-
* @method logRefund
|
|
1169
|
-
* @param {Object} transactionAttributes transaction attributes related to the refund
|
|
1170
|
-
* @param {Object} product product being refunded
|
|
1171
|
-
* @param {Boolean} [clearCart] boolean to clear the cart after refund is logged. Defaults to false.
|
|
1172
|
-
* @param {Object} [attrs] attributes related to the refund
|
|
1173
|
-
* @param {Object} [customFlags] Custom flags for the event
|
|
1174
|
-
* @deprecated
|
|
1175
|
-
*/
|
|
1176
|
-
logRefund: function(
|
|
1177
|
-
transactionAttributes,
|
|
1178
|
-
product,
|
|
1179
|
-
clearCart,
|
|
1180
|
-
attrs,
|
|
1181
|
-
customFlags
|
|
1182
|
-
) {
|
|
1183
|
-
logDeprecatedMethodUsage(
|
|
1184
|
-
{
|
|
1185
|
-
methodName: 'mParticle.logRefund',
|
|
1186
|
-
warningMessage: 'mParticle.logRefund is deprecated, please use mParticle.logProductAction instead',
|
|
1187
|
-
},
|
|
1188
|
-
self.Logger,
|
|
1189
|
-
self._ErrorReportingDispatcher
|
|
1190
|
-
);
|
|
1191
|
-
if (!self._Store.isInitialized) {
|
|
1192
|
-
self.ready(function() {
|
|
1193
|
-
self.eCommerce.logRefund(
|
|
1194
|
-
transactionAttributes,
|
|
1195
|
-
product,
|
|
1196
|
-
clearCart,
|
|
1197
|
-
attrs,
|
|
1198
|
-
customFlags
|
|
1199
|
-
);
|
|
1200
|
-
});
|
|
1201
|
-
return;
|
|
1202
|
-
}
|
|
1203
|
-
self._SessionManager.resetSessionTimer();
|
|
1204
|
-
self._Events.logRefundEvent(
|
|
1205
|
-
transactionAttributes,
|
|
1206
|
-
product,
|
|
1207
|
-
attrs,
|
|
1208
|
-
customFlags
|
|
1209
|
-
);
|
|
1210
|
-
},
|
|
1211
1057
|
expandCommerceEvent: function(event) {
|
|
1212
1058
|
return self._Ecommerce.expandCommerceEvent(event);
|
|
1213
1059
|
},
|
|
@@ -198,20 +198,6 @@ function mParticleInstanceManager(this: IMParticleInstanceManager) {
|
|
|
198
198
|
self.getInstance().upload();
|
|
199
199
|
};
|
|
200
200
|
this.eCommerce = {
|
|
201
|
-
Cart: {
|
|
202
|
-
add: function(product, logEventBoolean) {
|
|
203
|
-
self.getInstance().eCommerce.Cart.add(product, logEventBoolean);
|
|
204
|
-
},
|
|
205
|
-
remove: function(product, logEventBoolean) {
|
|
206
|
-
self.getInstance().eCommerce.Cart.remove(
|
|
207
|
-
product,
|
|
208
|
-
logEventBoolean
|
|
209
|
-
);
|
|
210
|
-
},
|
|
211
|
-
clear: function() {
|
|
212
|
-
self.getInstance().eCommerce.Cart.clear();
|
|
213
|
-
},
|
|
214
|
-
},
|
|
215
201
|
setCurrencyCode: function(code) {
|
|
216
202
|
self.getInstance().eCommerce.setCurrencyCode(code);
|
|
217
203
|
},
|
|
@@ -269,14 +255,6 @@ function mParticleInstanceManager(this: IMParticleInstanceManager) {
|
|
|
269
255
|
tax
|
|
270
256
|
);
|
|
271
257
|
},
|
|
272
|
-
logCheckout: function(step, options, attrs, customFlags) {
|
|
273
|
-
self.getInstance().eCommerce.logCheckout(
|
|
274
|
-
step,
|
|
275
|
-
options,
|
|
276
|
-
attrs,
|
|
277
|
-
customFlags
|
|
278
|
-
);
|
|
279
|
-
},
|
|
280
258
|
logProductAction: function(
|
|
281
259
|
productActionType,
|
|
282
260
|
product,
|
|
@@ -332,21 +310,6 @@ function mParticleInstanceManager(this: IMParticleInstanceManager) {
|
|
|
332
310
|
eventOptions
|
|
333
311
|
);
|
|
334
312
|
},
|
|
335
|
-
logRefund: function(
|
|
336
|
-
transactionAttributes,
|
|
337
|
-
product,
|
|
338
|
-
clearCart,
|
|
339
|
-
attrs,
|
|
340
|
-
customFlags
|
|
341
|
-
) {
|
|
342
|
-
self.getInstance().eCommerce.logRefund(
|
|
343
|
-
transactionAttributes,
|
|
344
|
-
product,
|
|
345
|
-
clearCart,
|
|
346
|
-
attrs,
|
|
347
|
-
customFlags
|
|
348
|
-
);
|
|
349
|
-
},
|
|
350
313
|
expandCommerceEvent: function(event) {
|
|
351
314
|
return self.getInstance().eCommerce.expandCommerceEvent(event);
|
|
352
315
|
},
|
package/src/public-types.ts
CHANGED
package/src/roktManager.ts
CHANGED
|
@@ -83,6 +83,9 @@ export interface IRoktKit {
|
|
|
83
83
|
setExtensionData<T>(extensionData: IRoktPartnerExtensionData<T>): void;
|
|
84
84
|
use: <T>(name: string) => Promise<T>;
|
|
85
85
|
onShoppableAdsReady(callback: () => void): void;
|
|
86
|
+
// Optional because the Rokt Kit ships on its own release cadence; a kit
|
|
87
|
+
// published before terminate() existed will not implement it.
|
|
88
|
+
terminate?: () => Promise<void>;
|
|
86
89
|
launcherOptions?: Dictionary<any>;
|
|
87
90
|
settings?: IRoktKitSettings;
|
|
88
91
|
integrationName?: string;
|
|
@@ -479,6 +482,40 @@ export default class RoktManager {
|
|
|
479
482
|
}
|
|
480
483
|
}
|
|
481
484
|
|
|
485
|
+
/**
|
|
486
|
+
* Tears down the current Rokt launcher and removes the placements it rendered.
|
|
487
|
+
*
|
|
488
|
+
* Intended for hosts that cannot simply destroy the container element —
|
|
489
|
+
* SPA route changes and confirmation pages, for example.
|
|
490
|
+
*
|
|
491
|
+
* Unlike the other proxied methods, a call made before the kit is ready is
|
|
492
|
+
* *not* queued. Replaying a teardown against a launcher created later would
|
|
493
|
+
* silently tear down placements the caller never asked to remove; with no
|
|
494
|
+
* launcher there is nothing to terminate, so this resolves as a no-op.
|
|
495
|
+
*
|
|
496
|
+
* @example
|
|
497
|
+
* await window.mParticle.Rokt.terminate();
|
|
498
|
+
*
|
|
499
|
+
* @returns {Promise<void>} Resolves once the launcher has torn down. Never rejects.
|
|
500
|
+
*/
|
|
501
|
+
public async terminate(): Promise<void> {
|
|
502
|
+
if (!this.isReady()) {
|
|
503
|
+
this.logger?.verbose('mParticle.Rokt.terminate called before the Rokt kit was ready. Nothing to terminate.');
|
|
504
|
+
return;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
if (!isFunction(this.kit.terminate)) {
|
|
508
|
+
this.logger?.error('mParticle.Rokt.terminate is not supported by the attached Rokt Kit version.');
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
try {
|
|
513
|
+
await this.kit.terminate();
|
|
514
|
+
} catch (error) {
|
|
515
|
+
this.logger?.error(`Failed to terminate the Rokt launcher: ${getErrorMessage(error)}`);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
|
|
482
519
|
public onShoppableAdsReady(callback: () => void): void {
|
|
483
520
|
if (!this.kit || !this.isShoppableAdsLoaded) {
|
|
484
521
|
this.deferredCall<void>('onShoppableAdsReady', callback);
|
package/src/sdkRuntimeModels.ts
CHANGED
|
@@ -87,7 +87,6 @@ export interface SDKEvent {
|
|
|
87
87
|
ProductAction?: SDKProductAction;
|
|
88
88
|
PromotionAction?: SDKPromotionAction;
|
|
89
89
|
ProductImpressions?: SDKProductImpression[];
|
|
90
|
-
ShoppingCart?: SDKShoppingCart;
|
|
91
90
|
UserIdentityChanges?: ISDKUserIdentityChanges;
|
|
92
91
|
UserAttributeChanges?: ISDKUserAttributeChangeData;
|
|
93
92
|
CurrencyCode: string;
|
|
@@ -111,10 +110,6 @@ export interface SDKDataPlan {
|
|
|
111
110
|
PlanId?: string | null;
|
|
112
111
|
}
|
|
113
112
|
|
|
114
|
-
export interface SDKShoppingCart {
|
|
115
|
-
ProductList?: SDKProduct[];
|
|
116
|
-
}
|
|
117
|
-
|
|
118
113
|
export interface SDKPromotionAction {
|
|
119
114
|
PromotionActionType: string;
|
|
120
115
|
PromotionList?: SDKPromotion[];
|
|
@@ -340,7 +335,6 @@ export interface SDKInitConfig
|
|
|
340
335
|
identityUrl?: string;
|
|
341
336
|
integrationDelayTimeout?: number;
|
|
342
337
|
isIOS?: boolean;
|
|
343
|
-
maxProducts?: number;
|
|
344
338
|
requestConfig?: boolean;
|
|
345
339
|
sessionTimeout?: number;
|
|
346
340
|
useNativeSdk?: boolean;
|
|
@@ -433,22 +433,6 @@ export function convertImpressions(
|
|
|
433
433
|
return impressions;
|
|
434
434
|
}
|
|
435
435
|
|
|
436
|
-
export function convertShoppingCart(
|
|
437
|
-
sdkEvent: SDKEvent
|
|
438
|
-
): EventsApi.ShoppingCart | null {
|
|
439
|
-
if (
|
|
440
|
-
!sdkEvent.ShoppingCart ||
|
|
441
|
-
!sdkEvent.ShoppingCart.ProductList ||
|
|
442
|
-
!sdkEvent.ShoppingCart.ProductList.length
|
|
443
|
-
) {
|
|
444
|
-
return null;
|
|
445
|
-
}
|
|
446
|
-
const shoppingCart: EventsApi.ShoppingCart = {
|
|
447
|
-
products: convertProducts(sdkEvent.ShoppingCart.ProductList),
|
|
448
|
-
};
|
|
449
|
-
return shoppingCart;
|
|
450
|
-
}
|
|
451
|
-
|
|
452
436
|
export function convertCommerceEvent(
|
|
453
437
|
sdkEvent: SDKEvent
|
|
454
438
|
): EventsApi.CommerceEvent {
|
|
@@ -460,7 +444,6 @@ export function convertCommerceEvent(
|
|
|
460
444
|
product_action: convertProductAction(sdkEvent),
|
|
461
445
|
promotion_action: convertPromotionAction(sdkEvent),
|
|
462
446
|
product_impressions: convertImpressions(sdkEvent),
|
|
463
|
-
shopping_cart: convertShoppingCart(sdkEvent),
|
|
464
447
|
currency_code: sdkEvent.CurrencyCode,
|
|
465
448
|
};
|
|
466
449
|
|
package/src/serverModel.ts
CHANGED
|
@@ -445,15 +445,6 @@ export default function ServerModel(
|
|
|
445
445
|
if (event.EventDataType === MessageType.Commerce) {
|
|
446
446
|
dto.cu = event.CurrencyCode;
|
|
447
447
|
|
|
448
|
-
// TODO: If Cart is deprecated, we should deprecate this too
|
|
449
|
-
if (event.ShoppingCart) {
|
|
450
|
-
dto.sc = {
|
|
451
|
-
pl: convertProductListToV2DTO(
|
|
452
|
-
event.ShoppingCart.ProductList
|
|
453
|
-
),
|
|
454
|
-
};
|
|
455
|
-
}
|
|
456
|
-
|
|
457
448
|
if (event.ProductAction) {
|
|
458
449
|
dto.pd = {
|
|
459
450
|
an: event.ProductAction.ProductActionType,
|
package/src/store.ts
CHANGED
|
@@ -85,7 +85,6 @@ export interface SDKConfig {
|
|
|
85
85
|
userAudienceUrl?: string;
|
|
86
86
|
isIOS?: boolean;
|
|
87
87
|
maxAliasWindow: number;
|
|
88
|
-
maxProducts: number;
|
|
89
88
|
requestConfig?: boolean;
|
|
90
89
|
sessionTimeout?: number;
|
|
91
90
|
timeout?: number;
|
|
@@ -375,12 +374,6 @@ export default function Store(
|
|
|
375
374
|
this.SDKConfig.useCookieStorage = false;
|
|
376
375
|
}
|
|
377
376
|
|
|
378
|
-
if (config.hasOwnProperty('maxProducts')) {
|
|
379
|
-
this.SDKConfig.maxProducts = config.maxProducts;
|
|
380
|
-
} else {
|
|
381
|
-
this.SDKConfig.maxProducts = Constants.DefaultConfig.maxProducts;
|
|
382
|
-
}
|
|
383
|
-
|
|
384
377
|
if (config.hasOwnProperty('maxCookieSize')) {
|
|
385
378
|
this.SDKConfig.maxCookieSize = config.maxCookieSize;
|
|
386
379
|
} else {
|
|
@@ -34,14 +34,11 @@ let mParticle = {
|
|
|
34
34
|
createProduct: returnProduct,
|
|
35
35
|
createPromotion: returnPromotion,
|
|
36
36
|
createTransactionAttributes: returnTransactionAttributes,
|
|
37
|
-
logCheckout: voidFunction,
|
|
38
37
|
logImpression: voidFunction,
|
|
39
38
|
logProductAction: voidFunction,
|
|
40
39
|
logPromotion: voidFunction,
|
|
41
40
|
logPurchase: voidFunction,
|
|
42
|
-
logRefund: voidFunction,
|
|
43
41
|
setCurrencyCode: voidFunction,
|
|
44
|
-
Cart: new Cart(),
|
|
45
42
|
},
|
|
46
43
|
Consent: {
|
|
47
44
|
createConsentState: createConsentState,
|
|
@@ -88,7 +85,6 @@ function returnUser() {
|
|
|
88
85
|
removeAllUserAttributes: voidFunction,
|
|
89
86
|
getUserAttributesLists: returnObject,
|
|
90
87
|
getAllUserAttributes: returnObject,
|
|
91
|
-
getCart: Cart,
|
|
92
88
|
getConsentState: createConsentState,
|
|
93
89
|
setConsentState: voidFunction,
|
|
94
90
|
};
|
|
@@ -98,17 +94,6 @@ function returnUsers() {
|
|
|
98
94
|
return [returnUser()];
|
|
99
95
|
}
|
|
100
96
|
|
|
101
|
-
function Cart() {
|
|
102
|
-
return {
|
|
103
|
-
add: voidFunction,
|
|
104
|
-
clear: voidFunction,
|
|
105
|
-
remove: voidFunction,
|
|
106
|
-
getCartProducts: function() {
|
|
107
|
-
return [returnProduct()];
|
|
108
|
-
},
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
|
|
112
97
|
function returnImpression() {
|
|
113
98
|
return {
|
|
114
99
|
Name: 'name',
|