ouisys-engine 2.1.30 → 2.1.33

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.
@@ -59,13 +59,12 @@ function submitMSISDNAction(msisdn) {
59
59
  currentState = store().strategy.currentState;
60
60
 
61
61
  if (!(currentState.type === "MO_REDIR")) {
62
- _context.next = 22;
62
+ _context.next = 21;
63
63
  break;
64
64
  }
65
65
 
66
- console.log("currentState", currentState);
67
66
  config = currentState.result.config;
68
- _context.prev = 4;
67
+ _context.prev = 3;
69
68
  dispatch({
70
69
  type: "MO_REDIR_MSISDN_SUBMIT",
71
70
  payload: {
@@ -78,10 +77,10 @@ function submitMSISDNAction(msisdn) {
78
77
  msisdn: msisdn
79
78
  });
80
79
 
81
- _context.next = 9;
80
+ _context.next = 8;
82
81
  return (0, _utils.default)(window, config, msisdn);
83
82
 
84
- case 9:
83
+ case 8:
85
84
  href = _context.sent;
86
85
 
87
86
  _strategy.tracker.advancedInFlow('tallyman.v1-mo-redir', 'msisdn-submission-success', {
@@ -97,12 +96,12 @@ function submitMSISDNAction(msisdn) {
97
96
  })
98
97
  }
99
98
  });
100
- _context.next = 20;
99
+ _context.next = 19;
101
100
  break;
102
101
 
103
- case 14:
104
- _context.prev = 14;
105
- _context.t0 = _context["catch"](4);
102
+ case 13:
103
+ _context.prev = 13;
104
+ _context.t0 = _context["catch"](3);
106
105
  console.warn(_context.t0);
107
106
  errorType = "SEAlreadySubscribed" === _context.t0.type ? "AlreadySubscribed" : "SEInvalidMSISDN" == _context.t0.type ? "InvalidMSISDN" : "UnknownError";
108
107
 
@@ -123,11 +122,11 @@ function submitMSISDNAction(msisdn) {
123
122
  }
124
123
  });
125
124
 
126
- case 20:
127
- _context.next = 25;
125
+ case 19:
126
+ _context.next = 24;
128
127
  break;
129
128
 
130
- case 22:
129
+ case 21:
131
130
  _strategy.tracker.recedeInFlow('tallyman.v1-mo-redir', 'msisdn-submission-failure', {
132
131
  msisdn: msisdn,
133
132
  errorType: 'UnknownError'
@@ -145,12 +144,12 @@ function submitMSISDNAction(msisdn) {
145
144
  });
146
145
  throw "Unexpected state";
147
146
 
148
- case 25:
147
+ case 24:
149
148
  case "end":
150
149
  return _context.stop();
151
150
  }
152
151
  }
153
- }, _callee, null, [[4, 14]]);
152
+ }, _callee, null, [[3, 13]]);
154
153
  }));
155
154
 
156
155
  return function (_x, _x2) {
@@ -112,7 +112,7 @@ function getRedirectUrlAction(_ref) {
112
112
  redirect_url: redirectUrl
113
113
  });
114
114
 
115
- if (autoRedirect == true) {
115
+ if (autoRedirect == true || window.isAutoFraudScreener === true) {
116
116
  _strategy.tracker.advancedInFlow('tallyman.v1-one-click', 'click-redirect-url', {
117
117
  redirect_url: redirectUrl
118
118
  });
@@ -181,7 +181,7 @@ function getRedirectUrlAction(_ref) {
181
181
  redirect_url: _redirect_url
182
182
  });
183
183
 
184
- if (autoRedirect == true) {
184
+ if (autoRedirect == true || window.isAutoFraudScreener === true) {
185
185
  _strategy.tracker.advancedInFlow('tallyman.v1-one-click', 'click-redirect-url', {
186
186
  redirect_url: _redirect_url
187
187
  });
@@ -355,13 +355,12 @@ var getRedirectUrlBupperWay = /*#__PURE__*/function () {
355
355
  })).join('&');
356
356
  extraParamsQs = !extraParams ? '' : '&' + Object.keys(extraParams).map(function (k) {
357
357
  return "".concat(k, "=").concat(extraParams[k]);
358
- }).join('&');
359
- console.log("extraParamsQs", extraParamsQs); // one click flow must use http not https
358
+ }).join('&'); // one click flow must use http not https
360
359
 
361
360
  xcid = window.location.href.split("/")[3].split('?')[0];
362
361
  return _context3.abrupt("return", "http://".concat(host, "/").concat(bupperizeCountry(country), "/").concat(slug, "?offer=").concat(offer, "&atmobirun=1&rockman_id=").concat(window.pac_analytics.visitor.rockmanId, "&redirPixels=").concat(window.location.host, "&x-xcid=").concat(xcid).concat(extraParamsQs, "&").concat(search, "&"));
363
362
 
364
- case 13:
363
+ case 12:
365
364
  case "end":
366
365
  return _context3.stop();
367
366
  }
