ouisys-engine 2.1.51 → 2.1.54
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/api/index.js +1 -1
- package/dist/reducers/moFlow/utils.js +4 -7
- package/dist/utilities/loadScriptSrc.d.ts +4 -1
- package/dist/utilities/loadScriptSrc.js +13 -3
- package/package.json +1 -1
- package/src/api/index.ts +1 -1
- package/src/reducers/moFlow/utils.ts +1 -13
- package/src/utilities/loadScriptSrc.ts +16 -3
package/dist/api/index.js
CHANGED
|
@@ -688,7 +688,7 @@ var RealTallyman = {
|
|
|
688
688
|
isDMB = window.pac_analytics.visitor.xaid != null && (window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb") != -1 || window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")) != -1 ? true : false;
|
|
689
689
|
newHost = isDMB ? "de.tallymans.com" : host;
|
|
690
690
|
_context22.next = 4;
|
|
691
|
-
return fetch("https://".concat(newHost, "/tallyman/helper/?action=google-captcha-v3-config&country=").concat(country, "&slug=").concat(slug, "&device=").concat(device, "&domain=
|
|
691
|
+
return fetch("https://".concat(newHost, "/tallyman/helper/?action=google-captcha-v3-config&country=").concat(country, "&slug=").concat(slug, "&device=").concat(device, "&domain=").concat(domain)).then(function (x) {
|
|
692
692
|
return x.json();
|
|
693
693
|
});
|
|
694
694
|
|
|
@@ -54,8 +54,6 @@ require("regenerator-runtime/runtime");
|
|
|
54
54
|
|
|
55
55
|
var RDS = _interopRequireWildcard(require("../../common-types/RemoteDataState"));
|
|
56
56
|
|
|
57
|
-
var _loadScriptInnerHtml = _interopRequireDefault(require("../../utilities/loadScriptInnerHtml"));
|
|
58
|
-
|
|
59
57
|
var _loadScriptSrc = _interopRequireDefault(require("../../utilities/loadScriptSrc"));
|
|
60
58
|
|
|
61
59
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -177,11 +175,10 @@ var getGoogleReCaptchaConfig = /*#__PURE__*/function () {
|
|
|
177
175
|
|
|
178
176
|
if (result.success === true) {
|
|
179
177
|
srcUrl = "https://www.google.com/recaptcha/api.js?render=".concat(result.site_key);
|
|
180
|
-
(0, _loadScriptSrc.default)(
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}, 0);
|
|
178
|
+
(0, _loadScriptSrc.default)({
|
|
179
|
+
url: srcUrl,
|
|
180
|
+
key: result.site_key
|
|
181
|
+
});
|
|
185
182
|
}
|
|
186
183
|
|
|
187
184
|
return _context2.abrupt("return", result);
|
|
@@ -5,13 +5,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _loadScriptInnerHtml = _interopRequireDefault(require("./loadScriptInnerHtml"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
var loadScriptSrc = function loadScriptSrc(_ref) {
|
|
13
|
+
var url = _ref.url,
|
|
14
|
+
key = _ref.key;
|
|
9
15
|
var script = document.createElement('script');
|
|
10
16
|
script.type = 'text/javascript';
|
|
11
|
-
script.src =
|
|
17
|
+
script.src = url;
|
|
12
18
|
var headElem = document.getElementsByTagName('head')[0];
|
|
13
19
|
headElem.insertBefore(script, headElem.firstChild);
|
|
14
|
-
|
|
20
|
+
|
|
21
|
+
script.onload = function () {
|
|
22
|
+
var scriptInner = "\n grecaptcha.ready(function() {\n grecaptcha.execute(\"".concat(key, "\", {action: 'submit'}).then(function(token) {\n // To be used by tallyman\n window.reCaptchaToken = token;\n console.log(\"-------\" + token);\n });\n });\n ");
|
|
23
|
+
(0, _loadScriptInnerHtml.default)(scriptInner, true);
|
|
24
|
+
};
|
|
15
25
|
};
|
|
16
26
|
|
|
17
27
|
var _default = loadScriptSrc;
|
package/package.json
CHANGED
package/src/api/index.ts
CHANGED
|
@@ -217,7 +217,7 @@ export const RealTallyman:ITallyman = {
|
|
|
217
217
|
getGoogleCaptcha:async(host: string, country: string, slug: string, device:string, domain: string):Promise<IGoogleReCaptcha>=>{
|
|
218
218
|
const isDMB = (window.pac_analytics.visitor.xaid != null && (window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb") != -1 || window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")) != -1) ? true : false;
|
|
219
219
|
const newHost = isDMB ? "de.tallymans.com" : host;
|
|
220
|
-
return await fetch(`https://${newHost}/tallyman/helper/?action=google-captcha-v3-config&country=${country}&slug=${slug}&device=${device}&domain
|
|
220
|
+
return await fetch(`https://${newHost}/tallyman/helper/?action=google-captcha-v3-config&country=${country}&slug=${slug}&device=${device}&domain=${domain}`).then(x => x.json())
|
|
221
221
|
|
|
222
222
|
}
|
|
223
223
|
}
|
|
@@ -48,19 +48,7 @@ export const getGoogleReCaptchaConfig = async ({ slug, country, device, host }:I
|
|
|
48
48
|
const result: IGoogleReCaptcha = await window.tallymanApi.getGoogleCaptcha(host, country, slug, device, domain);
|
|
49
49
|
if(result.success === true){
|
|
50
50
|
const srcUrl = `https://www.google.com/recaptcha/api.js?render=${result.site_key}`;
|
|
51
|
-
loadScriptSrc(srcUrl);
|
|
52
|
-
setTimeout(() => {
|
|
53
|
-
const script = `
|
|
54
|
-
grecaptcha.ready(function() {
|
|
55
|
-
grecaptcha.execute("${result.site_key}", {action: 'submit'}).then(function(token) {
|
|
56
|
-
// To be used by tallyman
|
|
57
|
-
window.reCaptchaToken = token;
|
|
58
|
-
console.log("-------" + token);
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
`;
|
|
62
|
-
loadScriptInnerHtml(script, true);
|
|
63
|
-
}, 0);
|
|
51
|
+
loadScriptSrc({url:srcUrl, key: result.site_key});
|
|
64
52
|
}
|
|
65
53
|
return result;
|
|
66
54
|
}
|
|
@@ -1,10 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
import loadScriptInnerHtml from "./loadScriptInnerHtml";
|
|
2
|
+
|
|
3
|
+
const loadScriptSrc = ({url, key}:{url:string, key:string})=>{
|
|
2
4
|
var script = document.createElement('script');
|
|
3
5
|
script.type = 'text/javascript';
|
|
4
|
-
script.src =
|
|
6
|
+
script.src = url;
|
|
5
7
|
var headElem = document.getElementsByTagName('head')[0];
|
|
6
8
|
headElem.insertBefore(script, headElem.firstChild)
|
|
7
|
-
|
|
9
|
+
script.onload = () => {
|
|
10
|
+
const scriptInner = `
|
|
11
|
+
grecaptcha.ready(function() {
|
|
12
|
+
grecaptcha.execute("${key}", {action: 'submit'}).then(function(token) {
|
|
13
|
+
// To be used by tallyman
|
|
14
|
+
window.reCaptchaToken = token;
|
|
15
|
+
console.log("-------" + token);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
`;
|
|
19
|
+
loadScriptInnerHtml(scriptInner, true);
|
|
20
|
+
}
|
|
8
21
|
}
|
|
9
22
|
|
|
10
23
|
export default loadScriptSrc;
|