@mparticle/web-sdk 2.28.0 → 2.28.1
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 +407 -23
- package/dist/mparticle.esm.js +407 -23
- package/dist/mparticle.js +453 -41
- package/package.json +1 -1
- package/src/apiClient.ts +43 -42
- package/src/forwarders.js +32 -0
- package/src/persistence.interfaces.ts +2 -2
- package/src/sdkRuntimeModels.ts +1 -0
package/dist/mparticle.js
CHANGED
|
@@ -203,22 +203,22 @@ var mParticle = (function () {
|
|
|
203
203
|
Base64: Base64$1
|
|
204
204
|
};
|
|
205
205
|
|
|
206
|
-
function _typeof(o) {
|
|
206
|
+
function _typeof$1(o) {
|
|
207
207
|
"@babel/helpers - typeof";
|
|
208
208
|
|
|
209
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
209
|
+
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
210
210
|
return typeof o;
|
|
211
211
|
} : function (o) {
|
|
212
212
|
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
213
|
-
}, _typeof(o);
|
|
213
|
+
}, _typeof$1(o);
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
function _toPrimitive(input, hint) {
|
|
217
|
-
if (_typeof(input) !== "object" || input === null) return input;
|
|
217
|
+
if (_typeof$1(input) !== "object" || input === null) return input;
|
|
218
218
|
var prim = input[Symbol.toPrimitive];
|
|
219
219
|
if (prim !== undefined) {
|
|
220
220
|
var res = prim.call(input, hint || "default");
|
|
221
|
-
if (_typeof(res) !== "object") return res;
|
|
221
|
+
if (_typeof$1(res) !== "object") return res;
|
|
222
222
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
223
223
|
}
|
|
224
224
|
return (hint === "string" ? String : Number)(input);
|
|
@@ -226,7 +226,7 @@ var mParticle = (function () {
|
|
|
226
226
|
|
|
227
227
|
function _toPropertyKey(arg) {
|
|
228
228
|
var key = _toPrimitive(arg, "string");
|
|
229
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
229
|
+
return _typeof$1(key) === "symbol" ? key : String(key);
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
function _defineProperty(obj, key, value) {
|
|
@@ -393,7 +393,7 @@ var mParticle = (function () {
|
|
|
393
393
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
394
394
|
};
|
|
395
395
|
|
|
396
|
-
var version = "2.28.
|
|
396
|
+
var version = "2.28.1";
|
|
397
397
|
|
|
398
398
|
var Constants = {
|
|
399
399
|
sdkVersion: version,
|
|
@@ -1146,6 +1146,10 @@ var mParticle = (function () {
|
|
|
1146
1146
|
SDKProductActionType[SDKProductActionType["RemoveFromWishlist"] = 10] = "RemoveFromWishlist";
|
|
1147
1147
|
})(SDKProductActionType || (SDKProductActionType = {}));
|
|
1148
1148
|
|
|
1149
|
+
function getDefaultExportFromCjs (x) {
|
|
1150
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1149
1153
|
var dist = {};
|
|
1150
1154
|
|
|
1151
1155
|
(function (exports) {
|
|
@@ -2563,27 +2567,12 @@ var mParticle = (function () {
|
|
|
2563
2567
|
mpInstance.Logger.error('Error sending forwarding stats to mParticle servers.');
|
|
2564
2568
|
}
|
|
2565
2569
|
};
|
|
2566
|
-
this.
|
|
2567
|
-
var
|
|
2568
|
-
var
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
if (xhr_1.status === 202) {
|
|
2573
|
-
mpInstance.Logger.verbose('Successfully sent ' + xhr_1.statusText + ' from server');
|
|
2574
|
-
}
|
|
2575
|
-
}
|
|
2576
|
-
};
|
|
2577
|
-
var xhr_1 = mpInstance._Helpers.createXHR(xhrCallback);
|
|
2578
|
-
url = mpInstance._Helpers.createServiceUrl(mpInstance._Store.SDKConfig.v1SecureServiceUrl, mpInstance._Store.devToken);
|
|
2579
|
-
data = forwardingStatsData;
|
|
2580
|
-
if (xhr_1) {
|
|
2581
|
-
xhr_1.open('post', url + '/Forwarding');
|
|
2582
|
-
xhr_1.send(JSON.stringify(data));
|
|
2583
|
-
}
|
|
2584
|
-
} catch (e) {
|
|
2585
|
-
mpInstance.Logger.error('Error sending forwarding stats to mParticle servers.');
|
|
2586
|
-
}
|
|
2570
|
+
this.initializeForwarderStatsUploader = function () {
|
|
2571
|
+
var forwardingDomain = mpInstance._Store.SDKConfig.v1SecureServiceUrl;
|
|
2572
|
+
var devToken = mpInstance._Store.devToken;
|
|
2573
|
+
var uploadUrl = "https://".concat(forwardingDomain).concat(devToken, "/Forwarding");
|
|
2574
|
+
var uploader = window.fetch ? new FetchUploader(uploadUrl) : new XHRUploader(uploadUrl);
|
|
2575
|
+
return uploader;
|
|
2587
2576
|
};
|
|
2588
2577
|
this.prepareForwardingStats = function (forwarder, event) {
|
|
2589
2578
|
var forwardingStatsData;
|
|
@@ -2602,11 +2591,14 @@ var mParticle = (function () {
|
|
|
2602
2591
|
eec: event.ExpandedEventCount,
|
|
2603
2592
|
dp: event.DataPlan
|
|
2604
2593
|
};
|
|
2594
|
+
var _a = mpInstance._Forwarders,
|
|
2595
|
+
sendSingleForwardingStatsToServer = _a.sendSingleForwardingStatsToServer,
|
|
2596
|
+
setForwarderStatsQueue = _a.setForwarderStatsQueue;
|
|
2605
2597
|
if (mpInstance._Helpers.getFeatureFlag(Constants.FeatureFlags.ReportBatching)) {
|
|
2606
2598
|
queue.push(forwardingStatsData);
|
|
2607
|
-
|
|
2599
|
+
setForwarderStatsQueue(queue);
|
|
2608
2600
|
} else {
|
|
2609
|
-
|
|
2601
|
+
sendSingleForwardingStatsToServer(forwardingStatsData);
|
|
2610
2602
|
}
|
|
2611
2603
|
}
|
|
2612
2604
|
};
|
|
@@ -2865,7 +2857,7 @@ var mParticle = (function () {
|
|
|
2865
2857
|
}
|
|
2866
2858
|
|
|
2867
2859
|
// Handle case when target is a string or something (possible in deep copy)
|
|
2868
|
-
if (_typeof(target) !== 'object' && !objectHelper.isFunction(target)) {
|
|
2860
|
+
if (_typeof$1(target) !== 'object' && !objectHelper.isFunction(target)) {
|
|
2869
2861
|
target = {};
|
|
2870
2862
|
}
|
|
2871
2863
|
|
|
@@ -3841,7 +3833,7 @@ var mParticle = (function () {
|
|
|
3841
3833
|
// sanitizes any non number, non string value to 0
|
|
3842
3834
|
this.sanitizeAmount = function (amount, category) {
|
|
3843
3835
|
if (!mpInstance._Helpers.Validators.isStringOrNumber(amount)) {
|
|
3844
|
-
var message = [category, 'must be of type number. A', _typeof(amount), 'was passed. Converting to 0'].join(' ');
|
|
3836
|
+
var message = [category, 'must be of type number. A', _typeof$1(amount), 'was passed. Converting to 0'].join(' ');
|
|
3845
3837
|
mpInstance.Logger.warning(message);
|
|
3846
3838
|
return 0;
|
|
3847
3839
|
}
|
|
@@ -3999,7 +3991,7 @@ var mParticle = (function () {
|
|
|
3999
3991
|
if (mpInstance._Helpers.Validators.isFunction(callback)) {
|
|
4000
3992
|
this.SDKConfig.identityCallback = config.identityCallback;
|
|
4001
3993
|
} else {
|
|
4002
|
-
mpInstance.Logger.warning('The optional callback must be a function. You tried entering a(n) ' + _typeof(callback) + ' . Callback not set. Please set your callback again.');
|
|
3994
|
+
mpInstance.Logger.warning('The optional callback must be a function. You tried entering a(n) ' + _typeof$1(callback) + ' . Callback not set. Please set your callback again.');
|
|
4003
3995
|
}
|
|
4004
3996
|
}
|
|
4005
3997
|
if (config.hasOwnProperty('appVersion')) {
|
|
@@ -5413,6 +5405,386 @@ var mParticle = (function () {
|
|
|
5413
5405
|
};
|
|
5414
5406
|
}
|
|
5415
5407
|
|
|
5408
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
5409
|
+
try {
|
|
5410
|
+
var info = gen[key](arg);
|
|
5411
|
+
var value = info.value;
|
|
5412
|
+
} catch (error) {
|
|
5413
|
+
reject(error);
|
|
5414
|
+
return;
|
|
5415
|
+
}
|
|
5416
|
+
if (info.done) {
|
|
5417
|
+
resolve(value);
|
|
5418
|
+
} else {
|
|
5419
|
+
Promise.resolve(value).then(_next, _throw);
|
|
5420
|
+
}
|
|
5421
|
+
}
|
|
5422
|
+
function _asyncToGenerator(fn) {
|
|
5423
|
+
return function () {
|
|
5424
|
+
var self = this,
|
|
5425
|
+
args = arguments;
|
|
5426
|
+
return new Promise(function (resolve, reject) {
|
|
5427
|
+
var gen = fn.apply(self, args);
|
|
5428
|
+
function _next(value) {
|
|
5429
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
5430
|
+
}
|
|
5431
|
+
function _throw(err) {
|
|
5432
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
5433
|
+
}
|
|
5434
|
+
_next(undefined);
|
|
5435
|
+
});
|
|
5436
|
+
};
|
|
5437
|
+
}
|
|
5438
|
+
|
|
5439
|
+
var regeneratorRuntime$1 = {exports: {}};
|
|
5440
|
+
|
|
5441
|
+
var _typeof = {exports: {}};
|
|
5442
|
+
|
|
5443
|
+
_typeof.exports;
|
|
5444
|
+
|
|
5445
|
+
(function (module) {
|
|
5446
|
+
function _typeof(o) {
|
|
5447
|
+
"@babel/helpers - typeof";
|
|
5448
|
+
|
|
5449
|
+
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
5450
|
+
return typeof o;
|
|
5451
|
+
} : function (o) {
|
|
5452
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
5453
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
|
|
5454
|
+
}
|
|
5455
|
+
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
5456
|
+
} (_typeof));
|
|
5457
|
+
|
|
5458
|
+
var _typeofExports = _typeof.exports;
|
|
5459
|
+
|
|
5460
|
+
regeneratorRuntime$1.exports;
|
|
5461
|
+
|
|
5462
|
+
(function (module) {
|
|
5463
|
+
var _typeof = _typeofExports["default"];
|
|
5464
|
+
function _regeneratorRuntime() {
|
|
5465
|
+
module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
|
|
5466
|
+
return e;
|
|
5467
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
5468
|
+
var t,
|
|
5469
|
+
e = {},
|
|
5470
|
+
r = Object.prototype,
|
|
5471
|
+
n = r.hasOwnProperty,
|
|
5472
|
+
o = Object.defineProperty || function (t, e, r) {
|
|
5473
|
+
t[e] = r.value;
|
|
5474
|
+
},
|
|
5475
|
+
i = "function" == typeof Symbol ? Symbol : {},
|
|
5476
|
+
a = i.iterator || "@@iterator",
|
|
5477
|
+
c = i.asyncIterator || "@@asyncIterator",
|
|
5478
|
+
u = i.toStringTag || "@@toStringTag";
|
|
5479
|
+
function define(t, e, r) {
|
|
5480
|
+
return Object.defineProperty(t, e, {
|
|
5481
|
+
value: r,
|
|
5482
|
+
enumerable: !0,
|
|
5483
|
+
configurable: !0,
|
|
5484
|
+
writable: !0
|
|
5485
|
+
}), t[e];
|
|
5486
|
+
}
|
|
5487
|
+
try {
|
|
5488
|
+
define({}, "");
|
|
5489
|
+
} catch (t) {
|
|
5490
|
+
define = function define(t, e, r) {
|
|
5491
|
+
return t[e] = r;
|
|
5492
|
+
};
|
|
5493
|
+
}
|
|
5494
|
+
function wrap(t, e, r, n) {
|
|
5495
|
+
var i = e && e.prototype instanceof Generator ? e : Generator,
|
|
5496
|
+
a = Object.create(i.prototype),
|
|
5497
|
+
c = new Context(n || []);
|
|
5498
|
+
return o(a, "_invoke", {
|
|
5499
|
+
value: makeInvokeMethod(t, r, c)
|
|
5500
|
+
}), a;
|
|
5501
|
+
}
|
|
5502
|
+
function tryCatch(t, e, r) {
|
|
5503
|
+
try {
|
|
5504
|
+
return {
|
|
5505
|
+
type: "normal",
|
|
5506
|
+
arg: t.call(e, r)
|
|
5507
|
+
};
|
|
5508
|
+
} catch (t) {
|
|
5509
|
+
return {
|
|
5510
|
+
type: "throw",
|
|
5511
|
+
arg: t
|
|
5512
|
+
};
|
|
5513
|
+
}
|
|
5514
|
+
}
|
|
5515
|
+
e.wrap = wrap;
|
|
5516
|
+
var h = "suspendedStart",
|
|
5517
|
+
l = "suspendedYield",
|
|
5518
|
+
f = "executing",
|
|
5519
|
+
s = "completed",
|
|
5520
|
+
y = {};
|
|
5521
|
+
function Generator() {}
|
|
5522
|
+
function GeneratorFunction() {}
|
|
5523
|
+
function GeneratorFunctionPrototype() {}
|
|
5524
|
+
var p = {};
|
|
5525
|
+
define(p, a, function () {
|
|
5526
|
+
return this;
|
|
5527
|
+
});
|
|
5528
|
+
var d = Object.getPrototypeOf,
|
|
5529
|
+
v = d && d(d(values([])));
|
|
5530
|
+
v && v !== r && n.call(v, a) && (p = v);
|
|
5531
|
+
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
5532
|
+
function defineIteratorMethods(t) {
|
|
5533
|
+
["next", "throw", "return"].forEach(function (e) {
|
|
5534
|
+
define(t, e, function (t) {
|
|
5535
|
+
return this._invoke(e, t);
|
|
5536
|
+
});
|
|
5537
|
+
});
|
|
5538
|
+
}
|
|
5539
|
+
function AsyncIterator(t, e) {
|
|
5540
|
+
function invoke(r, o, i, a) {
|
|
5541
|
+
var c = tryCatch(t[r], t, o);
|
|
5542
|
+
if ("throw" !== c.type) {
|
|
5543
|
+
var u = c.arg,
|
|
5544
|
+
h = u.value;
|
|
5545
|
+
return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
5546
|
+
invoke("next", t, i, a);
|
|
5547
|
+
}, function (t) {
|
|
5548
|
+
invoke("throw", t, i, a);
|
|
5549
|
+
}) : e.resolve(h).then(function (t) {
|
|
5550
|
+
u.value = t, i(u);
|
|
5551
|
+
}, function (t) {
|
|
5552
|
+
return invoke("throw", t, i, a);
|
|
5553
|
+
});
|
|
5554
|
+
}
|
|
5555
|
+
a(c.arg);
|
|
5556
|
+
}
|
|
5557
|
+
var r;
|
|
5558
|
+
o(this, "_invoke", {
|
|
5559
|
+
value: function value(t, n) {
|
|
5560
|
+
function callInvokeWithMethodAndArg() {
|
|
5561
|
+
return new e(function (e, r) {
|
|
5562
|
+
invoke(t, n, e, r);
|
|
5563
|
+
});
|
|
5564
|
+
}
|
|
5565
|
+
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
5566
|
+
}
|
|
5567
|
+
});
|
|
5568
|
+
}
|
|
5569
|
+
function makeInvokeMethod(e, r, n) {
|
|
5570
|
+
var o = h;
|
|
5571
|
+
return function (i, a) {
|
|
5572
|
+
if (o === f) throw new Error("Generator is already running");
|
|
5573
|
+
if (o === s) {
|
|
5574
|
+
if ("throw" === i) throw a;
|
|
5575
|
+
return {
|
|
5576
|
+
value: t,
|
|
5577
|
+
done: !0
|
|
5578
|
+
};
|
|
5579
|
+
}
|
|
5580
|
+
for (n.method = i, n.arg = a;;) {
|
|
5581
|
+
var c = n.delegate;
|
|
5582
|
+
if (c) {
|
|
5583
|
+
var u = maybeInvokeDelegate(c, n);
|
|
5584
|
+
if (u) {
|
|
5585
|
+
if (u === y) continue;
|
|
5586
|
+
return u;
|
|
5587
|
+
}
|
|
5588
|
+
}
|
|
5589
|
+
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
5590
|
+
if (o === h) throw o = s, n.arg;
|
|
5591
|
+
n.dispatchException(n.arg);
|
|
5592
|
+
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
5593
|
+
o = f;
|
|
5594
|
+
var p = tryCatch(e, r, n);
|
|
5595
|
+
if ("normal" === p.type) {
|
|
5596
|
+
if (o = n.done ? s : l, p.arg === y) continue;
|
|
5597
|
+
return {
|
|
5598
|
+
value: p.arg,
|
|
5599
|
+
done: n.done
|
|
5600
|
+
};
|
|
5601
|
+
}
|
|
5602
|
+
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
5603
|
+
}
|
|
5604
|
+
};
|
|
5605
|
+
}
|
|
5606
|
+
function maybeInvokeDelegate(e, r) {
|
|
5607
|
+
var n = r.method,
|
|
5608
|
+
o = e.iterator[n];
|
|
5609
|
+
if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
|
|
5610
|
+
var i = tryCatch(o, e.iterator, r.arg);
|
|
5611
|
+
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
5612
|
+
var a = i.arg;
|
|
5613
|
+
return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
|
|
5614
|
+
}
|
|
5615
|
+
function pushTryEntry(t) {
|
|
5616
|
+
var e = {
|
|
5617
|
+
tryLoc: t[0]
|
|
5618
|
+
};
|
|
5619
|
+
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
5620
|
+
}
|
|
5621
|
+
function resetTryEntry(t) {
|
|
5622
|
+
var e = t.completion || {};
|
|
5623
|
+
e.type = "normal", delete e.arg, t.completion = e;
|
|
5624
|
+
}
|
|
5625
|
+
function Context(t) {
|
|
5626
|
+
this.tryEntries = [{
|
|
5627
|
+
tryLoc: "root"
|
|
5628
|
+
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
5629
|
+
}
|
|
5630
|
+
function values(e) {
|
|
5631
|
+
if (e || "" === e) {
|
|
5632
|
+
var r = e[a];
|
|
5633
|
+
if (r) return r.call(e);
|
|
5634
|
+
if ("function" == typeof e.next) return e;
|
|
5635
|
+
if (!isNaN(e.length)) {
|
|
5636
|
+
var o = -1,
|
|
5637
|
+
i = function next() {
|
|
5638
|
+
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
|
|
5639
|
+
return next.value = t, next.done = !0, next;
|
|
5640
|
+
};
|
|
5641
|
+
return i.next = i;
|
|
5642
|
+
}
|
|
5643
|
+
}
|
|
5644
|
+
throw new TypeError(_typeof(e) + " is not iterable");
|
|
5645
|
+
}
|
|
5646
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
5647
|
+
value: GeneratorFunctionPrototype,
|
|
5648
|
+
configurable: !0
|
|
5649
|
+
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
5650
|
+
value: GeneratorFunction,
|
|
5651
|
+
configurable: !0
|
|
5652
|
+
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
5653
|
+
var e = "function" == typeof t && t.constructor;
|
|
5654
|
+
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
5655
|
+
}, e.mark = function (t) {
|
|
5656
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
5657
|
+
}, e.awrap = function (t) {
|
|
5658
|
+
return {
|
|
5659
|
+
__await: t
|
|
5660
|
+
};
|
|
5661
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
5662
|
+
return this;
|
|
5663
|
+
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
5664
|
+
void 0 === i && (i = Promise);
|
|
5665
|
+
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
5666
|
+
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
5667
|
+
return t.done ? t.value : a.next();
|
|
5668
|
+
});
|
|
5669
|
+
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
5670
|
+
return this;
|
|
5671
|
+
}), define(g, "toString", function () {
|
|
5672
|
+
return "[object Generator]";
|
|
5673
|
+
}), e.keys = function (t) {
|
|
5674
|
+
var e = Object(t),
|
|
5675
|
+
r = [];
|
|
5676
|
+
for (var n in e) r.push(n);
|
|
5677
|
+
return r.reverse(), function next() {
|
|
5678
|
+
for (; r.length;) {
|
|
5679
|
+
var t = r.pop();
|
|
5680
|
+
if (t in e) return next.value = t, next.done = !1, next;
|
|
5681
|
+
}
|
|
5682
|
+
return next.done = !0, next;
|
|
5683
|
+
};
|
|
5684
|
+
}, e.values = values, Context.prototype = {
|
|
5685
|
+
constructor: Context,
|
|
5686
|
+
reset: function reset(e) {
|
|
5687
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
|
|
5688
|
+
},
|
|
5689
|
+
stop: function stop() {
|
|
5690
|
+
this.done = !0;
|
|
5691
|
+
var t = this.tryEntries[0].completion;
|
|
5692
|
+
if ("throw" === t.type) throw t.arg;
|
|
5693
|
+
return this.rval;
|
|
5694
|
+
},
|
|
5695
|
+
dispatchException: function dispatchException(e) {
|
|
5696
|
+
if (this.done) throw e;
|
|
5697
|
+
var r = this;
|
|
5698
|
+
function handle(n, o) {
|
|
5699
|
+
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
5700
|
+
}
|
|
5701
|
+
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
5702
|
+
var i = this.tryEntries[o],
|
|
5703
|
+
a = i.completion;
|
|
5704
|
+
if ("root" === i.tryLoc) return handle("end");
|
|
5705
|
+
if (i.tryLoc <= this.prev) {
|
|
5706
|
+
var c = n.call(i, "catchLoc"),
|
|
5707
|
+
u = n.call(i, "finallyLoc");
|
|
5708
|
+
if (c && u) {
|
|
5709
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
5710
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
5711
|
+
} else if (c) {
|
|
5712
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
5713
|
+
} else {
|
|
5714
|
+
if (!u) throw new Error("try statement without catch or finally");
|
|
5715
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
5716
|
+
}
|
|
5717
|
+
}
|
|
5718
|
+
}
|
|
5719
|
+
},
|
|
5720
|
+
abrupt: function abrupt(t, e) {
|
|
5721
|
+
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
5722
|
+
var o = this.tryEntries[r];
|
|
5723
|
+
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
5724
|
+
var i = o;
|
|
5725
|
+
break;
|
|
5726
|
+
}
|
|
5727
|
+
}
|
|
5728
|
+
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
5729
|
+
var a = i ? i.completion : {};
|
|
5730
|
+
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
5731
|
+
},
|
|
5732
|
+
complete: function complete(t, e) {
|
|
5733
|
+
if ("throw" === t.type) throw t.arg;
|
|
5734
|
+
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
|
|
5735
|
+
},
|
|
5736
|
+
finish: function finish(t) {
|
|
5737
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
5738
|
+
var r = this.tryEntries[e];
|
|
5739
|
+
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
5740
|
+
}
|
|
5741
|
+
},
|
|
5742
|
+
"catch": function _catch(t) {
|
|
5743
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
5744
|
+
var r = this.tryEntries[e];
|
|
5745
|
+
if (r.tryLoc === t) {
|
|
5746
|
+
var n = r.completion;
|
|
5747
|
+
if ("throw" === n.type) {
|
|
5748
|
+
var o = n.arg;
|
|
5749
|
+
resetTryEntry(r);
|
|
5750
|
+
}
|
|
5751
|
+
return o;
|
|
5752
|
+
}
|
|
5753
|
+
}
|
|
5754
|
+
throw new Error("illegal catch attempt");
|
|
5755
|
+
},
|
|
5756
|
+
delegateYield: function delegateYield(e, r, n) {
|
|
5757
|
+
return this.delegate = {
|
|
5758
|
+
iterator: values(e),
|
|
5759
|
+
resultName: r,
|
|
5760
|
+
nextLoc: n
|
|
5761
|
+
}, "next" === this.method && (this.arg = t), y;
|
|
5762
|
+
}
|
|
5763
|
+
}, e;
|
|
5764
|
+
}
|
|
5765
|
+
module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
5766
|
+
} (regeneratorRuntime$1));
|
|
5767
|
+
|
|
5768
|
+
var regeneratorRuntimeExports = regeneratorRuntime$1.exports;
|
|
5769
|
+
|
|
5770
|
+
// TODO(Babel 8): Remove this file.
|
|
5771
|
+
|
|
5772
|
+
var runtime = regeneratorRuntimeExports();
|
|
5773
|
+
var regenerator = runtime;
|
|
5774
|
+
|
|
5775
|
+
// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
|
|
5776
|
+
try {
|
|
5777
|
+
regeneratorRuntime = runtime;
|
|
5778
|
+
} catch (accidentalStrictMode) {
|
|
5779
|
+
if (typeof globalThis === "object") {
|
|
5780
|
+
globalThis.regeneratorRuntime = runtime;
|
|
5781
|
+
} else {
|
|
5782
|
+
Function("r", "regeneratorRuntime = r")(runtime);
|
|
5783
|
+
}
|
|
5784
|
+
}
|
|
5785
|
+
|
|
5786
|
+
var _regeneratorRuntime = /*@__PURE__*/getDefaultExportFromCjs(regenerator);
|
|
5787
|
+
|
|
5416
5788
|
function filteredMparticleUser(mpid, forwarder, mpInstance, kitBlocker) {
|
|
5417
5789
|
var self = this;
|
|
5418
5790
|
return {
|
|
@@ -5477,7 +5849,9 @@ var mParticle = (function () {
|
|
|
5477
5849
|
Login$2 = _Constants$IdentityMe.Login,
|
|
5478
5850
|
Logout$2 = _Constants$IdentityMe.Logout;
|
|
5479
5851
|
function Forwarders(mpInstance, kitBlocker) {
|
|
5852
|
+
var _this = this;
|
|
5480
5853
|
var self = this;
|
|
5854
|
+
this.forwarderStatsUploader = new APIClient(mpInstance, kitBlocker).initializeForwarderStatsUploader();
|
|
5481
5855
|
var UserAttributeActionTypes = {
|
|
5482
5856
|
setUserAttribute: 'setUserAttribute',
|
|
5483
5857
|
removeUserAttribute: 'removeUserAttribute'
|
|
@@ -5946,6 +6320,44 @@ var mParticle = (function () {
|
|
|
5946
6320
|
mpInstance.Logger.error('Cookie Sync configs not configured propertly. Cookie Sync may not be initialized. ' + e);
|
|
5947
6321
|
}
|
|
5948
6322
|
};
|
|
6323
|
+
this.sendSingleForwardingStatsToServer = /*#__PURE__*/function () {
|
|
6324
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(forwardingStatsData) {
|
|
6325
|
+
var _mpInstance$Logger;
|
|
6326
|
+
var fetchPayload, response, message;
|
|
6327
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
6328
|
+
while (1) switch (_context.prev = _context.next) {
|
|
6329
|
+
case 0:
|
|
6330
|
+
// https://go.mparticle.com/work/SQDSDKS-6568
|
|
6331
|
+
fetchPayload = {
|
|
6332
|
+
method: 'post',
|
|
6333
|
+
body: JSON.stringify(forwardingStatsData),
|
|
6334
|
+
headers: {
|
|
6335
|
+
Accept: 'text/plain;charset=UTF-8',
|
|
6336
|
+
'Content-Type': 'text/plain;charset=UTF-8'
|
|
6337
|
+
}
|
|
6338
|
+
};
|
|
6339
|
+
_context.next = 3;
|
|
6340
|
+
return _this.forwarderStatsUploader.upload(fetchPayload);
|
|
6341
|
+
case 3:
|
|
6342
|
+
response = _context.sent;
|
|
6343
|
+
// This is a fire and forget, so we only need to log the response based on the code, and not return any response body
|
|
6344
|
+
if (response.status === 202) {
|
|
6345
|
+
// https://go.mparticle.com/work/SQDSDKS-6670
|
|
6346
|
+
message = 'Successfully sent forwarding stats to mParticle Servers';
|
|
6347
|
+
} else {
|
|
6348
|
+
message = 'Issue with forwarding stats to mParticle Servers, received HTTP Code of ' + response.statusText;
|
|
6349
|
+
}
|
|
6350
|
+
mpInstance === null || mpInstance === void 0 || (_mpInstance$Logger = mpInstance.Logger) === null || _mpInstance$Logger === void 0 || _mpInstance$Logger.verbose(message);
|
|
6351
|
+
case 6:
|
|
6352
|
+
case "end":
|
|
6353
|
+
return _context.stop();
|
|
6354
|
+
}
|
|
6355
|
+
}, _callee);
|
|
6356
|
+
}));
|
|
6357
|
+
return function (_x) {
|
|
6358
|
+
return _ref.apply(this, arguments);
|
|
6359
|
+
};
|
|
6360
|
+
}();
|
|
5949
6361
|
}
|
|
5950
6362
|
|
|
5951
6363
|
// TODO: This file is no longer the server model because the web SDK payload
|
|
@@ -6543,7 +6955,7 @@ var mParticle = (function () {
|
|
|
6543
6955
|
};
|
|
6544
6956
|
}
|
|
6545
6957
|
if (callback && !mpInstance._Helpers.Validators.isFunction(callback)) {
|
|
6546
|
-
var error = 'The optional callback must be a function. You tried entering a(n) ' + _typeof(callback);
|
|
6958
|
+
var error = 'The optional callback must be a function. You tried entering a(n) ' + _typeof$1(callback);
|
|
6547
6959
|
mpInstance.Logger.error(error);
|
|
6548
6960
|
return {
|
|
6549
6961
|
valid: false,
|
|
@@ -7087,7 +7499,7 @@ var mParticle = (function () {
|
|
|
7087
7499
|
}
|
|
7088
7500
|
}
|
|
7089
7501
|
} else {
|
|
7090
|
-
mpInstance.Logger.error('Must pass an object into setUserAttributes. You passed a ' + _typeof(userAttributes));
|
|
7502
|
+
mpInstance.Logger.error('Must pass an object into setUserAttributes. You passed a ' + _typeof$1(userAttributes));
|
|
7091
7503
|
}
|
|
7092
7504
|
},
|
|
7093
7505
|
/**
|
|
@@ -7139,7 +7551,7 @@ var mParticle = (function () {
|
|
|
7139
7551
|
return;
|
|
7140
7552
|
}
|
|
7141
7553
|
if (!Array.isArray(newValue)) {
|
|
7142
|
-
mpInstance.Logger.error('The value you passed in to setUserAttributeList must be an array. You passed in a ' + (typeof value === "undefined" ? "undefined" : _typeof(value)));
|
|
7554
|
+
mpInstance.Logger.error('The value you passed in to setUserAttributeList must be an array. You passed in a ' + (typeof value === "undefined" ? "undefined" : _typeof$1(value)));
|
|
7143
7555
|
return;
|
|
7144
7556
|
}
|
|
7145
7557
|
var arrayCopy = newValue.slice();
|
|
@@ -8943,11 +9355,11 @@ var mParticle = (function () {
|
|
|
8943
9355
|
title: window.document.title
|
|
8944
9356
|
};
|
|
8945
9357
|
} else if (!self._Helpers.isObject(attrs)) {
|
|
8946
|
-
self.Logger.error('The attributes argument must be an object. A ' + _typeof(attrs) + ' was entered. Please correct and retry.');
|
|
9358
|
+
self.Logger.error('The attributes argument must be an object. A ' + _typeof$1(attrs) + ' was entered. Please correct and retry.');
|
|
8947
9359
|
return;
|
|
8948
9360
|
}
|
|
8949
9361
|
if (customFlags && !self._Helpers.isObject(customFlags)) {
|
|
8950
|
-
self.Logger.error('The customFlags argument must be an object. A ' + _typeof(customFlags) + ' was entered. Please correct and retry.');
|
|
9362
|
+
self.Logger.error('The customFlags argument must be an object. A ' + _typeof$1(customFlags) + ' was entered. Please correct and retry.');
|
|
8951
9363
|
return;
|
|
8952
9364
|
}
|
|
8953
9365
|
}
|
|
@@ -9373,17 +9785,17 @@ var mParticle = (function () {
|
|
|
9373
9785
|
self._Store.integrationAttributes[integrationId][key] = attrs[key];
|
|
9374
9786
|
}
|
|
9375
9787
|
} else {
|
|
9376
|
-
self.Logger.error('Values for integration attributes must be strings. You entered a ' + _typeof(attrs[key]));
|
|
9788
|
+
self.Logger.error('Values for integration attributes must be strings. You entered a ' + _typeof$1(attrs[key]));
|
|
9377
9789
|
continue;
|
|
9378
9790
|
}
|
|
9379
9791
|
} else {
|
|
9380
|
-
self.Logger.error('Keys must be strings, you entered a ' + _typeof(key));
|
|
9792
|
+
self.Logger.error('Keys must be strings, you entered a ' + _typeof$1(key));
|
|
9381
9793
|
continue;
|
|
9382
9794
|
}
|
|
9383
9795
|
}
|
|
9384
9796
|
}
|
|
9385
9797
|
} else {
|
|
9386
|
-
self.Logger.error('Attrs must be an object with keys and values. You entered a ' + _typeof(attrs));
|
|
9798
|
+
self.Logger.error('Attrs must be an object with keys and values. You entered a ' + _typeof$1(attrs));
|
|
9387
9799
|
return;
|
|
9388
9800
|
}
|
|
9389
9801
|
self._Persistence.update();
|