rudder-sdk-js 1.2.19 → 1.3.3
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/index.js +221 -46
- package/package.json +1 -1
package/index.js
CHANGED
@@ -5345,17 +5345,20 @@
|
|
5345
5345
|
Comscore: "COMSCORE",
|
5346
5346
|
COMSCORE: "COMSCORE",
|
5347
5347
|
Customerio: "CUSTOMERIO",
|
5348
|
+
CUSTOMERIO: "CUSTOMERIO",
|
5348
5349
|
"Customer.io": "CUSTOMERIO",
|
5349
5350
|
"FB Pixel": "FACEBOOK_PIXEL",
|
5350
5351
|
"Facebook Pixel": "FACEBOOK_PIXEL",
|
5351
5352
|
FB_PIXEL: "FACEBOOK_PIXEL",
|
5352
|
-
|
5353
|
+
FACEBOOK_PIXEL: "FACEBOOK_PIXEL",
|
5354
|
+
"Google Tag Manager": "GTM",
|
5353
5355
|
GTM: "GTM",
|
5354
5356
|
Hotjar: "HOTJAR",
|
5355
5357
|
hotjar: "HOTJAR",
|
5356
5358
|
HOTJAR: "HOTJAR",
|
5357
5359
|
Hubspot: "HS",
|
5358
5360
|
HUBSPOT: "HS",
|
5361
|
+
HS: "HS",
|
5359
5362
|
Intercom: "INTERCOM",
|
5360
5363
|
INTERCOM: "INTERCOM",
|
5361
5364
|
Keen: "KEEN",
|
@@ -5374,17 +5377,19 @@
|
|
5374
5377
|
FullStory: "FULLSTORY",
|
5375
5378
|
BUGSNAG: "BUGSNAG",
|
5376
5379
|
TVSQUARED: "TVSQUARED",
|
5380
|
+
TVSquared: "TVSQUARED",
|
5377
5381
|
"Google Analytics 4": "GA4",
|
5378
5382
|
GoogleAnalytics4: "GA4",
|
5379
5383
|
GA4: "GA4",
|
5380
|
-
|
5384
|
+
MoEngage: "MOENGAGE",
|
5385
|
+
MOENGAGE: "MOENGAGE",
|
5381
5386
|
AM: "AM",
|
5382
5387
|
AMPLITUDE: "AM",
|
5383
5388
|
Amplitude: "AM",
|
5384
5389
|
Pendo: "PENDO",
|
5385
5390
|
PENDO: "PENDO",
|
5386
|
-
Lytics: "
|
5387
|
-
LYTICS: "
|
5391
|
+
Lytics: "LYTICS",
|
5392
|
+
LYTICS: "LYTICS",
|
5388
5393
|
Appcues: "APPCUES",
|
5389
5394
|
APPCUES: "APPCUES",
|
5390
5395
|
POSTHOG: "POSTHOG",
|
@@ -5395,6 +5400,7 @@
|
|
5395
5400
|
CLEVERTAP: "CLEVERTAP",
|
5396
5401
|
Clevertap: "CLEVERTAP",
|
5397
5402
|
BingAds: "BINGADS",
|
5403
|
+
BINGADS: "BINGADS",
|
5398
5404
|
PinterestTag: "PINTEREST_TAG",
|
5399
5405
|
Pinterest_Tag: "PINTEREST_TAG",
|
5400
5406
|
PINTERESTTAG: "PINTEREST_TAG",
|
@@ -5416,6 +5422,7 @@
|
|
5416
5422
|
Linkedininsighttag: "LINKEDIN_INSIGHT_TAG",
|
5417
5423
|
LINKEDININSIGHTTAG: "LINKEDIN_INSIGHT_TAG",
|
5418
5424
|
Reddit_Pixel: "REDDIT_PIXEL",
|
5425
|
+
REDDIT_PIXEL: "REDDIT_PIXEL",
|
5419
5426
|
RedditPixel: "REDDIT_PIXEL",
|
5420
5427
|
REDDITPIXEL: "REDDIT_PIXEL",
|
5421
5428
|
redditpixel: "REDDIT_PIXEL",
|
@@ -5424,6 +5431,7 @@
|
|
5424
5431
|
"reddit pixel": "REDDIT_PIXEL",
|
5425
5432
|
Drip: "DRIP",
|
5426
5433
|
drip: "DRIP",
|
5434
|
+
DRIP: "DRIP",
|
5427
5435
|
Heap: "HEAP",
|
5428
5436
|
heap: "HEAP",
|
5429
5437
|
"Heap.io": "HEAP",
|
@@ -5433,6 +5441,7 @@
|
|
5433
5441
|
CRITEO: "CRITEO",
|
5434
5442
|
MIXPANEL: "MP",
|
5435
5443
|
Mixpanel: "MP",
|
5444
|
+
MP: "MP",
|
5436
5445
|
Qualtrics: "QUALTRICS",
|
5437
5446
|
qualtrics: "QUALTRICS",
|
5438
5447
|
QUALTRICS: "QUALTRICS",
|
@@ -5440,6 +5449,7 @@
|
|
5440
5449
|
SnapPixel: "SNAP_PIXEL",
|
5441
5450
|
SNAPPIXEL: "SNAP_PIXEL",
|
5442
5451
|
snappixel: "SNAP_PIXEL",
|
5452
|
+
SNAP_PIXEL: "SNAP_PIXEL",
|
5443
5453
|
"Snap Pixel": "SNAP_PIXEL",
|
5444
5454
|
"SNAP PIXEL": "SNAP_PIXEL",
|
5445
5455
|
"snap pixel": "SNAP_PIXEL",
|
@@ -5454,6 +5464,7 @@
|
|
5454
5464
|
quantumMetric: "QUANTUMMETRIC",
|
5455
5465
|
quantummetric: "QUANTUMMETRIC",
|
5456
5466
|
Quantum_Metric: "QUANTUMMETRIC",
|
5467
|
+
QUANTUMMETRIC: "QUANTUMMETRIC",
|
5457
5468
|
"Google Optimize": "GOOGLE_OPTIMIZE",
|
5458
5469
|
GOOGLE_OPTIMIZE: "GOOGLE_OPTIMIZE",
|
5459
5470
|
GoogleOptimize: "GOOGLE_OPTIMIZE",
|
@@ -5561,7 +5572,7 @@
|
|
5561
5572
|
PRODUCT_REVIEWED: "Product Reviewed"
|
5562
5573
|
}; // Enumeration for integrations supported
|
5563
5574
|
|
5564
|
-
var CONFIG_URL = "https://api.rudderlabs.com/sourceConfig/?p=npm&v=1.
|
5575
|
+
var CONFIG_URL = "https://api.rudderlabs.com/sourceConfig/?p=npm&v=1.3.3";
|
5565
5576
|
var MAX_WAIT_FOR_INTEGRATION_LOAD = 10000;
|
5566
5577
|
var INTEGRATION_LOAD_CHECK_INTERVAL = 1000;
|
5567
5578
|
/* module.exports = {
|
@@ -22878,10 +22889,17 @@
|
|
22878
22889
|
js.async = async === undefined ? defaultAsyncState : async;
|
22879
22890
|
js.type = "text/javascript";
|
22880
22891
|
js.id = id;
|
22881
|
-
var
|
22882
|
-
|
22883
|
-
|
22884
|
-
|
22892
|
+
var headElmColl = document.getElementsByTagName("head");
|
22893
|
+
|
22894
|
+
if (headElmColl.length !== 0) {
|
22895
|
+
logger.debug("==adding script==", js);
|
22896
|
+
headElmColl[0].insertBefore(js, headElmColl[0].firstChild);
|
22897
|
+
} else {
|
22898
|
+
var e = document.getElementsByTagName("script")[0];
|
22899
|
+
logger.debug("==parent script==", e);
|
22900
|
+
logger.debug("==adding script==", js);
|
22901
|
+
e.parentNode.insertBefore(js, e);
|
22902
|
+
}
|
22885
22903
|
};
|
22886
22904
|
|
22887
22905
|
var AdobeAnalytics = /*#__PURE__*/function () {
|
@@ -25498,7 +25516,7 @@
|
|
25498
25516
|
function Criteo(config) {
|
25499
25517
|
_classCallCheck(this, Criteo);
|
25500
25518
|
|
25501
|
-
this.name = "
|
25519
|
+
this.name = "CRITEO";
|
25502
25520
|
this.hashMethod = config.hashMethod;
|
25503
25521
|
this.accountId = config.accountId;
|
25504
25522
|
this.url = config.homePageUrl; // eslint-disable-next-line no-nested-ternary
|
@@ -26923,7 +26941,7 @@
|
|
26923
26941
|
this.legacyConversionPixelId = config.legacyConversionPixelId;
|
26924
26942
|
this.userIdAsPixelId = config.userIdAsPixelId;
|
26925
26943
|
this.whitelistPiiProperties = config.whitelistPiiProperties;
|
26926
|
-
this.name = "
|
26944
|
+
this.name = "FACEBOOK_PIXEL";
|
26927
26945
|
}
|
26928
26946
|
|
26929
26947
|
_createClass(FacebookPixel, [{
|
@@ -27547,12 +27565,13 @@
|
|
27547
27565
|
camelcase.default = default_1;
|
27548
27566
|
|
27549
27567
|
var Fullstory = /*#__PURE__*/function () {
|
27550
|
-
function Fullstory(config) {
|
27568
|
+
function Fullstory(config, analytics) {
|
27551
27569
|
_classCallCheck(this, Fullstory);
|
27552
27570
|
|
27553
27571
|
this.fs_org = config.fs_org;
|
27554
27572
|
this.fs_debug_mode = config.fs_debug_mode;
|
27555
27573
|
this.name = "FULLSTORY";
|
27574
|
+
this.analytics = analytics;
|
27556
27575
|
}
|
27557
27576
|
|
27558
27577
|
_createClass(Fullstory, [{
|
@@ -27638,6 +27657,85 @@
|
|
27638
27657
|
return g._w[y].apply(this, arguments);
|
27639
27658
|
};
|
27640
27659
|
})(window, document, window._fs_namespace, "script", "user");
|
27660
|
+
|
27661
|
+
var FULLSTORY = this.analytics.loadOnlyIntegrations.FULLSTORY; // Checking if crossDomainSupport is their or not.
|
27662
|
+
|
27663
|
+
if ((FULLSTORY === null || FULLSTORY === void 0 ? void 0 : FULLSTORY.crossDomainSupport) === true) {
|
27664
|
+
// This function will check if the customer hash is available or not in localStorage
|
27665
|
+
window._fs_identity = function () {
|
27666
|
+
if (window.localStorage) {
|
27667
|
+
var tata_customer_hash = window.localStorage.tata_customer_hash;
|
27668
|
+
|
27669
|
+
if (tata_customer_hash) {
|
27670
|
+
return {
|
27671
|
+
uid: tata_customer_hash,
|
27672
|
+
displayName: tata_customer_hash
|
27673
|
+
};
|
27674
|
+
}
|
27675
|
+
} else {
|
27676
|
+
logger.debug("Unable to access locaStorage");
|
27677
|
+
}
|
27678
|
+
|
27679
|
+
return null;
|
27680
|
+
};
|
27681
|
+
|
27682
|
+
(function () {
|
27683
|
+
function fs(api) {
|
27684
|
+
if (!window._fs_namespace) {
|
27685
|
+
console.error('FullStory unavailable, window["_fs_namespace"] must be defined');
|
27686
|
+
return undefined;
|
27687
|
+
}
|
27688
|
+
|
27689
|
+
return api ? window[window._fs_namespace][api] : window[window._fs_namespace];
|
27690
|
+
}
|
27691
|
+
|
27692
|
+
function waitUntil(predicateFn, callbackFn, timeout, timeoutFn) {
|
27693
|
+
var totalTime = 0;
|
27694
|
+
var delay = 64;
|
27695
|
+
|
27696
|
+
var resultFn = function resultFn() {
|
27697
|
+
if (typeof predicateFn === "function" && predicateFn()) {
|
27698
|
+
callbackFn();
|
27699
|
+
return;
|
27700
|
+
}
|
27701
|
+
|
27702
|
+
delay = Math.min(delay * 2, 1024);
|
27703
|
+
|
27704
|
+
if (totalTime > timeout) {
|
27705
|
+
if (timeoutFn) {
|
27706
|
+
timeoutFn();
|
27707
|
+
}
|
27708
|
+
}
|
27709
|
+
|
27710
|
+
totalTime += delay;
|
27711
|
+
setTimeout(resultFn, delay);
|
27712
|
+
};
|
27713
|
+
|
27714
|
+
resultFn();
|
27715
|
+
} // Checking if timeout is provided or not.
|
27716
|
+
|
27717
|
+
|
27718
|
+
var timeout = FULLSTORY.timeout || 2000;
|
27719
|
+
|
27720
|
+
function identify() {
|
27721
|
+
if (typeof window._fs_identity === "function") {
|
27722
|
+
var userVars = window._fs_identity();
|
27723
|
+
|
27724
|
+
if (_typeof(userVars) === "object" && typeof userVars.uid === "string") {
|
27725
|
+
fs("setUserVars")(userVars);
|
27726
|
+
fs("restart")();
|
27727
|
+
} else {
|
27728
|
+
fs("log")("error", "FS.setUserVars requires an object that contains uid");
|
27729
|
+
}
|
27730
|
+
} else {
|
27731
|
+
fs("log")("error", 'window["_fs_identity"] function not found');
|
27732
|
+
}
|
27733
|
+
}
|
27734
|
+
|
27735
|
+
fs("shutdown")();
|
27736
|
+
waitUntil(window._fs_identity, identify, timeout, fs("restart"));
|
27737
|
+
})();
|
27738
|
+
}
|
27641
27739
|
}
|
27642
27740
|
}, {
|
27643
27741
|
key: "page",
|
@@ -29285,13 +29383,17 @@
|
|
29285
29383
|
_classCallCheck(this, GoogleTagManager);
|
29286
29384
|
|
29287
29385
|
this.containerID = config.containerID;
|
29288
|
-
this.name = "
|
29386
|
+
this.name = "GTM";
|
29387
|
+
this.serverUrl = config.serverUrl;
|
29289
29388
|
}
|
29290
29389
|
|
29291
29390
|
_createClass(GoogleTagManager, [{
|
29292
29391
|
key: "init",
|
29293
29392
|
value: function init() {
|
29294
29393
|
logger.debug("===in init GoogleTagManager===");
|
29394
|
+
var defaultUrl = "https://www.googletagmanager.com"; // ref: https://developers.google.com/tag-platform/tag-manager/server-side/send-data#update_the_gtmjs_source_domain
|
29395
|
+
|
29396
|
+
window.finalUrl = this.serverUrl ? this.serverUrl : defaultUrl;
|
29295
29397
|
|
29296
29398
|
(function (w, d, s, l, i) {
|
29297
29399
|
w[l] = w[l] || [];
|
@@ -29303,7 +29405,7 @@
|
|
29303
29405
|
var j = d.createElement(s);
|
29304
29406
|
var dl = l !== "dataLayer" ? "&l=".concat(l) : "";
|
29305
29407
|
j.async = true;
|
29306
|
-
j.src = "
|
29408
|
+
j.src = "".concat(window.finalUrl, "/gtm.js?id=").concat(i).concat(dl);
|
29307
29409
|
f.parentNode.insertBefore(j, f);
|
29308
29410
|
})(window, document, "script", "dataLayer", this.containerID);
|
29309
29411
|
}
|
@@ -29697,7 +29799,7 @@
|
|
29697
29799
|
function INTERCOM(config) {
|
29698
29800
|
_classCallCheck(this, INTERCOM);
|
29699
29801
|
|
29700
|
-
this.
|
29802
|
+
this.name = "INTERCOM";
|
29701
29803
|
this.API_KEY = config.apiKey;
|
29702
29804
|
this.APP_ID = config.appId;
|
29703
29805
|
this.MOBILE_APP_ID = config.mobileAppId;
|
@@ -31330,7 +31432,7 @@
|
|
31330
31432
|
function Mixpanel(config) {
|
31331
31433
|
_classCallCheck(this, Mixpanel);
|
31332
31434
|
|
31333
|
-
this.name = "
|
31435
|
+
this.name = "MP";
|
31334
31436
|
this.accountId = config.accountId;
|
31335
31437
|
this.token = config.token;
|
31336
31438
|
this.people = config.people || false;
|
@@ -31755,7 +31857,7 @@
|
|
31755
31857
|
this.apiId = config.apiId;
|
31756
31858
|
this.debug = config.debug;
|
31757
31859
|
this.region = config.region;
|
31758
|
-
this.name = "
|
31860
|
+
this.name = "MOENGAGE";
|
31759
31861
|
this.analyticsinstance = analyticsinstance;
|
31760
31862
|
}
|
31761
31863
|
|
@@ -32321,7 +32423,7 @@
|
|
32321
32423
|
}();
|
32322
32424
|
|
32323
32425
|
var eventMapping = [{
|
32324
|
-
src: ["
|
32426
|
+
src: ["order completed"],
|
32325
32427
|
dest: "Checkout"
|
32326
32428
|
}, {
|
32327
32429
|
src: ["product added"],
|
@@ -32737,6 +32839,7 @@
|
|
32737
32839
|
e._i.push([i, s, a]);
|
32738
32840
|
}, e.__SV = 1);
|
32739
32841
|
}(document, window.posthog || []);
|
32842
|
+
var POSTHOG = this.analytics.loadOnlyIntegrations.POSTHOG;
|
32740
32843
|
var configObject = {
|
32741
32844
|
api_host: this.yourInstance,
|
32742
32845
|
autocapture: this.autocapture,
|
@@ -32746,6 +32849,10 @@
|
|
32746
32849
|
disable_cookie: this.disableCookie
|
32747
32850
|
};
|
32748
32851
|
|
32852
|
+
if (POSTHOG && POSTHOG.loaded) {
|
32853
|
+
configObject.loaded = POSTHOG.loaded;
|
32854
|
+
}
|
32855
|
+
|
32749
32856
|
if (this.xhrHeaders && Object.keys(this.xhrHeaders).length > 0) {
|
32750
32857
|
configObject.xhr_headers = this.xhrHeaders;
|
32751
32858
|
}
|
@@ -32849,7 +32956,7 @@
|
|
32849
32956
|
|
32850
32957
|
this.publicApiKey = config.publicApiKey;
|
32851
32958
|
this.siteType = config.siteType;
|
32852
|
-
this.name = "
|
32959
|
+
this.name = "PROFITWELL";
|
32853
32960
|
}
|
32854
32961
|
|
32855
32962
|
_createClass(ProfitWell, [{
|
@@ -32932,7 +33039,7 @@
|
|
32932
33039
|
function Qualtrics(config) {
|
32933
33040
|
_classCallCheck(this, Qualtrics);
|
32934
33041
|
|
32935
|
-
this.name = "
|
33042
|
+
this.name = "QUALTRICS";
|
32936
33043
|
this.projectId = config.projectId;
|
32937
33044
|
this.brandId = config.brandId;
|
32938
33045
|
this.enableGenericPageTitle = config.enableGenericPageTitle;
|
@@ -32974,7 +33081,7 @@
|
|
32974
33081
|
this.set = function (a, c) {
|
32975
33082
|
var b = "",
|
32976
33083
|
b = new Date();
|
32977
|
-
b.setTime(b.getTime() +
|
33084
|
+
b.setTime(b.getTime() + 6048e5);
|
32978
33085
|
b = "; expires=" + b.toGMTString();
|
32979
33086
|
document.cookie = a + "=" + c + b + "; path=/; ";
|
32980
33087
|
};
|
@@ -33281,7 +33388,7 @@
|
|
33281
33388
|
function Sentry(config) {
|
33282
33389
|
_classCallCheck(this, Sentry);
|
33283
33390
|
|
33284
|
-
this.name = "
|
33391
|
+
this.name = "SENTRY";
|
33285
33392
|
this.dsn = config.dsn;
|
33286
33393
|
this.debugMode = config.debugMode;
|
33287
33394
|
this.environment = config.environment;
|
@@ -33743,7 +33850,7 @@
|
|
33743
33850
|
this.clientId = config.clientId;
|
33744
33851
|
this.eventWhiteList = config.eventWhiteList || [];
|
33745
33852
|
this.customMetrics = config.customMetrics || [];
|
33746
|
-
this.name = "
|
33853
|
+
this.name = "TVSQUARED";
|
33747
33854
|
}
|
33748
33855
|
|
33749
33856
|
_createClass(TVSquared, [{
|
@@ -34241,7 +34348,7 @@
|
|
34241
34348
|
function LaunchDarkly(config) {
|
34242
34349
|
_classCallCheck(this, LaunchDarkly);
|
34243
34350
|
|
34244
|
-
this.name = "
|
34351
|
+
this.name = "LAUNCHDARKLY";
|
34245
34352
|
this.clientSideId = config.clientSideId;
|
34246
34353
|
}
|
34247
34354
|
|
@@ -34366,7 +34473,7 @@
|
|
34366
34473
|
this.build = "1.0.0";
|
34367
34474
|
this.name = "RudderLabs JavaScript SDK";
|
34368
34475
|
this.namespace = "com.rudderlabs.javascript";
|
34369
|
-
this.version = "1.
|
34476
|
+
this.version = "1.3.3";
|
34370
34477
|
});
|
34371
34478
|
|
34372
34479
|
// Library information class
|
@@ -34374,7 +34481,7 @@
|
|
34374
34481
|
_classCallCheck(this, RudderLibraryInfo);
|
34375
34482
|
|
34376
34483
|
this.name = "RudderLabs JavaScript SDK";
|
34377
|
-
this.version = "1.
|
34484
|
+
this.version = "1.3.3";
|
34378
34485
|
}); // Operating System information class
|
34379
34486
|
|
34380
34487
|
|
@@ -37381,11 +37488,15 @@
|
|
37381
37488
|
try {
|
37382
37489
|
if (!succesfulLoadedIntersectClientSuppliedIntegrations[i].isFailed || !succesfulLoadedIntersectClientSuppliedIntegrations[i].isFailed()) {
|
37383
37490
|
if (succesfulLoadedIntersectClientSuppliedIntegrations[i][methodName]) {
|
37384
|
-
var
|
37491
|
+
var sendEvent = !object.IsEventBlackListed(event[0].message.event, succesfulLoadedIntersectClientSuppliedIntegrations[i].name); // Block the event if it is blacklisted for the device-mode destination
|
37492
|
+
|
37493
|
+
if (sendEvent) {
|
37494
|
+
var _succesfulLoadedInter;
|
37385
37495
|
|
37386
|
-
|
37496
|
+
var clonedBufferEvent = lodash_clonedeep(event);
|
37387
37497
|
|
37388
|
-
|
37498
|
+
(_succesfulLoadedInter = succesfulLoadedIntersectClientSuppliedIntegrations[i])[methodName].apply(_succesfulLoadedInter, _toConsumableArray(clonedBufferEvent));
|
37499
|
+
}
|
37389
37500
|
}
|
37390
37501
|
}
|
37391
37502
|
} catch (error) {
|
@@ -37692,6 +37803,64 @@
|
|
37692
37803
|
value: function trackEvent(rudderElement, options, callback) {
|
37693
37804
|
this.processAndSendDataToDestinations("track", rudderElement, options, callback);
|
37694
37805
|
}
|
37806
|
+
}, {
|
37807
|
+
key: "IsEventBlackListed",
|
37808
|
+
value: function IsEventBlackListed(eventName, intgName) {
|
37809
|
+
if (!eventName || !(typeof eventName === "string")) {
|
37810
|
+
return false;
|
37811
|
+
}
|
37812
|
+
|
37813
|
+
var sdkIntgName = commonNames[intgName];
|
37814
|
+
var intg = this.clientIntegrations.find(function (intg) {
|
37815
|
+
return intg.name === sdkIntgName;
|
37816
|
+
});
|
37817
|
+
var _intg$config = intg.config,
|
37818
|
+
blacklistedEvents = _intg$config.blacklistedEvents,
|
37819
|
+
whitelistedEvents = _intg$config.whitelistedEvents,
|
37820
|
+
eventFilteringOption = _intg$config.eventFilteringOption;
|
37821
|
+
|
37822
|
+
if (!eventFilteringOption) {
|
37823
|
+
return false;
|
37824
|
+
}
|
37825
|
+
|
37826
|
+
switch (eventFilteringOption) {
|
37827
|
+
// disabled filtering
|
37828
|
+
case "disable":
|
37829
|
+
return false;
|
37830
|
+
// Blacklist is choosen for filtering events
|
37831
|
+
|
37832
|
+
case "blacklistedEvents":
|
37833
|
+
var isValidBlackList = blacklistedEvents && Array.isArray(blacklistedEvents) && blacklistedEvents.every(function (x) {
|
37834
|
+
return x.eventName !== "";
|
37835
|
+
});
|
37836
|
+
|
37837
|
+
if (isValidBlackList) {
|
37838
|
+
return blacklistedEvents.find(function (eventObj) {
|
37839
|
+
return eventObj.eventName.trim().toUpperCase() === eventName.trim().toUpperCase();
|
37840
|
+
}) === undefined ? false : true;
|
37841
|
+
} else {
|
37842
|
+
return false;
|
37843
|
+
}
|
37844
|
+
|
37845
|
+
// Whitelist is choosen for filtering events
|
37846
|
+
|
37847
|
+
case "whitelistedEvents":
|
37848
|
+
var isValidWhiteList = whitelistedEvents && Array.isArray(whitelistedEvents) && whitelistedEvents.some(function (x) {
|
37849
|
+
return x.eventName !== "";
|
37850
|
+
});
|
37851
|
+
|
37852
|
+
if (isValidWhiteList) {
|
37853
|
+
return whitelistedEvents.find(function (eventObj) {
|
37854
|
+
return eventObj.eventName.trim().toUpperCase() === eventName.trim().toUpperCase();
|
37855
|
+
}) === undefined ? true : false;
|
37856
|
+
} else {
|
37857
|
+
return true;
|
37858
|
+
}
|
37859
|
+
|
37860
|
+
default:
|
37861
|
+
return false;
|
37862
|
+
}
|
37863
|
+
}
|
37695
37864
|
/**
|
37696
37865
|
* Process and send data to destinations along with rudder BE
|
37697
37866
|
*
|
@@ -37704,6 +37873,8 @@
|
|
37704
37873
|
}, {
|
37705
37874
|
key: "processAndSendDataToDestinations",
|
37706
37875
|
value: function processAndSendDataToDestinations(type, rudderElement, options, callback) {
|
37876
|
+
var _this3 = this;
|
37877
|
+
|
37707
37878
|
try {
|
37708
37879
|
if (!this.anonymousId) {
|
37709
37880
|
this.setAnonymousId();
|
@@ -37745,8 +37916,12 @@
|
|
37745
37916
|
succesfulLoadedIntersectClientSuppliedIntegrations.forEach(function (obj) {
|
37746
37917
|
if (!obj.isFailed || !obj.isFailed()) {
|
37747
37918
|
if (obj[type]) {
|
37748
|
-
var
|
37749
|
-
|
37919
|
+
var sendEvent = !_this3.IsEventBlackListed(rudderElement.message.event, obj.name); // Block the event if it is blacklisted for the device-mode destination
|
37920
|
+
|
37921
|
+
if (sendEvent) {
|
37922
|
+
var clonedRudderElement = lodash_clonedeep(rudderElement);
|
37923
|
+
obj[type](clonedRudderElement);
|
37924
|
+
}
|
37750
37925
|
}
|
37751
37926
|
}
|
37752
37927
|
});
|
@@ -37941,7 +38116,7 @@
|
|
37941
38116
|
}, {
|
37942
38117
|
key: "load",
|
37943
38118
|
value: function load(writeKey, serverUrl, options) {
|
37944
|
-
var
|
38119
|
+
var _this4 = this;
|
37945
38120
|
|
37946
38121
|
logger.debug("inside load ");
|
37947
38122
|
if (options && options.cookieConsentManager) this.cookieConsentOptions = lodash_clonedeep(options.cookieConsentManager);
|
@@ -37999,9 +38174,9 @@
|
|
37999
38174
|
// convert to rudder recognised method names
|
38000
38175
|
var tranformedCallbackMapping = {};
|
38001
38176
|
Object.keys(this.methodToCallbackMapping).forEach(function (methodName) {
|
38002
|
-
if (
|
38003
|
-
if (options.clientSuppliedCallbacks[
|
38004
|
-
tranformedCallbackMapping[methodName] = options.clientSuppliedCallbacks[
|
38177
|
+
if (_this4.methodToCallbackMapping.hasOwnProperty(methodName)) {
|
38178
|
+
if (options.clientSuppliedCallbacks[_this4.methodToCallbackMapping[methodName]]) {
|
38179
|
+
tranformedCallbackMapping[methodName] = options.clientSuppliedCallbacks[_this4.methodToCallbackMapping[methodName]];
|
38005
38180
|
}
|
38006
38181
|
}
|
38007
38182
|
});
|
@@ -38050,7 +38225,7 @@
|
|
38050
38225
|
|
38051
38226
|
if (res instanceof Promise) {
|
38052
38227
|
res.then(function (res) {
|
38053
|
-
return
|
38228
|
+
return _this4.processResponse(200, res);
|
38054
38229
|
}).catch(errorHandler);
|
38055
38230
|
} else {
|
38056
38231
|
this.processResponse(200, res);
|
@@ -38085,25 +38260,25 @@
|
|
38085
38260
|
}, {
|
38086
38261
|
key: "initializeCallbacks",
|
38087
38262
|
value: function initializeCallbacks() {
|
38088
|
-
var
|
38263
|
+
var _this5 = this;
|
38089
38264
|
|
38090
38265
|
Object.keys(this.methodToCallbackMapping).forEach(function (methodName) {
|
38091
|
-
if (
|
38092
|
-
|
38266
|
+
if (_this5.methodToCallbackMapping.hasOwnProperty(methodName)) {
|
38267
|
+
_this5.on(methodName, function () {});
|
38093
38268
|
}
|
38094
38269
|
});
|
38095
38270
|
}
|
38096
38271
|
}, {
|
38097
38272
|
key: "registerCallbacks",
|
38098
38273
|
value: function registerCallbacks(calledFromLoad) {
|
38099
|
-
var
|
38274
|
+
var _this6 = this;
|
38100
38275
|
|
38101
38276
|
if (!calledFromLoad) {
|
38102
38277
|
Object.keys(this.methodToCallbackMapping).forEach(function (methodName) {
|
38103
|
-
if (
|
38278
|
+
if (_this6.methodToCallbackMapping.hasOwnProperty(methodName)) {
|
38104
38279
|
if (window.rudderanalytics) {
|
38105
|
-
if (typeof window.rudderanalytics[
|
38106
|
-
|
38280
|
+
if (typeof window.rudderanalytics[_this6.methodToCallbackMapping[methodName]] === "function") {
|
38281
|
+
_this6.clientSuppliedCallbacks[methodName] = window.rudderanalytics[_this6.methodToCallbackMapping[methodName]];
|
38107
38282
|
}
|
38108
38283
|
} // let callback =
|
38109
38284
|
// ? typeof window.rudderanalytics[
|
@@ -38120,10 +38295,10 @@
|
|
38120
38295
|
}
|
38121
38296
|
|
38122
38297
|
Object.keys(this.clientSuppliedCallbacks).forEach(function (methodName) {
|
38123
|
-
if (
|
38124
|
-
logger.debug("registerCallbacks", methodName,
|
38298
|
+
if (_this6.clientSuppliedCallbacks.hasOwnProperty(methodName)) {
|
38299
|
+
logger.debug("registerCallbacks", methodName, _this6.clientSuppliedCallbacks[methodName]);
|
38125
38300
|
|
38126
|
-
|
38301
|
+
_this6.on(methodName, _this6.clientSuppliedCallbacks[methodName]);
|
38127
38302
|
}
|
38128
38303
|
});
|
38129
38304
|
}
|