ouisys-engine 2.1.19 → 2.1.24

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.
Files changed (65) hide show
  1. package/dist/api/click2sms.js +357 -0
  2. package/dist/api/index.d.ts +1 -3
  3. package/dist/api/index.js +93 -169
  4. package/dist/api/mo.js +274 -0
  5. package/dist/api/moRedir.js +186 -0
  6. package/dist/api/oneClick.js +366 -0
  7. package/dist/api/pin.js +493 -0
  8. package/dist/api/strategies.js +704 -0
  9. package/dist/api/ussd.js +1 -0
  10. package/dist/app/store.js +35 -0
  11. package/dist/common-types/AppThunk.d.ts +1 -2
  12. package/dist/features/strategies/categories/askMobileNumber.js +395 -0
  13. package/dist/features/strategies/categories/askOperator.js +311 -0
  14. package/dist/features/strategies/categories/detectOperatorByIp.js +606 -0
  15. package/dist/features/strategies/categories/headerEnrichment.js +670 -0
  16. package/dist/features/strategies/categories/typings/click2smsSliceTypes.js +12 -0
  17. package/dist/features/strategies/categories/typings/identifySliceTypes.js +22 -0
  18. package/dist/features/strategies/categories/typings/moFlowSliceTypes.js +22 -0
  19. package/dist/features/strategies/categories/typings/moRedirFlowSliceTypes.js +21 -0
  20. package/dist/features/strategies/categories/typings/oneClickSliceTypes.js +13 -0
  21. package/dist/features/strategies/categories/typings/pinFlowSliceTypes.js +13 -0
  22. package/dist/features/strategies/click2smsFlowSlice.js +172 -0
  23. package/dist/features/strategies/identifySlice.js +455 -0
  24. package/dist/features/strategies/moFlowSlice.js +196 -0
  25. package/dist/features/strategies/moRedirFlowSlice.js +190 -0
  26. package/dist/features/strategies/oneClickFlowSlice.js +277 -0
  27. package/dist/features/strategies/pinFlowSlice.js +313 -0
  28. package/dist/features/strategies/ussdFlowSlice.js +1 -0
  29. package/dist/flows/strategy.d.ts +1 -2
  30. package/dist/flows/strategy.js +1 -5
  31. package/dist/ips/tryGetIPRangeName.js +14 -13
  32. package/dist/mockServer/browser.js +48 -0
  33. package/dist/mockServer/handlers.js +22 -0
  34. package/dist/mockServer/server.js +48 -0
  35. package/dist/pacman/index.js +0 -1
  36. package/dist/reducers/click2smsFlow/utils.js +1 -3
  37. package/dist/reducers/oneClickFlow/utils.js +8 -7
  38. package/dist/reducers/pinFlow/utils.js +16 -15
  39. package/dist/reducers/strategy/strategies/header_enrichment.js +31 -25
  40. package/dist/reducers/strategy/utils.js +11 -12
  41. package/dist/reducers/tpayHeFlow/utils.js +1 -1
  42. package/dist/store/index.d.ts +1 -2
  43. package/dist/store/reducers.d.ts +0 -2
  44. package/dist/store/reducers.js +1 -4
  45. package/dist/test/setup.js +24 -0
  46. package/dist/test/test-utils.js +51 -0
  47. package/package.json +1 -1
  48. package/src/@types/window.d.ts +1 -0
  49. package/src/api/index.ts +4 -37
  50. package/src/common-types/AppThunk.ts +1 -2
  51. package/src/flows/strategy.ts +1 -5
  52. package/src/ips/tryGetIPRangeName.ts +3 -2
  53. package/src/pacman/index.ts +1 -1
  54. package/src/reducers/click2smsFlow/utils.ts +0 -3
  55. package/src/reducers/oneClickFlow/utils.ts +3 -2
  56. package/src/reducers/pinFlow/utils.ts +3 -1
  57. package/src/reducers/strategy/strategies/header_enrichment.ts +14 -11
  58. package/src/reducers/strategy/utils.ts +1 -2
  59. package/src/store/index.ts +1 -2
  60. package/src/store/reducers.ts +1 -5
  61. package/src/flows/tpayHeFlow.ts +0 -20
  62. package/src/reducers/tpayHeFlow/ITpayHeConstants.ts +0 -7
  63. package/src/reducers/tpayHeFlow/TpayHeTypes.ts +0 -135
  64. package/src/reducers/tpayHeFlow/index.ts +0 -207
  65. package/src/reducers/tpayHeFlow/utils.ts +0 -311
