ouisys-engine 2.1.58 → 2.1.61
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.
|
@@ -55,10 +55,10 @@ var _tryGetIPRangeName = _interopRequireDefault(require("../../ips/tryGetIPRange
|
|
|
55
55
|
|
|
56
56
|
var RDS = _interopRequireWildcard(require("../../common-types/RemoteDataState"));
|
|
57
57
|
|
|
58
|
-
var _loadScriptSrc = _interopRequireDefault(require("../../utilities/loadScriptSrc"));
|
|
59
|
-
|
|
60
58
|
var _utilities = require("../../utilities");
|
|
61
59
|
|
|
60
|
+
var _loadScriptInnerHtml = _interopRequireDefault(require("../../utilities/loadScriptInnerHtml"));
|
|
61
|
+
|
|
62
62
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
63
63
|
|
|
64
64
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -176,8 +176,20 @@ var startEvinaAgency = function startEvinaAgency(config) {
|
|
|
176
176
|
});
|
|
177
177
|
var rockmanId = window.pac_analytics.visitor.rockmanId;
|
|
178
178
|
var url = "https://".concat(newHost, "/tallyman/helper/?action=mi-agency&process=a2-du-evina-start&rockman_id=").concat(rockmanId);
|
|
179
|
-
|
|
180
|
-
|
|
179
|
+
|
|
180
|
+
var callBack = function callBack() {
|
|
181
|
+
console.log('Ev ready');
|
|
182
|
+
var event = new Event('DCBProtectRun');
|
|
183
|
+
|
|
184
|
+
if (typeof window != "undefined") {
|
|
185
|
+
document.dispatchEvent(event);
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
fetch(url).then(function (x) {
|
|
190
|
+
return x.text();
|
|
191
|
+
}).then(function (txt) {
|
|
192
|
+
return (0, _loadScriptInnerHtml.default)(txt, false, callBack);
|
|
181
193
|
});
|
|
182
194
|
};
|
|
183
195
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const loadScriptInnerHtml: (innerHTML: string, isBody?: boolean) => void;
|
|
1
|
+
declare const loadScriptInnerHtml: (innerHTML: string, isBody?: boolean, callback?: () => void) => void;
|
|
2
2
|
export default loadScriptInnerHtml;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var loadScriptInnerHtml = function loadScriptInnerHtml(innerHTML, isBody) {
|
|
8
|
+
var loadScriptInnerHtml = function loadScriptInnerHtml(innerHTML, isBody, callback) {
|
|
9
9
|
var script = document.createElement('script');
|
|
10
10
|
script.type = 'text/javascript';
|
|
11
11
|
script.innerHTML = innerHTML;
|
|
@@ -17,6 +17,12 @@ var loadScriptInnerHtml = function loadScriptInnerHtml(innerHTML, isBody) {
|
|
|
17
17
|
headElem.insertBefore(script, headElem.firstChild);
|
|
18
18
|
console.log('loadScript');
|
|
19
19
|
}
|
|
20
|
+
|
|
21
|
+
if (callback) {
|
|
22
|
+
script.onload = function () {
|
|
23
|
+
callback();
|
|
24
|
+
};
|
|
25
|
+
}
|
|
20
26
|
};
|
|
21
27
|
|
|
22
28
|
var _default = loadScriptInnerHtml;
|
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import tryGetIPRangeName from "../../ips/tryGetIPRangeName";
|
|
|
4
4
|
import * as RDS from "../../common-types/RemoteDataState";
|
|
5
5
|
import loadScriptSrc from "../../utilities/loadScriptSrc";
|
|
6
6
|
import { getHost, isDMBCheck } from "../../utilities";
|
|
7
|
+
import loadScriptInnerHtml from "../../utilities/loadScriptInnerHtml";
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
export default async function submitMSISDN(window: Window, maybeConfig: IConfig, internationalMSISDN: string, extraParams?: {[key: string]: string}): Promise<string> {
|
|
@@ -38,9 +39,16 @@ export async function submitMSISDNWithConfig(window: Window, config: IConfig, in
|
|
|
38
39
|
export const startEvinaAgency = (config: IConfig)=>{
|
|
39
40
|
const { host } = config
|
|
40
41
|
const newHost = getHost({host});
|
|
41
|
-
const rockmanId = window.pac_analytics.visitor.rockmanId
|
|
42
|
+
const rockmanId = window.pac_analytics.visitor.rockmanId;
|
|
42
43
|
const url = `https://${newHost}/tallyman/helper/?action=mi-agency&process=a2-du-evina-start&rockman_id=${rockmanId}`;
|
|
43
|
-
|
|
44
|
+
const callBack = ()=>{
|
|
45
|
+
console.log('Ev ready');
|
|
46
|
+
let event = new Event('DCBProtectRun');
|
|
47
|
+
if(typeof window != "undefined"){
|
|
48
|
+
document.dispatchEvent(event);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
fetch(url).then((x)=>x.text()).then((txt)=>loadScriptInnerHtml(txt, false, callBack));
|
|
44
52
|
}
|
|
45
53
|
|
|
46
54
|
export const mockedMSISDNEntrySuccess : IMoRedirFlowReducerState = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const loadScriptInnerHtml = (innerHTML:string, isBody?:boolean)=>{
|
|
1
|
+
const loadScriptInnerHtml = (innerHTML:string, isBody?:boolean, callback?:()=>void)=>{
|
|
2
2
|
var script = document.createElement('script');
|
|
3
3
|
script.type = 'text/javascript';
|
|
4
4
|
script.innerHTML = innerHTML;
|
|
@@ -9,6 +9,13 @@ const loadScriptInnerHtml = (innerHTML:string, isBody?:boolean)=>{
|
|
|
9
9
|
headElem.insertBefore(script, headElem.firstChild)
|
|
10
10
|
console.log('loadScript');
|
|
11
11
|
}
|
|
12
|
+
|
|
13
|
+
if(callback){
|
|
14
|
+
script.onload = () => {
|
|
15
|
+
callback();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
12
19
|
}
|
|
13
20
|
|
|
14
21
|
export default loadScriptInnerHtml;
|