ouisys-engine 2.1.61 → 2.1.65
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/reducers/moRedirFlow/utils.js +5 -8
- package/dist/reducers/pinFlow/utils.js +2 -1
- package/dist/reducers/strategy/strategies/header_enrichment.js +13 -12
- package/dist/utilities/handleSubmitNumber.js +14 -0
- package/dist/utilities/loadScriptInnerHtml.d.ts +1 -1
- package/dist/utilities/loadScriptInnerHtml.js +1 -7
- package/package.json +1 -1
- package/src/reducers/moRedirFlow/utils.ts +3 -3
- package/src/reducers/pinFlow/utils.ts +2 -1
- package/src/reducers/strategy/strategies/header_enrichment.ts +1 -0
- package/src/utilities/handleSubmitNumber.ts +12 -1
- package/src/utilities/loadScriptInnerHtml.ts +1 -8
|
@@ -176,20 +176,17 @@ 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
|
+
fetch(url).then(function (x) {
|
|
180
|
+
return x.text();
|
|
181
|
+
}).then(function (txt) {
|
|
182
|
+
return (0, _loadScriptInnerHtml.default)(txt);
|
|
183
|
+
}).then(function () {
|
|
181
184
|
console.log('Ev ready');
|
|
182
185
|
var event = new Event('DCBProtectRun');
|
|
183
186
|
|
|
184
187
|
if (typeof window != "undefined") {
|
|
185
188
|
document.dispatchEvent(event);
|
|
186
189
|
}
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
fetch(url).then(function (x) {
|
|
190
|
-
return x.text();
|
|
191
|
-
}).then(function (txt) {
|
|
192
|
-
return (0, _loadScriptInnerHtml.default)(txt, false, callBack);
|
|
193
190
|
});
|
|
194
191
|
};
|
|
195
192
|
|
|
@@ -193,7 +193,8 @@ function _submitMSISDNOnce() {
|
|
|
193
193
|
throw submissionError;
|
|
194
194
|
|
|
195
195
|
case 4:
|
|
196
|
-
msisdn =
|
|
196
|
+
msisdn = !!extraParams && extraParams["skip-validation"] === "1" ? //Special case Digital Virgo sents encrypted msisdn we dont need to validate is
|
|
197
|
+
internationalMSISDN : internationalMSISDN.match(/\d+/gi).join(''); // tallyman API expects international msisdn without any special character
|
|
197
198
|
|
|
198
199
|
rockmanId = window.pac_analytics.visitor.rockmanId; // HARDCODING This for now if the concerpt works we move this to configs
|
|
199
200
|
|
|
@@ -106,9 +106,10 @@ var pin_header_enrichment = function pin_header_enrichment(defaultFlow) {
|
|
|
106
106
|
|
|
107
107
|
case 3:
|
|
108
108
|
ipRangeName = _context.sent;
|
|
109
|
+
console.log("ipRangeName", ipRangeName);
|
|
109
110
|
|
|
110
111
|
if (!(ipRangeName == null)) {
|
|
111
|
-
_context.next =
|
|
112
|
+
_context.next = 8;
|
|
112
113
|
break;
|
|
113
114
|
}
|
|
114
115
|
|
|
@@ -125,16 +126,16 @@ var pin_header_enrichment = function pin_header_enrichment(defaultFlow) {
|
|
|
125
126
|
}
|
|
126
127
|
}));
|
|
127
128
|
|
|
128
|
-
case
|
|
129
|
-
_context.next =
|
|
129
|
+
case 8:
|
|
130
|
+
_context.next = 10;
|
|
130
131
|
return (0, _utils.identifyUser)();
|
|
131
132
|
|
|
132
|
-
case
|
|
133
|
+
case 10:
|
|
133
134
|
heResult = _context.sent;
|
|
134
135
|
flowObj = defaultFlow;
|
|
135
136
|
|
|
136
137
|
if (!(heResult.msisdn !== undefined && heResult.msisdn !== "")) {
|
|
137
|
-
_context.next =
|
|
138
|
+
_context.next = 20;
|
|
138
139
|
break;
|
|
139
140
|
}
|
|
140
141
|
|
|
@@ -161,7 +162,7 @@ var pin_header_enrichment = function pin_header_enrichment(defaultFlow) {
|
|
|
161
162
|
}
|
|
162
163
|
}));
|
|
163
164
|
|
|
164
|
-
case
|
|
165
|
+
case 20:
|
|
165
166
|
_.tracker.sendOptInFlowEvent("Pin");
|
|
166
167
|
|
|
167
168
|
return _context.abrupt("return", dispatch({
|
|
@@ -175,12 +176,12 @@ var pin_header_enrichment = function pin_header_enrichment(defaultFlow) {
|
|
|
175
176
|
}
|
|
176
177
|
}));
|
|
177
178
|
|
|
178
|
-
case
|
|
179
|
-
_context.next =
|
|
179
|
+
case 22:
|
|
180
|
+
_context.next = 30;
|
|
180
181
|
break;
|
|
181
182
|
|
|
182
|
-
case
|
|
183
|
-
_context.prev =
|
|
183
|
+
case 24:
|
|
184
|
+
_context.prev = 24;
|
|
184
185
|
_context.t0 = _context["catch"](0);
|
|
185
186
|
console.warn(_context.t0);
|
|
186
187
|
|
|
@@ -201,12 +202,12 @@ var pin_header_enrichment = function pin_header_enrichment(defaultFlow) {
|
|
|
201
202
|
}
|
|
202
203
|
});
|
|
203
204
|
|
|
204
|
-
case
|
|
205
|
+
case 30:
|
|
205
206
|
case "end":
|
|
206
207
|
return _context.stop();
|
|
207
208
|
}
|
|
208
209
|
}
|
|
209
|
-
}, _callee, null, [[0,
|
|
210
|
+
}, _callee, null, [[0, 24]]);
|
|
210
211
|
}));
|
|
211
212
|
|
|
212
213
|
return function (_x) {
|
|
@@ -13,6 +13,8 @@ exports.handleFormSubmit = exports.handleAutoSubmitMsisdn = void 0;
|
|
|
13
13
|
|
|
14
14
|
var _awesomePhonenumber = _interopRequireDefault(require("awesome-phonenumber"));
|
|
15
15
|
|
|
16
|
+
var _utils = require("../reducers/strategy/utils");
|
|
17
|
+
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
19
|
|
|
18
20
|
var handleAutoSubmitMsisdn = function handleAutoSubmitMsisdn(_ref) {
|
|
@@ -44,11 +46,23 @@ var handleFormSubmit = function handleFormSubmit(_ref2) {
|
|
|
44
46
|
internationalNumber = _ref2.internationalNumber;
|
|
45
47
|
var pn = new _awesomePhonenumber.default("+" + internationalNumber, process.env.country.toUpperCase());
|
|
46
48
|
var countryCode = pn.getCountryCode();
|
|
49
|
+
var networkType = isHeaderEnrichmentSuccess ? "mobile_data" : "wifi";
|
|
47
50
|
|
|
48
51
|
if (isHeaderEnrichmentSuccess == true && process.env.country == "kw" && internationalNumber != "" && !pn.isValid()) {
|
|
49
52
|
setInternationalNumber(countryCode + internationalNumber);
|
|
50
53
|
var newNumber = countryCode + internationalNumber;
|
|
51
54
|
onEnd(newNumber.match(/\d+/gi).join(''));
|
|
55
|
+
} else if (isHeaderEnrichmentSuccess == true && process.env.country == "ci") {
|
|
56
|
+
//Special case Digital Virgo sents encrypted msisdn we dont need to validate is
|
|
57
|
+
var searchObj = (0, _utils.searchToObject)();
|
|
58
|
+
|
|
59
|
+
if (searchObj.success && searchObj.msisdn) {
|
|
60
|
+
var encryptedMsisdn = searchObj.msisdn;
|
|
61
|
+
onEnd(encryptedMsisdn, {
|
|
62
|
+
network_type: networkType,
|
|
63
|
+
"skip-validation": "1"
|
|
64
|
+
});
|
|
65
|
+
}
|
|
52
66
|
} else {
|
|
53
67
|
if (!!internationalNumber) {
|
|
54
68
|
onEnd(internationalNumber.match(/\d+/gi).join(''));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const loadScriptInnerHtml: (innerHTML: string, isBody?: boolean
|
|
1
|
+
declare const loadScriptInnerHtml: (innerHTML: string, isBody?: boolean) => 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) {
|
|
9
9
|
var script = document.createElement('script');
|
|
10
10
|
script.type = 'text/javascript';
|
|
11
11
|
script.innerHTML = innerHTML;
|
|
@@ -17,12 +17,6 @@ var loadScriptInnerHtml = function loadScriptInnerHtml(innerHTML, isBody, callba
|
|
|
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
|
-
}
|
|
26
20
|
};
|
|
27
21
|
|
|
28
22
|
var _default = loadScriptInnerHtml;
|
package/package.json
CHANGED
|
@@ -41,14 +41,14 @@ export const startEvinaAgency = (config: IConfig)=>{
|
|
|
41
41
|
const newHost = getHost({host});
|
|
42
42
|
const rockmanId = window.pac_analytics.visitor.rockmanId;
|
|
43
43
|
const url = `https://${newHost}/tallyman/helper/?action=mi-agency&process=a2-du-evina-start&rockman_id=${rockmanId}`;
|
|
44
|
-
|
|
44
|
+
|
|
45
|
+
fetch(url).then((x)=>x.text()).then((txt)=>loadScriptInnerHtml(txt)).then(()=>{
|
|
45
46
|
console.log('Ev ready');
|
|
46
47
|
let event = new Event('DCBProtectRun');
|
|
47
48
|
if(typeof window != "undefined"){
|
|
48
49
|
document.dispatchEvent(event);
|
|
49
50
|
}
|
|
50
|
-
}
|
|
51
|
-
fetch(url).then((x)=>x.text()).then((txt)=>loadScriptInnerHtml(txt, false, callBack));
|
|
51
|
+
});
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
export const mockedMSISDNEntrySuccess : IMoRedirFlowReducerState = {
|
|
@@ -46,7 +46,8 @@ async function submitMSISDNOnce(window: Window, config: IConfig, internationalMS
|
|
|
46
46
|
throw submissionError
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
const msisdn =
|
|
49
|
+
const msisdn = (!!extraParams && extraParams["skip-validation"] === "1") //Special case Digital Virgo sents encrypted msisdn we dont need to validate is
|
|
50
|
+
? internationalMSISDN : internationalMSISDN.match(/\d+/gi).join('') // tallyman API expects international msisdn without any special character
|
|
50
51
|
const rockmanId = window.pac_analytics.visitor.rockmanId
|
|
51
52
|
|
|
52
53
|
// HARDCODING This for now if the concerpt works we move this to configs
|
|
@@ -51,6 +51,7 @@ export const pin_header_enrichment = (defaultFlow:IFlow):AppThunk=>{
|
|
|
51
51
|
return async(dispatch)=>{
|
|
52
52
|
try{
|
|
53
53
|
let ipRangeName = await tryGetIPRangeName(window.pac_analytics.visitor);
|
|
54
|
+
console.log("ipRangeName", ipRangeName)
|
|
54
55
|
if (ipRangeName == null) {
|
|
55
56
|
|
|
56
57
|
tracker.sendOptInFlowEvent("Pin")
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import PhoneNumber from "awesome-phonenumber"
|
|
2
|
+
import { IStrategyIDentifyUserResult } from "../reducers/strategy/StrategyTypes";
|
|
3
|
+
import { searchToObject } from "../reducers/strategy/utils";
|
|
2
4
|
|
|
3
5
|
export const handleAutoSubmitMsisdn = ({
|
|
4
6
|
msisdnValue,
|
|
@@ -37,11 +39,20 @@ export const handleFormSubmit = ({
|
|
|
37
39
|
internationalNumber:string
|
|
38
40
|
})=>{
|
|
39
41
|
const pn = new PhoneNumber("+" + internationalNumber, process.env.country.toUpperCase() );
|
|
40
|
-
const countryCode = pn.getCountryCode()
|
|
42
|
+
const countryCode = pn.getCountryCode();
|
|
43
|
+
const networkType = isHeaderEnrichmentSuccess ? "mobile_data" : "wifi";
|
|
44
|
+
|
|
41
45
|
if(isHeaderEnrichmentSuccess == true && process.env.country == "kw" && internationalNumber != "" && !pn.isValid()){
|
|
42
46
|
setInternationalNumber(countryCode + internationalNumber)
|
|
43
47
|
const newNumber = countryCode + internationalNumber
|
|
44
48
|
onEnd(newNumber.match(/\d+/gi).join(''));
|
|
49
|
+
}else if(isHeaderEnrichmentSuccess == true && process.env.country == "ci"){
|
|
50
|
+
//Special case Digital Virgo sents encrypted msisdn we dont need to validate is
|
|
51
|
+
const searchObj = searchToObject() as IStrategyIDentifyUserResult;
|
|
52
|
+
if(searchObj.success && searchObj.msisdn){
|
|
53
|
+
const encryptedMsisdn = searchObj.msisdn
|
|
54
|
+
onEnd(encryptedMsisdn, { network_type:networkType, "skip-validation": "1" });
|
|
55
|
+
}
|
|
45
56
|
}else{
|
|
46
57
|
if(!!internationalNumber){
|
|
47
58
|
onEnd(internationalNumber.match(/\d+/gi).join(''));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const loadScriptInnerHtml = (innerHTML:string, isBody?:boolean
|
|
1
|
+
const loadScriptInnerHtml = (innerHTML:string, isBody?:boolean)=>{
|
|
2
2
|
var script = document.createElement('script');
|
|
3
3
|
script.type = 'text/javascript';
|
|
4
4
|
script.innerHTML = innerHTML;
|
|
@@ -9,13 +9,6 @@ const loadScriptInnerHtml = (innerHTML:string, isBody?:boolean, callback?:()=>vo
|
|
|
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
|
-
|
|
19
12
|
}
|
|
20
13
|
|
|
21
14
|
export default loadScriptInnerHtml;
|