@@ -398,7 +398,7 @@ function submitPIN(_x16, _x17, _x18, _x19) {
398
398
 
399
399
  function _submitPIN() {
400
400
  _submitPIN = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(window, pin, config, extraParams) {
401
- var slug, country, device, host, offer, extraParamsQs, rockmanId, emptyPinError, uniqid, pinResult, pinError, check, checkResult, isAlreadySubscribed, _pinError, _isAlreadySubscribed;
401
+ var slug, country, device, host, offer, extraParamsQs, rockmanId, emptyPinError, uniqid, evinaTid, pinResult, pinError, check, checkResult, isAlreadySubscribed, _pinError, _isAlreadySubscribed;
402
402
 
403
403
  return regeneratorRuntime.wrap(function _callee6$(_context6) {
404
404
  while (1) {
@@ -427,14 +427,15 @@ function _submitPIN() {
427
427
 
428
428
  case 9:
429
429
  uniqid = uniqidResult != "" ? "&mcpUniqid=".concat(uniqidResult) : '';
430
- _context6.next = 12;
431
- return window.tallymanApi.verifyPin(host, country, slug, device, offer, rockmanId, pin, extraParamsQs, uniqid);
430
+ evinaTid = typeof window != "undefined" && window.tid ? window.tid : "";
431
+ _context6.next = 13;
432
+ return window.tallymanApi.verifyPin(host, country, slug, device, offer, rockmanId, pin, extraParamsQs, uniqid, evinaTid);
432
433
 
433
- case 12:
434
+ case 13:
434
435
  pinResult = _context6.sent;
435
436
 
436
437
  if (!(false === pinResult.success)) {
437
- _context6.next = 19;
438
+ _context6.next = 20;
438
439
  break;
439
440
  }
440
441
 
@@ -442,9 +443,9 @@ function _submitPIN() {
442
443
  pinError['type'] = "InvalidPIN";
443
444
  throw pinError;
444
445
 
445
- case 19:
446
+ case 20:
446
447
  if (!(true === pinResult.async)) {
447
- _context6.next = 34;
448
+ _context6.next = 35;
448
449
  break;
449
450
  }
450
451
 
@@ -452,16 +453,16 @@ function _submitPIN() {
452
453
  return window.tallymanApi.checkSubscription(host, country, slug, device, offer, rockmanId, pin, extraParamsQs);
453
454
  };
454
455
 
455
- _context6.next = 23;
456
+ _context6.next = 24;
456
457
  return (0, _utils.loop)(check, 30, function (r) {
457
458
  return r.success;
458
459
  }, 0);
459
460
 
460
- case 23:
461
+ case 24:
461
462
  checkResult = _context6.sent;
462
463
 
463
464
  if (!(true === checkResult.success)) {
464
- _context6.next = 29;
465
+ _context6.next = 30;
465
466
  break;
466
467
  }
467
468
 
@@ -471,23 +472,23 @@ function _submitPIN() {
471
472
  isAlreadySubscribed: isAlreadySubscribed
472
473
  });
473
474
 
474
- case 29:
475
+ case 30:
475
476
  _pinError = new Error("Error in submitMSISDN() verify-pin action:\n".concat(checkResult.message));
476
477
  _pinError['type'] = "InvalidPIN";
477
478
  throw _pinError;
478
479
 
479
- case 32:
480
- _context6.next = 36;
480
+ case 33:
481
+ _context6.next = 37;
481
482
  break;
482
483
 
483
- case 34:
484
+ case 35:
484
485
  _isAlreadySubscribed = pinResult.message == "ALREADY SUBSCRIBED" ? true : false;
485
486
  return _context6.abrupt("return", {
486
487
  productUrl: pinResult.product_url || null,
487
488
  isAlreadySubscribed: _isAlreadySubscribed
488
489
  });
489
490
 
490
- case 36:
491
+ case 37:
491
492
  case "end":
492
493
  return _context6.stop();
493
494
  }
@@ -142,7 +142,7 @@ var pin_header_enrichment = function pin_header_enrichment(defaultFlow) {
142
142
  msisdn = heResult.msisdn;
143
143
  operator = heResult.operator;
144
144
 
145
- _.tracker.advancedInFlow('tallyman.v1-pin', 'msisdn-detected', {
145
+ _.tracker.customEvent('Flow', 'advance-auto', 'msisdn-detected', {
146
146
  msisdn: msisdn
147
147
  });
148
148
 
@@ -185,7 +185,7 @@ var pin_header_enrichment = function pin_header_enrichment(defaultFlow) {
185
185
  _context.t0 = _context["catch"](0);
186
186
  console.warn(_context.t0);
187
187
 
188
- _.tracker.recedeInFlow('tallyman.v1-pin', 'msisdn-detection-failure', {
188
+ _.tracker.customEvent('Flow', 'advance-auto', 'msisdn-detection-failure', {
189
189
  errorType: _context.t0.toString()
190
190
  });
191
191
 
@@ -297,13 +297,14 @@ var he_pin_one_click_header_enrichment = function he_pin_one_click_header_enrich
297
297
 
298
298
  case 3:
299
299
  ipRangeName = _context2.sent;
300
- console.log("IP ipRangeName", ipRangeName);
301
300
 
302
301
  if (!(ipRangeName == null)) {
303
302
  _context2.next = 7;
304
303
  break;
305
304
  }
306
305
 
306
+ _.tracker.sendOptInFlowEvent("Pin");
307
+
307
308
  return _context2.abrupt("return", dispatch({
308
309
  type: "IDENTIFY_FLOW_BY_HE",
309
310
  payload: {
@@ -336,7 +337,7 @@ var he_pin_one_click_header_enrichment = function he_pin_one_click_header_enrich
336
337
  operator = heResult.operator ? heResult.operator.toUpperCase() : ipRangeName.toUpperCase();
337
338
 
338
339
  if (msisdn && msisdn !== "") {
339
- _.tracker.advancedInFlow('identify-user', 'msisdn-detected', {
340
+ _.tracker.customEvent('Flow', 'advance-auto', 'msisdn-detected', {
340
341
  msisdn: msisdn
341
342
  });
342
343
 
@@ -358,10 +359,12 @@ var he_pin_one_click_header_enrichment = function he_pin_one_click_header_enrich
358
359
  });
359
360
  }
360
361
 
361
- _context2.next = 19;
362
+ _context2.next = 20;
362
363
  break;
363
364
 
364
365
  case 18:
366
+ _.tracker.sendOptInFlowEvent("Pin");
367
+
365
368
  return _context2.abrupt("return", dispatch({
366
369
  type: "IDENTIFY_FLOW_BY_HE",
367
370
  payload: {
@@ -374,16 +377,16 @@ var he_pin_one_click_header_enrichment = function he_pin_one_click_header_enrich
374
377
  }
375
378
  }));
376
379
 
377
- case 19:
378
- _context2.next = 27;
380
+ case 20:
381
+ _context2.next = 28;
379
382
  break;
380
383
 
381
- case 21:
382
- _context2.prev = 21;
384
+ case 22:
385
+ _context2.prev = 22;
383
386
  _context2.t0 = _context2["catch"](7);
384
387
  console.warn(_context2.t0);
385
388
 
386
- _.tracker.recedeInFlow('identify-user', 'msisdn-detection-failure', {
389
+ _.tracker.customEvent('Flow', 'advance-auto', 'msisdn-detection-failure', {
387
390
  errorType: _context2.t0.toString()
388
391
  });
389
392
 
@@ -400,12 +403,12 @@ var he_pin_one_click_header_enrichment = function he_pin_one_click_header_enrich
400
403
  }
401
404
  });
402
405
 
403
- case 27:
406
+ case 28:
404
407
  case "end":
405
408
  return _context2.stop();
406
409
  }
407
410
  }
408
- }, _callee2, null, [[7, 21]]);
411
+ }, _callee2, null, [[7, 22]]);
409
412
  }));
410
413
 
411
414
  return function (_x2) {
@@ -491,13 +494,14 @@ var he_mo_redir_one_click_header_enrichment = function he_mo_redir_one_click_hea
491
494
 
492
495
  case 3:
493
496
  ipRangeName = _context3.sent;
494
- console.log("IP ipRangeName", ipRangeName);
495
497
 
496
498
  if (!(ipRangeName == null)) {
497
499
  _context3.next = 7;
498
500
  break;
499
501
  }
500
502
 
503
+ _.tracker.sendOptInFlowEvent("Redirect");
504
+
501
505
  return _context3.abrupt("return", dispatch({
502
506
  type: "IDENTIFY_FLOW_BY_HE",
503
507
  payload: {
@@ -530,7 +534,7 @@ var he_mo_redir_one_click_header_enrichment = function he_mo_redir_one_click_hea
530
534
  operator = heResult.operator ? heResult.operator.toUpperCase() : ipRangeName.toUpperCase();
531
535
 
532
536
  if (msisdn && msisdn !== "") {
533
- _.tracker.advancedInFlow('identify-user', 'msisdn-detected', {
537
+ _.tracker.customEvent('Flow', 'advance-auto', 'msisdn-detected', {
534
538
  msisdn: msisdn
535
539
  });
536
540
 
@@ -552,10 +556,12 @@ var he_mo_redir_one_click_header_enrichment = function he_mo_redir_one_click_hea
552
556
  });
553
557
  }
554
558
 
555
- _context3.next = 19;
559
+ _context3.next = 20;
556
560
  break;
557
561
 
558
562
  case 18:
563
+ _.tracker.sendOptInFlowEvent("Redirect");
564
+
559
565
  return _context3.abrupt("return", dispatch({
560
566
  type: "IDENTIFY_FLOW_BY_HE",
561
567
  payload: {
@@ -568,20 +574,20 @@ var he_mo_redir_one_click_header_enrichment = function he_mo_redir_one_click_hea
568
574
  }
569
575
  }));
570
576
 
571
- case 19:
572
- _context3.next = 27;
577
+ case 20:
578
+ _context3.next = 28;
573
579
  break;
574
580
 
575
- case 21:
576
- _context3.prev = 21;
581
+ case 22:
582
+ _context3.prev = 22;
577
583
  _context3.t0 = _context3["catch"](7);
578
584
  console.warn(_context3.t0);
579
585
 
580
- _.tracker.recedeInFlow('identify-user', 'msisdn-detection-failure', {
586
+ _.tracker.customEvent('Flow', 'advance-auto', 'msisdn-detection-failure', {
581
587
  errorType: _context3.t0.toString()
582
588
  });
583
589
 
584
- _.tracker.sendOptInFlowEvent("Pin");
590
+ _.tracker.sendOptInFlowEvent("Redirect");
585
591
 
586
592
  dispatch({
587
593
  type: "IDENTIFY_FLOW_BY_HE",
@@ -594,12 +600,12 @@ var he_mo_redir_one_click_header_enrichment = function he_mo_redir_one_click_hea
594
600
  }
595
601
  });
596
602
 
597
- case 27:
603
+ case 28:
598
604
  case "end":
599
605
  return _context3.stop();
600
606
  }
601
607
  }
602
- }, _callee3, null, [[7, 21]]);
608
+ }, _callee3, null, [[7, 22]]);
603
609
  }));
604
610
 
605
611
  return function (_x3) {
@@ -695,7 +701,7 @@ var he_pin_mo_redir_header_enrichment = function he_pin_mo_redir_header_enrichme
695
701
  msisdn = heResult.msisdn;
696
702
  operator = heResult.operator;
697
703
 
698
- _.tracker.advancedInFlow('identify-user', 'msisdn-detected', {
704
+ _.tracker.customEvent('Flow', 'advance-auto', 'msisdn-detected', {
699
705
  msisdn: msisdn
700
706
  });
701
707
 
@@ -738,7 +744,7 @@ var he_pin_mo_redir_header_enrichment = function he_pin_mo_redir_header_enrichme
738
744
  _context4.t0 = _context4["catch"](1);
739
745
  console.warn(_context4.t0);
740
746
 
741
- _.tracker.recedeInFlow('tallyman.v1-pin', 'msisdn-detection-failure', {
747
+ _.tracker.customEvent('Flow', 'advance-auto', 'msisdn-detection-failure', {
742
748
  errorType: _context4.t0.toString()
743
749
  });
744
750
 
@@ -431,7 +431,7 @@ var identifyUser = /*#__PURE__*/function () {
431
431
  searchObj = searchToObject();
432
432
 
433
433
  if (!(!!searchObj["redirect-back"] && searchObj["redirect-back"] == "1" && !!searchObj.success)) {
434
- _context2.next = 57;
434
+ _context2.next = 56;
435
435
  break;
436
436
  }
437
437
 
@@ -503,11 +503,10 @@ var identifyUser = /*#__PURE__*/function () {
503
503
  });
504
504
 
505
505
  case 46:
506
- _context2.next = 55;
506
+ _context2.next = 54;
507
507
  break;
508
508
 
509
509
  case 48:
510
- console.log("newUrl", window.location.href);
511
510
  _newUrl2 = new URL(window.location.href);
512
511
  _queryString3 = _newUrl2.search;
513
512
  _urlParams2 = new URLSearchParams(_queryString3);
@@ -518,20 +517,20 @@ var identifyUser = /*#__PURE__*/function () {
518
517
  operator: _operator2
519
518
  });
520
519
 
521
- case 55:
522
- _context2.next = 68;
520
+ case 54:
521
+ _context2.next = 67;
523
522
  break;
524
523
 
525
- case 57:
526
- _url2 = "https://".concat(newHost, "/tallyman/v1/?action=identify-user&country=").concat(bupperizeCountry(country), "&slug=").concat(slug, "&device=").concat(device, "&offerId=").concat(offer, "&page=").concat(window.location.href, "&pixel_url=").concat(encodeURIComponent("http://c1.ouisys.com/pixels?xcid=".concat(window.location.pathname.replace("/", ""), "&xaid=").concat(window.pac_analytics.visitor.xaid, "&country=").concat(bupperizeCountry(country))), "&rockman_id=").concat(rockmanId).concat(extraParamsQs, "&").concat(search);
527
- _context2.next = 60;
524
+ case 56:
525
+ _url2 = "https://".concat(newHost, "/tallyman/v1/?action=identify-user&country=").concat(bupperizeCountry(country), "&slug=").concat(slug, "&device=").concat(device, "&offerId=").concat(offer, "&page=").concat(window.location.href, "&pixel_url=").concat(encodeURIComponent("http://".concat(window.location.host, "/pixels?xcid=").concat(window.location.pathname.replace("/", ""), "&xaid=").concat(window.pac_analytics.visitor.xaid, "&country=").concat(bupperizeCountry(country))), "&rockman_id=").concat(rockmanId).concat(extraParamsQs, "&").concat(search);
526
+ _context2.next = 59;
528
527
  return fetchJsonp(_url2);
529
528
 
530
- case 60:
529
+ case 59:
531
530
  result = _context2.sent;
532
531
 
533
532
  if (!(false === result.success)) {
534
- _context2.next = 67;
533
+ _context2.next = 66;
535
534
  break;
536
535
  }
537
536
 
@@ -540,7 +539,7 @@ var identifyUser = /*#__PURE__*/function () {
540
539
 
541
540
  throw _identifyError;
542
541
 
543
- case 67:
542
+ case 66:
544
543
  return _context2.abrupt("return", {
545
544
  subscription_url: result.subscription_url || result.redirect_url,
546
545
  action: function action() {
@@ -550,7 +549,7 @@ var identifyUser = /*#__PURE__*/function () {
550
549
  operator: result.operator
551
550
  });
552
551
 
553
- case 68:
552
+ case 67:
554
553
  case "end":
555
554
  return _context2.stop();
556
555
  }
@@ -441,7 +441,7 @@ var confirmTPay = function confirmTPay(window, tpayConfig, locale, redirectUrl)
441
441
  if (config["replace_uid"] != undefined && config['replace_uid'] == true) {
442
442
  console.log('sub id ' + subId);
443
443
  productUrl = config['product_full_access'];
444
- fetch("http://de-mcb-api.sam-media.com/api/v2/validate-access/?domain=".concat(config.domain, "&sub_id=").concat(subId, "&country=").concat(tpayConfig.country, "&gateway=tpay")).then(function (response) {
444
+ fetch("http://de.tallymans.com/api/v2/validate-access/?domain=".concat(config.domain, "&sub_id=").concat(subId, "&country=").concat(tpayConfig.country, "&gateway=tpay")).then(function (response) {
445
445
  if (response.payload.token) {
446
446
  productUrl = config['product_url'].replace('<%UID%>', response.payload.token);
447
447
  }
@@ -6,8 +6,7 @@ import { IUssdActions } from "../reducers/ussdFlow/UssdTypes";
6
6
  import { IMoRedirActions } from "../reducers/moRedirFlow/MoRedirTypes";
7
7
  import { IOneClickActions } from "../reducers/oneClickFlow/OneClickTypes";
8
8
  import { IClick2SmsActions } from "../reducers/click2smsFlow/Click2smsTypes";
9
- import { ITpayHeActions } from "../reducers/tpayHeFlow/TpayHeTypes";
10
- export declare type IApplicationActions = IStrategyActions | IPinActions | IMoActions | IMoRedirActions | IOneClickActions | IClick2SmsActions | IUssdActions | ITpayHeActions;
9
+ export declare type IApplicationActions = IStrategyActions | IPinActions | IMoActions | IMoRedirActions | IOneClickActions | IClick2SmsActions | IUssdActions;
11
10
  declare const store: import("redux").Store<import("redux").EmptyObject & IApplicationState, import("redux").AnyAction> & {
12
11
  dispatch: import("redux-thunk").ThunkDispatch<IApplicationState, undefined, IApplicationActions>;
13
12
  };
@@ -5,7 +5,6 @@ import { IMoRedirFlowReducerState } from "../reducers/moRedirFlow/MoRedirTypes";
5
5
  import { IOneClickFlowReducerState } from "../reducers/oneClickFlow/OneClickTypes";
6
6
  import { IClick2smsFlowReducerState } from "../reducers/click2smsFlow/Click2smsTypes";
7
7
  import { IUssdFlowReducerState } from "../reducers/ussdFlow/UssdTypes";
8
- import { ITpayHeFlowReducerState } from "../reducers/tpayHeFlow/TpayHeTypes";
9
8
  export interface IApplicationState {
10
9
  strategy: IStrategyReducerState;
11
10
  pinFlow: IPinFlowReducerState;
@@ -14,7 +13,6 @@ export interface IApplicationState {
14
13
  oneClickFlow: IOneClickFlowReducerState;
15
14
  click2smsFlow: IClick2smsFlowReducerState;
16
15
  ussdFlow: IUssdFlowReducerState;
17
- tpayHeFlow: ITpayHeFlowReducerState;
18
16
  }
19
17
  declare const _default: () => import("redux").Reducer<import("redux").CombinedState<IApplicationState>, import("redux").AnyAction>;
20
18
  export default _default;
@@ -21,8 +21,6 @@ var _click2smsFlow = _interopRequireDefault(require("../reducers/click2smsFlow")
21
21
 
22
22
  var _ussdFlow = _interopRequireDefault(require("../reducers/ussdFlow"));
23
23
 
24
- var _tpayHeFlow = _interopRequireDefault(require("../reducers/tpayHeFlow"));
25
-
26
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
25
 
28
26
  var _default = function _default() {
@@ -33,8 +31,7 @@ var _default = function _default() {
33
31
  moRedirFlow: _moRedirFlow.default,
34
32
  oneClickFlow: _oneClickFlow.default,
35
33
  click2smsFlow: _click2smsFlow.default,
36
- ussdFlow: _ussdFlow.default,
37
- tpayHeFlow: _tpayHeFlow.default
34
+ ussdFlow: _ussdFlow.default
38
35
  });
39
36
  };
40
37
 
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.array.includes");
4
+
5
+ require("core-js/modules/es.string.includes");
6
+
7
+ require("whatwg-fetch");
8
+
9
+ // Jenkins seems to have installed a custom certificate which causes the logs to be poluted
10
+ // This little hack fixes that
11
+ var logErr = console.error; // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
+
13
+ console.error = function (message) {
14
+ if (message && message.includes('ERR_TLS_CERT_ALTNAME_INVALID')) return;
15
+
16
+ for (var _len = arguments.length, optionalParams = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
17
+ optionalParams[_key - 1] = arguments[_key];
18
+ }
19
+
20
+ logErr(message, optionalParams);
21
+ };
22
+
23
+ jest.mock('../auth/authHandler');
24
+ global.scrollTo = jest.fn();
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.object.keys");
4
+
5
+ require("core-js/modules/web.dom-collections.for-each");
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ var _exportNames = {
11
+ server: true
12
+ };
13
+ Object.defineProperty(exports, "server", {
14
+ enumerable: true,
15
+ get: function get() {
16
+ return _server.server;
17
+ }
18
+ });
19
+
20
+ require("whatwg-fetch");
21
+
22
+ var _server = require("../mockServer/server");
23
+
24
+ var _msw = require("msw");
25
+
26
+ Object.keys(_msw).forEach(function (key) {
27
+ if (key === "default" || key === "__esModule") return;
28
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
29
+ if (key in exports && exports[key] === _msw[key]) return;
30
+ Object.defineProperty(exports, key, {
31
+ enumerable: true,
32
+ get: function get() {
33
+ return _msw[key];
34
+ }
35
+ });
36
+ });
37
+
38
+ /**
39
+ * Generic functions for the tests.
40
+ */
41
+ beforeAll(function () {
42
+ _server.server.listen();
43
+ });
44
+ afterEach(function () {
45
+ _server.server.resetHandlers();
46
+
47
+ _server.server.restoreHandlers();
48
+ });
49
+ afterAll(function () {
50
+ _server.server.close();
51
+ }); // re-export everything
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ouisys-engine",
3
- "version": "2.1.19",
3
+ "version": "2.1.24",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "directories": "dist dev-tools",
@@ -56,6 +56,7 @@ export type ITpay = {
56
56
  tPayhash:string;
57
57
  hostCountry?:string;
58
58
  hostSlug?:string;
59
+ tid:string;
59
60
  }
60
61
 
61
62
  namespace NodeJS {
package/src/api/index.ts CHANGED
@@ -6,21 +6,19 @@ import { IMSISDNSubmissionResult as IMoMSISDNSubmissionResult } from "../reducer
6
6
  import IError from "../common-types/IError";
7
7
  import { IIdentifyResult } from "../reducers/strategy/StrategyTypes";
8
8
  import { IFetchResult } from "../reducers/click2smsFlow/Click2smsTypes";
9
- import { ITpayConsentResult } from "../reducers/TpayHeFlow/TpayHeTypes";
10
9
 
11
10
  const bupperizeCountry = (c:string) => c == 'gb' ? 'uk' : c;
12
11
 
13
12
  export interface ITallyman {
14
13
  identify:(host: string, slug: string, country: string, msisdn: string, device: string, offer: number, rockmanId: string)=>Promise<IIdentifyResult>
15
14
  triggerPin:(host: string, country: string, slug: string, device: string, offer: number, msisdn: string, rockmanId: string, extraParamsQs: string, search: string,uniqid?:string)=>Promise<IMSISDNSubmissionResult>;
16
- verifyPin:(host:string, country:string, slug:string, device:string, offer:number, rockmanId:string, pin:string, extraParamsQs:string, uniqid:string)=>Promise<IPINSubmissionResult>;
15
+ verifyPin:(host:string, country:string, slug:string, device:string, offer:number, rockmanId:string, pin:string, extraParamsQs:string, uniqid:string, evinaTid:string)=>Promise<IPINSubmissionResult>;
17
16
  checkSubscriptionByRockmanIdOnly:(host:string, rockmanId:string)=>Promise<ICheckSubscriptionResult>;
18
17
  checkSubscription:(host:string, country:string, slug:string, device:string, offer:number, rockmanId:string, pin:string, extraParamsQs:string)=>Promise<ICheckSubscriptionResult>;
19
18
  triggerMessage:(host:string, slug:string, country:string, msisdn:string, device:string, offer:number, rockmanId:string, search:string, extraParamsQs:string)=>Promise<IMoMSISDNSubmissionResult>;
20
19
  redirect:(host:string, slug:string, country:string, msisdn:string, device:string, offer:number, rockmanId:string, ip_range_name:string, search:string, extraParamsQs:string)=>Promise<IMoRedirMSISDNSubmissionResult>;
21
20
  ussd:(host:string, slug:string, country:string, msisdn:string, device:string, offer:number, rockmanId:string, search:string, extraParamsQs:string)=>Promise<IMoMSISDNSubmissionResult>;
22
21
  oc2sms:(host: string, country:string, slug:string, offer:number, rockmanId:string, keyword:string, operator:string, search:string)=>Promise<IFetchResult>;
23
- tpayConsentConfig:(host: string, country: string, slug: string, device:string, offer: number, rockmanId: string, search: string)=>Promise<ITpayConsentResult>;
24
22
  mcpShield:(host: string, country: string, slug: string, device:string, offer: number, rockmanId: string, operator?:string, uniqid?:string)=>Promise<IMcpShieldResult>;
25
23
  }
26
24
 
@@ -44,7 +42,7 @@ export const MockTallyman:ITallyman = {
44
42
  rockman_id: ""
45
43
  }
46
44
  },
47
- triggerPin:async(host: string, country: string, slug: string, device: string, offer: number, msisdn: string, rockmanId: string, extraParamsQs: string, search: string,uniqid?:string): Promise<IMSISDNSubmissionResult> =>{
45
+ triggerPin:async(host: string, country: string, slug: string, device: string, offer: number, msisdn: string, rockmanId: string, extraParamsQs: string, search: string,uniqid?:string, evinaTid?:string): Promise<IMSISDNSubmissionResult> =>{
48
46
  console.log("MockTallyman")
49
47
  sleep(2000);
50
48
  return {
@@ -125,31 +123,6 @@ export const MockTallyman:ITallyman = {
125
123
  shortcode: '666'
126
124
  }
127
125
  },
128
- tpayConsentConfig:async(host: string, country: string, slug: string, device:string, offer: number, rockmanId: string, search: string): Promise<ITpayConsentResult>=> {
129
- console.log("MockTallyman")
130
- sleep(2000);
131
- return {
132
- "prodSku": "gamelords",
133
- "lang": "ar",
134
- "country": "eg",
135
- "subscription_url": "http:\/\/n.vidflixz.com\/tallyman\/v1\/?action=one-click-subscribe&device=smart&slug=tpay-he-vidflixz&country=eg&offerId=1&rockman_id=13643b4780fb40bb8adf2feb2a400d7f&",
136
- "config": {
137
- "product_url": "http:\/\/eg.game-lords.com\/#\/?uid=fdf098fcc6",
138
- "subscription_plan_id": 829,
139
- "public": "HFyenUyCJCxl1QTgtVCA",
140
- "private": "vazlmVhGFyxKLOav6DvW",
141
- "flow": "consent",
142
- "catalog_name": {
143
- "60201": "gamelords_org",
144
- "60202": "gamelords_vdf",
145
- "60203": "gamelords_etst"
146
- }
147
- },
148
- "redirectUrl": "http:\/\/n.game-lords.com\/eg\/animal-game?country=eg&handle=animal-game&offer=1&device=smart&_extracted=957ad26679cd47a09d4efe28d4a4af72&operator=#operator#&msisdnSubmitted=Y&network_type=mobile_data&atmobirun=true&force_mcb_page=true&skipTrigger=true",
149
- "rid": "957ad26679cd47a09d4efe28d4a4af72",
150
- "success": true
151
- }
152
- },
153
126
  mcpShield:async(host: string, country: string, slug: string, device:string, offer: number, rockmanId: string, operator?:string,): Promise<IMcpShieldResult>=> {
154
127
  console.log("MockTallyman")
155
128
  sleep(2000);
@@ -176,11 +149,11 @@ export const RealTallyman:ITallyman = {
176
149
  const newHost = isDMB ? "de.tallymans.com" : host;
177
150
  return await fetch(`https://${newHost}/tallyman/v1/?action=trigger-pin&country=${bupperizeCountry(country)}&slug=${slug}&device=${device}&offerId=${offer}&msisdn=${msisdn}&rockman_id=${rockmanId}${uniqid}${extraParamsQs}&${search}`).then(x => x.json());
178
151
  },
179
- verifyPin:async(host:string, country:string, slug:string, device:string, offer:number, rockmanId:string, pin:string, extraParamsQs:string, uniqid:string): Promise<IPINSubmissionResult> =>{
152
+ verifyPin:async(host:string, country:string, slug:string, device:string, offer:number, rockmanId:string, pin:string, extraParamsQs:string, uniqid:string, evinaTid:string): Promise<IPINSubmissionResult> =>{
180
153
  console.log("RealTallyman")
181
154
  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;
182
155
  const newHost = isDMB ? "de.tallymans.com" : host;
183
- return await fetch(`https://${newHost}/tallyman/v1/?action=verify-pin&country=${bupperizeCountry(country)}&slug=${slug}&device=${device}&offerId=${offer}&rockman_id=${rockmanId}&pin=${pin}${uniqid}${extraParamsQs}`).then(x => x.json())
156
+ return await fetch(`https://${newHost}/tallyman/v1/?action=verify-pin&country=${bupperizeCountry(country)}&slug=${slug}&device=${device}&offerId=${offer}&rockman_id=${rockmanId}&pin=${pin}${uniqid}&sam_evina_tid=${evinaTid}${extraParamsQs}`).then(x => x.json())
184
157
  },
185
158
  checkSubscription:async(host:string, country:string, slug:string, device:string, offer:number, rockmanId:string, pin:string, extraParamsQs:string): Promise<ICheckSubscriptionResult> =>{
186
159
  console.log("RealTallyman")
@@ -218,12 +191,6 @@ export const RealTallyman:ITallyman = {
218
191
  const newHost = isDMB ? "de.tallymans.com" : host;
219
192
  return await fetch(`https://${newHost}/tallyman/v1/?action=oc2sms&country=${country}&slug=${slug}&offerId=${offer}${!!keyword ? '&keyword=' + keyword : ''}&device=smart&rockman_id=${rockmanId}${!!operator ? '&operator=' + operator : ''}&${search}`).then(x => x.json())
220
193
  },
221
- tpayConsentConfig:async(host: string, country: string, slug: string, device:string, offer: number, rockmanId: string, search: string): Promise<ITpayConsentResult>=> {
222
- console.log("RealTallyman")
223
- 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;
224
- const newHost = isDMB ? "de.tallymans.com" : host;
225
- return await fetch(`https://${newHost}/tallyman/helper/?action=tpay-consent-config&country=${country}&slug=${slug}&device=${device}&offerId=${offer}&device=smart&rockman_id=${rockmanId}&${search}`).then(x => x.json())
226
- },
227
194
  mcpShield:async(host: string, country: string, slug: string, device:string, offer: number, rockmanId: string, operator?:string, uniqid?:string): Promise<IMcpShieldResult>=> {
228
195
  console.log("RealTallyman")
229
196
  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;
@@ -8,9 +8,8 @@ import IMoRedirConstants from "../reducers/moRedirFlow/IMoRedirConstants";
8
8
  import IOneClickConstants from "../reducers/oneClickFlow/IOneClickConstants";
9
9
  import IClick2smsConstants from "../reducers/click2smsFlow/IClick2smsConstants";
10
10
  import IUssdConstants from "../reducers/ussdFlow/IUssdConstants";
11
- import ITpayHeConstants from "../reducers/tpayHeFlow/ITpayHeConstants";
12
11
 
13
- type IAllActionConstants = IStategyActionContants | IPinConstants | IMoConstants | IMoRedirConstants | IOneClickConstants | IClick2smsConstants | IUssdConstants | ITpayHeConstants;
12
+ type IAllActionConstants = IStategyActionContants | IPinConstants | IMoConstants | IMoRedirConstants | IOneClickConstants | IClick2smsConstants | IUssdConstants;
14
13
 
15
14
  export type AppThunk<ReturnType = void> = ThunkAction<
16
15
  ReturnType,
@@ -12,8 +12,7 @@ function strategy<R>(
12
12
  moRedirFlow,
13
13
  oneClickFlow,
14
14
  click2smsFlow,
15
- ussdFlow,
16
- tpayHeFlow
15
+ ussdFlow
17
16
  }:
18
17
  {
19
18
  identifyFlowByOperatorSelect: (data: OPERATORSelectFlowIdentifySuccess) => R,
@@ -24,7 +23,6 @@ function strategy<R>(
24
23
  oneClickFlow: (data: IdentifyFlowOptionsResult<"getRedirectUrlAction">) => R
25
24
  click2smsFlow: (data: IdentifyFlowOptionsResult<"loadOc2sms">) => R,
26
25
  ussdFlow: (data: IdentifyFlowOptionsResult<"submitMSISDNAction">) => R,
27
- tpayHeFlow: (data: IdentifyFlowOptionsResult<"loadTpayAction">) => R,
28
26
  }): (state: IStrategyCurrentState) => R {
29
27
 
30
28
 
@@ -46,8 +44,6 @@ function strategy<R>(
46
44
  return click2smsFlow(state.result);
47
45
  case 'USSD':
48
46
  return ussdFlow(state.result);
49
- case 'TPAY_HE':
50
- return tpayHeFlow(state.result);
51
47
  }
52
48
  }
53
49
  }
@@ -5,9 +5,10 @@ export default async function tryGetIPRangeName(visitor: IVisitor): Promise<stri
5
5
 
6
6
  const mockip = queryString(window.location.href, "mock-ip") || process.env.mock_ip;
7
7
  console.log("mockip", mockip)
8
- if (!visitor.ip) {
8
+ if (!visitor.ip && typeof window != "undefined") {
9
9
  try {
10
- const res = await fetch('https://c1.ouisys.com/api/v1/ip' + (!!mockip ? `?mock-ip=${mockip}` : "")).then(x => x.json())
10
+ const host = window.location.host
11
+ const res = await fetch(`https://${host}/api/v1/ip` + (!!mockip ? `?mock-ip=${mockip}` : "")).then(x => x.json())
11
12
  // return isIPInRange('37.200.146.28')
12
13
  visitor.ip = res.ip
13
14
  visitor.ip_range_name = res.ip_range_name
@@ -56,7 +56,7 @@ export default (window: Window, country?: string, page?: string): ITrackerFlowEv
56
56
 
57
57
  const pacmanClient = mkPacmanClient({
58
58
  rockmanId: window.pac_analytics.visitor.rockmanId,
59
- serverUrl: process.env.pacman_server, // check webpack.config.common.js //"https://de-pacman.sam-media.com/api/v2/mstore",
59
+ serverUrl: process.env.pacman_server,
60
60
  impressionNumber: 1,
61
61
  signalInterval: 1000 // in milliseconds
62
62
  });