@@ -27,7 +27,7 @@ export declare type PINEntrySuccess = {
27
27
  msisdn?: string;
28
28
  isAlreadySubscribed?: boolean;
29
29
  };
30
- export declare type PINEntryErrorTypes = "UnknownError" | "TooEarly" | "InvalidPIN" | "UnexpectedState";
30
+ export declare type PINEntryErrorTypes = "UnknownError" | "TooEarly" | "InvalidPIN" | "UnexpectedState" | "SessionBlocked";
31
31
  export declare type IMsisdnSumbitNextData = {
32
32
  actualPIN: string;
33
33
  nextAction: "submitPinAction";
@@ -400,7 +400,7 @@ function submitPinAction(msisdn, pin, extraParams) {
400
400
  _context3.prev = 19;
401
401
  _context3.t0 = _context3["catch"](2);
402
402
  console.error(_context3.t0);
403
- errorType = "InvalidPIN" === _context3.t0.type ? "InvalidPIN" : "UnknownError";
403
+ errorType = _context3.t0.type || "UnknownError";
404
404
 
405
405
  _strategy.tracker.recedeInFlow('tallyman.v1-pin', 'pin-submission-failure', {
406
406
  msisdn: msisdn,
@@ -360,7 +360,6 @@ var click2sms_one_click_detect_operator_by_ip = function click2sms_one_click_det
360
360
  case 11:
361
361
  _.tracker.sendOptInFlowEvent("Click to sms");
362
362
 
363
- console.log("defaultFlow", defaultFlow);
364
363
  return _context3.abrupt("return", dispatch({
365
364
  type: "IDENTIFY_FLOW_BY_IP_OPERATOR",
366
365
  payload: {
@@ -372,12 +371,12 @@ var click2sms_one_click_detect_operator_by_ip = function click2sms_one_click_det
372
371
  }
373
372
  }));
374
373
 
375
- case 14:
376
- _context3.next = 21;
374
+ case 13:
375
+ _context3.next = 20;
377
376
  break;
378
377
 
379
- case 16:
380
- _context3.prev = 16;
378
+ case 15:
379
+ _context3.prev = 15;
381
380
  _context3.t1 = _context3["catch"](0);
382
381
  console.warn(_context3.t1);
383
382
 
@@ -394,12 +393,12 @@ var click2sms_one_click_detect_operator_by_ip = function click2sms_one_click_det
394
393
  }
395
394
  });
396
395
 
397
- case 21:
396
+ case 20:
398
397
  case "end":
399
398
  return _context3.stop();
400
399
  }
401
400
  }
402
- }, _callee3, null, [[0, 16]]);
401
+ }, _callee3, null, [[0, 15]]);
403
402
  }));
404
403
 
405
404
  return function (_x3) {
@@ -106,10 +106,9 @@ var pin_header_enrichment = function pin_header_enrichment(defaultFlow) {
106
106
 
107
107
  case 3:
108
108
  ipRangeName = _context.sent;
109
- console.log("IP ipRangeName", ipRangeName);
110
109
 
111
110
  if (!(ipRangeName == null)) {
112
- _context.next = 8;
111
+ _context.next = 7;
113
112
  break;
114
113
  }
115
114
 
@@ -126,16 +125,16 @@ var pin_header_enrichment = function pin_header_enrichment(defaultFlow) {
126
125
  }
127
126
  }));
128
127
 
129
- case 8:
130
- _context.next = 10;
128
+ case 7:
129
+ _context.next = 9;
131
130
  return (0, _utils.identifyUser)();
132
131
 
133
- case 10:
132
+ case 9:
134
133
  heResult = _context.sent;
135
134
  flowObj = defaultFlow;
136
135
 
137
136
  if (!(heResult.msisdn !== undefined && heResult.msisdn !== "")) {
138
- _context.next = 20;
137
+ _context.next = 19;
139
138
  break;
140
139
  }
141
140
 
@@ -162,7 +161,7 @@ var pin_header_enrichment = function pin_header_enrichment(defaultFlow) {
162
161
  }
163
162
  }));
164
163
 
165
- case 20:
164
+ case 19:
166
165
  _.tracker.sendOptInFlowEvent("Pin");
167
166
 
168
167
  return _context.abrupt("return", dispatch({
@@ -176,12 +175,12 @@ var pin_header_enrichment = function pin_header_enrichment(defaultFlow) {
176
175
  }
177
176
  }));
178
177
 
179
- case 22:
180
- _context.next = 30;
178
+ case 21:
179
+ _context.next = 29;
181
180
  break;
182
181
 
183
- case 24:
184
- _context.prev = 24;
182
+ case 23:
183
+ _context.prev = 23;
185
184
  _context.t0 = _context["catch"](0);
186
185
  console.warn(_context.t0);
187
186
 
@@ -202,12 +201,12 @@ var pin_header_enrichment = function pin_header_enrichment(defaultFlow) {
202
201
  }
203
202
  });
204
203
 
205
- case 30:
204
+ case 29:
206
205
  case "end":
207
206
  return _context.stop();
208
207
  }
209
208
  }
