@blotoutio/providers-shop-gpt-sdk 1.14.0 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +7 -2
- package/index.js +7 -2
- package/index.mjs +7 -2
- package/package.json +1 -1
package/index.cjs.js
CHANGED
@@ -830,7 +830,7 @@ const createShopGPTAPI = ({ fetch: fetchImpl = window.fetch, baseURL, userId, st
|
|
830
830
|
const data = (await response.json());
|
831
831
|
return data.customPrompts;
|
832
832
|
};
|
833
|
-
const sendEvent = (action, currency, actionData, clickData) => {
|
833
|
+
const sendEvent = (action, currency, actionData, clickData, beacon) => {
|
834
834
|
var _a;
|
835
835
|
const storageData = (_a = getProductActions(baseURL, sessionId)) !== null && _a !== void 0 ? _a : {};
|
836
836
|
const userType = getUserType(baseURL, sessionId);
|
@@ -860,6 +860,10 @@ const createShopGPTAPI = ({ fetch: fetchImpl = window.fetch, baseURL, userId, st
|
|
860
860
|
}
|
861
861
|
})
|
862
862
|
.catch(logger.error);
|
863
|
+
const options = { destination: baseURL };
|
864
|
+
if (beacon) {
|
865
|
+
options.method = 'beacon';
|
866
|
+
}
|
863
867
|
sendTag({
|
864
868
|
eventId: crypto.randomUUID(),
|
865
869
|
eventName: action,
|
@@ -874,6 +878,7 @@ const createShopGPTAPI = ({ fetch: fetchImpl = window.fetch, baseURL, userId, st
|
|
874
878
|
providers: {
|
875
879
|
shopGPT: true,
|
876
880
|
},
|
881
|
+
options,
|
877
882
|
});
|
878
883
|
};
|
879
884
|
return {
|
@@ -6197,7 +6202,7 @@ class ShopGPT extends i$1 {
|
|
6197
6202
|
url: e.detail.url,
|
6198
6203
|
title: e.detail.title,
|
6199
6204
|
rank: e.detail.rank,
|
6200
|
-
});
|
6205
|
+
}, true);
|
6201
6206
|
}
|
6202
6207
|
getSiteCurrency() {
|
6203
6208
|
return this.storeAPI.getSiteCurrency();
|
package/index.js
CHANGED
@@ -831,7 +831,7 @@ var ProvidersShopGptSdk = (function () {
|
|
831
831
|
const data = (await response.json());
|
832
832
|
return data.customPrompts;
|
833
833
|
};
|
834
|
-
const sendEvent = (action, currency, actionData, clickData) => {
|
834
|
+
const sendEvent = (action, currency, actionData, clickData, beacon) => {
|
835
835
|
var _a;
|
836
836
|
const storageData = (_a = getProductActions(baseURL, sessionId)) !== null && _a !== void 0 ? _a : {};
|
837
837
|
const userType = getUserType(baseURL, sessionId);
|
@@ -861,6 +861,10 @@ var ProvidersShopGptSdk = (function () {
|
|
861
861
|
}
|
862
862
|
})
|
863
863
|
.catch(logger.error);
|
864
|
+
const options = { destination: baseURL };
|
865
|
+
if (beacon) {
|
866
|
+
options.method = 'beacon';
|
867
|
+
}
|
864
868
|
sendTag({
|
865
869
|
eventId: crypto.randomUUID(),
|
866
870
|
eventName: action,
|
@@ -875,6 +879,7 @@ var ProvidersShopGptSdk = (function () {
|
|
875
879
|
providers: {
|
876
880
|
shopGPT: true,
|
877
881
|
},
|
882
|
+
options,
|
878
883
|
});
|
879
884
|
};
|
880
885
|
return {
|
@@ -6198,7 +6203,7 @@ ${this.comment ? this.comment : E}</textarea
|
|
6198
6203
|
url: e.detail.url,
|
6199
6204
|
title: e.detail.title,
|
6200
6205
|
rank: e.detail.rank,
|
6201
|
-
});
|
6206
|
+
}, true);
|
6202
6207
|
}
|
6203
6208
|
getSiteCurrency() {
|
6204
6209
|
return this.storeAPI.getSiteCurrency();
|
package/index.mjs
CHANGED
@@ -828,7 +828,7 @@ const createShopGPTAPI = ({ fetch: fetchImpl = window.fetch, baseURL, userId, st
|
|
828
828
|
const data = (await response.json());
|
829
829
|
return data.customPrompts;
|
830
830
|
};
|
831
|
-
const sendEvent = (action, currency, actionData, clickData) => {
|
831
|
+
const sendEvent = (action, currency, actionData, clickData, beacon) => {
|
832
832
|
var _a;
|
833
833
|
const storageData = (_a = getProductActions(baseURL, sessionId)) !== null && _a !== void 0 ? _a : {};
|
834
834
|
const userType = getUserType(baseURL, sessionId);
|
@@ -858,6 +858,10 @@ const createShopGPTAPI = ({ fetch: fetchImpl = window.fetch, baseURL, userId, st
|
|
858
858
|
}
|
859
859
|
})
|
860
860
|
.catch(logger.error);
|
861
|
+
const options = { destination: baseURL };
|
862
|
+
if (beacon) {
|
863
|
+
options.method = 'beacon';
|
864
|
+
}
|
861
865
|
sendTag({
|
862
866
|
eventId: crypto.randomUUID(),
|
863
867
|
eventName: action,
|
@@ -872,6 +876,7 @@ const createShopGPTAPI = ({ fetch: fetchImpl = window.fetch, baseURL, userId, st
|
|
872
876
|
providers: {
|
873
877
|
shopGPT: true,
|
874
878
|
},
|
879
|
+
options,
|
875
880
|
});
|
876
881
|
};
|
877
882
|
return {
|
@@ -6195,7 +6200,7 @@ class ShopGPT extends i$1 {
|
|
6195
6200
|
url: e.detail.url,
|
6196
6201
|
title: e.detail.title,
|
6197
6202
|
rank: e.detail.rank,
|
6198
|
-
});
|
6203
|
+
}, true);
|
6199
6204
|
}
|
6200
6205
|
getSiteCurrency() {
|
6201
6206
|
return this.storeAPI.getSiteCurrency();
|