@blotoutio/edgetag-sdk-js 0.10.5 → 0.10.7
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.cjs +20 -6
- package/index.d.ts +1 -1
- package/index.esm.js +20 -6
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -516,7 +516,7 @@ const ajax = (method, url, payload) => __awaiter(void 0, void 0, void 0, functio
|
|
|
516
516
|
});
|
|
517
517
|
});
|
|
518
518
|
const getStandardPayload = (payload) => {
|
|
519
|
-
const data = Object.assign({ pageUrl: getPageUrl(), pageTitle: getPageTitle(), userAgent: getUserAgent(), referrer: getReferrer(), search: getSearch(), sdkVersion: "0.10.
|
|
519
|
+
const data = Object.assign({ pageUrl: getPageUrl(), pageTitle: getPageTitle(), userAgent: getUserAgent(), referrer: getReferrer(), search: getSearch(), sdkVersion: "0.10.7" }, (payload || {}));
|
|
520
520
|
let storage = {};
|
|
521
521
|
const session = getData$1('session');
|
|
522
522
|
if (session) {
|
|
@@ -582,7 +582,12 @@ const manifestVariables = {};
|
|
|
582
582
|
const addProviderVariable = (name, variables) => {
|
|
583
583
|
manifestVariables[name] = variables;
|
|
584
584
|
};
|
|
585
|
-
const getProviderVariables = (name) =>
|
|
585
|
+
const getProviderVariables = (name) => {
|
|
586
|
+
if (!name) {
|
|
587
|
+
return {};
|
|
588
|
+
}
|
|
589
|
+
return manifestVariables[name] || {};
|
|
590
|
+
};
|
|
586
591
|
|
|
587
592
|
let stubs = [];
|
|
588
593
|
const addStubs = (newStubs) => {
|
|
@@ -645,7 +650,10 @@ const handleTag = (eventName, data = {}, providers, options) => {
|
|
|
645
650
|
const providerData = {};
|
|
646
651
|
if (providerPackages) {
|
|
647
652
|
Object.values(providerPackages).forEach((pkg) => {
|
|
648
|
-
if (!pkg ||
|
|
653
|
+
if (!pkg ||
|
|
654
|
+
!pkg.name ||
|
|
655
|
+
!pkg.tag ||
|
|
656
|
+
!allowProviderWithConsent(providers, pkg.name)) {
|
|
649
657
|
return;
|
|
650
658
|
}
|
|
651
659
|
const result = pkg.tag({
|
|
@@ -681,7 +689,10 @@ const handleData = (data, providers, options) => {
|
|
|
681
689
|
const userId = handleGetUserId();
|
|
682
690
|
if (providerPackages) {
|
|
683
691
|
Object.values(providerPackages).forEach((pkg) => {
|
|
684
|
-
if (!pkg ||
|
|
692
|
+
if (!pkg ||
|
|
693
|
+
!pkg.user ||
|
|
694
|
+
!pkg.name ||
|
|
695
|
+
!allowProviderWithConsent(providers, pkg.name)) {
|
|
685
696
|
return;
|
|
686
697
|
}
|
|
687
698
|
pkg.user({
|
|
@@ -806,7 +817,7 @@ const handleManifest = (manifest) => {
|
|
|
806
817
|
}
|
|
807
818
|
if (providerPackages) {
|
|
808
819
|
const pkg = providerPackages[provider.package];
|
|
809
|
-
if (pkg && pkg.init && allowProvider(pkg.name)) {
|
|
820
|
+
if (pkg && pkg.name && pkg.init && allowProvider(pkg.name)) {
|
|
810
821
|
const initData = {
|
|
811
822
|
userId,
|
|
812
823
|
manifest: provider,
|
|
@@ -863,7 +874,10 @@ const handleUser = (key, value, providers, options) => {
|
|
|
863
874
|
const userId = handleGetUserId();
|
|
864
875
|
if (providerPackages) {
|
|
865
876
|
Object.values(providerPackages).forEach((pkg) => {
|
|
866
|
-
if (!pkg ||
|
|
877
|
+
if (!pkg ||
|
|
878
|
+
!pkg.name ||
|
|
879
|
+
!pkg.user ||
|
|
880
|
+
!allowProviderWithConsent(providers, pkg.name)) {
|
|
867
881
|
return;
|
|
868
882
|
}
|
|
869
883
|
pkg.user({
|
package/index.d.ts
CHANGED
package/index.esm.js
CHANGED
|
@@ -512,7 +512,7 @@ const ajax = (method, url, payload) => __awaiter(void 0, void 0, void 0, functio
|
|
|
512
512
|
});
|
|
513
513
|
});
|
|
514
514
|
const getStandardPayload = (payload) => {
|
|
515
|
-
const data = Object.assign({ pageUrl: getPageUrl(), pageTitle: getPageTitle(), userAgent: getUserAgent(), referrer: getReferrer(), search: getSearch(), sdkVersion: "0.10.
|
|
515
|
+
const data = Object.assign({ pageUrl: getPageUrl(), pageTitle: getPageTitle(), userAgent: getUserAgent(), referrer: getReferrer(), search: getSearch(), sdkVersion: "0.10.7" }, (payload || {}));
|
|
516
516
|
let storage = {};
|
|
517
517
|
const session = getData$1('session');
|
|
518
518
|
if (session) {
|
|
@@ -578,7 +578,12 @@ const manifestVariables = {};
|
|
|
578
578
|
const addProviderVariable = (name, variables) => {
|
|
579
579
|
manifestVariables[name] = variables;
|
|
580
580
|
};
|
|
581
|
-
const getProviderVariables = (name) =>
|
|
581
|
+
const getProviderVariables = (name) => {
|
|
582
|
+
if (!name) {
|
|
583
|
+
return {};
|
|
584
|
+
}
|
|
585
|
+
return manifestVariables[name] || {};
|
|
586
|
+
};
|
|
582
587
|
|
|
583
588
|
let stubs = [];
|
|
584
589
|
const addStubs = (newStubs) => {
|
|
@@ -641,7 +646,10 @@ const handleTag = (eventName, data = {}, providers, options) => {
|
|
|
641
646
|
const providerData = {};
|
|
642
647
|
if (providerPackages) {
|
|
643
648
|
Object.values(providerPackages).forEach((pkg) => {
|
|
644
|
-
if (!pkg ||
|
|
649
|
+
if (!pkg ||
|
|
650
|
+
!pkg.name ||
|
|
651
|
+
!pkg.tag ||
|
|
652
|
+
!allowProviderWithConsent(providers, pkg.name)) {
|
|
645
653
|
return;
|
|
646
654
|
}
|
|
647
655
|
const result = pkg.tag({
|
|
@@ -677,7 +685,10 @@ const handleData = (data, providers, options) => {
|
|
|
677
685
|
const userId = handleGetUserId();
|
|
678
686
|
if (providerPackages) {
|
|
679
687
|
Object.values(providerPackages).forEach((pkg) => {
|
|
680
|
-
if (!pkg ||
|
|
688
|
+
if (!pkg ||
|
|
689
|
+
!pkg.user ||
|
|
690
|
+
!pkg.name ||
|
|
691
|
+
!allowProviderWithConsent(providers, pkg.name)) {
|
|
681
692
|
return;
|
|
682
693
|
}
|
|
683
694
|
pkg.user({
|
|
@@ -802,7 +813,7 @@ const handleManifest = (manifest) => {
|
|
|
802
813
|
}
|
|
803
814
|
if (providerPackages) {
|
|
804
815
|
const pkg = providerPackages[provider.package];
|
|
805
|
-
if (pkg && pkg.init && allowProvider(pkg.name)) {
|
|
816
|
+
if (pkg && pkg.name && pkg.init && allowProvider(pkg.name)) {
|
|
806
817
|
const initData = {
|
|
807
818
|
userId,
|
|
808
819
|
manifest: provider,
|
|
@@ -859,7 +870,10 @@ const handleUser = (key, value, providers, options) => {
|
|
|
859
870
|
const userId = handleGetUserId();
|
|
860
871
|
if (providerPackages) {
|
|
861
872
|
Object.values(providerPackages).forEach((pkg) => {
|
|
862
|
-
if (!pkg ||
|
|
873
|
+
if (!pkg ||
|
|
874
|
+
!pkg.name ||
|
|
875
|
+
!pkg.user ||
|
|
876
|
+
!allowProviderWithConsent(providers, pkg.name)) {
|
|
863
877
|
return;
|
|
864
878
|
}
|
|
865
879
|
pkg.user({
|