ouisys-engine 2.1.36 → 2.1.39

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.
@@ -49,8 +49,6 @@ var _utils = require("./utils");
49
49
 
50
50
  var _strategy = require("../strategy");
51
51
 
52
- var _timers = require("timers");
53
-
54
52
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
55
53
 
56
54
  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; }
@@ -67,8 +65,6 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
67
65
 
68
66
  //ACTION CREATORS
69
67
  function getRedirectUrlAction(_ref) {
70
- var _this = this;
71
-
72
68
  var extraParams = _ref.extraParams,
73
69
  _ref$autoRedirect = _ref.autoRedirect,
74
70
  autoRedirect = _ref$autoRedirect === void 0 ? false : _ref$autoRedirect,
@@ -76,7 +72,7 @@ function getRedirectUrlAction(_ref) {
76
72
  isGetRedirectBupperWay = _ref$isGetRedirectBup === void 0 ? false : _ref$isGetRedirectBup;
77
73
  return /*#__PURE__*/function () {
78
74
  var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(dispatch, store) {
79
- var currentState, _currentState$result, config, subscription_url, redirect_url, redirectUrl, _yield$getRedirectUrl, _redirect_url;
75
+ var currentState, _currentState$result, config, subscription_url, redirect_url, redirectUrl, timer, _yield$getRedirectUrl, _redirect_url;
80
76
 
81
77
  return regeneratorRuntime.wrap(function _callee$(_context) {
82
78
  while (1) {
@@ -85,7 +81,7 @@ function getRedirectUrlAction(_ref) {
85
81
  currentState = store().strategy.currentState;
86
82
 
87
83
  if (!(currentState.type === "ONE_CLICK")) {
88
- _context.next = 38;
84
+ _context.next = 37;
89
85
  break;
90
86
  }
91
87
 
@@ -100,7 +96,7 @@ function getRedirectUrlAction(_ref) {
100
96
  });
101
97
 
102
98
  if (!(isGetRedirectBupperWay == true)) {
103
- _context.next = 14;
99
+ _context.next = 13;
104
100
  break;
105
101
  }
106
102
 
@@ -116,20 +112,18 @@ function getRedirectUrlAction(_ref) {
116
112
  redirect_url: redirectUrl
117
113
  });
118
114
 
119
- window.isAutoFraudScreener = true;
120
-
121
115
  if (autoRedirect == true || window.isAutoFraudScreener === true) {
122
116
  if (process.env.NODE_ENV === "production") {
123
117
  // Wait for Evina to Check Fraud First
124
- setInterval(function () {
118
+ timer = setInterval(function () {
125
119
  if (window.isEvinaSessionChecked) {
126
- (0, _timers.clearInterval)(_this);
120
+ clearInterval(timer);
127
121
 
128
122
  _strategy.tracker.advancedInFlow('tallyman.v1-one-click', 'click-redirect-url', {
129
123
  redirect_url: redirectUrl
130
124
  });
131
125
 
132
- (0, _timers.setTimeout)(function () {
126
+ setTimeout(function () {
133
127
  window.location.href = redirectUrl;
134
128
  }, 3000);
135
129
  }
@@ -139,7 +133,7 @@ function getRedirectUrlAction(_ref) {
139
133
  redirect_url: redirectUrl
140
134
  });
141
135
 
142
- (0, _timers.setTimeout)(function () {
136
+ setTimeout(function () {
143
137
  window.location.href = redirectUrl;
144
138
  }, 3000);
145
139
  }
@@ -155,12 +149,12 @@ function getRedirectUrlAction(_ref) {
155
149
  });
156
150
  }
157
151
 
158
- _context.next = 29;
152
+ _context.next = 28;
159
153
  break;
160
154
 
161
- case 14:
155
+ case 13:
162
156
  if (!(subscription_url && subscription_url != null)) {
163
- _context.next = 18;
157
+ _context.next = 17;
164
158
  break;
165
159
  }
166
160
 
@@ -172,9 +166,9 @@ function getRedirectUrlAction(_ref) {
172
166
  }
173
167
  }));
174
168
 
175
- case 18:
169
+ case 17:
176
170
  if (!(redirect_url && redirect_url != null)) {
177
- _context.next = 23;
171
+ _context.next = 22;
178
172
  break;
179
173
  }
180
174
 
@@ -192,13 +186,13 @@ function getRedirectUrlAction(_ref) {
192
186
  }
193
187
  }));
194
188
 
195
- case 23:
196
- _context.next = 25;
189
+ case 22:
190
+ _context.next = 24;
197
191
  return (0, _utils.getRedirectUrl)(window, config, _objectSpread(_objectSpread({}, currentState.result.operator && {
198
192
  operator: currentState.result.operator
199
193
  }), extraParams));
200
194
 
201
- case 25:
195
+ case 24:
202
196
  _yield$getRedirectUrl = _context.sent;
203
197
  _redirect_url = _yield$getRedirectUrl.redirect_url;
204
198
 
@@ -224,12 +218,12 @@ function getRedirectUrlAction(_ref) {
224
218
  });
225
219
  }
226
220
 
227
- case 29:
228
- _context.next = 36;
221
+ case 28:
222
+ _context.next = 35;
229
223
  break;
230
224
 
231
- case 31:
232
- _context.prev = 31;
225
+ case 30:
226
+ _context.prev = 30;
233
227
  _context.t0 = _context["catch"](3);
234
228
  console.warn(_context.t0);
235
229
  console.log("Falling back to bupper");
@@ -246,11 +240,11 @@ function getRedirectUrlAction(_ref) {
246
240
  });
247
241
  }
248
242
 
249
- case 36:
250
- _context.next = 40;
243
+ case 35:
244
+ _context.next = 39;
251
245
  break;
252
246
 
253
- case 38:
247
+ case 37:
254
248
  dispatch({
255
249
  type: "GET_REDIRECT_URL",
256
250
  payload: {
@@ -262,12 +256,12 @@ function getRedirectUrlAction(_ref) {
262
256
  });
263
257
  throw "Unexpected state";
264
258
 
265
- case 40:
259
+ case 39:
266
260
  case "end":
267
261
  return _context.stop();
268
262
  }
269
263
  }
270
- }, _callee, null, [[3, 31]]);
264
+ }, _callee, null, [[3, 30]]);
271
265
  }));
