ouisys-engine 3.0.12 → 3.0.13
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.
|
@@ -113,7 +113,7 @@ function identify_user() {
|
|
|
113
113
|
var pin_header_enrichment = function pin_header_enrichment(defaultFlow) {
|
|
114
114
|
return /*#__PURE__*/function () {
|
|
115
115
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(dispatch) {
|
|
116
|
-
var ipRangeName, heResult, flowObj, msisdn
|
|
116
|
+
var ipRangeName, heResult, flowObj, msisdn;
|
|
117
117
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
118
118
|
while (1) {
|
|
119
119
|
switch (_context.prev = _context.next) {
|
|
@@ -124,10 +124,9 @@ var pin_header_enrichment = function pin_header_enrichment(defaultFlow) {
|
|
|
124
124
|
|
|
125
125
|
case 3:
|
|
126
126
|
ipRangeName = _context.sent;
|
|
127
|
-
console.log('ipRangeName', ipRangeName);
|
|
128
127
|
|
|
129
|
-
if (!(ipRangeName
|
|
130
|
-
_context.next =
|
|
128
|
+
if (!(ipRangeName === null)) {
|
|
129
|
+
_context.next = 7;
|
|
131
130
|
break;
|
|
132
131
|
}
|
|
133
132
|
|
|
@@ -144,21 +143,20 @@ var pin_header_enrichment = function pin_header_enrichment(defaultFlow) {
|
|
|
144
143
|
}
|
|
145
144
|
}));
|
|
146
145
|
|
|
147
|
-
case
|
|
148
|
-
_context.next =
|
|
146
|
+
case 7:
|
|
147
|
+
_context.next = 9;
|
|
149
148
|
return (0, _utils.identifyUser)();
|
|
150
149
|
|
|
151
|
-
case
|
|
150
|
+
case 9:
|
|
152
151
|
heResult = _context.sent;
|
|
153
152
|
flowObj = defaultFlow;
|
|
154
153
|
|
|
155
154
|
if (!(heResult.msisdn !== undefined && heResult.msisdn !== '')) {
|
|
156
|
-
_context.next =
|
|
155
|
+
_context.next = 16;
|
|
157
156
|
break;
|
|
158
157
|
}
|
|
159
158
|
|
|
160
|
-
msisdn = heResult.msisdn;
|
|
161
|
-
operator = heResult.operator;
|
|
159
|
+
msisdn = heResult.msisdn; // const { operator } = heResult;
|
|
162
160
|
|
|
163
161
|
_.tracker.customEvent('Flow', 'advance-auto', 'msisdn-detected', {
|
|
164
162
|
msisdn: msisdn
|
|
@@ -180,7 +178,7 @@ var pin_header_enrichment = function pin_header_enrichment(defaultFlow) {
|
|
|
180
178
|
}
|
|
181
179
|
}));
|
|
182
180
|
|
|
183
|
-
case
|
|
181
|
+
case 16:
|
|
184
182
|
_.tracker.sendOptInFlowEvent('Pin');
|
|
185
183
|
|
|
186
184
|
return _context.abrupt("return", dispatch({
|
|
@@ -194,8 +192,8 @@ var pin_header_enrichment = function pin_header_enrichment(defaultFlow) {
|
|
|
194
192
|
}
|
|
195
193
|
}));
|
|
196
194
|
|
|
197
|
-
case
|
|
198
|
-
_context.prev =
|
|
195
|
+
case 20:
|
|
196
|
+
_context.prev = 20;
|
|
199
197
|
_context.t0 = _context["catch"](0);
|
|
200
198
|
console.warn(_context.t0);
|
|
201
199
|
|
|
@@ -216,12 +214,12 @@ var pin_header_enrichment = function pin_header_enrichment(defaultFlow) {
|
|
|
216
214
|
}
|
|
217
215
|
});
|
|
218
216
|
|
|
219
|
-
case
|
|
217
|
+
case 26:
|
|
220
218
|
case "end":
|
|
221
219
|
return _context.stop();
|
|
222
220
|
}
|
|
223
221
|
}
|
|
224
|
-
}, _callee, null, [[0,
|
|
222
|
+
}, _callee, null, [[0, 20]]);
|
|
225
223
|
}));
|
|
226
224
|
|
|
227
225
|
return function (_x) {
|
|
@@ -240,17 +238,13 @@ var he_pin_one_click_header_enrichment = function he_pin_one_click_header_enrich
|
|
|
240
238
|
while (1) {
|
|
241
239
|
switch (_context2.prev = _context2.next) {
|
|
242
240
|
case 0:
|
|
243
|
-
console.log('here');
|
|
244
|
-
|
|
245
241
|
switchState = function switchState(_ref3) {
|
|
246
242
|
var flowObj = _ref3.flowObj,
|
|
247
243
|
msisdn = _ref3.msisdn,
|
|
248
244
|
operator = _ref3.operator,
|
|
249
245
|
subscription_url = _ref3.subscription_url,
|
|
250
246
|
redirect_url = _ref3.redirect_url;
|
|
251
|
-
var isHeaderEnrichmentSuccess = !!(msisdn !== undefined && msisdn !== '');
|
|
252
|
-
|
|
253
|
-
console.log('isHeaderEnrichmentSuccess', isHeaderEnrichmentSuccess);
|
|
247
|
+
var isHeaderEnrichmentSuccess = !!(msisdn !== undefined && msisdn !== '');
|
|
254
248
|
|
|
255
249
|
switch (flowObj.flow) {
|
|
256
250
|
case 'oneClick':
|
|
@@ -271,7 +265,7 @@ var he_pin_one_click_header_enrichment = function he_pin_one_click_header_enrich
|
|
|
271
265
|
});
|
|
272
266
|
|
|
273
267
|
case 'pin':
|
|
274
|
-
if (isHeaderEnrichmentSuccess
|
|
268
|
+
if (isHeaderEnrichmentSuccess === true) {
|
|
275
269
|
_.tracker.sendOptInFlowEvent('Hybrid Pin');
|
|
276
270
|
} else {
|
|
277
271
|
_.tracker.sendOptInFlowEvent('Pin');
|
|
@@ -309,14 +303,14 @@ var he_pin_one_click_header_enrichment = function he_pin_one_click_header_enrich
|
|
|
309
303
|
}
|
|
310
304
|
};
|
|
311
305
|
|
|
312
|
-
_context2.next =
|
|
306
|
+
_context2.next = 3;
|
|
313
307
|
return (0, _tryGetIPRangeName.default)(window.pac_analytics.visitor);
|
|
314
308
|
|
|
315
|
-
case
|
|
309
|
+
case 3:
|
|
316
310
|
ipRangeName = _context2.sent;
|
|
317
311
|
|
|
318
|
-
if (!(ipRangeName
|
|
319
|
-
_context2.next =
|
|
312
|
+
if (!(ipRangeName === null)) {
|
|
313
|
+
_context2.next = 7;
|
|
320
314
|
break;
|
|
321
315
|
}
|
|
322
316
|
|
|
@@ -334,26 +328,24 @@ var he_pin_one_click_header_enrichment = function he_pin_one_click_header_enrich
|
|
|
334
328
|
}
|
|
335
329
|
}));
|
|
336
330
|
|
|
337
|
-
case
|
|
338
|
-
_context2.prev =
|
|
331
|
+
case 7:
|
|
332
|
+
_context2.prev = 7;
|
|
339
333
|
mapIpRangeToAgency = {
|
|
340
334
|
om_ooredoo: 'o2_ooredoo'
|
|
341
335
|
};
|
|
342
|
-
flowObj = (0, _utils.determineFlowByOperator)(mapIpRangeToAgency[ipRangeName.toUpperCase()]);
|
|
343
|
-
|
|
344
|
-
console.log('flowObj', flowObj);
|
|
336
|
+
flowObj = (0, _utils.determineFlowByOperator)(mapIpRangeToAgency[ipRangeName.toUpperCase()]);
|
|
345
337
|
|
|
346
338
|
if (!(flowObj.flow === 'oneClick')) {
|
|
347
|
-
_context2.next =
|
|
339
|
+
_context2.next = 19;
|
|
348
340
|
break;
|
|
349
341
|
}
|
|
350
342
|
|
|
351
|
-
_context2.next =
|
|
343
|
+
_context2.next = 13;
|
|
352
344
|
return (0, _utils.identifyUser)({
|
|
353
345
|
operator: ipRangeName
|
|
354
346
|
});
|
|
355
347
|
|
|
356
|
-
case
|
|
348
|
+
case 13:
|
|
357
349
|
heResult = _context2.sent;
|
|
358
350
|
msisdn = heResult.msisdn, subscription_url = heResult.subscription_url, redirect_url = heResult.redirect_url;
|
|
359
351
|
operator = heResult.operator ? heResult.operator.toUpperCase() : ipRangeName.toUpperCase();
|
|
@@ -379,10 +371,10 @@ var he_pin_one_click_header_enrichment = function he_pin_one_click_header_enrich
|
|
|
379
371
|
});
|
|
380
372
|
}
|
|
381
373
|
|
|
382
|
-
_context2.next =
|
|
374
|
+
_context2.next = 21;
|
|
383
375
|
break;
|
|
384
376
|
|
|
385
|
-
case
|
|
377
|
+
case 19:
|
|
386
378
|
_.tracker.sendOptInFlowEvent('Pin');
|
|
387
379
|
|
|
388
380
|
return _context2.abrupt("return", dispatch({
|
|
@@ -397,13 +389,13 @@ var he_pin_one_click_header_enrichment = function he_pin_one_click_header_enrich
|
|
|
397
389
|
}
|
|
398
390
|
}));
|
|
399
391
|
|
|
400
|
-
case
|
|
401
|
-
_context2.next =
|
|
392
|
+
case 21:
|
|
393
|
+
_context2.next = 29;
|
|
402
394
|
break;
|
|
403
395
|
|
|
404
|
-
case
|
|
405
|
-
_context2.prev =
|
|
406
|
-
_context2.t0 = _context2["catch"](
|
|
396
|
+
case 23:
|
|
397
|
+
_context2.prev = 23;
|
|
398
|
+
_context2.t0 = _context2["catch"](7);
|
|
407
399
|
console.warn(_context2.t0);
|
|
408
400
|
|
|
409
401
|
_.tracker.customEvent('Flow', 'advance-auto', 'msisdn-detection-failure', {
|
|
@@ -423,12 +415,12 @@ var he_pin_one_click_header_enrichment = function he_pin_one_click_header_enrich
|
|
|
423
415
|
}
|
|
424
416
|
});
|
|
425
417
|
|
|
426
|
-
case
|
|
418
|
+
case 29:
|
|
427
419
|
case "end":
|
|
428
420
|
return _context2.stop();
|
|
429
421
|
}
|
|
430
422
|
}
|
|
431
|
-
}, _callee2, null, [[
|
|
423
|
+
}, _callee2, null, [[7, 23]]);
|
|
432
424
|
}));
|
|
433
425
|
|
|
434
426
|
return function (_x2) {
|
|
@@ -442,8 +434,7 @@ exports.he_pin_one_click_header_enrichment = he_pin_one_click_header_enrichment;
|
|
|
442
434
|
var he_mo_redir_one_click_header_enrichment = function he_mo_redir_one_click_header_enrichment(defaultFlow) {
|
|
443
435
|
return /*#__PURE__*/function () {
|
|
444
436
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(dispatch) {
|
|
445
|
-
var switchState, ipRangeName, flowObj, heResult, msisdn, subscription_url, redirect_url, operator
|
|
446
|
-
|
|
437
|
+
var switchState, ipRangeName, flowObj, heResult, msisdn, subscription_url, redirect_url, operator;
|
|
447
438
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
448
439
|
while (1) {
|
|
449
440
|
switch (_context3.prev = _context3.next) {
|
|
@@ -515,7 +506,7 @@ var he_mo_redir_one_click_header_enrichment = function he_mo_redir_one_click_hea
|
|
|
515
506
|
case 3:
|
|
516
507
|
ipRangeName = _context3.sent;
|
|
517
508
|
|
|
518
|
-
if (!(ipRangeName
|
|
509
|
+
if (!(ipRangeName === null)) {
|
|
519
510
|
_context3.next = 7;
|
|
520
511
|
break;
|
|
521
512
|
}
|
|
@@ -538,7 +529,7 @@ var he_mo_redir_one_click_header_enrichment = function he_mo_redir_one_click_hea
|
|
|
538
529
|
_context3.prev = 7;
|
|
539
530
|
flowObj = (0, _utils.determineFlowByOperator)(ipRangeName.toUpperCase());
|
|
540
531
|
|
|
541
|
-
if (!(flowObj.flow
|
|
532
|
+
if (!(flowObj.flow === 'oneClick')) {
|
|
542
533
|
_context3.next = 18;
|
|
543
534
|
break;
|
|
544
535
|
}
|
|
@@ -556,20 +547,20 @@ var he_mo_redir_one_click_header_enrichment = function he_mo_redir_one_click_hea
|
|
|
556
547
|
if (msisdn && msisdn !== '') {
|
|
557
548
|
_.tracker.customEvent('Flow', 'advance-auto', 'msisdn-detected', {
|
|
558
549
|
msisdn: msisdn
|
|
559
|
-
});
|
|
550
|
+
}); // const flowObj = determineFlowByOperator(operator);
|
|
551
|
+
|
|
560
552
|
|
|
561
|
-
_flowObj = (0, _utils.determineFlowByOperator)(operator);
|
|
562
553
|
switchState({
|
|
563
|
-
flowObj:
|
|
554
|
+
flowObj: flowObj,
|
|
564
555
|
msisdn: msisdn,
|
|
565
556
|
operator: operator,
|
|
566
557
|
subscription_url: subscription_url,
|
|
567
558
|
redirect_url: redirect_url
|
|
568
559
|
});
|
|
569
560
|
} else {
|
|
570
|
-
|
|
561
|
+
// const flowObj = determineFlowByOperator(operator);
|
|
571
562
|
switchState({
|
|
572
|
-
flowObj:
|
|
563
|
+
flowObj: flowObj,
|
|
573
564
|
redirect_url: redirect_url,
|
|
574
565
|
subscription_url: subscription_url,
|
|
575
566
|
operator: operator
|
|
@@ -639,7 +630,7 @@ exports.he_mo_redir_one_click_header_enrichment = he_mo_redir_one_click_header_e
|
|
|
639
630
|
var he_pin_mo_redir_header_enrichment = function he_pin_mo_redir_header_enrichment(defaultFlow) {
|
|
640
631
|
return /*#__PURE__*/function () {
|
|
641
632
|
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(dispatch) {
|
|
642
|
-
var switchState, heResult, msisdn, operator, flowObj,
|
|
633
|
+
var switchState, heResult, msisdn, operator, flowObj, _flowObj, _flowObj2, _flowObj3;
|
|
643
634
|
|
|
644
635
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
645
636
|
while (1) {
|
|
@@ -668,7 +659,7 @@ var he_pin_mo_redir_header_enrichment = function he_pin_mo_redir_header_enrichme
|
|
|
668
659
|
});
|
|
669
660
|
|
|
670
661
|
case 'pin':
|
|
671
|
-
if (isHeaderEnrichmentSuccess
|
|
662
|
+
if (isHeaderEnrichmentSuccess === true) {
|
|
672
663
|
_.tracker.sendOptInFlowEvent('Hybrid Pin');
|
|
673
664
|
} else {
|
|
674
665
|
_.tracker.sendOptInFlowEvent('Pin');
|
|
@@ -740,8 +731,8 @@ var he_pin_mo_redir_header_enrichment = function he_pin_mo_redir_header_enrichme
|
|
|
740
731
|
return (0, _utils.determineFlowByOperatorFromIp)();
|
|
741
732
|
|
|
742
733
|
case 16:
|
|
743
|
-
|
|
744
|
-
switchState(
|
|
734
|
+
_flowObj = _context4.sent;
|
|
735
|
+
switchState(_flowObj, msisdn);
|
|
745
736
|
|
|
746
737
|
case 18:
|
|
747
738
|
_context4.next = 24;
|
|
@@ -752,8 +743,8 @@ var he_pin_mo_redir_header_enrichment = function he_pin_mo_redir_header_enrichme
|
|
|
752
743
|
return (0, _utils.determineFlowByOperatorFromIp)();
|
|
753
744
|
|
|
754
745
|
case 22:
|
|
755
|
-
|
|
756
|
-
switchState(
|
|
746
|
+
_flowObj2 = _context4.sent;
|
|
747
|
+
switchState(_flowObj2);
|
|
757
748
|
|
|
758
749
|
case 24:
|
|
759
750
|
_context4.next = 42;
|
|
@@ -773,8 +764,8 @@ var he_pin_mo_redir_header_enrichment = function he_pin_mo_redir_header_enrichme
|
|
|
773
764
|
return (0, _utils.determineFlowByOperatorFromIp)();
|
|
774
765
|
|
|
775
766
|
case 33:
|
|
776
|
-
|
|
777
|
-
switchState(
|
|
767
|
+
_flowObj3 = _context4.sent;
|
|
768
|
+
switchState(_flowObj3);
|
|
778
769
|
_context4.next = 42;
|
|
779
770
|
break;
|
|
780
771
|
|