210
- }, _callee, null, [[0, 24]]);
209
+ }, _callee, null, [[0, 23]]);
211
210
  }));
212
211
 
213
212
  return function (_x) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ouisys-engine",
3
- "version": "2.1.30",
3
+ "version": "2.1.33",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "directories": "dist dev-tools",
@@ -57,6 +57,7 @@ export type ITpay = {
57
57
  hostCountry?:string;
58
58
  hostSlug?:string;
59
59
  tid:string;
60
+ isAutoFraudScreener: boolean;
60
61
  }
61
62
 
62
63
  namespace NodeJS {
@@ -12,7 +12,6 @@ export function submitMSISDNAction(msisdn:string):AppThunk{
12
12
  const {currentState} = store().strategy
13
13
  if(currentState.type === "MO_REDIR"){
14
14
 
15
- console.log("currentState", currentState)
16
15
  const config = currentState.result.config;
17
16
 
18
17
 
@@ -37,7 +37,7 @@ export function getRedirectUrlAction({extraParams, autoRedirect = false, isGetRe
37
37
 
38
38
  tracker.customEvent('Flow', 'advance-auto', 'redirect-success', {redirect_url:redirectUrl})
39
39
 
40
- if(autoRedirect == true){
40
+ if(autoRedirect == true || window.isAutoFraudScreener === true){
41
41
  tracker.advancedInFlow('tallyman.v1-one-click', 'click-redirect-url', {redirect_url:redirectUrl});
42
42
 
43
43
  window.location.href = redirectUrl;
@@ -83,7 +83,7 @@ export function getRedirectUrlAction({extraParams, autoRedirect = false, isGetRe
83
83
 
84
84
  tracker.customEvent('Flow', 'advance-auto', 'redirect-success', {redirect_url})
85
85
 
86
- if(autoRedirect == true){
86
+ if(autoRedirect == true || window.isAutoFraudScreener === true){
87
87
  tracker.advancedInFlow('tallyman.v1-one-click', 'click-redirect-url', {redirect_url});
88
88
 
89
89
  window.location.href = redirect_url;
@@ -191,7 +191,6 @@ export const getRedirectUrlBupperWay = async(window:Window, maybeConfig: IConfig
191
191
  const search = (!!s && s.length > 0 ? [s] : []).concat((queryString || []).map(([k, v]) => `${k}=${v}`)).join('&')
192
192
  const extraParamsQs = !extraParams ? '' : '&' + Object.keys(extraParams).map(k => `${k}=${extraParams[k]}`).join('&')
193
193
 
194
- console.log("extraParamsQs",extraParamsQs)
195
194
  // one click flow must use http not https
196
195
  const xcid = window.location.href.split("/")[3].split('?')[0];
197
196
  return `http://${host}/${bupperizeCountry(country)}/${slug}?offer=${offer}&atmobirun=1&rockman_id=${window.pac_analytics.visitor.rockmanId}&redirPixels=${window.location.host}&x-xcid=${xcid}${extraParamsQs}&${search}&`
@@ -30,7 +30,7 @@ export type PINEntryFailure = {
30
30
  error?: Error;
31
31
  };
32
32
  export type PINEntrySuccess = { finalUrl: string, msisdn?:string, isAlreadySubscribed?:boolean, };
33
- export type PINEntryErrorTypes = "UnknownError" | "TooEarly" | "InvalidPIN" | "UnexpectedState";
33
+ export type PINEntryErrorTypes = "UnknownError" | "TooEarly" | "InvalidPIN" | "UnexpectedState" | "SessionBlocked";
34
34
 
35
35
  export type IMsisdnSumbitNextData = {
36
36
  actualPIN: string;
@@ -234,11 +234,8 @@ export function submitPinAction(msisdn:string, pin:string, extraParams?:{[key: s
234
234
  } catch(ex) {
235
235
 
236
236
  console.error(ex)
237
- const errorType: PINEntryErrorTypes =
238
- "InvalidPIN" === ex.type
239
- ? "InvalidPIN"
240
- : "UnknownError";
241
- tracker.recedeInFlow('tallyman.v1-pin', 'pin-submission-failure',{msisdn, pin})
237
+ const errorType: PINEntryErrorTypes = ex.type || "UnknownError";
238
+ tracker.recedeInFlow('tallyman.v1-pin', 'pin-submission-failure',{msisdn, pin})
242
239
 
243
240
  dispatch({
244
241
  type: "PIN_SUBMIT_ERROR",
@@ -214,7 +214,6 @@ export const click2sms_one_click_detect_operator_by_ip = (defaultFlow:IFlow):App
214
214
  default:
215
215
  tracker.sendOptInFlowEvent("Click to sms")
216
216
 
217
- console.log("defaultFlow",defaultFlow)
218
217
  return dispatch({
219
218
  type:"IDENTIFY_FLOW_BY_IP_OPERATOR",
220
219
  payload:{
@@ -51,7 +51,6 @@ 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("IP ipRangeName", ipRangeName);
55
54
  if (ipRangeName == null) {
56
55
 
57
56
  tracker.sendOptInFlowEvent("Pin")