272
266
 
273
267
  return function (_x, _x2) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ouisys-engine",
3
- "version": "2.1.36",
3
+ "version": "2.1.39",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "directories": "dist dev-tools",
@@ -6,7 +6,6 @@ import { AppThunk } from "../../common-types/AppThunk";
6
6
  import { getRedirectUrl, getRedirectUrlBupperWay, mockedRedirectUrlSuccessState, mockedSubscribeAjaxState, subscribe } from "./utils";
7
7
  import { genericHandler, tracker } from "../strategy";
8
8
  import { IHash } from "../strategy/StrategyTypes";
9
- import { clearInterval, setTimeout } from "timers";
10
9
 
11
10
 
12
11
 
@@ -37,14 +36,13 @@ export function getRedirectUrlAction({extraParams, autoRedirect = false, isGetRe
37
36
 
38
37
 
39
38
  tracker.customEvent('Flow', 'advance-auto', 'redirect-success', {redirect_url:redirectUrl})
40
- window.isAutoFraudScreener = true
41
39
  if(autoRedirect == true || window.isAutoFraudScreener === true){
42
40
 
43
41
  if(process.env.NODE_ENV === "production"){
44
42
  // Wait for Evina to Check Fraud First
45
- setInterval(() => {
43
+ const timer = setInterval(() => {
46
44
  if(window.isEvinaSessionChecked){
47
- clearInterval(this);
45
+ clearInterval(timer);
48
46
  tracker.advancedInFlow('tallyman.v1-one-click', 'click-redirect-url', {redirect_url:redirectUrl});
49
47
  setTimeout(() => {
50
48
  window.location.href = redirectUrl;