@mparticle/web-sdk 2.26.2 → 2.26.4
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 +59 -76
- package/dist/mparticle.esm.js +59 -76
- package/dist/mparticle.js +754 -789
- package/package.json +1 -1
- package/src/apiClient.ts +3 -2
- package/src/batchUploader.ts +5 -9
- package/src/consent.ts +4 -3
- package/src/forwarders.interfaces.ts +20 -18
- package/src/identity-user-interfaces.ts +64 -0
- package/src/identity-utils.ts +1 -1
- package/src/identity.interfaces.ts +205 -0
- package/src/identity.js +221 -158
- package/src/identityApiClient.js +0 -2
- package/src/persistence.interfaces.ts +1 -3
- package/src/persistence.js +0 -17
- package/src/sdkRuntimeModels.ts +15 -92
- package/src/sdkToEventsApiConverter.ts +33 -23
- package/src/serverModel.ts +10 -12
- package/src/sessionManager.ts +3 -2
- package/src/store.ts +0 -18
- package/src/types.js +44 -3
- package/src/utils.ts +2 -4
- package/src/validators.ts +1 -1
- package/src/type-utils.ts +0 -66
- package/src/user-utils.ts +0 -12
package/dist/mparticle.js
CHANGED
|
@@ -244,574 +244,8 @@ var mParticle = (function () {
|
|
|
244
244
|
return obj;
|
|
245
245
|
}
|
|
246
246
|
|
|
247
|
-
var EventTypeEnum;
|
|
248
|
-
(function (EventTypeEnum) {
|
|
249
|
-
EventTypeEnum[EventTypeEnum["Unknown"] = 0] = "Unknown";
|
|
250
|
-
EventTypeEnum[EventTypeEnum["Navigation"] = 1] = "Navigation";
|
|
251
|
-
EventTypeEnum[EventTypeEnum["Location"] = 2] = "Location";
|
|
252
|
-
EventTypeEnum[EventTypeEnum["Search"] = 3] = "Search";
|
|
253
|
-
EventTypeEnum[EventTypeEnum["Transaction"] = 4] = "Transaction";
|
|
254
|
-
EventTypeEnum[EventTypeEnum["UserContent"] = 5] = "UserContent";
|
|
255
|
-
EventTypeEnum[EventTypeEnum["UserPreference"] = 6] = "UserPreference";
|
|
256
|
-
EventTypeEnum[EventTypeEnum["Social"] = 7] = "Social";
|
|
257
|
-
EventTypeEnum[EventTypeEnum["Other"] = 8] = "Other";
|
|
258
|
-
EventTypeEnum[EventTypeEnum["Media"] = 9] = "Media";
|
|
259
|
-
})(EventTypeEnum || (EventTypeEnum = {}));
|
|
260
|
-
// TODO: https://mparticle-eng.atlassian.net/browse/SQDSDKS-5403
|
|
261
|
-
var MessageType$2;
|
|
262
|
-
(function (MessageType) {
|
|
263
|
-
MessageType[MessageType["SessionStart"] = 1] = "SessionStart";
|
|
264
|
-
MessageType[MessageType["SessionEnd"] = 2] = "SessionEnd";
|
|
265
|
-
MessageType[MessageType["PageView"] = 3] = "PageView";
|
|
266
|
-
MessageType[MessageType["PageEvent"] = 4] = "PageEvent";
|
|
267
|
-
MessageType[MessageType["CrashReport"] = 5] = "CrashReport";
|
|
268
|
-
MessageType[MessageType["OptOut"] = 6] = "OptOut";
|
|
269
|
-
MessageType[MessageType["AppStateTransition"] = 10] = "AppStateTransition";
|
|
270
|
-
MessageType[MessageType["Profile"] = 14] = "Profile";
|
|
271
|
-
MessageType[MessageType["Commerce"] = 16] = "Commerce";
|
|
272
|
-
MessageType[MessageType["UserAttributeChange"] = 17] = "UserAttributeChange";
|
|
273
|
-
MessageType[MessageType["UserIdentityChange"] = 18] = "UserIdentityChange";
|
|
274
|
-
MessageType[MessageType["Media"] = 20] = "Media";
|
|
275
|
-
})(MessageType$2 || (MessageType$2 = {}));
|
|
276
|
-
var IdentityType$1;
|
|
277
|
-
(function (IdentityType) {
|
|
278
|
-
IdentityType[IdentityType["Other"] = 0] = "Other";
|
|
279
|
-
IdentityType[IdentityType["CustomerId"] = 1] = "CustomerId";
|
|
280
|
-
IdentityType[IdentityType["Facebook"] = 2] = "Facebook";
|
|
281
|
-
IdentityType[IdentityType["Twitter"] = 3] = "Twitter";
|
|
282
|
-
IdentityType[IdentityType["Google"] = 4] = "Google";
|
|
283
|
-
IdentityType[IdentityType["Microsoft"] = 5] = "Microsoft";
|
|
284
|
-
IdentityType[IdentityType["Yahoo"] = 6] = "Yahoo";
|
|
285
|
-
IdentityType[IdentityType["Email"] = 7] = "Email";
|
|
286
|
-
IdentityType[IdentityType["FacebookCustomAudienceId"] = 9] = "FacebookCustomAudienceId";
|
|
287
|
-
IdentityType[IdentityType["Other2"] = 10] = "Other2";
|
|
288
|
-
IdentityType[IdentityType["Other3"] = 11] = "Other3";
|
|
289
|
-
IdentityType[IdentityType["Other4"] = 12] = "Other4";
|
|
290
|
-
IdentityType[IdentityType["Other5"] = 13] = "Other5";
|
|
291
|
-
IdentityType[IdentityType["Other6"] = 14] = "Other6";
|
|
292
|
-
IdentityType[IdentityType["Other7"] = 15] = "Other7";
|
|
293
|
-
IdentityType[IdentityType["Other8"] = 16] = "Other8";
|
|
294
|
-
IdentityType[IdentityType["Other9"] = 17] = "Other9";
|
|
295
|
-
IdentityType[IdentityType["Other10"] = 18] = "Other10";
|
|
296
|
-
IdentityType[IdentityType["MobileNumber"] = 19] = "MobileNumber";
|
|
297
|
-
IdentityType[IdentityType["PhoneNumber2"] = 20] = "PhoneNumber2";
|
|
298
|
-
IdentityType[IdentityType["PhoneNumber3"] = 21] = "PhoneNumber3";
|
|
299
|
-
})(IdentityType$1 || (IdentityType$1 = {}));
|
|
300
|
-
|
|
301
|
-
/******************************************************************************
|
|
302
|
-
Copyright (c) Microsoft Corporation.
|
|
303
|
-
|
|
304
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
305
|
-
purpose with or without fee is hereby granted.
|
|
306
|
-
|
|
307
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
308
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
309
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
310
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
311
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
312
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
313
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
314
|
-
***************************************************************************** */
|
|
315
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
316
|
-
|
|
317
|
-
var extendStatics = function(d, b) {
|
|
318
|
-
extendStatics = Object.setPrototypeOf ||
|
|
319
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
320
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
321
|
-
return extendStatics(d, b);
|
|
322
|
-
};
|
|
323
|
-
|
|
324
|
-
function __extends(d, b) {
|
|
325
|
-
if (typeof b !== "function" && b !== null)
|
|
326
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
327
|
-
extendStatics(d, b);
|
|
328
|
-
function __() { this.constructor = d; }
|
|
329
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
var __assign = function() {
|
|
333
|
-
__assign = Object.assign || function __assign(t) {
|
|
334
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
335
|
-
s = arguments[i];
|
|
336
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
337
|
-
}
|
|
338
|
-
return t;
|
|
339
|
-
};
|
|
340
|
-
return __assign.apply(this, arguments);
|
|
341
|
-
};
|
|
342
|
-
|
|
343
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
344
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
345
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
346
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
347
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
348
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
349
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
350
|
-
});
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
function __generator(thisArg, body) {
|
|
354
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
355
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
356
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
357
|
-
function step(op) {
|
|
358
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
359
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
360
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
361
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
362
|
-
switch (op[0]) {
|
|
363
|
-
case 0: case 1: t = op; break;
|
|
364
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
365
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
366
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
367
|
-
default:
|
|
368
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
369
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
370
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
371
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
372
|
-
if (t[2]) _.ops.pop();
|
|
373
|
-
_.trys.pop(); continue;
|
|
374
|
-
}
|
|
375
|
-
op = body.call(thisArg, _);
|
|
376
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
377
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
function __spreadArray(to, from, pack) {
|
|
382
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
383
|
-
if (ar || !(i in from)) {
|
|
384
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
385
|
-
ar[i] = from[i];
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
392
|
-
var e = new Error(message);
|
|
393
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
394
|
-
};
|
|
395
|
-
|
|
396
|
-
var version = "2.26.2";
|
|
397
|
-
|
|
398
|
-
var Constants = {
|
|
399
|
-
sdkVersion: version,
|
|
400
|
-
sdkVendor: 'mparticle',
|
|
401
|
-
platform: 'web',
|
|
402
|
-
Messages: {
|
|
403
|
-
DeprecationMessages: {
|
|
404
|
-
MethodIsDeprecatedPostfix: 'is a deprecated method and will be removed in future releases',
|
|
405
|
-
AlternativeMethodPrefix: 'Please use the alternate method:'
|
|
406
|
-
},
|
|
407
|
-
ErrorMessages: {
|
|
408
|
-
NoToken: 'A token must be specified.',
|
|
409
|
-
EventNameInvalidType: 'Event name must be a valid string value.',
|
|
410
|
-
EventDataInvalidType: 'Event data must be a valid object hash.',
|
|
411
|
-
LoggingDisabled: 'Event logging is currently disabled.',
|
|
412
|
-
CookieParseError: 'Could not parse cookie',
|
|
413
|
-
EventEmpty: 'Event object is null or undefined, cancelling send',
|
|
414
|
-
APIRequestEmpty: 'APIRequest is null or undefined, cancelling send',
|
|
415
|
-
NoEventType: 'Event type must be specified.',
|
|
416
|
-
TransactionIdRequired: 'Transaction ID is required',
|
|
417
|
-
TransactionRequired: 'A transaction attributes object is required',
|
|
418
|
-
PromotionIdRequired: 'Promotion ID is required',
|
|
419
|
-
BadAttribute: 'Attribute value cannot be object or array',
|
|
420
|
-
BadKey: 'Key value cannot be object or array',
|
|
421
|
-
BadLogPurchase: 'Transaction attributes and a product are both required to log a purchase, https://docs.mparticle.com/?javascript#measuring-transactions',
|
|
422
|
-
AudienceAPINotEnabled: 'Your workspace is not enabled to retrieve user audiences.'
|
|
423
|
-
},
|
|
424
|
-
InformationMessages: {
|
|
425
|
-
CookieSearch: 'Searching for cookie',
|
|
426
|
-
CookieFound: 'Cookie found, parsing values',
|
|
427
|
-
CookieNotFound: 'Cookies not found',
|
|
428
|
-
CookieSet: 'Setting cookie',
|
|
429
|
-
CookieSync: 'Performing cookie sync',
|
|
430
|
-
SendBegin: 'Starting to send event',
|
|
431
|
-
SendIdentityBegin: 'Starting to send event to identity server',
|
|
432
|
-
SendWindowsPhone: 'Sending event to Windows Phone container',
|
|
433
|
-
SendIOS: 'Calling iOS path: ',
|
|
434
|
-
SendAndroid: 'Calling Android JS interface method: ',
|
|
435
|
-
SendHttp: 'Sending event to mParticle HTTP service',
|
|
436
|
-
SendAliasHttp: 'Sending alias request to mParticle HTTP service',
|
|
437
|
-
SendIdentityHttp: 'Sending event to mParticle HTTP service',
|
|
438
|
-
StartingNewSession: 'Starting new Session',
|
|
439
|
-
StartingLogEvent: 'Starting to log event',
|
|
440
|
-
StartingLogOptOut: 'Starting to log user opt in/out',
|
|
441
|
-
StartingEndSession: 'Starting to end session',
|
|
442
|
-
StartingInitialization: 'Starting to initialize',
|
|
443
|
-
StartingLogCommerceEvent: 'Starting to log commerce event',
|
|
444
|
-
StartingAliasRequest: 'Starting to Alias MPIDs',
|
|
445
|
-
LoadingConfig: 'Loading configuration options',
|
|
446
|
-
AbandonLogEvent: 'Cannot log event, logging disabled or developer token not set',
|
|
447
|
-
AbandonAliasUsers: 'Cannot Alias Users, logging disabled or developer token not set',
|
|
448
|
-
AbandonStartSession: 'Cannot start session, logging disabled or developer token not set',
|
|
449
|
-
AbandonEndSession: 'Cannot end session, logging disabled or developer token not set',
|
|
450
|
-
NoSessionToEnd: 'Cannot end session, no active session found'
|
|
451
|
-
},
|
|
452
|
-
ValidationMessages: {
|
|
453
|
-
ModifyIdentityRequestUserIdentitiesPresent: 'identityRequests to modify require userIdentities to be present. Request not sent to server. Please fix and try again',
|
|
454
|
-
IdentityRequesetInvalidKey: 'There is an invalid key on your identityRequest object. It can only contain a `userIdentities` object and a `onUserAlias` function. Request not sent to server. Please fix and try again.',
|
|
455
|
-
OnUserAliasType: 'The onUserAlias value must be a function.',
|
|
456
|
-
UserIdentities: 'The userIdentities key must be an object with keys of identityTypes and values of strings. Request not sent to server. Please fix and try again.',
|
|
457
|
-
UserIdentitiesInvalidKey: 'There is an invalid identity key on your `userIdentities` object within the identityRequest. Request not sent to server. Please fix and try again.',
|
|
458
|
-
UserIdentitiesInvalidValues: 'All user identity values must be strings or null. Request not sent to server. Please fix and try again.',
|
|
459
|
-
AliasMissingMpid: 'Alias Request must contain both a destinationMpid and a sourceMpid',
|
|
460
|
-
AliasNonUniqueMpid: "Alias Request's destinationMpid and sourceMpid must be unique",
|
|
461
|
-
AliasMissingTime: 'Alias Request must have both a startTime and an endTime',
|
|
462
|
-
AliasStartBeforeEndTime: "Alias Request's endTime must be later than its startTime"
|
|
463
|
-
}
|
|
464
|
-
},
|
|
465
|
-
NativeSdkPaths: {
|
|
466
|
-
LogEvent: 'logEvent',
|
|
467
|
-
SetUserTag: 'setUserTag',
|
|
468
|
-
RemoveUserTag: 'removeUserTag',
|
|
469
|
-
SetUserAttribute: 'setUserAttribute',
|
|
470
|
-
RemoveUserAttribute: 'removeUserAttribute',
|
|
471
|
-
SetSessionAttribute: 'setSessionAttribute',
|
|
472
|
-
AddToCart: 'addToCart',
|
|
473
|
-
RemoveFromCart: 'removeFromCart',
|
|
474
|
-
ClearCart: 'clearCart',
|
|
475
|
-
LogOut: 'logOut',
|
|
476
|
-
SetUserAttributeList: 'setUserAttributeList',
|
|
477
|
-
RemoveAllUserAttributes: 'removeAllUserAttributes',
|
|
478
|
-
GetUserAttributesLists: 'getUserAttributesLists',
|
|
479
|
-
GetAllUserAttributes: 'getAllUserAttributes',
|
|
480
|
-
Identify: 'identify',
|
|
481
|
-
Logout: 'logout',
|
|
482
|
-
Login: 'login',
|
|
483
|
-
Modify: 'modify',
|
|
484
|
-
Alias: 'aliasUsers',
|
|
485
|
-
Upload: 'upload'
|
|
486
|
-
},
|
|
487
|
-
StorageNames: {
|
|
488
|
-
localStorageName: 'mprtcl-api',
|
|
489
|
-
localStorageNameV3: 'mprtcl-v3',
|
|
490
|
-
cookieName: 'mprtcl-api',
|
|
491
|
-
cookieNameV2: 'mprtcl-v2',
|
|
492
|
-
cookieNameV3: 'mprtcl-v3',
|
|
493
|
-
localStorageNameV4: 'mprtcl-v4',
|
|
494
|
-
localStorageProductsV4: 'mprtcl-prodv4',
|
|
495
|
-
cookieNameV4: 'mprtcl-v4',
|
|
496
|
-
currentStorageName: 'mprtcl-v4',
|
|
497
|
-
currentStorageProductsName: 'mprtcl-prodv4'
|
|
498
|
-
},
|
|
499
|
-
DefaultConfig: {
|
|
500
|
-
cookieDomain: null,
|
|
501
|
-
cookieExpiration: 365,
|
|
502
|
-
logLevel: null,
|
|
503
|
-
timeout: 300,
|
|
504
|
-
sessionTimeout: 30,
|
|
505
|
-
maxProducts: 20,
|
|
506
|
-
forwarderStatsTimeout: 5000,
|
|
507
|
-
integrationDelayTimeout: 5000,
|
|
508
|
-
maxCookieSize: 3000,
|
|
509
|
-
aliasMaxWindow: 90,
|
|
510
|
-
uploadInterval: 0 // Maximum milliseconds in between batch uploads, below 500 will mean immediate upload. The server returns this as a string, but we are using it as a number internally
|
|
511
|
-
},
|
|
512
|
-
|
|
513
|
-
DefaultBaseUrls: {
|
|
514
|
-
v1SecureServiceUrl: 'jssdks.mparticle.com/v1/JS/',
|
|
515
|
-
v2SecureServiceUrl: 'jssdks.mparticle.com/v2/JS/',
|
|
516
|
-
v3SecureServiceUrl: 'jssdks.mparticle.com/v3/JS/',
|
|
517
|
-
configUrl: 'jssdkcdns.mparticle.com/JS/v2/',
|
|
518
|
-
identityUrl: 'identity.mparticle.com/v1/',
|
|
519
|
-
aliasUrl: 'jssdks.mparticle.com/v1/identity/',
|
|
520
|
-
userAudienceUrl: 'nativesdks.mparticle.com/v1/'
|
|
521
|
-
},
|
|
522
|
-
Base64CookieKeys: {
|
|
523
|
-
csm: 1,
|
|
524
|
-
sa: 1,
|
|
525
|
-
ss: 1,
|
|
526
|
-
ua: 1,
|
|
527
|
-
ui: 1,
|
|
528
|
-
csd: 1,
|
|
529
|
-
ia: 1,
|
|
530
|
-
con: 1
|
|
531
|
-
},
|
|
532
|
-
// https://go.mparticle.com/work/SQDSDKS-6039
|
|
533
|
-
SDKv2NonMPIDCookieKeys: {
|
|
534
|
-
gs: 1,
|
|
535
|
-
cu: 1,
|
|
536
|
-
l: 1,
|
|
537
|
-
globalSettings: 1,
|
|
538
|
-
currentUserMPID: 1
|
|
539
|
-
},
|
|
540
|
-
HTTPCodes: {
|
|
541
|
-
noHttpCoverage: -1,
|
|
542
|
-
activeIdentityRequest: -2,
|
|
543
|
-
activeSession: -3,
|
|
544
|
-
validationIssue: -4,
|
|
545
|
-
nativeIdentityRequest: -5,
|
|
546
|
-
loggingDisabledOrMissingAPIKey: -6,
|
|
547
|
-
tooManyRequests: 429
|
|
548
|
-
},
|
|
549
|
-
FeatureFlags: {
|
|
550
|
-
ReportBatching: 'reportBatching',
|
|
551
|
-
EventBatchingIntervalMillis: 'eventBatchingIntervalMillis',
|
|
552
|
-
OfflineStorage: 'offlineStorage',
|
|
553
|
-
DirectUrlRouting: 'directURLRouting',
|
|
554
|
-
CacheIdentity: 'cacheIdentity',
|
|
555
|
-
AudienceAPI: 'audienceAPI'
|
|
556
|
-
},
|
|
557
|
-
DefaultInstance: 'default_instance',
|
|
558
|
-
CCPAPurpose: 'data_sale_opt_out',
|
|
559
|
-
IdentityMethods: {
|
|
560
|
-
Modify: 'modify',
|
|
561
|
-
Logout: 'logout',
|
|
562
|
-
Login: 'login',
|
|
563
|
-
Identify: 'identify'
|
|
564
|
-
}
|
|
565
|
-
};
|
|
566
|
-
// https://go.mparticle.com/work/SQDSDKS-6080
|
|
567
|
-
var ONE_DAY_IN_SECONDS = 60 * 60 * 24;
|
|
568
|
-
var MILLIS_IN_ONE_SEC = 1000;
|
|
569
|
-
|
|
570
|
-
var Messages$9 = Constants.Messages;
|
|
571
|
-
var createCookieString = function createCookieString(value) {
|
|
572
|
-
return replaceCommasWithPipes(replaceQuotesWithApostrophes(value));
|
|
573
|
-
};
|
|
574
|
-
var revertCookieString = function revertCookieString(value) {
|
|
575
|
-
return replacePipesWithCommas(replaceApostrophesWithQuotes(value));
|
|
576
|
-
};
|
|
577
|
-
var inArray = function inArray(items, name) {
|
|
578
|
-
var i = 0;
|
|
579
|
-
if (Array.prototype.indexOf) {
|
|
580
|
-
return items.indexOf(name, 0) >= 0;
|
|
581
|
-
} else {
|
|
582
|
-
for (var n = items.length; i < n; i++) {
|
|
583
|
-
if (i in items && items[i] === name) {
|
|
584
|
-
return true;
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
return false;
|
|
589
|
-
};
|
|
590
|
-
var findKeyInObject = function findKeyInObject(obj, key) {
|
|
591
|
-
if (key && obj) {
|
|
592
|
-
for (var prop in obj) {
|
|
593
|
-
if (obj.hasOwnProperty(prop) && prop.toLowerCase() === key.toLowerCase()) {
|
|
594
|
-
return prop;
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
return null;
|
|
599
|
-
};
|
|
600
|
-
var generateDeprecationMessage = function generateDeprecationMessage(methodName, alternateMethod) {
|
|
601
|
-
var messageArray = [methodName, Messages$9.DeprecationMessages.MethodIsDeprecatedPostfix];
|
|
602
|
-
if (alternateMethod) {
|
|
603
|
-
messageArray.push(alternateMethod);
|
|
604
|
-
messageArray.push(Messages$9.DeprecationMessages.MethodIsDeprecatedPostfix);
|
|
605
|
-
}
|
|
606
|
-
return messageArray.join(' ');
|
|
607
|
-
};
|
|
608
|
-
function generateHash(name) {
|
|
609
|
-
var hash = 0;
|
|
610
|
-
var character;
|
|
611
|
-
if (name === undefined || name === null) {
|
|
612
|
-
return 0;
|
|
613
|
-
}
|
|
614
|
-
name = name.toString().toLowerCase();
|
|
615
|
-
if (Array.prototype.reduce) {
|
|
616
|
-
return name.split('').reduce(function (a, b) {
|
|
617
|
-
a = (a << 5) - a + b.charCodeAt(0);
|
|
618
|
-
return a & a;
|
|
619
|
-
}, 0);
|
|
620
|
-
}
|
|
621
|
-
if (name.length === 0) {
|
|
622
|
-
return hash;
|
|
623
|
-
}
|
|
624
|
-
for (var i = 0; i < name.length; i++) {
|
|
625
|
-
character = name.charCodeAt(i);
|
|
626
|
-
hash = (hash << 5) - hash + character;
|
|
627
|
-
hash = hash & hash;
|
|
628
|
-
}
|
|
629
|
-
return hash;
|
|
630
|
-
}
|
|
631
|
-
var generateRandomValue = function generateRandomValue(value) {
|
|
632
|
-
var randomValue;
|
|
633
|
-
var a;
|
|
634
|
-
if (window.crypto && window.crypto.getRandomValues) {
|
|
635
|
-
// @ts-ignore
|
|
636
|
-
randomValue = window.crypto.getRandomValues(new Uint8Array(1)); // eslint-disable-line no-undef
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
if (randomValue) {
|
|
640
|
-
// @ts-ignore
|
|
641
|
-
return (a ^ randomValue[0] % 16 >> a / 4).toString(16);
|
|
642
|
-
}
|
|
643
|
-
return (a ^ Math.random() * 16 >> a / 4).toString(16);
|
|
644
|
-
};
|
|
645
|
-
var generateUniqueId = function generateUniqueId(a) {
|
|
646
|
-
// https://gist.github.com/jed/982883
|
|
647
|
-
// Added support for crypto for better random
|
|
648
|
-
if (a === void 0) {
|
|
649
|
-
a = '';
|
|
650
|
-
}
|
|
651
|
-
return a // if the placeholder was passed, return
|
|
652
|
-
? generateRandomValue() // if the placeholder was passed, return
|
|
653
|
-
:
|
|
654
|
-
// [1e7] -> // 10000000 +
|
|
655
|
-
// -1e3 -> // -1000 +
|
|
656
|
-
// -4e3 -> // -4000 +
|
|
657
|
-
// -8e3 -> // -80000000 +
|
|
658
|
-
// -1e11 -> //-100000000000,
|
|
659
|
-
"".concat(1e7, "-").concat(1e3, "-").concat(4e3, "-").concat(8e3, "-").concat(1e11).replace(/[018]/g,
|
|
660
|
-
// zeroes, ones, and eights with
|
|
661
|
-
generateUniqueId // random hex digits
|
|
662
|
-
);
|
|
663
|
-
};
|
|
664
|
-
/**
|
|
665
|
-
* Returns a value between 1-100 inclusive.
|
|
666
|
-
*/
|
|
667
|
-
var getRampNumber = function getRampNumber(value) {
|
|
668
|
-
if (!value) {
|
|
669
|
-
return 100;
|
|
670
|
-
}
|
|
671
|
-
var hash = generateHash(value);
|
|
672
|
-
return Math.abs(hash % 100) + 1;
|
|
673
|
-
};
|
|
674
|
-
var isObject = function isObject(value) {
|
|
675
|
-
var objType = Object.prototype.toString.call(value);
|
|
676
|
-
return objType === '[object Object]' || objType === '[object Error]';
|
|
677
|
-
};
|
|
678
|
-
var parseNumber = function parseNumber(value) {
|
|
679
|
-
if (isNaN(value) || !isFinite(value)) {
|
|
680
|
-
return 0;
|
|
681
|
-
}
|
|
682
|
-
var floatValue = parseFloat(value);
|
|
683
|
-
return isNaN(floatValue) ? 0 : floatValue;
|
|
684
|
-
};
|
|
685
|
-
var parseStringOrNumber = function parseStringOrNumber(value) {
|
|
686
|
-
if (isStringOrNumber(value)) {
|
|
687
|
-
return value;
|
|
688
|
-
} else {
|
|
689
|
-
return null;
|
|
690
|
-
}
|
|
691
|
-
};
|
|
692
|
-
var replaceCommasWithPipes = function replaceCommasWithPipes(value) {
|
|
693
|
-
return value.replace(/,/g, '|');
|
|
694
|
-
};
|
|
695
|
-
var replacePipesWithCommas = function replacePipesWithCommas(value) {
|
|
696
|
-
return value.replace(/\|/g, ',');
|
|
697
|
-
};
|
|
698
|
-
var replaceApostrophesWithQuotes = function replaceApostrophesWithQuotes(value) {
|
|
699
|
-
return value.replace(/\'/g, '"');
|
|
700
|
-
};
|
|
701
|
-
var replaceQuotesWithApostrophes = function replaceQuotesWithApostrophes(value) {
|
|
702
|
-
return value.replace(/\"/g, "'");
|
|
703
|
-
};
|
|
704
|
-
// FIXME: REFACTOR for V3
|
|
705
|
-
// only used in store.js to sanitize server-side formatting of
|
|
706
|
-
// booleans when checking for `isDevelopmentMode`
|
|
707
|
-
// Should be removed in v3
|
|
708
|
-
var returnConvertedBoolean = function returnConvertedBoolean(data) {
|
|
709
|
-
if (data === 'false' || data === '0') {
|
|
710
|
-
return false;
|
|
711
|
-
} else {
|
|
712
|
-
return Boolean(data);
|
|
713
|
-
}
|
|
714
|
-
};
|
|
715
|
-
var decoded = function decoded(s) {
|
|
716
|
-
return decodeURIComponent(s.replace(/\+/g, ' '));
|
|
717
|
-
};
|
|
718
|
-
var converted = function converted(s) {
|
|
719
|
-
if (s.indexOf('"') === 0) {
|
|
720
|
-
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
|
|
721
|
-
}
|
|
722
|
-
return s;
|
|
723
|
-
};
|
|
724
|
-
var isString = function isString(value) {
|
|
725
|
-
return typeof value === 'string';
|
|
726
|
-
};
|
|
727
|
-
var isNumber = function isNumber(value) {
|
|
728
|
-
return typeof value === 'number';
|
|
729
|
-
};
|
|
730
|
-
var isBoolean = function isBoolean(value) {
|
|
731
|
-
return typeof value === 'boolean';
|
|
732
|
-
};
|
|
733
|
-
var isFunction = function isFunction(fn) {
|
|
734
|
-
return typeof fn === 'function';
|
|
735
|
-
};
|
|
736
|
-
var isValidCustomFlagProperty = function isValidCustomFlagProperty(value) {
|
|
737
|
-
return isNumber(value) || isString(value) || isBoolean(value);
|
|
738
|
-
};
|
|
739
|
-
var toDataPlanSlug = function toDataPlanSlug(value) {
|
|
740
|
-
// Make sure we are only acting on strings or numbers
|
|
741
|
-
return isStringOrNumber(value) ? value.toString().toLowerCase().replace(/[^0-9a-zA-Z]+/g, '_') : '';
|
|
742
|
-
};
|
|
743
|
-
var isDataPlanSlug = function isDataPlanSlug(str) {
|
|
744
|
-
return str === toDataPlanSlug(str);
|
|
745
|
-
};
|
|
746
|
-
var isStringOrNumber = function isStringOrNumber(value) {
|
|
747
|
-
return isString(value) || isNumber(value);
|
|
748
|
-
};
|
|
749
|
-
var isEmpty = function isEmpty(value) {
|
|
750
|
-
return value == null || !(Object.keys(value) || value).length;
|
|
751
|
-
};
|
|
752
|
-
var moveElementToEnd = function moveElementToEnd(array, index) {
|
|
753
|
-
return array.slice(0, index).concat(array.slice(index + 1), array[index]);
|
|
754
|
-
};
|
|
755
|
-
|
|
756
|
-
function getNewIdentitiesByName(newIdentitiesByType) {
|
|
757
|
-
var newIdentitiesByName = {};
|
|
758
|
-
for (var key in newIdentitiesByType) {
|
|
759
|
-
var identityNameKey = getIdentityName(parseNumber(key));
|
|
760
|
-
newIdentitiesByName[identityNameKey] = newIdentitiesByType[key];
|
|
761
|
-
}
|
|
762
|
-
return newIdentitiesByName;
|
|
763
|
-
}
|
|
764
|
-
function getIdentityName(identityType) {
|
|
765
|
-
switch (identityType) {
|
|
766
|
-
case IdentityType$1.Other:
|
|
767
|
-
return 'other';
|
|
768
|
-
case IdentityType$1.CustomerId:
|
|
769
|
-
return 'customerid';
|
|
770
|
-
case IdentityType$1.Facebook:
|
|
771
|
-
return 'facebook';
|
|
772
|
-
case IdentityType$1.Twitter:
|
|
773
|
-
return 'twitter';
|
|
774
|
-
case IdentityType$1.Google:
|
|
775
|
-
return 'google';
|
|
776
|
-
case IdentityType$1.Microsoft:
|
|
777
|
-
return 'microsoft';
|
|
778
|
-
case IdentityType$1.Yahoo:
|
|
779
|
-
return 'yahoo';
|
|
780
|
-
case IdentityType$1.Email:
|
|
781
|
-
return 'email';
|
|
782
|
-
case IdentityType$1.FacebookCustomAudienceId:
|
|
783
|
-
return 'facebookcustomaudienceid';
|
|
784
|
-
case IdentityType$1.Other2:
|
|
785
|
-
return 'other2';
|
|
786
|
-
case IdentityType$1.Other3:
|
|
787
|
-
return 'other3';
|
|
788
|
-
case IdentityType$1.Other4:
|
|
789
|
-
return 'other4';
|
|
790
|
-
case IdentityType$1.Other5:
|
|
791
|
-
return 'other5';
|
|
792
|
-
case IdentityType$1.Other6:
|
|
793
|
-
return 'other6';
|
|
794
|
-
case IdentityType$1.Other7:
|
|
795
|
-
return 'other7';
|
|
796
|
-
case IdentityType$1.Other8:
|
|
797
|
-
return 'other8';
|
|
798
|
-
case IdentityType$1.Other9:
|
|
799
|
-
return 'other9';
|
|
800
|
-
case IdentityType$1.Other10:
|
|
801
|
-
return 'other10';
|
|
802
|
-
case IdentityType$1.MobileNumber:
|
|
803
|
-
return 'mobile_number';
|
|
804
|
-
case IdentityType$1.PhoneNumber2:
|
|
805
|
-
return 'phone_number_2';
|
|
806
|
-
case IdentityType$1.PhoneNumber3:
|
|
807
|
-
return 'phone_number_3';
|
|
808
|
-
default:
|
|
809
|
-
return null;
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
|
|
813
247
|
var _TriggerUploadType;
|
|
814
|
-
var MessageType$
|
|
248
|
+
var MessageType$2 = {
|
|
815
249
|
SessionStart: 1,
|
|
816
250
|
SessionEnd: 2,
|
|
817
251
|
PageView: 3,
|
|
@@ -828,7 +262,7 @@ var mParticle = (function () {
|
|
|
828
262
|
|
|
829
263
|
// Dictionary that contains MessageTypes that will
|
|
830
264
|
// trigger an immediate upload.
|
|
831
|
-
var TriggerUploadType = (_TriggerUploadType = {}, _defineProperty(_TriggerUploadType, MessageType$
|
|
265
|
+
var TriggerUploadType = (_TriggerUploadType = {}, _defineProperty(_TriggerUploadType, MessageType$2.Commerce, 1), _defineProperty(_TriggerUploadType, MessageType$2.UserIdentityChange, 1), _TriggerUploadType);
|
|
832
266
|
var EventType = {
|
|
833
267
|
Unknown: 0,
|
|
834
268
|
Navigation: 1,
|
|
@@ -906,7 +340,7 @@ var mParticle = (function () {
|
|
|
906
340
|
ProductRemoveFromWishlist: 21,
|
|
907
341
|
ProductImpression: 22
|
|
908
342
|
};
|
|
909
|
-
var IdentityType = {
|
|
343
|
+
var IdentityType$1 = {
|
|
910
344
|
Other: 0,
|
|
911
345
|
CustomerId: 1,
|
|
912
346
|
Facebook: 2,
|
|
@@ -929,11 +363,11 @@ var mParticle = (function () {
|
|
|
929
363
|
PhoneNumber2: 20,
|
|
930
364
|
PhoneNumber3: 21
|
|
931
365
|
};
|
|
932
|
-
IdentityType.isValid = function (identityType) {
|
|
366
|
+
IdentityType$1.isValid = function (identityType) {
|
|
933
367
|
if (typeof identityType === 'number') {
|
|
934
|
-
for (var prop in IdentityType) {
|
|
935
|
-
if (IdentityType.hasOwnProperty(prop)) {
|
|
936
|
-
if (IdentityType[prop] === identityType) {
|
|
368
|
+
for (var prop in IdentityType$1) {
|
|
369
|
+
if (IdentityType$1.hasOwnProperty(prop)) {
|
|
370
|
+
if (IdentityType$1[prop] === identityType) {
|
|
937
371
|
return true;
|
|
938
372
|
}
|
|
939
373
|
}
|
|
@@ -941,7 +375,7 @@ var mParticle = (function () {
|
|
|
941
375
|
}
|
|
942
376
|
return false;
|
|
943
377
|
};
|
|
944
|
-
IdentityType.getName = function (identityType) {
|
|
378
|
+
IdentityType$1.getName = function (identityType) {
|
|
945
379
|
switch (identityType) {
|
|
946
380
|
case window.mParticle.IdentityType.CustomerId:
|
|
947
381
|
return 'Customer ID';
|
|
@@ -963,56 +397,99 @@ var mParticle = (function () {
|
|
|
963
397
|
return 'Other ID';
|
|
964
398
|
}
|
|
965
399
|
};
|
|
966
|
-
IdentityType.getIdentityType = function (identityName) {
|
|
400
|
+
IdentityType$1.getIdentityType = function (identityName) {
|
|
967
401
|
switch (identityName) {
|
|
968
402
|
case 'other':
|
|
969
|
-
return IdentityType.Other;
|
|
403
|
+
return IdentityType$1.Other;
|
|
970
404
|
case 'customerid':
|
|
971
|
-
return IdentityType.CustomerId;
|
|
405
|
+
return IdentityType$1.CustomerId;
|
|
972
406
|
case 'facebook':
|
|
973
|
-
return IdentityType.Facebook;
|
|
407
|
+
return IdentityType$1.Facebook;
|
|
974
408
|
case 'twitter':
|
|
975
|
-
return IdentityType.Twitter;
|
|
409
|
+
return IdentityType$1.Twitter;
|
|
976
410
|
case 'google':
|
|
977
|
-
return IdentityType.Google;
|
|
411
|
+
return IdentityType$1.Google;
|
|
978
412
|
case 'microsoft':
|
|
979
|
-
return IdentityType.Microsoft;
|
|
413
|
+
return IdentityType$1.Microsoft;
|
|
980
414
|
case 'yahoo':
|
|
981
|
-
return IdentityType.Yahoo;
|
|
415
|
+
return IdentityType$1.Yahoo;
|
|
982
416
|
case 'email':
|
|
983
|
-
return IdentityType.Email;
|
|
417
|
+
return IdentityType$1.Email;
|
|
984
418
|
case 'facebookcustomaudienceid':
|
|
985
|
-
return IdentityType.FacebookCustomAudienceId;
|
|
419
|
+
return IdentityType$1.FacebookCustomAudienceId;
|
|
986
420
|
case 'other2':
|
|
987
|
-
return IdentityType.Other2;
|
|
421
|
+
return IdentityType$1.Other2;
|
|
988
422
|
case 'other3':
|
|
989
|
-
return IdentityType.Other3;
|
|
423
|
+
return IdentityType$1.Other3;
|
|
990
424
|
case 'other4':
|
|
991
|
-
return IdentityType.Other4;
|
|
425
|
+
return IdentityType$1.Other4;
|
|
992
426
|
case 'other5':
|
|
993
|
-
return IdentityType.Other5;
|
|
427
|
+
return IdentityType$1.Other5;
|
|
994
428
|
case 'other6':
|
|
995
|
-
return IdentityType.Other6;
|
|
429
|
+
return IdentityType$1.Other6;
|
|
996
430
|
case 'other7':
|
|
997
|
-
return IdentityType.Other7;
|
|
431
|
+
return IdentityType$1.Other7;
|
|
998
432
|
case 'other8':
|
|
999
|
-
return IdentityType.Other8;
|
|
433
|
+
return IdentityType$1.Other8;
|
|
1000
434
|
case 'other9':
|
|
1001
|
-
return IdentityType.Other9;
|
|
435
|
+
return IdentityType$1.Other9;
|
|
1002
436
|
case 'other10':
|
|
1003
|
-
return IdentityType.Other10;
|
|
437
|
+
return IdentityType$1.Other10;
|
|
1004
438
|
case 'mobile_number':
|
|
1005
|
-
return IdentityType.MobileNumber;
|
|
439
|
+
return IdentityType$1.MobileNumber;
|
|
1006
440
|
case 'phone_number_2':
|
|
1007
|
-
return IdentityType.PhoneNumber2;
|
|
441
|
+
return IdentityType$1.PhoneNumber2;
|
|
1008
442
|
case 'phone_number_3':
|
|
1009
|
-
return IdentityType.PhoneNumber3;
|
|
443
|
+
return IdentityType$1.PhoneNumber3;
|
|
1010
444
|
default:
|
|
1011
445
|
return false;
|
|
1012
446
|
}
|
|
1013
447
|
};
|
|
1014
|
-
IdentityType.getIdentityName = function (identityType) {
|
|
1015
|
-
|
|
448
|
+
IdentityType$1.getIdentityName = function (identityType) {
|
|
449
|
+
switch (identityType) {
|
|
450
|
+
case IdentityType$1.Other:
|
|
451
|
+
return 'other';
|
|
452
|
+
case IdentityType$1.CustomerId:
|
|
453
|
+
return 'customerid';
|
|
454
|
+
case IdentityType$1.Facebook:
|
|
455
|
+
return 'facebook';
|
|
456
|
+
case IdentityType$1.Twitter:
|
|
457
|
+
return 'twitter';
|
|
458
|
+
case IdentityType$1.Google:
|
|
459
|
+
return 'google';
|
|
460
|
+
case IdentityType$1.Microsoft:
|
|
461
|
+
return 'microsoft';
|
|
462
|
+
case IdentityType$1.Yahoo:
|
|
463
|
+
return 'yahoo';
|
|
464
|
+
case IdentityType$1.Email:
|
|
465
|
+
return 'email';
|
|
466
|
+
case IdentityType$1.FacebookCustomAudienceId:
|
|
467
|
+
return 'facebookcustomaudienceid';
|
|
468
|
+
case IdentityType$1.Other2:
|
|
469
|
+
return 'other2';
|
|
470
|
+
case IdentityType$1.Other3:
|
|
471
|
+
return 'other3';
|
|
472
|
+
case IdentityType$1.Other4:
|
|
473
|
+
return 'other4';
|
|
474
|
+
case IdentityType$1.Other5:
|
|
475
|
+
return 'other5';
|
|
476
|
+
case IdentityType$1.Other6:
|
|
477
|
+
return 'other6';
|
|
478
|
+
case IdentityType$1.Other7:
|
|
479
|
+
return 'other7';
|
|
480
|
+
case IdentityType$1.Other8:
|
|
481
|
+
return 'other8';
|
|
482
|
+
case IdentityType$1.Other9:
|
|
483
|
+
return 'other9';
|
|
484
|
+
case IdentityType$1.Other10:
|
|
485
|
+
return 'other10';
|
|
486
|
+
case IdentityType$1.MobileNumber:
|
|
487
|
+
return 'mobile_number';
|
|
488
|
+
case IdentityType$1.PhoneNumber2:
|
|
489
|
+
return 'phone_number_2';
|
|
490
|
+
case IdentityType$1.PhoneNumber3:
|
|
491
|
+
return 'phone_number_3';
|
|
492
|
+
}
|
|
1016
493
|
};
|
|
1017
494
|
var ProductActionType = {
|
|
1018
495
|
Unknown: 0,
|
|
@@ -1097,38 +574,307 @@ var mParticle = (function () {
|
|
|
1097
574
|
}
|
|
1098
575
|
};
|
|
1099
576
|
|
|
1100
|
-
// these are the names that the server and mobile SDKs use while expanding CommerceEvent
|
|
1101
|
-
PromotionActionType.getExpansionName = function (id) {
|
|
1102
|
-
switch (id) {
|
|
1103
|
-
case PromotionActionType.PromotionView:
|
|
1104
|
-
return 'view';
|
|
1105
|
-
case PromotionActionType.PromotionClick:
|
|
1106
|
-
return 'click';
|
|
1107
|
-
default:
|
|
1108
|
-
return 'unknown';
|
|
1109
|
-
}
|
|
1110
|
-
};
|
|
1111
|
-
var ProfileMessageType = {
|
|
1112
|
-
Logout: 3
|
|
1113
|
-
};
|
|
1114
|
-
var ApplicationTransitionType$1 = {
|
|
1115
|
-
AppInit: 1
|
|
1116
|
-
};
|
|
1117
|
-
var Environment = {
|
|
1118
|
-
Production: 'production',
|
|
1119
|
-
Development: 'development'
|
|
1120
|
-
};
|
|
1121
|
-
var Types = {
|
|
1122
|
-
MessageType: MessageType$
|
|
1123
|
-
EventType: EventType,
|
|
1124
|
-
CommerceEventType: CommerceEventType,
|
|
1125
|
-
IdentityType: IdentityType,
|
|
1126
|
-
ProfileMessageType: ProfileMessageType,
|
|
1127
|
-
ApplicationTransitionType: ApplicationTransitionType$1,
|
|
1128
|
-
ProductActionType: ProductActionType,
|
|
1129
|
-
PromotionActionType: PromotionActionType,
|
|
1130
|
-
TriggerUploadType: TriggerUploadType,
|
|
1131
|
-
Environment: Environment
|
|
577
|
+
// these are the names that the server and mobile SDKs use while expanding CommerceEvent
|
|
578
|
+
PromotionActionType.getExpansionName = function (id) {
|
|
579
|
+
switch (id) {
|
|
580
|
+
case PromotionActionType.PromotionView:
|
|
581
|
+
return 'view';
|
|
582
|
+
case PromotionActionType.PromotionClick:
|
|
583
|
+
return 'click';
|
|
584
|
+
default:
|
|
585
|
+
return 'unknown';
|
|
586
|
+
}
|
|
587
|
+
};
|
|
588
|
+
var ProfileMessageType = {
|
|
589
|
+
Logout: 3
|
|
590
|
+
};
|
|
591
|
+
var ApplicationTransitionType$1 = {
|
|
592
|
+
AppInit: 1
|
|
593
|
+
};
|
|
594
|
+
var Environment = {
|
|
595
|
+
Production: 'production',
|
|
596
|
+
Development: 'development'
|
|
597
|
+
};
|
|
598
|
+
var Types = {
|
|
599
|
+
MessageType: MessageType$2,
|
|
600
|
+
EventType: EventType,
|
|
601
|
+
CommerceEventType: CommerceEventType,
|
|
602
|
+
IdentityType: IdentityType$1,
|
|
603
|
+
ProfileMessageType: ProfileMessageType,
|
|
604
|
+
ApplicationTransitionType: ApplicationTransitionType$1,
|
|
605
|
+
ProductActionType: ProductActionType,
|
|
606
|
+
PromotionActionType: PromotionActionType,
|
|
607
|
+
TriggerUploadType: TriggerUploadType,
|
|
608
|
+
Environment: Environment
|
|
609
|
+
};
|
|
610
|
+
|
|
611
|
+
var version = "2.26.4";
|
|
612
|
+
|
|
613
|
+
var Constants = {
|
|
614
|
+
sdkVersion: version,
|
|
615
|
+
sdkVendor: 'mparticle',
|
|
616
|
+
platform: 'web',
|
|
617
|
+
Messages: {
|
|
618
|
+
DeprecationMessages: {
|
|
619
|
+
MethodIsDeprecatedPostfix: 'is a deprecated method and will be removed in future releases',
|
|
620
|
+
AlternativeMethodPrefix: 'Please use the alternate method:'
|
|
621
|
+
},
|
|
622
|
+
ErrorMessages: {
|
|
623
|
+
NoToken: 'A token must be specified.',
|
|
624
|
+
EventNameInvalidType: 'Event name must be a valid string value.',
|
|
625
|
+
EventDataInvalidType: 'Event data must be a valid object hash.',
|
|
626
|
+
LoggingDisabled: 'Event logging is currently disabled.',
|
|
627
|
+
CookieParseError: 'Could not parse cookie',
|
|
628
|
+
EventEmpty: 'Event object is null or undefined, cancelling send',
|
|
629
|
+
APIRequestEmpty: 'APIRequest is null or undefined, cancelling send',
|
|
630
|
+
NoEventType: 'Event type must be specified.',
|
|
631
|
+
TransactionIdRequired: 'Transaction ID is required',
|
|
632
|
+
TransactionRequired: 'A transaction attributes object is required',
|
|
633
|
+
PromotionIdRequired: 'Promotion ID is required',
|
|
634
|
+
BadAttribute: 'Attribute value cannot be object or array',
|
|
635
|
+
BadKey: 'Key value cannot be object or array',
|
|
636
|
+
BadLogPurchase: 'Transaction attributes and a product are both required to log a purchase, https://docs.mparticle.com/?javascript#measuring-transactions',
|
|
637
|
+
AudienceAPINotEnabled: 'Your workspace is not enabled to retrieve user audiences.'
|
|
638
|
+
},
|
|
639
|
+
InformationMessages: {
|
|
640
|
+
CookieSearch: 'Searching for cookie',
|
|
641
|
+
CookieFound: 'Cookie found, parsing values',
|
|
642
|
+
CookieNotFound: 'Cookies not found',
|
|
643
|
+
CookieSet: 'Setting cookie',
|
|
644
|
+
CookieSync: 'Performing cookie sync',
|
|
645
|
+
SendBegin: 'Starting to send event',
|
|
646
|
+
SendIdentityBegin: 'Starting to send event to identity server',
|
|
647
|
+
SendWindowsPhone: 'Sending event to Windows Phone container',
|
|
648
|
+
SendIOS: 'Calling iOS path: ',
|
|
649
|
+
SendAndroid: 'Calling Android JS interface method: ',
|
|
650
|
+
SendHttp: 'Sending event to mParticle HTTP service',
|
|
651
|
+
SendAliasHttp: 'Sending alias request to mParticle HTTP service',
|
|
652
|
+
SendIdentityHttp: 'Sending event to mParticle HTTP service',
|
|
653
|
+
StartingNewSession: 'Starting new Session',
|
|
654
|
+
StartingLogEvent: 'Starting to log event',
|
|
655
|
+
StartingLogOptOut: 'Starting to log user opt in/out',
|
|
656
|
+
StartingEndSession: 'Starting to end session',
|
|
657
|
+
StartingInitialization: 'Starting to initialize',
|
|
658
|
+
StartingLogCommerceEvent: 'Starting to log commerce event',
|
|
659
|
+
StartingAliasRequest: 'Starting to Alias MPIDs',
|
|
660
|
+
LoadingConfig: 'Loading configuration options',
|
|
661
|
+
AbandonLogEvent: 'Cannot log event, logging disabled or developer token not set',
|
|
662
|
+
AbandonAliasUsers: 'Cannot Alias Users, logging disabled or developer token not set',
|
|
663
|
+
AbandonStartSession: 'Cannot start session, logging disabled or developer token not set',
|
|
664
|
+
AbandonEndSession: 'Cannot end session, logging disabled or developer token not set',
|
|
665
|
+
NoSessionToEnd: 'Cannot end session, no active session found'
|
|
666
|
+
},
|
|
667
|
+
ValidationMessages: {
|
|
668
|
+
ModifyIdentityRequestUserIdentitiesPresent: 'identityRequests to modify require userIdentities to be present. Request not sent to server. Please fix and try again',
|
|
669
|
+
IdentityRequesetInvalidKey: 'There is an invalid key on your identityRequest object. It can only contain a `userIdentities` object and a `onUserAlias` function. Request not sent to server. Please fix and try again.',
|
|
670
|
+
OnUserAliasType: 'The onUserAlias value must be a function.',
|
|
671
|
+
UserIdentities: 'The userIdentities key must be an object with keys of identityTypes and values of strings. Request not sent to server. Please fix and try again.',
|
|
672
|
+
UserIdentitiesInvalidKey: 'There is an invalid identity key on your `userIdentities` object within the identityRequest. Request not sent to server. Please fix and try again.',
|
|
673
|
+
UserIdentitiesInvalidValues: 'All user identity values must be strings or null. Request not sent to server. Please fix and try again.',
|
|
674
|
+
AliasMissingMpid: 'Alias Request must contain both a destinationMpid and a sourceMpid',
|
|
675
|
+
AliasNonUniqueMpid: "Alias Request's destinationMpid and sourceMpid must be unique",
|
|
676
|
+
AliasMissingTime: 'Alias Request must have both a startTime and an endTime',
|
|
677
|
+
AliasStartBeforeEndTime: "Alias Request's endTime must be later than its startTime"
|
|
678
|
+
}
|
|
679
|
+
},
|
|
680
|
+
NativeSdkPaths: {
|
|
681
|
+
LogEvent: 'logEvent',
|
|
682
|
+
SetUserTag: 'setUserTag',
|
|
683
|
+
RemoveUserTag: 'removeUserTag',
|
|
684
|
+
SetUserAttribute: 'setUserAttribute',
|
|
685
|
+
RemoveUserAttribute: 'removeUserAttribute',
|
|
686
|
+
SetSessionAttribute: 'setSessionAttribute',
|
|
687
|
+
AddToCart: 'addToCart',
|
|
688
|
+
RemoveFromCart: 'removeFromCart',
|
|
689
|
+
ClearCart: 'clearCart',
|
|
690
|
+
LogOut: 'logOut',
|
|
691
|
+
SetUserAttributeList: 'setUserAttributeList',
|
|
692
|
+
RemoveAllUserAttributes: 'removeAllUserAttributes',
|
|
693
|
+
GetUserAttributesLists: 'getUserAttributesLists',
|
|
694
|
+
GetAllUserAttributes: 'getAllUserAttributes',
|
|
695
|
+
Identify: 'identify',
|
|
696
|
+
Logout: 'logout',
|
|
697
|
+
Login: 'login',
|
|
698
|
+
Modify: 'modify',
|
|
699
|
+
Alias: 'aliasUsers',
|
|
700
|
+
Upload: 'upload'
|
|
701
|
+
},
|
|
702
|
+
StorageNames: {
|
|
703
|
+
localStorageName: 'mprtcl-api',
|
|
704
|
+
localStorageNameV3: 'mprtcl-v3',
|
|
705
|
+
cookieName: 'mprtcl-api',
|
|
706
|
+
cookieNameV2: 'mprtcl-v2',
|
|
707
|
+
cookieNameV3: 'mprtcl-v3',
|
|
708
|
+
localStorageNameV4: 'mprtcl-v4',
|
|
709
|
+
localStorageProductsV4: 'mprtcl-prodv4',
|
|
710
|
+
cookieNameV4: 'mprtcl-v4',
|
|
711
|
+
currentStorageName: 'mprtcl-v4',
|
|
712
|
+
currentStorageProductsName: 'mprtcl-prodv4'
|
|
713
|
+
},
|
|
714
|
+
DefaultConfig: {
|
|
715
|
+
cookieDomain: null,
|
|
716
|
+
cookieExpiration: 365,
|
|
717
|
+
logLevel: null,
|
|
718
|
+
timeout: 300,
|
|
719
|
+
sessionTimeout: 30,
|
|
720
|
+
maxProducts: 20,
|
|
721
|
+
forwarderStatsTimeout: 5000,
|
|
722
|
+
integrationDelayTimeout: 5000,
|
|
723
|
+
maxCookieSize: 3000,
|
|
724
|
+
aliasMaxWindow: 90,
|
|
725
|
+
uploadInterval: 0 // Maximum milliseconds in between batch uploads, below 500 will mean immediate upload. The server returns this as a string, but we are using it as a number internally
|
|
726
|
+
},
|
|
727
|
+
|
|
728
|
+
DefaultBaseUrls: {
|
|
729
|
+
v1SecureServiceUrl: 'jssdks.mparticle.com/v1/JS/',
|
|
730
|
+
v2SecureServiceUrl: 'jssdks.mparticle.com/v2/JS/',
|
|
731
|
+
v3SecureServiceUrl: 'jssdks.mparticle.com/v3/JS/',
|
|
732
|
+
configUrl: 'jssdkcdns.mparticle.com/JS/v2/',
|
|
733
|
+
identityUrl: 'identity.mparticle.com/v1/',
|
|
734
|
+
aliasUrl: 'jssdks.mparticle.com/v1/identity/',
|
|
735
|
+
userAudienceUrl: 'nativesdks.mparticle.com/v1/'
|
|
736
|
+
},
|
|
737
|
+
Base64CookieKeys: {
|
|
738
|
+
csm: 1,
|
|
739
|
+
sa: 1,
|
|
740
|
+
ss: 1,
|
|
741
|
+
ua: 1,
|
|
742
|
+
ui: 1,
|
|
743
|
+
csd: 1,
|
|
744
|
+
ia: 1,
|
|
745
|
+
con: 1
|
|
746
|
+
},
|
|
747
|
+
// https://go.mparticle.com/work/SQDSDKS-6039
|
|
748
|
+
SDKv2NonMPIDCookieKeys: {
|
|
749
|
+
gs: 1,
|
|
750
|
+
cu: 1,
|
|
751
|
+
l: 1,
|
|
752
|
+
globalSettings: 1,
|
|
753
|
+
currentUserMPID: 1
|
|
754
|
+
},
|
|
755
|
+
HTTPCodes: {
|
|
756
|
+
noHttpCoverage: -1,
|
|
757
|
+
activeIdentityRequest: -2,
|
|
758
|
+
activeSession: -3,
|
|
759
|
+
validationIssue: -4,
|
|
760
|
+
nativeIdentityRequest: -5,
|
|
761
|
+
loggingDisabledOrMissingAPIKey: -6,
|
|
762
|
+
tooManyRequests: 429
|
|
763
|
+
},
|
|
764
|
+
FeatureFlags: {
|
|
765
|
+
ReportBatching: 'reportBatching',
|
|
766
|
+
EventBatchingIntervalMillis: 'eventBatchingIntervalMillis',
|
|
767
|
+
OfflineStorage: 'offlineStorage',
|
|
768
|
+
DirectUrlRouting: 'directURLRouting',
|
|
769
|
+
CacheIdentity: 'cacheIdentity',
|
|
770
|
+
AudienceAPI: 'audienceAPI'
|
|
771
|
+
},
|
|
772
|
+
DefaultInstance: 'default_instance',
|
|
773
|
+
CCPAPurpose: 'data_sale_opt_out',
|
|
774
|
+
IdentityMethods: {
|
|
775
|
+
Modify: 'modify',
|
|
776
|
+
Logout: 'logout',
|
|
777
|
+
Login: 'login',
|
|
778
|
+
Identify: 'identify'
|
|
779
|
+
}
|
|
780
|
+
};
|
|
781
|
+
// https://go.mparticle.com/work/SQDSDKS-6080
|
|
782
|
+
var ONE_DAY_IN_SECONDS = 60 * 60 * 24;
|
|
783
|
+
var MILLIS_IN_ONE_SEC = 1000;
|
|
784
|
+
|
|
785
|
+
/******************************************************************************
|
|
786
|
+
Copyright (c) Microsoft Corporation.
|
|
787
|
+
|
|
788
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
789
|
+
purpose with or without fee is hereby granted.
|
|
790
|
+
|
|
791
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
792
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
793
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
794
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
795
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
796
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
797
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
798
|
+
***************************************************************************** */
|
|
799
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
800
|
+
|
|
801
|
+
var extendStatics = function(d, b) {
|
|
802
|
+
extendStatics = Object.setPrototypeOf ||
|
|
803
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
804
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
805
|
+
return extendStatics(d, b);
|
|
806
|
+
};
|
|
807
|
+
|
|
808
|
+
function __extends(d, b) {
|
|
809
|
+
if (typeof b !== "function" && b !== null)
|
|
810
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
811
|
+
extendStatics(d, b);
|
|
812
|
+
function __() { this.constructor = d; }
|
|
813
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
var __assign = function() {
|
|
817
|
+
__assign = Object.assign || function __assign(t) {
|
|
818
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
819
|
+
s = arguments[i];
|
|
820
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
821
|
+
}
|
|
822
|
+
return t;
|
|
823
|
+
};
|
|
824
|
+
return __assign.apply(this, arguments);
|
|
825
|
+
};
|
|
826
|
+
|
|
827
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
828
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
829
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
830
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
831
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
832
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
833
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
834
|
+
});
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
function __generator(thisArg, body) {
|
|
838
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
839
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
840
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
841
|
+
function step(op) {
|
|
842
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
843
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
844
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
845
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
846
|
+
switch (op[0]) {
|
|
847
|
+
case 0: case 1: t = op; break;
|
|
848
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
849
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
850
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
851
|
+
default:
|
|
852
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
853
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
854
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
855
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
856
|
+
if (t[2]) _.ops.pop();
|
|
857
|
+
_.trys.pop(); continue;
|
|
858
|
+
}
|
|
859
|
+
op = body.call(thisArg, _);
|
|
860
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
861
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
function __spreadArray(to, from, pack) {
|
|
866
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
867
|
+
if (ar || !(i in from)) {
|
|
868
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
869
|
+
ar[i] = from[i];
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
876
|
+
var e = new Error(message);
|
|
877
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
1132
878
|
};
|
|
1133
879
|
|
|
1134
880
|
var SDKProductActionType;
|
|
@@ -1145,31 +891,6 @@ var mParticle = (function () {
|
|
|
1145
891
|
SDKProductActionType[SDKProductActionType["AddToWishlist"] = 9] = "AddToWishlist";
|
|
1146
892
|
SDKProductActionType[SDKProductActionType["RemoveFromWishlist"] = 10] = "RemoveFromWishlist";
|
|
1147
893
|
})(SDKProductActionType || (SDKProductActionType = {}));
|
|
1148
|
-
var SDKIdentityTypeEnum;
|
|
1149
|
-
(function (SDKIdentityTypeEnum) {
|
|
1150
|
-
SDKIdentityTypeEnum["other"] = "other";
|
|
1151
|
-
SDKIdentityTypeEnum["customerId"] = "customerid";
|
|
1152
|
-
SDKIdentityTypeEnum["facebook"] = "facebook";
|
|
1153
|
-
SDKIdentityTypeEnum["twitter"] = "twitter";
|
|
1154
|
-
SDKIdentityTypeEnum["google"] = "google";
|
|
1155
|
-
SDKIdentityTypeEnum["microsoft"] = "microsoft";
|
|
1156
|
-
SDKIdentityTypeEnum["yahoo"] = "yahoo";
|
|
1157
|
-
SDKIdentityTypeEnum["email"] = "email";
|
|
1158
|
-
SDKIdentityTypeEnum["alias"] = "alias";
|
|
1159
|
-
SDKIdentityTypeEnum["facebookCustomAudienceId"] = "facebookcustomaudienceid";
|
|
1160
|
-
SDKIdentityTypeEnum["otherId2"] = "other2";
|
|
1161
|
-
SDKIdentityTypeEnum["otherId3"] = "other3";
|
|
1162
|
-
SDKIdentityTypeEnum["otherId4"] = "other4";
|
|
1163
|
-
SDKIdentityTypeEnum["otherId5"] = "other5";
|
|
1164
|
-
SDKIdentityTypeEnum["otherId6"] = "other6";
|
|
1165
|
-
SDKIdentityTypeEnum["otherId7"] = "other7";
|
|
1166
|
-
SDKIdentityTypeEnum["otherId8"] = "other8";
|
|
1167
|
-
SDKIdentityTypeEnum["otherId9"] = "other9";
|
|
1168
|
-
SDKIdentityTypeEnum["otherId10"] = "other10";
|
|
1169
|
-
SDKIdentityTypeEnum["mobileNumber"] = "mobile_number";
|
|
1170
|
-
SDKIdentityTypeEnum["phoneNumber2"] = "phone_number_2";
|
|
1171
|
-
SDKIdentityTypeEnum["phoneNumber3"] = "phone_number_3";
|
|
1172
|
-
})(SDKIdentityTypeEnum || (SDKIdentityTypeEnum = {}));
|
|
1173
894
|
|
|
1174
895
|
var dist = {};
|
|
1175
896
|
|
|
@@ -1401,6 +1122,215 @@ var mParticle = (function () {
|
|
|
1401
1122
|
})(exports.UserIdentityChangeEventEventTypeEnum || (exports.UserIdentityChangeEventEventTypeEnum = {}));
|
|
1402
1123
|
} (dist));
|
|
1403
1124
|
|
|
1125
|
+
var Messages$9 = Constants.Messages;
|
|
1126
|
+
var createCookieString = function createCookieString(value) {
|
|
1127
|
+
return replaceCommasWithPipes(replaceQuotesWithApostrophes(value));
|
|
1128
|
+
};
|
|
1129
|
+
var revertCookieString = function revertCookieString(value) {
|
|
1130
|
+
return replacePipesWithCommas(replaceApostrophesWithQuotes(value));
|
|
1131
|
+
};
|
|
1132
|
+
var inArray = function inArray(items, name) {
|
|
1133
|
+
var i = 0;
|
|
1134
|
+
if (Array.prototype.indexOf) {
|
|
1135
|
+
return items.indexOf(name, 0) >= 0;
|
|
1136
|
+
} else {
|
|
1137
|
+
for (var n = items.length; i < n; i++) {
|
|
1138
|
+
if (i in items && items[i] === name) {
|
|
1139
|
+
return true;
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
return false;
|
|
1144
|
+
};
|
|
1145
|
+
var findKeyInObject = function findKeyInObject(obj, key) {
|
|
1146
|
+
if (key && obj) {
|
|
1147
|
+
for (var prop in obj) {
|
|
1148
|
+
if (obj.hasOwnProperty(prop) && prop.toLowerCase() === key.toLowerCase()) {
|
|
1149
|
+
return prop;
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
return null;
|
|
1154
|
+
};
|
|
1155
|
+
var generateDeprecationMessage = function generateDeprecationMessage(methodName, alternateMethod) {
|
|
1156
|
+
var messageArray = [methodName, Messages$9.DeprecationMessages.MethodIsDeprecatedPostfix];
|
|
1157
|
+
if (alternateMethod) {
|
|
1158
|
+
messageArray.push(alternateMethod);
|
|
1159
|
+
messageArray.push(Messages$9.DeprecationMessages.MethodIsDeprecatedPostfix);
|
|
1160
|
+
}
|
|
1161
|
+
return messageArray.join(' ');
|
|
1162
|
+
};
|
|
1163
|
+
function generateHash(name) {
|
|
1164
|
+
var hash = 0;
|
|
1165
|
+
var character;
|
|
1166
|
+
if (name === undefined || name === null) {
|
|
1167
|
+
return 0;
|
|
1168
|
+
}
|
|
1169
|
+
name = name.toString().toLowerCase();
|
|
1170
|
+
if (Array.prototype.reduce) {
|
|
1171
|
+
return name.split('').reduce(function (a, b) {
|
|
1172
|
+
a = (a << 5) - a + b.charCodeAt(0);
|
|
1173
|
+
return a & a;
|
|
1174
|
+
}, 0);
|
|
1175
|
+
}
|
|
1176
|
+
if (name.length === 0) {
|
|
1177
|
+
return hash;
|
|
1178
|
+
}
|
|
1179
|
+
for (var i = 0; i < name.length; i++) {
|
|
1180
|
+
character = name.charCodeAt(i);
|
|
1181
|
+
hash = (hash << 5) - hash + character;
|
|
1182
|
+
hash = hash & hash;
|
|
1183
|
+
}
|
|
1184
|
+
return hash;
|
|
1185
|
+
}
|
|
1186
|
+
var generateRandomValue = function generateRandomValue(value) {
|
|
1187
|
+
var randomValue;
|
|
1188
|
+
var a;
|
|
1189
|
+
if (window.crypto && window.crypto.getRandomValues) {
|
|
1190
|
+
// @ts-ignore
|
|
1191
|
+
randomValue = window.crypto.getRandomValues(new Uint8Array(1)); // eslint-disable-line no-undef
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
if (randomValue) {
|
|
1195
|
+
// @ts-ignore
|
|
1196
|
+
return (a ^ randomValue[0] % 16 >> a / 4).toString(16);
|
|
1197
|
+
}
|
|
1198
|
+
return (a ^ Math.random() * 16 >> a / 4).toString(16);
|
|
1199
|
+
};
|
|
1200
|
+
var generateUniqueId = function generateUniqueId(a) {
|
|
1201
|
+
// https://gist.github.com/jed/982883
|
|
1202
|
+
// Added support for crypto for better random
|
|
1203
|
+
if (a === void 0) {
|
|
1204
|
+
a = '';
|
|
1205
|
+
}
|
|
1206
|
+
return a // if the placeholder was passed, return
|
|
1207
|
+
? generateRandomValue() // if the placeholder was passed, return
|
|
1208
|
+
:
|
|
1209
|
+
// [1e7] -> // 10000000 +
|
|
1210
|
+
// -1e3 -> // -1000 +
|
|
1211
|
+
// -4e3 -> // -4000 +
|
|
1212
|
+
// -8e3 -> // -80000000 +
|
|
1213
|
+
// -1e11 -> //-100000000000,
|
|
1214
|
+
"".concat(1e7, "-").concat(1e3, "-").concat(4e3, "-").concat(8e3, "-").concat(1e11).replace(/[018]/g,
|
|
1215
|
+
// zeroes, ones, and eights with
|
|
1216
|
+
generateUniqueId // random hex digits
|
|
1217
|
+
);
|
|
1218
|
+
};
|
|
1219
|
+
/**
|
|
1220
|
+
* Returns a value between 1-100 inclusive.
|
|
1221
|
+
*/
|
|
1222
|
+
var getRampNumber = function getRampNumber(value) {
|
|
1223
|
+
if (!value) {
|
|
1224
|
+
return 100;
|
|
1225
|
+
}
|
|
1226
|
+
var hash = generateHash(value);
|
|
1227
|
+
return Math.abs(hash % 100) + 1;
|
|
1228
|
+
};
|
|
1229
|
+
var isObject = function isObject(value) {
|
|
1230
|
+
var objType = Object.prototype.toString.call(value);
|
|
1231
|
+
return objType === '[object Object]' || objType === '[object Error]';
|
|
1232
|
+
};
|
|
1233
|
+
var parseNumber = function parseNumber(value) {
|
|
1234
|
+
if (isNaN(value) || !isFinite(value)) {
|
|
1235
|
+
return 0;
|
|
1236
|
+
}
|
|
1237
|
+
var floatValue = parseFloat(value);
|
|
1238
|
+
return isNaN(floatValue) ? 0 : floatValue;
|
|
1239
|
+
};
|
|
1240
|
+
var parseStringOrNumber = function parseStringOrNumber(value) {
|
|
1241
|
+
if (isStringOrNumber(value)) {
|
|
1242
|
+
return value;
|
|
1243
|
+
} else {
|
|
1244
|
+
return null;
|
|
1245
|
+
}
|
|
1246
|
+
};
|
|
1247
|
+
var replaceCommasWithPipes = function replaceCommasWithPipes(value) {
|
|
1248
|
+
return value.replace(/,/g, '|');
|
|
1249
|
+
};
|
|
1250
|
+
var replacePipesWithCommas = function replacePipesWithCommas(value) {
|
|
1251
|
+
return value.replace(/\|/g, ',');
|
|
1252
|
+
};
|
|
1253
|
+
var replaceApostrophesWithQuotes = function replaceApostrophesWithQuotes(value) {
|
|
1254
|
+
return value.replace(/\'/g, '"');
|
|
1255
|
+
};
|
|
1256
|
+
var replaceQuotesWithApostrophes = function replaceQuotesWithApostrophes(value) {
|
|
1257
|
+
return value.replace(/\"/g, "'");
|
|
1258
|
+
};
|
|
1259
|
+
// FIXME: REFACTOR for V3
|
|
1260
|
+
// only used in store.js to sanitize server-side formatting of
|
|
1261
|
+
// booleans when checking for `isDevelopmentMode`
|
|
1262
|
+
// Should be removed in v3
|
|
1263
|
+
var returnConvertedBoolean = function returnConvertedBoolean(data) {
|
|
1264
|
+
if (data === 'false' || data === '0') {
|
|
1265
|
+
return false;
|
|
1266
|
+
} else {
|
|
1267
|
+
return Boolean(data);
|
|
1268
|
+
}
|
|
1269
|
+
};
|
|
1270
|
+
var decoded = function decoded(s) {
|
|
1271
|
+
return decodeURIComponent(s.replace(/\+/g, ' '));
|
|
1272
|
+
};
|
|
1273
|
+
var converted = function converted(s) {
|
|
1274
|
+
if (s.indexOf('"') === 0) {
|
|
1275
|
+
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
|
|
1276
|
+
}
|
|
1277
|
+
return s;
|
|
1278
|
+
};
|
|
1279
|
+
var isString = function isString(value) {
|
|
1280
|
+
return typeof value === 'string';
|
|
1281
|
+
};
|
|
1282
|
+
var isNumber = function isNumber(value) {
|
|
1283
|
+
return typeof value === 'number';
|
|
1284
|
+
};
|
|
1285
|
+
var isBoolean = function isBoolean(value) {
|
|
1286
|
+
return typeof value === 'boolean';
|
|
1287
|
+
};
|
|
1288
|
+
var isFunction = function isFunction(fn) {
|
|
1289
|
+
return typeof fn === 'function';
|
|
1290
|
+
};
|
|
1291
|
+
var isValidCustomFlagProperty = function isValidCustomFlagProperty(value) {
|
|
1292
|
+
return isNumber(value) || isString(value) || isBoolean(value);
|
|
1293
|
+
};
|
|
1294
|
+
var toDataPlanSlug = function toDataPlanSlug(value) {
|
|
1295
|
+
// Make sure we are only acting on strings or numbers
|
|
1296
|
+
return isStringOrNumber(value) ? value.toString().toLowerCase().replace(/[^0-9a-zA-Z]+/g, '_') : '';
|
|
1297
|
+
};
|
|
1298
|
+
var isDataPlanSlug = function isDataPlanSlug(str) {
|
|
1299
|
+
return str === toDataPlanSlug(str);
|
|
1300
|
+
};
|
|
1301
|
+
var isStringOrNumber = function isStringOrNumber(value) {
|
|
1302
|
+
return isString(value) || isNumber(value);
|
|
1303
|
+
};
|
|
1304
|
+
var isEmpty = function isEmpty(value) {
|
|
1305
|
+
return value == null || !(Object.keys(value) || value).length;
|
|
1306
|
+
};
|
|
1307
|
+
|
|
1308
|
+
var SDKIdentityTypeEnum;
|
|
1309
|
+
(function (SDKIdentityTypeEnum) {
|
|
1310
|
+
SDKIdentityTypeEnum["other"] = "other";
|
|
1311
|
+
SDKIdentityTypeEnum["customerId"] = "customerid";
|
|
1312
|
+
SDKIdentityTypeEnum["facebook"] = "facebook";
|
|
1313
|
+
SDKIdentityTypeEnum["twitter"] = "twitter";
|
|
1314
|
+
SDKIdentityTypeEnum["google"] = "google";
|
|
1315
|
+
SDKIdentityTypeEnum["microsoft"] = "microsoft";
|
|
1316
|
+
SDKIdentityTypeEnum["yahoo"] = "yahoo";
|
|
1317
|
+
SDKIdentityTypeEnum["email"] = "email";
|
|
1318
|
+
SDKIdentityTypeEnum["alias"] = "alias";
|
|
1319
|
+
SDKIdentityTypeEnum["facebookCustomAudienceId"] = "facebookcustomaudienceid";
|
|
1320
|
+
SDKIdentityTypeEnum["otherId2"] = "other2";
|
|
1321
|
+
SDKIdentityTypeEnum["otherId3"] = "other3";
|
|
1322
|
+
SDKIdentityTypeEnum["otherId4"] = "other4";
|
|
1323
|
+
SDKIdentityTypeEnum["otherId5"] = "other5";
|
|
1324
|
+
SDKIdentityTypeEnum["otherId6"] = "other6";
|
|
1325
|
+
SDKIdentityTypeEnum["otherId7"] = "other7";
|
|
1326
|
+
SDKIdentityTypeEnum["otherId8"] = "other8";
|
|
1327
|
+
SDKIdentityTypeEnum["otherId9"] = "other9";
|
|
1328
|
+
SDKIdentityTypeEnum["otherId10"] = "other10";
|
|
1329
|
+
SDKIdentityTypeEnum["mobileNumber"] = "mobile_number";
|
|
1330
|
+
SDKIdentityTypeEnum["phoneNumber2"] = "phone_number_2";
|
|
1331
|
+
SDKIdentityTypeEnum["phoneNumber3"] = "phone_number_3";
|
|
1332
|
+
})(SDKIdentityTypeEnum || (SDKIdentityTypeEnum = {}));
|
|
1333
|
+
|
|
1404
1334
|
function convertEvents(mpid, sdkEvents, mpInstance) {
|
|
1405
1335
|
if (!mpid) {
|
|
1406
1336
|
return null;
|
|
@@ -4083,16 +4013,6 @@ var mParticle = (function () {
|
|
|
4083
4013
|
_this.persistenceData.gs.das = deviceId;
|
|
4084
4014
|
mpInstance._Persistence.update();
|
|
4085
4015
|
};
|
|
4086
|
-
this.addMpidToSessionHistory = function (mpid, previousMPID) {
|
|
4087
|
-
var indexOfMPID = _this.currentSessionMPIDs.indexOf(mpid);
|
|
4088
|
-
if (mpid && previousMPID !== mpid && indexOfMPID < 0) {
|
|
4089
|
-
_this.currentSessionMPIDs.push(mpid);
|
|
4090
|
-
return;
|
|
4091
|
-
}
|
|
4092
|
-
if (indexOfMPID >= 0) {
|
|
4093
|
-
_this.currentSessionMPIDs = moveElementToEnd(_this.currentSessionMPIDs, indexOfMPID);
|
|
4094
|
-
}
|
|
4095
|
-
};
|
|
4096
4016
|
this.getFirstSeenTime = function (mpid) {
|
|
4097
4017
|
if (!mpid) {
|
|
4098
4018
|
return null;
|
|
@@ -5030,16 +4950,6 @@ var mParticle = (function () {
|
|
|
5030
4950
|
}
|
|
5031
4951
|
}
|
|
5032
4952
|
};
|
|
5033
|
-
this.swapCurrentUser = function (previousMPID, currentMPID, currentSessionMPIDs) {
|
|
5034
|
-
if (previousMPID && currentMPID && previousMPID !== currentMPID) {
|
|
5035
|
-
var persistence = self.getPersistence();
|
|
5036
|
-
if (persistence) {
|
|
5037
|
-
persistence.cu = currentMPID;
|
|
5038
|
-
persistence.gs.csm = currentSessionMPIDs;
|
|
5039
|
-
self.savePersistence(persistence);
|
|
5040
|
-
}
|
|
5041
|
-
}
|
|
5042
|
-
};
|
|
5043
4953
|
|
|
5044
4954
|
// https://go.mparticle.com/work/SQDSDKS-6021
|
|
5045
4955
|
this.savePersistence = function (persistence) {
|
|
@@ -5095,7 +5005,6 @@ var mParticle = (function () {
|
|
|
5095
5005
|
if (!mpid) {
|
|
5096
5006
|
return;
|
|
5097
5007
|
}
|
|
5098
|
-
// https://go.mparticle.com/work/SQDSDKS-6329
|
|
5099
5008
|
if (!time) {
|
|
5100
5009
|
time = new Date().getTime();
|
|
5101
5010
|
}
|
|
@@ -5135,7 +5044,6 @@ var mParticle = (function () {
|
|
|
5135
5044
|
if (!mpid) {
|
|
5136
5045
|
return;
|
|
5137
5046
|
}
|
|
5138
|
-
// https://go.mparticle.com/work/SQDSDKS-6329
|
|
5139
5047
|
if (!time) {
|
|
5140
5048
|
time = new Date().getTime();
|
|
5141
5049
|
}
|
|
@@ -5509,11 +5417,11 @@ var mParticle = (function () {
|
|
|
5509
5417
|
};
|
|
5510
5418
|
}
|
|
5511
5419
|
|
|
5512
|
-
var _Constants$IdentityMe = Constants.IdentityMethods,
|
|
5513
|
-
Modify$3 = _Constants$IdentityMe.Modify,
|
|
5514
|
-
Identify$2 = _Constants$IdentityMe.Identify,
|
|
5515
|
-
Login$2 = _Constants$IdentityMe.Login,
|
|
5516
|
-
Logout$2 = _Constants$IdentityMe.Logout;
|
|
5420
|
+
var _Constants$IdentityMe$1 = Constants.IdentityMethods,
|
|
5421
|
+
Modify$3 = _Constants$IdentityMe$1.Modify,
|
|
5422
|
+
Identify$2 = _Constants$IdentityMe$1.Identify,
|
|
5423
|
+
Login$2 = _Constants$IdentityMe$1.Login,
|
|
5424
|
+
Logout$2 = _Constants$IdentityMe$1.Logout;
|
|
5517
5425
|
function Forwarders(mpInstance, kitBlocker) {
|
|
5518
5426
|
var self = this;
|
|
5519
5427
|
var UserAttributeActionTypes = {
|
|
@@ -5987,7 +5895,7 @@ var mParticle = (function () {
|
|
|
5987
5895
|
}
|
|
5988
5896
|
|
|
5989
5897
|
// TODO: This file is no longer the server model because the web SDK payload
|
|
5990
|
-
var MessageType = Types.MessageType;
|
|
5898
|
+
var MessageType$1 = Types.MessageType;
|
|
5991
5899
|
var ApplicationTransitionType = Types.ApplicationTransitionType;
|
|
5992
5900
|
// TODO: Make this a pure function that returns a new object
|
|
5993
5901
|
function convertCustomFlags(event, dto) {
|
|
@@ -6170,7 +6078,7 @@ var mParticle = (function () {
|
|
|
6170
6078
|
CurrencyCode: mpInstance._Store.currencyCode,
|
|
6171
6079
|
DataPlan: mpInstance._Store.SDKConfig.dataPlan ? mpInstance._Store.SDKConfig.dataPlan : {}
|
|
6172
6080
|
};
|
|
6173
|
-
if (eventObject.EventDataType === MessageType.AppStateTransition) {
|
|
6081
|
+
if (eventObject.EventDataType === MessageType$1.AppStateTransition) {
|
|
6174
6082
|
eventObject.IsFirstRun = mpInstance._Store.isFirstRun;
|
|
6175
6083
|
eventObject.LaunchReferral = window.location.href || null;
|
|
6176
6084
|
}
|
|
@@ -6230,7 +6138,7 @@ var mParticle = (function () {
|
|
|
6230
6138
|
if (consent) {
|
|
6231
6139
|
dto.con = consent;
|
|
6232
6140
|
}
|
|
6233
|
-
if (event.EventDataType === MessageType.AppStateTransition) {
|
|
6141
|
+
if (event.EventDataType === MessageType$1.AppStateTransition) {
|
|
6234
6142
|
dto.fr = event.IsFirstRun;
|
|
6235
6143
|
dto.iu = false;
|
|
6236
6144
|
dto.at = ApplicationTransitionType.AppInit;
|
|
@@ -6242,7 +6150,7 @@ var mParticle = (function () {
|
|
|
6242
6150
|
if (event.CustomFlags) {
|
|
6243
6151
|
convertCustomFlags(event, dto);
|
|
6244
6152
|
}
|
|
6245
|
-
if (event.EventDataType === MessageType.Commerce) {
|
|
6153
|
+
if (event.EventDataType === MessageType$1.Commerce) {
|
|
6246
6154
|
dto.cu = event.CurrencyCode;
|
|
6247
6155
|
// TODO: If Cart is deprecated, we should deprecate this too
|
|
6248
6156
|
if (event.ShoppingCart) {
|
|
@@ -6283,7 +6191,7 @@ var mParticle = (function () {
|
|
|
6283
6191
|
};
|
|
6284
6192
|
});
|
|
6285
6193
|
}
|
|
6286
|
-
} else if (event.EventDataType === MessageType.Profile) {
|
|
6194
|
+
} else if (event.EventDataType === MessageType$1.Profile) {
|
|
6287
6195
|
dto.pet = event.ProfileMessageType;
|
|
6288
6196
|
}
|
|
6289
6197
|
return dto;
|
|
@@ -6542,29 +6450,29 @@ var mParticle = (function () {
|
|
|
6542
6450
|
return AudienceManager;
|
|
6543
6451
|
}();
|
|
6544
6452
|
|
|
6545
|
-
function didUserChange(previousUser, newUser) {
|
|
6546
|
-
return !previousUser || newUser.getMPID() !== previousUser.getMPID() || previousUser.isLoggedIn() !== newUser.isLoggedIn();
|
|
6547
|
-
}
|
|
6548
|
-
|
|
6549
6453
|
var Messages$2 = Constants.Messages,
|
|
6550
6454
|
HTTPCodes$2 = Constants.HTTPCodes,
|
|
6551
|
-
FeatureFlags$1 = Constants.FeatureFlags
|
|
6552
|
-
IdentityMethods = Constants.IdentityMethods;
|
|
6455
|
+
FeatureFlags$1 = Constants.FeatureFlags;
|
|
6553
6456
|
var ErrorMessages = Messages$2.ErrorMessages;
|
|
6554
|
-
var
|
|
6555
|
-
|
|
6556
|
-
Modify$1 =
|
|
6557
|
-
Login =
|
|
6558
|
-
Logout =
|
|
6457
|
+
var _Constants$IdentityMe = Constants.IdentityMethods,
|
|
6458
|
+
Identify = _Constants$IdentityMe.Identify,
|
|
6459
|
+
Modify$1 = _Constants$IdentityMe.Modify,
|
|
6460
|
+
Login = _Constants$IdentityMe.Login,
|
|
6461
|
+
Logout = _Constants$IdentityMe.Logout;
|
|
6559
6462
|
function Identity(mpInstance) {
|
|
6560
|
-
var _mpInstance$_Helpers = mpInstance._Helpers,
|
|
6561
|
-
getFeatureFlag = _mpInstance$_Helpers.getFeatureFlag,
|
|
6562
|
-
extend = _mpInstance$_Helpers.extend;
|
|
6563
6463
|
var self = this;
|
|
6564
6464
|
this.idCache = null;
|
|
6565
6465
|
this.audienceManager = null;
|
|
6566
|
-
|
|
6567
|
-
|
|
6466
|
+
this.checkIdentitySwap = function (previousMPID, currentMPID, currentSessionMPIDs) {
|
|
6467
|
+
if (previousMPID && currentMPID && previousMPID !== currentMPID) {
|
|
6468
|
+
var persistence = mpInstance._Persistence.getPersistence();
|
|
6469
|
+
if (persistence) {
|
|
6470
|
+
persistence.cu = currentMPID;
|
|
6471
|
+
persistence.gs.csm = currentSessionMPIDs;
|
|
6472
|
+
mpInstance._Persistence.savePersistence(persistence);
|
|
6473
|
+
}
|
|
6474
|
+
}
|
|
6475
|
+
};
|
|
6568
6476
|
this.IdentityRequest = {
|
|
6569
6477
|
preProcessIdentityRequest: function preProcessIdentityRequest(identityApiData, callback, method) {
|
|
6570
6478
|
mpInstance.Logger.verbose(Messages$2.InformationMessages.StartingLogEvent + ': ' + method);
|
|
@@ -6621,7 +6529,7 @@ var mParticle = (function () {
|
|
|
6621
6529
|
createIdentityChanges: function createIdentityChanges(previousIdentities, newIdentities) {
|
|
6622
6530
|
var identityChanges = [];
|
|
6623
6531
|
var key;
|
|
6624
|
-
if (newIdentities && isObject(newIdentities) && previousIdentities && isObject(previousIdentities)) {
|
|
6532
|
+
if (newIdentities && mpInstance._Helpers.isObject(newIdentities) && previousIdentities && mpInstance._Helpers.isObject(previousIdentities)) {
|
|
6625
6533
|
for (key in newIdentities) {
|
|
6626
6534
|
identityChanges.push({
|
|
6627
6535
|
old_value: previousIdentities[key] || null,
|
|
@@ -6635,7 +6543,7 @@ var mParticle = (function () {
|
|
|
6635
6543
|
// takes 2 UI objects keyed by name, combines them, returns them keyed by type
|
|
6636
6544
|
combineUserIdentities: function combineUserIdentities(previousUIByName, newUIByName) {
|
|
6637
6545
|
var combinedUIByType = {};
|
|
6638
|
-
var combinedUIByName = extend(
|
|
6546
|
+
var combinedUIByName = mpInstance._Helpers.extend(previousUIByName, newUIByName);
|
|
6639
6547
|
for (var key in combinedUIByName) {
|
|
6640
6548
|
var type = Types.IdentityType.getIdentityType(key);
|
|
6641
6549
|
// this check removes anything that is not whitelisted as an identity type
|
|
@@ -6700,7 +6608,6 @@ var mParticle = (function () {
|
|
|
6700
6608
|
* @param {Function} [callback] A callback function that is called when the identify request completes
|
|
6701
6609
|
*/
|
|
6702
6610
|
identify: function identify(identityApiData, callback) {
|
|
6703
|
-
// https://go.mparticle.com/work/SQDSDKS-6337
|
|
6704
6611
|
var mpid,
|
|
6705
6612
|
currentUser = mpInstance.Identity.getCurrentUser(),
|
|
6706
6613
|
preProcessResult = mpInstance._Identity.IdentityRequest.preProcessIdentityRequest(identityApiData, callback, Identify);
|
|
@@ -6738,7 +6645,6 @@ var mParticle = (function () {
|
|
|
6738
6645
|
* @param {Function} [callback] A callback function that is called when the logout request completes
|
|
6739
6646
|
*/
|
|
6740
6647
|
logout: function logout(identityApiData, callback) {
|
|
6741
|
-
// https://go.mparticle.com/work/SQDSDKS-6337
|
|
6742
6648
|
var mpid,
|
|
6743
6649
|
currentUser = mpInstance.Identity.getCurrentUser(),
|
|
6744
6650
|
preProcessResult = mpInstance._Identity.IdentityRequest.preProcessIdentityRequest(identityApiData, callback, Logout);
|
|
@@ -6782,7 +6688,6 @@ var mParticle = (function () {
|
|
|
6782
6688
|
* @param {Function} [callback] A callback function that is called when the login request completes
|
|
6783
6689
|
*/
|
|
6784
6690
|
login: function login(identityApiData, callback) {
|
|
6785
|
-
// https://go.mparticle.com/work/SQDSDKS-6337
|
|
6786
6691
|
var mpid,
|
|
6787
6692
|
currentUser = mpInstance.Identity.getCurrentUser(),
|
|
6788
6693
|
preProcessResult = mpInstance._Identity.IdentityRequest.preProcessIdentityRequest(identityApiData, callback, Login);
|
|
@@ -6820,7 +6725,6 @@ var mParticle = (function () {
|
|
|
6820
6725
|
* @param {Function} [callback] A callback function that is called when the modify request completes
|
|
6821
6726
|
*/
|
|
6822
6727
|
modify: function modify(identityApiData, callback) {
|
|
6823
|
-
// https://go.mparticle.com/work/SQDSDKS-6337
|
|
6824
6728
|
var mpid,
|
|
6825
6729
|
currentUser = mpInstance.Identity.getCurrentUser(),
|
|
6826
6730
|
preProcessResult = mpInstance._Identity.IdentityRequest.preProcessIdentityRequest(identityApiData, callback, Modify$1);
|
|
@@ -7002,7 +6906,6 @@ var mParticle = (function () {
|
|
|
7002
6906
|
}
|
|
7003
6907
|
};
|
|
7004
6908
|
|
|
7005
|
-
// https://go.mparticle.com/work/SQDSDKS-6354
|
|
7006
6909
|
/**
|
|
7007
6910
|
* Invoke these methods on the mParticle.Identity.getCurrentUser() object.
|
|
7008
6911
|
* Example: mParticle.Identity.getCurrentUser().getAllUserAttributes()
|
|
@@ -7112,7 +7015,7 @@ var mParticle = (function () {
|
|
|
7112
7015
|
*/
|
|
7113
7016
|
setUserAttributes: function setUserAttributes(userAttributes) {
|
|
7114
7017
|
mpInstance._SessionManager.resetSessionTimer();
|
|
7115
|
-
if (isObject(userAttributes)) {
|
|
7018
|
+
if (mpInstance._Helpers.isObject(userAttributes)) {
|
|
7116
7019
|
if (mpInstance._Helpers.canLog()) {
|
|
7117
7020
|
for (var key in userAttributes) {
|
|
7118
7021
|
if (userAttributes.hasOwnProperty(key)) {
|
|
@@ -7321,6 +7224,7 @@ var mParticle = (function () {
|
|
|
7321
7224
|
* @method getuserAudiences
|
|
7322
7225
|
* @param {Function} [callback] A callback function that is invoked when the user audience request completes
|
|
7323
7226
|
*/
|
|
7227
|
+
// https://go.mparticle.com/work/SQDSDKS-6436
|
|
7324
7228
|
getUserAudiences: function getUserAudiences(callback) {
|
|
7325
7229
|
// user audience API is feature flagged
|
|
7326
7230
|
if (!mpInstance._Helpers.getFeatureFlag(FeatureFlags$1.AudienceAPI)) {
|
|
@@ -7452,51 +7356,64 @@ var mParticle = (function () {
|
|
|
7452
7356
|
}
|
|
7453
7357
|
};
|
|
7454
7358
|
};
|
|
7455
|
-
|
|
7456
|
-
// https://go.mparticle.com/work/SQDSDKS-6355
|
|
7457
7359
|
this.parseIdentityResponse = function (xhr, previousMPID, callback, identityApiData, method, knownIdentities, parsingCachedResponse) {
|
|
7458
|
-
var prevUser = mpInstance.Identity.getUser(previousMPID)
|
|
7459
|
-
|
|
7460
|
-
|
|
7461
|
-
|
|
7462
|
-
|
|
7463
|
-
|
|
7360
|
+
var prevUser = mpInstance.Identity.getUser(previousMPID),
|
|
7361
|
+
newUser,
|
|
7362
|
+
mpidIsNotInCookies,
|
|
7363
|
+
identityApiResult,
|
|
7364
|
+
indexOfMPID,
|
|
7365
|
+
newIdentitiesByType = {},
|
|
7366
|
+
previousUIByName = prevUser ? prevUser.getUserIdentities().userIdentities : {},
|
|
7367
|
+
previousUIByNameCopy = mpInstance._Helpers.extend({}, previousUIByName);
|
|
7464
7368
|
mpInstance._Store.identityCallInFlight = false;
|
|
7465
7369
|
try {
|
|
7466
|
-
var _identityApiResult;
|
|
7467
7370
|
mpInstance.Logger.verbose('Parsing "' + method + '" identity response from server');
|
|
7468
|
-
|
|
7469
|
-
|
|
7470
|
-
|
|
7471
|
-
|
|
7472
|
-
|
|
7473
|
-
mpInstance._Persistence.setLastSeenTime(previousMPID);
|
|
7371
|
+
if (xhr.responseText) {
|
|
7372
|
+
identityApiResult = JSON.parse(xhr.responseText);
|
|
7373
|
+
if (identityApiResult.hasOwnProperty('is_logged_in')) {
|
|
7374
|
+
mpInstance._Store.isLoggedIn = identityApiResult.is_logged_in;
|
|
7375
|
+
}
|
|
7474
7376
|
}
|
|
7475
|
-
var mpidIsNotInCookies = !mpInstance._Persistence.getFirstSeenTime(identityApiResult.mpid);
|
|
7476
7377
|
|
|
7477
|
-
//
|
|
7478
|
-
|
|
7378
|
+
// set currentUser
|
|
7379
|
+
if (!prevUser || prevUser.getMPID() && identityApiResult.mpid && identityApiResult.mpid !== prevUser.getMPID()) {
|
|
7380
|
+
mpInstance._Store.mpid = identityApiResult.mpid;
|
|
7381
|
+
if (prevUser) {
|
|
7382
|
+
mpInstance._Persistence.setLastSeenTime(previousMPID);
|
|
7383
|
+
}
|
|
7384
|
+
if (!mpInstance._Persistence.getFirstSeenTime(identityApiResult.mpid)) mpidIsNotInCookies = true;
|
|
7385
|
+
mpInstance._Persistence.setFirstSeenTime(identityApiResult.mpid);
|
|
7386
|
+
}
|
|
7479
7387
|
if (xhr.status === 200) {
|
|
7480
|
-
if (getFeatureFlag(CacheIdentity)) {
|
|
7388
|
+
if (mpInstance._Helpers.getFeatureFlag(Constants.FeatureFlags.CacheIdentity)) {
|
|
7481
7389
|
cacheOrClearIdCache(method, knownIdentities, self.idCache, xhr, parsingCachedResponse);
|
|
7482
7390
|
}
|
|
7483
|
-
var incomingUser = self.IdentityAPI.getUser(identityApiResult.mpid);
|
|
7484
|
-
var incomingMpidUIByName = incomingUser ? incomingUser.getUserIdentities().userIdentities : {};
|
|
7485
7391
|
if (method === Modify$1) {
|
|
7486
7392
|
newIdentitiesByType = mpInstance._Identity.IdentityRequest.combineUserIdentities(previousUIByName, identityApiData.userIdentities);
|
|
7487
7393
|
mpInstance._Persistence.saveUserIdentitiesToPersistence(previousMPID, newIdentitiesByType);
|
|
7488
7394
|
} else {
|
|
7489
|
-
|
|
7395
|
+
var incomingUser = self.IdentityAPI.getUser(identityApiResult.mpid);
|
|
7396
|
+
var incomingMpidUIByName = incomingUser ? incomingUser.getUserIdentities().userIdentities : {};
|
|
7397
|
+
var incomingMpidUIByNameCopy = mpInstance._Helpers.extend({}, incomingMpidUIByName);
|
|
7398
|
+
mpInstance.Logger.verbose('Successfully parsed Identity Response');
|
|
7399
|
+
|
|
7490
7400
|
//this covers an edge case where, users stored before "firstSeenTime" was introduced
|
|
7491
7401
|
//will not have a value for "fst" until the current MPID changes, and in some cases,
|
|
7492
7402
|
//the current MPID will never change
|
|
7493
|
-
if (method === Identify && prevUser && identityApiResult.mpid ===
|
|
7403
|
+
if (method === Identify && prevUser && identityApiResult.mpid === prevUser.getMPID()) {
|
|
7494
7404
|
mpInstance._Persistence.setFirstSeenTime(identityApiResult.mpid);
|
|
7495
7405
|
}
|
|
7496
|
-
mpInstance._Store.
|
|
7406
|
+
indexOfMPID = mpInstance._Store.currentSessionMPIDs.indexOf(identityApiResult.mpid);
|
|
7407
|
+
if (mpInstance._Store.sessionId && identityApiResult.mpid && previousMPID !== identityApiResult.mpid && indexOfMPID < 0) {
|
|
7408
|
+
mpInstance._Store.currentSessionMPIDs.push(identityApiResult.mpid);
|
|
7409
|
+
}
|
|
7410
|
+
if (indexOfMPID > -1) {
|
|
7411
|
+
mpInstance._Store.currentSessionMPIDs = mpInstance._Store.currentSessionMPIDs.slice(0, indexOfMPID).concat(mpInstance._Store.currentSessionMPIDs.slice(indexOfMPID + 1, mpInstance._Store.currentSessionMPIDs.length));
|
|
7412
|
+
mpInstance._Store.currentSessionMPIDs.push(identityApiResult.mpid);
|
|
7413
|
+
}
|
|
7497
7414
|
mpInstance._CookieSyncManager.attemptCookieSync(previousMPID, identityApiResult.mpid, mpidIsNotInCookies);
|
|
7498
|
-
|
|
7499
|
-
if (identityApiData &&
|
|
7415
|
+
self.checkIdentitySwap(previousMPID, identityApiResult.mpid, mpInstance._Store.currentSessionMPIDs);
|
|
7416
|
+
if (identityApiData && identityApiData.userIdentities && Object.keys(identityApiData.userIdentities).length) {
|
|
7500
7417
|
newIdentitiesByType = self.IdentityRequest.combineUserIdentities(incomingMpidUIByName, identityApiData.userIdentities);
|
|
7501
7418
|
}
|
|
7502
7419
|
|
|
@@ -7504,31 +7421,46 @@ var mParticle = (function () {
|
|
|
7504
7421
|
mpInstance._Persistence.saveUserIdentitiesToPersistence(identityApiResult.mpid, newIdentitiesByType);
|
|
7505
7422
|
mpInstance._Persistence.update();
|
|
7506
7423
|
mpInstance._Persistence.findPrevCookiesBasedOnUI(identityApiData);
|
|
7507
|
-
|
|
7508
|
-
// https://go.mparticle.com/work/SQDSDKS-6357
|
|
7509
7424
|
mpInstance._Store.context = identityApiResult.context || mpInstance._Store.context;
|
|
7510
7425
|
}
|
|
7511
7426
|
newUser = mpInstance.Identity.getCurrentUser();
|
|
7512
|
-
|
|
7513
|
-
|
|
7514
|
-
|
|
7427
|
+
if (identityApiData && identityApiData.onUserAlias && mpInstance._Helpers.Validators.isFunction(identityApiData.onUserAlias)) {
|
|
7428
|
+
try {
|
|
7429
|
+
mpInstance.Logger.warning('Deprecated function onUserAlias will be removed in future releases');
|
|
7430
|
+
identityApiData.onUserAlias(prevUser, newUser);
|
|
7431
|
+
} catch (e) {
|
|
7432
|
+
mpInstance.Logger.error('There was an error with your onUserAlias function - ' + e);
|
|
7433
|
+
}
|
|
7434
|
+
}
|
|
7515
7435
|
var persistence = mpInstance._Persistence.getPersistence();
|
|
7516
7436
|
if (newUser) {
|
|
7517
7437
|
mpInstance._Persistence.storeDataInMemory(persistence, newUser.getMPID());
|
|
7518
|
-
|
|
7519
|
-
|
|
7438
|
+
if (!prevUser || newUser.getMPID() !== prevUser.getMPID() || prevUser.isLoggedIn() !== newUser.isLoggedIn()) {
|
|
7439
|
+
mpInstance._Forwarders.initForwarders(newUser.getUserIdentities().userIdentities, mpInstance._APIClient.prepareForwardingStats);
|
|
7440
|
+
}
|
|
7441
|
+
|
|
7442
|
+
// TODO: https://go.mparticle.com/work/SQDSDKS-6036
|
|
7443
|
+
mpInstance._Forwarders.setForwarderUserIdentities(newUser.getUserIdentities().userIdentities);
|
|
7444
|
+
mpInstance._Forwarders.setForwarderOnIdentityComplete(newUser, method);
|
|
7445
|
+
mpInstance._Forwarders.setForwarderOnUserIdentified(newUser);
|
|
7446
|
+
}
|
|
7447
|
+
var newIdentitiesByName = {};
|
|
7448
|
+
for (var key in newIdentitiesByType) {
|
|
7449
|
+
newIdentitiesByName[Types.IdentityType.getIdentityName(mpInstance._Helpers.parseNumber(key))] = newIdentitiesByType[key];
|
|
7520
7450
|
}
|
|
7521
|
-
|
|
7522
|
-
var uiByName = method === Modify$1 ? previousUIByName : incomingMpidUIByName;
|
|
7523
|
-
self.sendUserIdentityChangeEvent(newIdentitiesByName, identityApiResult.mpid, uiByName);
|
|
7451
|
+
self.sendUserIdentityChangeEvent(newIdentitiesByName, method, identityApiResult.mpid, method === Modify$1 ? previousUIByNameCopy : incomingMpidUIByNameCopy);
|
|
7524
7452
|
}
|
|
7525
7453
|
if (callback) {
|
|
7526
|
-
|
|
7527
|
-
|
|
7528
|
-
|
|
7529
|
-
|
|
7454
|
+
if (xhr.status === 0) {
|
|
7455
|
+
mpInstance._Helpers.invokeCallback(callback, HTTPCodes$2.noHttpCoverage, identityApiResult || null, newUser);
|
|
7456
|
+
} else {
|
|
7457
|
+
mpInstance._Helpers.invokeCallback(callback, xhr.status, identityApiResult || null, newUser);
|
|
7458
|
+
}
|
|
7459
|
+
} else {
|
|
7460
|
+
if (identityApiResult && identityApiResult.errors && identityApiResult.errors.length) {
|
|
7461
|
+
mpInstance.Logger.error('Received HTTP response code of ' + xhr.status + ' - ' + identityApiResult.errors[0].message);
|
|
7462
|
+
}
|
|
7530
7463
|
}
|
|
7531
|
-
mpInstance.Logger.verbose('Successfully parsed Identity Response');
|
|
7532
7464
|
mpInstance._APIClient.processQueuedEvents();
|
|
7533
7465
|
} catch (e) {
|
|
7534
7466
|
if (callback) {
|
|
@@ -7542,30 +7474,33 @@ var mParticle = (function () {
|
|
|
7542
7474
|
// compare what identities exist vs what is previously was for the specific user if they were in memory before.
|
|
7543
7475
|
// if it's the first time the user is logging in, send a user identity change request with
|
|
7544
7476
|
|
|
7545
|
-
this.sendUserIdentityChangeEvent = function (newUserIdentities, mpid,
|
|
7546
|
-
|
|
7547
|
-
|
|
7477
|
+
this.sendUserIdentityChangeEvent = function (newUserIdentities, method, mpid, prevUserIdentities) {
|
|
7478
|
+
var currentUserInMemory, userIdentityChangeEvent;
|
|
7479
|
+
if (!mpid) {
|
|
7480
|
+
if (method !== Modify$1) {
|
|
7481
|
+
return;
|
|
7482
|
+
}
|
|
7483
|
+
}
|
|
7484
|
+
currentUserInMemory = this.IdentityAPI.getUser(mpid);
|
|
7548
7485
|
for (var identityType in newUserIdentities) {
|
|
7549
|
-
|
|
7550
|
-
|
|
7551
|
-
|
|
7552
|
-
// we need to notify the server so that it will associate the new
|
|
7553
|
-
// identity type with subsequent events
|
|
7554
|
-
var isNewUserIdentityType = !currentUserIdentities[identityType];
|
|
7555
|
-
var userIdentityChangeEvent = self.createUserIdentityChange(identityType, newUserIdentities[identityType], currentUserIdentities[identityType], isNewUserIdentityType, currentUserInMemory);
|
|
7486
|
+
if (prevUserIdentities[identityType] !== newUserIdentities[identityType]) {
|
|
7487
|
+
var isNewUserIdentityType = !prevUserIdentities[identityType];
|
|
7488
|
+
userIdentityChangeEvent = self.createUserIdentityChange(identityType, newUserIdentities[identityType], prevUserIdentities[identityType], isNewUserIdentityType, currentUserInMemory);
|
|
7556
7489
|
mpInstance._APIClient.sendEventToServer(userIdentityChangeEvent);
|
|
7557
7490
|
}
|
|
7558
7491
|
}
|
|
7559
7492
|
};
|
|
7560
|
-
this.createUserIdentityChange = function (identityType, newIdentity, oldIdentity,
|
|
7493
|
+
this.createUserIdentityChange = function (identityType, newIdentity, oldIdentity, newCreatedThisBatch, userInMemory) {
|
|
7561
7494
|
var userIdentityChangeEvent;
|
|
7495
|
+
|
|
7496
|
+
// https://go.mparticle.com/work/SQDSDKS-6439
|
|
7562
7497
|
userIdentityChangeEvent = mpInstance._ServerModel.createEventObject({
|
|
7563
7498
|
messageType: Types.MessageType.UserIdentityChange,
|
|
7564
7499
|
userIdentityChanges: {
|
|
7565
7500
|
New: {
|
|
7566
7501
|
IdentityType: identityType,
|
|
7567
7502
|
Identity: newIdentity,
|
|
7568
|
-
CreatedThisBatch:
|
|
7503
|
+
CreatedThisBatch: newCreatedThisBatch
|
|
7569
7504
|
},
|
|
7570
7505
|
Old: {
|
|
7571
7506
|
IdentityType: identityType,
|
|
@@ -7589,6 +7524,7 @@ var mParticle = (function () {
|
|
|
7589
7524
|
}
|
|
7590
7525
|
var userAttributeChangeEvent;
|
|
7591
7526
|
if (newValue !== previousUserAttributeValue) {
|
|
7527
|
+
// https://go.mparticle.com/work/SQDSDKS-6439
|
|
7592
7528
|
userAttributeChangeEvent = mpInstance._ServerModel.createEventObject({
|
|
7593
7529
|
messageType: Types.MessageType.UserAttributeChange,
|
|
7594
7530
|
userAttributeChanges: {
|
|
@@ -7602,29 +7538,6 @@ var mParticle = (function () {
|
|
|
7602
7538
|
}
|
|
7603
7539
|
return userAttributeChangeEvent;
|
|
7604
7540
|
};
|
|
7605
|
-
this.reinitForwardersOnUserChange = function (prevUser, newUser) {
|
|
7606
|
-
if (didUserChange(prevUser, newUser)) {
|
|
7607
|
-
mpInstance._Forwarders.initForwarders(newUser.getUserIdentities().userIdentities, mpInstance._APIClient.prepareForwardingStats);
|
|
7608
|
-
}
|
|
7609
|
-
};
|
|
7610
|
-
this.setForwarderCallbacks = function (user, method) {
|
|
7611
|
-
// https://go.mparticle.com/work/SQDSDKS-6036
|
|
7612
|
-
mpInstance._Forwarders.setForwarderUserIdentities(user.getUserIdentities().userIdentities);
|
|
7613
|
-
mpInstance._Forwarders.setForwarderOnIdentityComplete(user, method);
|
|
7614
|
-
mpInstance._Forwarders.setForwarderOnUserIdentified(user);
|
|
7615
|
-
};
|
|
7616
|
-
}
|
|
7617
|
-
|
|
7618
|
-
// https://go.mparticle.com/work/SQDSDKS-6359
|
|
7619
|
-
function tryOnUserAlias(previousUser, newUser, identityApiData, logger) {
|
|
7620
|
-
if (identityApiData && identityApiData.onUserAlias && isFunction(identityApiData.onUserAlias)) {
|
|
7621
|
-
try {
|
|
7622
|
-
logger.warning(generateDeprecationMessage('onUserAlias'));
|
|
7623
|
-
identityApiData.onUserAlias(previousUser, newUser);
|
|
7624
|
-
} catch (e) {
|
|
7625
|
-
logger.error('There was an error with your onUserAlias function - ' + e);
|
|
7626
|
-
}
|
|
7627
|
-
}
|
|
7628
7541
|
}
|
|
7629
7542
|
|
|
7630
7543
|
var CCPAPurpose = Constants.CCPAPurpose;
|
|
@@ -8431,7 +8344,6 @@ var mParticle = (function () {
|
|
|
8431
8344
|
var xhr,
|
|
8432
8345
|
xhrCallback = function xhrCallback() {
|
|
8433
8346
|
if (xhr.readyState === 4) {
|
|
8434
|
-
// https://go.mparticle.com/work/SQDSDKS-6368
|
|
8435
8347
|
mpInstance.Logger.verbose('Received ' + xhr.statusText + ' from server');
|
|
8436
8348
|
//only parse error messages from failing requests
|
|
8437
8349
|
if (xhr.status !== 200 && xhr.status !== 202) {
|
|
@@ -8464,7 +8376,6 @@ var mParticle = (function () {
|
|
|
8464
8376
|
previousMPID,
|
|
8465
8377
|
xhrCallback = function xhrCallback() {
|
|
8466
8378
|
if (xhr.readyState === 4) {
|
|
8467
|
-
// https://go.mparticle.com/work/SQDSDKS-6368
|
|
8468
8379
|
mpInstance.Logger.verbose('Received ' + xhr.statusText + ' from server');
|
|
8469
8380
|
parseIdentityResponse(xhr, previousMPID, callback, originalIdentityApiData, method, knownIdentities, false);
|
|
8470
8381
|
}
|
|
@@ -9778,6 +9689,60 @@ var mParticle = (function () {
|
|
|
9778
9689
|
return _BatchValidator;
|
|
9779
9690
|
}();
|
|
9780
9691
|
|
|
9692
|
+
var EventTypeEnum;
|
|
9693
|
+
(function (EventTypeEnum) {
|
|
9694
|
+
EventTypeEnum[EventTypeEnum["Unknown"] = 0] = "Unknown";
|
|
9695
|
+
EventTypeEnum[EventTypeEnum["Navigation"] = 1] = "Navigation";
|
|
9696
|
+
EventTypeEnum[EventTypeEnum["Location"] = 2] = "Location";
|
|
9697
|
+
EventTypeEnum[EventTypeEnum["Search"] = 3] = "Search";
|
|
9698
|
+
EventTypeEnum[EventTypeEnum["Transaction"] = 4] = "Transaction";
|
|
9699
|
+
EventTypeEnum[EventTypeEnum["UserContent"] = 5] = "UserContent";
|
|
9700
|
+
EventTypeEnum[EventTypeEnum["UserPreference"] = 6] = "UserPreference";
|
|
9701
|
+
EventTypeEnum[EventTypeEnum["Social"] = 7] = "Social";
|
|
9702
|
+
EventTypeEnum[EventTypeEnum["Other"] = 8] = "Other";
|
|
9703
|
+
EventTypeEnum[EventTypeEnum["Media"] = 9] = "Media";
|
|
9704
|
+
})(EventTypeEnum || (EventTypeEnum = {}));
|
|
9705
|
+
// TODO: https://mparticle-eng.atlassian.net/browse/SQDSDKS-5403
|
|
9706
|
+
var MessageType;
|
|
9707
|
+
(function (MessageType) {
|
|
9708
|
+
MessageType[MessageType["SessionStart"] = 1] = "SessionStart";
|
|
9709
|
+
MessageType[MessageType["SessionEnd"] = 2] = "SessionEnd";
|
|
9710
|
+
MessageType[MessageType["PageView"] = 3] = "PageView";
|
|
9711
|
+
MessageType[MessageType["PageEvent"] = 4] = "PageEvent";
|
|
9712
|
+
MessageType[MessageType["CrashReport"] = 5] = "CrashReport";
|
|
9713
|
+
MessageType[MessageType["OptOut"] = 6] = "OptOut";
|
|
9714
|
+
MessageType[MessageType["AppStateTransition"] = 10] = "AppStateTransition";
|
|
9715
|
+
MessageType[MessageType["Profile"] = 14] = "Profile";
|
|
9716
|
+
MessageType[MessageType["Commerce"] = 16] = "Commerce";
|
|
9717
|
+
MessageType[MessageType["UserAttributeChange"] = 17] = "UserAttributeChange";
|
|
9718
|
+
MessageType[MessageType["UserIdentityChange"] = 18] = "UserIdentityChange";
|
|
9719
|
+
MessageType[MessageType["Media"] = 20] = "Media";
|
|
9720
|
+
})(MessageType || (MessageType = {}));
|
|
9721
|
+
var IdentityType;
|
|
9722
|
+
(function (IdentityType) {
|
|
9723
|
+
IdentityType[IdentityType["Other"] = 0] = "Other";
|
|
9724
|
+
IdentityType[IdentityType["CustomerId"] = 1] = "CustomerId";
|
|
9725
|
+
IdentityType[IdentityType["Facebook"] = 2] = "Facebook";
|
|
9726
|
+
IdentityType[IdentityType["Twitter"] = 3] = "Twitter";
|
|
9727
|
+
IdentityType[IdentityType["Google"] = 4] = "Google";
|
|
9728
|
+
IdentityType[IdentityType["Microsoft"] = 5] = "Microsoft";
|
|
9729
|
+
IdentityType[IdentityType["Yahoo"] = 6] = "Yahoo";
|
|
9730
|
+
IdentityType[IdentityType["Email"] = 7] = "Email";
|
|
9731
|
+
IdentityType[IdentityType["FacebookCustomAudienceId"] = 9] = "FacebookCustomAudienceId";
|
|
9732
|
+
IdentityType[IdentityType["Other2"] = 10] = "Other2";
|
|
9733
|
+
IdentityType[IdentityType["Other3"] = 11] = "Other3";
|
|
9734
|
+
IdentityType[IdentityType["Other4"] = 12] = "Other4";
|
|
9735
|
+
IdentityType[IdentityType["Other5"] = 13] = "Other5";
|
|
9736
|
+
IdentityType[IdentityType["Other6"] = 14] = "Other6";
|
|
9737
|
+
IdentityType[IdentityType["Other7"] = 15] = "Other7";
|
|
9738
|
+
IdentityType[IdentityType["Other8"] = 16] = "Other8";
|
|
9739
|
+
IdentityType[IdentityType["Other9"] = 17] = "Other9";
|
|
9740
|
+
IdentityType[IdentityType["Other10"] = 18] = "Other10";
|
|
9741
|
+
IdentityType[IdentityType["MobileNumber"] = 19] = "MobileNumber";
|
|
9742
|
+
IdentityType[IdentityType["PhoneNumber2"] = 20] = "PhoneNumber2";
|
|
9743
|
+
IdentityType[IdentityType["PhoneNumber3"] = 21] = "PhoneNumber3";
|
|
9744
|
+
})(IdentityType || (IdentityType = {}));
|
|
9745
|
+
|
|
9781
9746
|
var MPSideloadedKit = /** @class */function () {
|
|
9782
9747
|
function MPSideloadedKit(unregisteredKitInstance) {
|
|
9783
9748
|
this.filterDictionary = {
|