ouisys-engine 3.0.1 → 3.0.5

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 (195) hide show
  1. package/.babelrc +4 -8
  2. package/.eslintrc.js +1 -1
  3. package/.husky/pre-commit +4 -0
  4. package/.nvmrc +1 -1
  5. package/.prettierignore +2 -1
  6. package/.vscode/settings.json +1 -1
  7. package/README.md +2 -4
  8. package/dist/api/index.d.ts +5 -5
  9. package/dist/api/index.js +76 -76
  10. package/dist/common-types/AppThunk.d.ts +11 -12
  11. package/dist/common-types/IOptInFlowName.d.ts +1 -1
  12. package/dist/common-types/ITracker.js +1 -2
  13. package/dist/common-types/RemoteDataState.d.ts +4 -4
  14. package/dist/common-types/RemoteDataState.js +17 -17
  15. package/dist/flows/click2smsFlow.d.ts +2 -2
  16. package/dist/flows/moFlow.d.ts +2 -2
  17. package/dist/flows/moRedirFlow.d.ts +2 -2
  18. package/dist/flows/oneClickFlow.d.ts +2 -2
  19. package/dist/flows/pinFlow.d.ts +2 -2
  20. package/dist/flows/pinFlow.js +2 -0
  21. package/dist/flows/strategy.d.ts +8 -8
  22. package/dist/flows/ussdFlow.d.ts +2 -2
  23. package/dist/ips/tryGetIPRangeName.d.ts +1 -1
  24. package/dist/ips/tryGetIPRangeName.js +7 -5
  25. package/dist/jest.config.js +1 -1
  26. package/dist/pacman/index.d.ts +2 -2
  27. package/dist/pacman/index.js +41 -41
  28. package/dist/pacman/queryString.js +11 -9
  29. package/dist/reducers/click2smsFlow/Click2smsTypes.d.ts +19 -19
  30. package/dist/reducers/click2smsFlow/IClick2smsConstants.d.ts +1 -1
  31. package/dist/reducers/click2smsFlow/index.d.ts +2 -2
  32. package/dist/reducers/click2smsFlow/index.js +24 -24
  33. package/dist/reducers/click2smsFlow/utils.d.ts +1 -1
  34. package/dist/reducers/click2smsFlow/utils.js +30 -30
  35. package/dist/reducers/moFlow/IMoConstants.d.ts +1 -1
  36. package/dist/reducers/moFlow/MoTypes.d.ts +13 -13
  37. package/dist/reducers/moFlow/index.d.ts +3 -3
  38. package/dist/reducers/moFlow/index.js +27 -27
  39. package/dist/reducers/moFlow/utils.d.ts +1 -2
  40. package/dist/reducers/moFlow/utils.js +28 -26
  41. package/dist/reducers/moRedirFlow/IMoRedirConstants.d.ts +1 -1
  42. package/dist/reducers/moRedirFlow/MoRedirTypes.d.ts +13 -13
  43. package/dist/reducers/moRedirFlow/index.d.ts +3 -3
  44. package/dist/reducers/moRedirFlow/index.js +27 -27
  45. package/dist/reducers/moRedirFlow/utils.d.ts +1 -1
  46. package/dist/reducers/moRedirFlow/utils.js +17 -17
  47. package/dist/reducers/oneClickFlow/IOneClickConstants.d.ts +1 -1
  48. package/dist/reducers/oneClickFlow/OneClickTypes.d.ts +10 -10
  49. package/dist/reducers/oneClickFlow/index.d.ts +3 -3
  50. package/dist/reducers/oneClickFlow/index.js +75 -68
  51. package/dist/reducers/oneClickFlow/utils.d.ts +2 -2
  52. package/dist/reducers/oneClickFlow/utils.js +70 -69
  53. package/dist/reducers/pinFlow/IPinConstants.d.ts +1 -1
  54. package/dist/reducers/pinFlow/PinTypes.d.ts +24 -23
  55. package/dist/reducers/pinFlow/index.d.ts +3 -3
  56. package/dist/reducers/pinFlow/index.js +76 -76
  57. package/dist/reducers/pinFlow/utils.d.ts +1 -1
  58. package/dist/reducers/pinFlow/utils.js +61 -65
  59. package/dist/reducers/strategy/IStategyActionContants.d.ts +1 -1
  60. package/dist/reducers/strategy/StrategyTypes.d.ts +56 -56
  61. package/dist/reducers/strategy/index.d.ts +2 -2
  62. package/dist/reducers/strategy/index.js +99 -99
  63. package/dist/reducers/strategy/strategies/ask_mobile_number.d.ts +3 -2
  64. package/dist/reducers/strategy/strategies/ask_mobile_number.js +132 -74
  65. package/dist/reducers/strategy/strategies/ask_operator.d.ts +2 -2
  66. package/dist/reducers/strategy/strategies/ask_operator.js +64 -68
  67. package/dist/reducers/strategy/strategies/detect_operator_by_ip.d.ts +2 -2
  68. package/dist/reducers/strategy/strategies/detect_operator_by_ip.js +97 -97
  69. package/dist/reducers/strategy/strategies/header_enrichment.d.ts +2 -2
  70. package/dist/reducers/strategy/strategies/header_enrichment.js +116 -120
  71. package/dist/reducers/strategy/utils.d.ts +3 -3
  72. package/dist/reducers/strategy/utils.js +115 -111
  73. package/dist/reducers/ussdFlow/IUssdConstants.d.ts +1 -1
  74. package/dist/reducers/ussdFlow/UssdTypes.d.ts +13 -13
  75. package/dist/reducers/ussdFlow/index.d.ts +3 -3
  76. package/dist/reducers/ussdFlow/index.js +27 -27
  77. package/dist/reducers/ussdFlow/utils.d.ts +1 -2
  78. package/dist/reducers/ussdFlow/utils.js +19 -17
  79. package/dist/store/index.d.ts +8 -8
  80. package/dist/store/index.js +87 -83
  81. package/dist/store/reducers.d.ts +7 -7
  82. package/dist/store/reducers.js +4 -4
  83. package/dist/utilities/handleSubmitNumber.d.ts +7 -3
  84. package/dist/utilities/handleSubmitNumber.js +15 -18
  85. package/dist/utilities/index.d.ts +1 -1
  86. package/dist/utilities/index.js +13 -11
  87. package/dist/utilities/loadScriptInnerHtml.js +0 -1
  88. package/index.html +21 -28
  89. package/mockData/config.json +1 -1
  90. package/package.json +23 -15
  91. package/setupJest.js +1 -1
  92. package/tsconfig.json +2 -2
  93. package/dist/api/click2sms.js +0 -357
  94. package/dist/api/mo.js +0 -274
  95. package/dist/api/moRedir.js +0 -186
  96. package/dist/api/oneClick.js +0 -366
  97. package/dist/api/pin.js +0 -493
  98. package/dist/api/strategies.js +0 -704
  99. package/dist/api/ussd.js +0 -1
  100. package/dist/app/store.js +0 -35
  101. package/dist/features/strategies/categories/askMobileNumber.js +0 -395
  102. package/dist/features/strategies/categories/askOperator.js +0 -311
  103. package/dist/features/strategies/categories/detectOperatorByIp.js +0 -606
  104. package/dist/features/strategies/categories/headerEnrichment.js +0 -670
  105. package/dist/features/strategies/categories/typings/click2smsSliceTypes.js +0 -12
  106. package/dist/features/strategies/categories/typings/identifySliceTypes.js +0 -22
  107. package/dist/features/strategies/categories/typings/moFlowSliceTypes.js +0 -22
  108. package/dist/features/strategies/categories/typings/moRedirFlowSliceTypes.js +0 -21
  109. package/dist/features/strategies/categories/typings/oneClickSliceTypes.js +0 -13
  110. package/dist/features/strategies/categories/typings/pinFlowSliceTypes.js +0 -13
  111. package/dist/features/strategies/click2smsFlowSlice.js +0 -172
  112. package/dist/features/strategies/identifySlice.js +0 -455
  113. package/dist/features/strategies/moFlowSlice.js +0 -196
  114. package/dist/features/strategies/moRedirFlowSlice.js +0 -190
  115. package/dist/features/strategies/oneClickFlowSlice.js +0 -277
  116. package/dist/features/strategies/pinFlowSlice.js +0 -313
  117. package/dist/features/strategies/ussdFlowSlice.js +0 -1
  118. package/dist/flows/tpayHeFlow.d.ts +0 -7
  119. package/dist/flows/tpayHeFlow.js +0 -23
  120. package/dist/mockServer/browser.js +0 -48
  121. package/dist/mockServer/handlers.js +0 -22
  122. package/dist/mockServer/server.js +0 -48
  123. package/dist/reducers/tpayHeFlow/ITpayHeConstants.d.ts +0 -2
  124. package/dist/reducers/tpayHeFlow/ITpayHeConstants.js +0 -1
  125. package/dist/reducers/tpayHeFlow/TpayHeTypes.d.ts +0 -114
  126. package/dist/reducers/tpayHeFlow/TpayHeTypes.js +0 -1
  127. package/dist/reducers/tpayHeFlow/index.d.ts +0 -7
  128. package/dist/reducers/tpayHeFlow/index.js +0 -331
  129. package/dist/reducers/tpayHeFlow/utils.d.ts +0 -20
  130. package/dist/reducers/tpayHeFlow/utils.js +0 -510
  131. package/dist/test/setup.js +0 -24
  132. package/dist/test/test-utils.js +0 -51
  133. package/prettier.config.js +0 -7
  134. package/src/@types/react-tracker.d.ts +0 -16
  135. package/src/@types/redux-cli-logger.d.ts +0 -1
  136. package/src/@types/tiny-async-pool.d.ts +0 -3
  137. package/src/@types/window.d.ts +0 -74
  138. package/src/api/index.ts +0 -225
  139. package/src/common-types/AppThunk.ts +0 -19
  140. package/src/common-types/Either.ts +0 -3
  141. package/src/common-types/IError.ts +0 -5
  142. package/src/common-types/IOptInFlowName.ts +0 -1
  143. package/src/common-types/ITracker.ts +0 -10
  144. package/src/common-types/IVisitor.ts +0 -16
  145. package/src/common-types/RemoteDataState.ts +0 -88
  146. package/src/flows/click2smsFlow.ts +0 -18
  147. package/src/flows/moFlow.ts +0 -20
  148. package/src/flows/moRedirFlow.ts +0 -20
  149. package/src/flows/oneClickFlow.ts +0 -20
  150. package/src/flows/pinFlow.ts +0 -25
  151. package/src/flows/strategy.ts +0 -51
  152. package/src/flows/ussdFlow.ts +0 -20
  153. package/src/index.ts +0 -3
  154. package/src/ips/tryGetIPRangeName.ts +0 -22
  155. package/src/jest.config.js +0 -194
  156. package/src/pacman/index.ts +0 -71
  157. package/src/pacman/queryString.ts +0 -24
  158. package/src/reducers/click2smsFlow/Click2smsTypes.ts +0 -93
  159. package/src/reducers/click2smsFlow/IClick2smsConstants.ts +0 -4
  160. package/src/reducers/click2smsFlow/index.ts +0 -105
  161. package/src/reducers/click2smsFlow/utils.ts +0 -126
  162. package/src/reducers/moFlow/IMoConstants.ts +0 -7
  163. package/src/reducers/moFlow/MoTypes.ts +0 -125
  164. package/src/reducers/moFlow/index.ts +0 -150
  165. package/src/reducers/moFlow/utils.ts +0 -135
  166. package/src/reducers/moRedirFlow/IMoRedirConstants.ts +0 -7
  167. package/src/reducers/moRedirFlow/MoRedirTypes.ts +0 -99
  168. package/src/reducers/moRedirFlow/index.ts +0 -137
  169. package/src/reducers/moRedirFlow/utils.ts +0 -78
  170. package/src/reducers/oneClickFlow/IOneClickConstants.ts +0 -3
  171. package/src/reducers/oneClickFlow/OneClickTypes.ts +0 -108
  172. package/src/reducers/oneClickFlow/index.ts +0 -268
  173. package/src/reducers/oneClickFlow/utils.ts +0 -217
  174. package/src/reducers/pinFlow/IPinConstants.ts +0 -9
  175. package/src/reducers/pinFlow/PinTypes.ts +0 -189
  176. package/src/reducers/pinFlow/index.ts +0 -331
  177. package/src/reducers/pinFlow/utils.ts +0 -232
  178. package/src/reducers/strategy/IStategyActionContants.ts +0 -17
  179. package/src/reducers/strategy/StrategyTypes.ts +0 -375
  180. package/src/reducers/strategy/index.ts +0 -321
  181. package/src/reducers/strategy/strategies/ask_mobile_number.ts +0 -316
  182. package/src/reducers/strategy/strategies/ask_operator.ts +0 -195
  183. package/src/reducers/strategy/strategies/detect_operator_by_ip.ts +0 -414
  184. package/src/reducers/strategy/strategies/header_enrichment.ts +0 -489
  185. package/src/reducers/strategy/utils.ts +0 -357
  186. package/src/reducers/ussdFlow/IUssdConstants.ts +0 -7
  187. package/src/reducers/ussdFlow/UssdTypes.ts +0 -112
  188. package/src/reducers/ussdFlow/index.ts +0 -146
  189. package/src/reducers/ussdFlow/utils.ts +0 -88
  190. package/src/store/index.ts +0 -150
  191. package/src/store/reducers.ts +0 -37
  192. package/src/utilities/handleSubmitNumber.ts +0 -65
  193. package/src/utilities/index.ts +0 -114
  194. package/src/utilities/loadScriptInnerHtml.ts +0 -14
  195. package/src/utilities/loadScriptSrc.ts +0 -26
@@ -48,14 +48,14 @@ require("core-js/modules/es.regexp.to-string.js");
48
48
 
49
49
  require("core-js/modules/es.promise.js");
50
50
 
51
- var RDS = _interopRequireWildcard(require("../../../common-types/RemoteDataState"));
52
-
53
- var _utils = require("../utils");
54
-
55
51
  var _ = require("..");
56
52
 
53
+ var RDS = _interopRequireWildcard(require("../../../common-types/RemoteDataState"));
54
+
57
55
  var _tryGetIPRangeName = _interopRequireDefault(require("../../../ips/tryGetIPRangeName"));
58
56
 
57
+ var _utils = require("../utils");
58
+
59
59
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
60
60
 
61
61
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -72,9 +72,9 @@ function identify_user() {
72
72
  return function (dispatch) {
73
73
  try {
74
74
  dispatch({
75
- type: "HE_IDENTIFY",
75
+ type: 'HE_IDENTIFY',
76
76
  payload: {
77
- type: "HE_IDENTIFY",
77
+ type: 'HE_IDENTIFY',
78
78
  result: RDS.Loading()
79
79
  }
80
80
  });
@@ -86,23 +86,23 @@ function identify_user() {
86
86
  var defaultFlow = strategyConfigs.default;
87
87
 
88
88
  switch (strategy) {
89
- case "pin-header-enrichment":
89
+ case 'pin-header-enrichment':
90
90
  return dispatch(pin_header_enrichment(defaultFlow));
91
91
 
92
- case "he-pin-mo-redir-header-enrichment":
92
+ case 'he-pin-mo-redir-header-enrichment':
93
93
  return dispatch(he_pin_mo_redir_header_enrichment(defaultFlow));
94
94
 
95
- case "he-pin-one-click-header-enrichment":
95
+ case 'he-pin-one-click-header-enrichment':
96
96
  return dispatch(he_pin_one_click_header_enrichment(defaultFlow));
97
97
 
98
- case "he-mo-redir-one-click-header-enrichment":
98
+ case 'he-mo-redir-one-click-header-enrichment':
99
99
  return dispatch(he_mo_redir_one_click_header_enrichment(defaultFlow));
100
100
  }
101
101
  } catch (err) {
102
102
  dispatch({
103
- type: "HE_IDENTIFY",
103
+ type: 'HE_IDENTIFY',
104
104
  payload: {
105
- type: "HE_IDENTIFY",
105
+ type: 'HE_IDENTIFY',
106
106
  result: RDS.Failure(err)
107
107
  }
108
108
  });
@@ -124,21 +124,21 @@ 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);
127
+ console.log('ipRangeName', ipRangeName);
128
128
 
129
129
  if (!(ipRangeName == null)) {
130
130
  _context.next = 8;
131
131
  break;
132
132
  }
133
133
 
134
- _.tracker.sendOptInFlowEvent("Pin");
134
+ _.tracker.sendOptInFlowEvent('Pin');
135
135
 
136
136
  return _context.abrupt("return", dispatch({
137
- type: "IDENTIFY_FLOW_BY_HE",
137
+ type: 'IDENTIFY_FLOW_BY_HE',
138
138
  payload: {
139
- type: "PIN",
139
+ type: 'PIN',
140
140
  result: {
141
- nextAction: "submitMSISDNAction",
141
+ nextAction: 'submitMSISDNAction',
142
142
  config: defaultFlow.flowConfig
143
143
  }
144
144
  }
@@ -152,8 +152,8 @@ var pin_header_enrichment = function pin_header_enrichment(defaultFlow) {
152
152
  heResult = _context.sent;
153
153
  flowObj = defaultFlow;
154
154
 
155
- if (!(heResult.msisdn !== undefined && heResult.msisdn !== "")) {
156
- _context.next = 20;
155
+ if (!(heResult.msisdn !== undefined && heResult.msisdn !== '')) {
156
+ _context.next = 18;
157
157
  break;
158
158
  }
159
159
 
@@ -164,14 +164,14 @@ var pin_header_enrichment = function pin_header_enrichment(defaultFlow) {
164
164
  msisdn: msisdn
165
165
  });
166
166
 
167
- _.tracker.sendOptInFlowEvent("Hybrid Pin");
167
+ _.tracker.sendOptInFlowEvent('Hybrid Pin');
168
168
 
169
169
  return _context.abrupt("return", dispatch({
170
- type: "IDENTIFY_FLOW_BY_HE",
170
+ type: 'IDENTIFY_FLOW_BY_HE',
171
171
  payload: {
172
- type: "PIN",
172
+ type: 'PIN',
173
173
  result: {
174
- nextAction: "submitMSISDNAction",
174
+ nextAction: 'submitMSISDNAction',
175
175
  config: flowObj.flowConfig,
176
176
  msisdn: msisdn,
177
177
  rockman_id: flowObj.rockman_id,
@@ -180,26 +180,22 @@ var pin_header_enrichment = function pin_header_enrichment(defaultFlow) {
180
180
  }
181
181
  }));
182
182
 
183
- case 20:
184
- _.tracker.sendOptInFlowEvent("Pin");
183
+ case 18:
184
+ _.tracker.sendOptInFlowEvent('Pin');
185
185
 
186
186
  return _context.abrupt("return", dispatch({
187
- type: "IDENTIFY_FLOW_BY_HE",
187
+ type: 'IDENTIFY_FLOW_BY_HE',
188
188
  payload: {
189
- type: "PIN",
189
+ type: 'PIN',
190
190
  result: {
191
- nextAction: "submitMSISDNAction",
191
+ nextAction: 'submitMSISDNAction',
192
192
  config: flowObj.flowConfig
193
193
  }
194
194
  }
195
195
  }));
196
196
 
197
197
  case 22:
198
- _context.next = 30;
199
- break;
200
-
201
- case 24:
202
- _context.prev = 24;
198
+ _context.prev = 22;
203
199
  _context.t0 = _context["catch"](0);
204
200
  console.warn(_context.t0);
205
201
 
@@ -207,25 +203,25 @@ var pin_header_enrichment = function pin_header_enrichment(defaultFlow) {
207
203
  errorType: _context.t0.toString()
208
204
  });
209
205
 
210
- _.tracker.sendOptInFlowEvent("Pin");
206
+ _.tracker.sendOptInFlowEvent('Pin');
211
207
 
212
208
  dispatch({
213
- type: "IDENTIFY_FLOW_BY_HE",
209
+ type: 'IDENTIFY_FLOW_BY_HE',
214
210
  payload: {
215
- type: "PIN",
211
+ type: 'PIN',
216
212
  result: {
217
- nextAction: "submitMSISDNAction",
213
+ nextAction: 'submitMSISDNAction',
218
214
  config: defaultFlow.flowConfig
219
215
  }
220
216
  }
221
217
  });
222
218
 
223
- case 30:
219
+ case 28:
224
220
  case "end":
225
221
  return _context.stop();
226
222
  }
227
223
  }
228
- }, _callee, null, [[0, 24]]);
224
+ }, _callee, null, [[0, 22]]);
229
225
  }));
230
226
 
231
227
  return function (_x) {
@@ -251,18 +247,18 @@ var he_pin_one_click_header_enrichment = function he_pin_one_click_header_enrich
251
247
  operator = _ref3.operator,
252
248
  subscription_url = _ref3.subscription_url,
253
249
  redirect_url = _ref3.redirect_url;
254
- var isHeaderEnrichmentSuccess = msisdn !== undefined && msisdn !== "" ? true : false;
250
+ var isHeaderEnrichmentSuccess = !!(msisdn !== undefined && msisdn !== '');
255
251
 
256
252
  switch (flowObj.flow) {
257
- case "oneClick":
258
- _.tracker.sendOptInFlowEvent("3G click");
253
+ case 'oneClick':
254
+ _.tracker.sendOptInFlowEvent('3G click');
259
255
 
260
256
  return dispatch({
261
- type: "IDENTIFY_FLOW_BY_HE",
257
+ type: 'IDENTIFY_FLOW_BY_HE',
262
258
  payload: {
263
- type: "ONE_CLICK",
259
+ type: 'ONE_CLICK',
264
260
  result: {
265
- nextAction: "getRedirectUrlAction",
261
+ nextAction: 'getRedirectUrlAction',
266
262
  config: flowObj.flowConfig,
267
263
  operator: flowObj.operator,
268
264
  subscription_url: subscription_url || null,
@@ -271,19 +267,19 @@ var he_pin_one_click_header_enrichment = function he_pin_one_click_header_enrich
271
267
  }
272
268
  });
273
269
 
274
- case "pin":
270
+ case 'pin':
275
271
  if (isHeaderEnrichmentSuccess == true) {
276
- _.tracker.sendOptInFlowEvent("Hybrid Pin");
272
+ _.tracker.sendOptInFlowEvent('Hybrid Pin');
277
273
  } else {
278
- _.tracker.sendOptInFlowEvent("Pin");
274
+ _.tracker.sendOptInFlowEvent('Pin');
279
275
  }
280
276
 
281
277
  return dispatch({
282
- type: "IDENTIFY_FLOW_BY_HE",
278
+ type: 'IDENTIFY_FLOW_BY_HE',
283
279
  payload: {
284
- type: "PIN",
280
+ type: 'PIN',
285
281
  result: {
286
- nextAction: "submitMSISDNAction",
282
+ nextAction: 'submitMSISDNAction',
287
283
  config: flowObj.flowConfig,
288
284
  msisdn: msisdn,
289
285
  rockman_id: flowObj.rockman_id,
@@ -294,14 +290,14 @@ var he_pin_one_click_header_enrichment = function he_pin_one_click_header_enrich
294
290
  });
295
291
 
296
292
  default:
297
- _.tracker.sendOptInFlowEvent("Pin");
293
+ _.tracker.sendOptInFlowEvent('Pin');
298
294
 
299
295
  return dispatch({
300
- type: "IDENTIFY_FLOW_BY_HE",
296
+ type: 'IDENTIFY_FLOW_BY_HE',
301
297
  payload: {
302
- type: "PIN",
298
+ type: 'PIN',
303
299
  result: {
304
- nextAction: "submitMSISDNAction",
300
+ nextAction: 'submitMSISDNAction',
305
301
  config: defaultFlow.flowConfig,
306
302
  rockman_id: defaultFlow.rockman_id
307
303
  }
@@ -321,14 +317,14 @@ var he_pin_one_click_header_enrichment = function he_pin_one_click_header_enrich
321
317
  break;
322
318
  }
323
319
 
324
- _.tracker.sendOptInFlowEvent("Pin");
320
+ _.tracker.sendOptInFlowEvent('Pin');
325
321
 
326
322
  return _context2.abrupt("return", dispatch({
327
- type: "IDENTIFY_FLOW_BY_HE",
323
+ type: 'IDENTIFY_FLOW_BY_HE',
328
324
  payload: {
329
- type: "PIN",
325
+ type: 'PIN',
330
326
  result: {
331
- nextAction: "submitMSISDNAction",
327
+ nextAction: 'submitMSISDNAction',
332
328
  config: defaultFlow.flowConfig,
333
329
  rockman_id: defaultFlow.rockman_id
334
330
  }
@@ -339,7 +335,7 @@ var he_pin_one_click_header_enrichment = function he_pin_one_click_header_enrich
339
335
  _context2.prev = 7;
340
336
  flowObj = (0, _utils.determineFlowByOperator)(ipRangeName.toUpperCase());
341
337
 
342
- if (!(flowObj.flow == "oneClick")) {
338
+ if (!(flowObj.flow == 'oneClick')) {
343
339
  _context2.next = 18;
344
340
  break;
345
341
  }
@@ -354,7 +350,7 @@ var he_pin_one_click_header_enrichment = function he_pin_one_click_header_enrich
354
350
  msisdn = heResult.msisdn, subscription_url = heResult.subscription_url, redirect_url = heResult.redirect_url;
355
351
  operator = heResult.operator ? heResult.operator.toUpperCase() : ipRangeName.toUpperCase();
356
352
 
357
- if (msisdn && msisdn !== "") {
353
+ if (msisdn && msisdn !== '') {
358
354
  _.tracker.customEvent('Flow', 'advance-auto', 'msisdn-detected', {
359
355
  msisdn: msisdn
360
356
  });
@@ -381,14 +377,14 @@ var he_pin_one_click_header_enrichment = function he_pin_one_click_header_enrich
381
377
  break;
382
378
 
383
379
  case 18:
384
- _.tracker.sendOptInFlowEvent("Pin");
380
+ _.tracker.sendOptInFlowEvent('Pin');
385
381
 
386
382
  return _context2.abrupt("return", dispatch({
387
- type: "IDENTIFY_FLOW_BY_HE",
383
+ type: 'IDENTIFY_FLOW_BY_HE',
388
384
  payload: {
389
- type: "PIN",
385
+ type: 'PIN',
390
386
  result: {
391
- nextAction: "submitMSISDNAction",
387
+ nextAction: 'submitMSISDNAction',
392
388
  config: defaultFlow.flowConfig,
393
389
  rockman_id: defaultFlow.rockman_id
394
390
  }
@@ -408,14 +404,14 @@ var he_pin_one_click_header_enrichment = function he_pin_one_click_header_enrich
408
404
  errorType: _context2.t0.toString()
409
405
  });
410
406
 
411
- _.tracker.sendOptInFlowEvent("Pin");
407
+ _.tracker.sendOptInFlowEvent('Pin');
412
408
 
413
409
  dispatch({
414
- type: "IDENTIFY_FLOW_BY_HE",
410
+ type: 'IDENTIFY_FLOW_BY_HE',
415
411
  payload: {
416
- type: "PIN",
412
+ type: 'PIN',
417
413
  result: {
418
- nextAction: "submitMSISDNAction",
414
+ nextAction: 'submitMSISDNAction',
419
415
  config: defaultFlow.flowConfig
420
416
  }
421
417
  }
@@ -452,18 +448,18 @@ var he_mo_redir_one_click_header_enrichment = function he_mo_redir_one_click_hea
452
448
  operator = _ref5.operator,
453
449
  subscription_url = _ref5.subscription_url,
454
450
  redirect_url = _ref5.redirect_url;
455
- var isHeaderEnrichmentSuccess = msisdn !== undefined && msisdn !== "" ? true : false;
451
+ var isHeaderEnrichmentSuccess = !!(msisdn !== undefined && msisdn !== '');
456
452
 
457
453
  switch (flowObj.flow) {
458
- case "oneClick":
459
- _.tracker.sendOptInFlowEvent("3G click");
454
+ case 'oneClick':
455
+ _.tracker.sendOptInFlowEvent('3G click');
460
456
 
461
457
  return dispatch({
462
- type: "IDENTIFY_FLOW_BY_HE",
458
+ type: 'IDENTIFY_FLOW_BY_HE',
463
459
  payload: {
464
- type: "ONE_CLICK",
460
+ type: 'ONE_CLICK',
465
461
  result: {
466
- nextAction: "getRedirectUrlAction",
462
+ nextAction: 'getRedirectUrlAction',
467
463
  config: flowObj.flowConfig,
468
464
  operator: flowObj.operator,
469
465
  subscription_url: subscription_url || null,
@@ -472,15 +468,15 @@ var he_mo_redir_one_click_header_enrichment = function he_mo_redir_one_click_hea
472
468
  }
473
469
  });
474
470
 
475
- case "moRedir":
476
- _.tracker.sendOptInFlowEvent("Redirect");
471
+ case 'moRedir':
472
+ _.tracker.sendOptInFlowEvent('Redirect');
477
473
 
478
474
  return dispatch({
479
- type: "IDENTIFY_FLOW_BY_HE",
475
+ type: 'IDENTIFY_FLOW_BY_HE',
480
476
  payload: {
481
- type: "MO_REDIR",
477
+ type: 'MO_REDIR',
482
478
  result: {
483
- nextAction: "submitMSISDNAction",
479
+ nextAction: 'submitMSISDNAction',
484
480
  config: flowObj.flowConfig,
485
481
  msisdn: msisdn,
486
482
  rockman_id: flowObj.rockman_id,
@@ -491,14 +487,14 @@ var he_mo_redir_one_click_header_enrichment = function he_mo_redir_one_click_hea
491
487
  });
492
488
 
493
489
  default:
494
- _.tracker.sendOptInFlowEvent("Redirect");
490
+ _.tracker.sendOptInFlowEvent('Redirect');
495
491
 
496
492
  return dispatch({
497
- type: "IDENTIFY_FLOW_BY_HE",
493
+ type: 'IDENTIFY_FLOW_BY_HE',
498
494
  payload: {
499
- type: "MO_REDIR",
495
+ type: 'MO_REDIR',
500
496
  result: {
501
- nextAction: "submitMSISDNAction",
497
+ nextAction: 'submitMSISDNAction',
502
498
  config: defaultFlow.flowConfig,
503
499
  rockman_id: defaultFlow.rockman_id
504
500
  }
@@ -518,14 +514,14 @@ var he_mo_redir_one_click_header_enrichment = function he_mo_redir_one_click_hea
518
514
  break;
519
515
  }
520
516
 
521
- _.tracker.sendOptInFlowEvent("Redirect");
517
+ _.tracker.sendOptInFlowEvent('Redirect');
522
518
 
523
519
  return _context3.abrupt("return", dispatch({
524
- type: "IDENTIFY_FLOW_BY_HE",
520
+ type: 'IDENTIFY_FLOW_BY_HE',
525
521
  payload: {
526
- type: "MO_REDIR",
522
+ type: 'MO_REDIR',
527
523
  result: {
528
- nextAction: "submitMSISDNAction",
524
+ nextAction: 'submitMSISDNAction',
529
525
  config: defaultFlow.flowConfig,
530
526
  rockman_id: defaultFlow.rockman_id
531
527
  }
@@ -536,7 +532,7 @@ var he_mo_redir_one_click_header_enrichment = function he_mo_redir_one_click_hea
536
532
  _context3.prev = 7;
537
533
  flowObj = (0, _utils.determineFlowByOperator)(ipRangeName.toUpperCase());
538
534
 
539
- if (!(flowObj.flow == "oneClick")) {
535
+ if (!(flowObj.flow == 'oneClick')) {
540
536
  _context3.next = 18;
541
537
  break;
542
538
  }
@@ -551,7 +547,7 @@ var he_mo_redir_one_click_header_enrichment = function he_mo_redir_one_click_hea
551
547
  msisdn = heResult.msisdn, subscription_url = heResult.subscription_url, redirect_url = heResult.redirect_url;
552
548
  operator = heResult.operator ? heResult.operator.toUpperCase() : ipRangeName.toUpperCase();
553
549
 
554
- if (msisdn && msisdn !== "") {
550
+ if (msisdn && msisdn !== '') {
555
551
  _.tracker.customEvent('Flow', 'advance-auto', 'msisdn-detected', {
556
552
  msisdn: msisdn
557
553
  });
@@ -578,14 +574,14 @@ var he_mo_redir_one_click_header_enrichment = function he_mo_redir_one_click_hea
578
574
  break;
579
575
 
580
576
  case 18:
581
- _.tracker.sendOptInFlowEvent("Redirect");
577
+ _.tracker.sendOptInFlowEvent('Redirect');
582
578
 
583
579
  return _context3.abrupt("return", dispatch({
584
- type: "IDENTIFY_FLOW_BY_HE",
580
+ type: 'IDENTIFY_FLOW_BY_HE',
585
581
  payload: {
586
- type: "MO_REDIR",
582
+ type: 'MO_REDIR',
587
583
  result: {
588
- nextAction: "submitMSISDNAction",
584
+ nextAction: 'submitMSISDNAction',
589
585
  config: defaultFlow.flowConfig,
590
586
  rockman_id: defaultFlow.rockman_id
591
587
  }
@@ -605,14 +601,14 @@ var he_mo_redir_one_click_header_enrichment = function he_mo_redir_one_click_hea
605
601
  errorType: _context3.t0.toString()
606
602
  });
607
603
 
608
- _.tracker.sendOptInFlowEvent("Redirect");
604
+ _.tracker.sendOptInFlowEvent('Redirect');
609
605
 
610
606
  dispatch({
611
- type: "IDENTIFY_FLOW_BY_HE",
607
+ type: 'IDENTIFY_FLOW_BY_HE',
612
608
  payload: {
613
- type: "MO_REDIR",
609
+ type: 'MO_REDIR',
614
610
  result: {
615
- nextAction: "submitMSISDNAction",
611
+ nextAction: 'submitMSISDNAction',
616
612
  config: defaultFlow.flowConfig
617
613
  }
618
614
  }
@@ -644,18 +640,18 @@ var he_pin_mo_redir_header_enrichment = function he_pin_mo_redir_header_enrichme
644
640
  switch (_context4.prev = _context4.next) {
645
641
  case 0:
646
642
  switchState = function switchState(flowObj, msisdn, operator) {
647
- var isHeaderEnrichmentSuccess = msisdn !== undefined && msisdn !== "" ? true : false;
643
+ var isHeaderEnrichmentSuccess = !!(msisdn !== undefined && msisdn !== '');
648
644
 
649
645
  switch (flowObj.flow) {
650
- case "moRedir":
651
- _.tracker.sendOptInFlowEvent("Redirect");
646
+ case 'moRedir':
647
+ _.tracker.sendOptInFlowEvent('Redirect');
652
648
 
653
649
  return dispatch({
654
- type: "IDENTIFY_FLOW_BY_HE",
650
+ type: 'IDENTIFY_FLOW_BY_HE',
655
651
  payload: {
656
- type: "MO_REDIR",
652
+ type: 'MO_REDIR',
657
653
  result: {
658
- nextAction: "submitMSISDNAction",
654
+ nextAction: 'submitMSISDNAction',
659
655
  config: flowObj.flowConfig,
660
656
  msisdn: msisdn,
661
657
  rockman_id: flowObj.rockman_id,
@@ -665,19 +661,19 @@ var he_pin_mo_redir_header_enrichment = function he_pin_mo_redir_header_enrichme
665
661
  }
666
662
  });
667
663
 
668
- case "pin":
664
+ case 'pin':
669
665
  if (isHeaderEnrichmentSuccess == true) {
670
- _.tracker.sendOptInFlowEvent("Hybrid Pin");
666
+ _.tracker.sendOptInFlowEvent('Hybrid Pin');
671
667
  } else {
672
- _.tracker.sendOptInFlowEvent("Pin");
668
+ _.tracker.sendOptInFlowEvent('Pin');
673
669
  }
674
670
 
675
671
  return dispatch({
676
- type: "IDENTIFY_FLOW_BY_HE",
672
+ type: 'IDENTIFY_FLOW_BY_HE',
677
673
  payload: {
678
- type: "PIN",
674
+ type: 'PIN',
679
675
  result: {
680
- nextAction: "submitMSISDNAction",
676
+ nextAction: 'submitMSISDNAction',
681
677
  config: flowObj.flowConfig,
682
678
  msisdn: msisdn,
683
679
  rockman_id: flowObj.rockman_id,
@@ -688,14 +684,14 @@ var he_pin_mo_redir_header_enrichment = function he_pin_mo_redir_header_enrichme
688
684
  });
689
685
 
690
686
  default:
691
- _.tracker.sendOptInFlowEvent("Pin");
687
+ _.tracker.sendOptInFlowEvent('Pin');
692
688
 
693
689
  return dispatch({
694
- type: "IDENTIFY_FLOW_BY_HE",
690
+ type: 'IDENTIFY_FLOW_BY_HE',
695
691
  payload: {
696
- type: "PIN",
692
+ type: 'PIN',
697
693
  result: {
698
- nextAction: "submitMSISDNAction",
694
+ nextAction: 'submitMSISDNAction',
699
695
  config: defaultFlow.flowConfig,
700
696
  rockman_id: defaultFlow.rockman_id
701
697
  }
@@ -711,7 +707,7 @@ var he_pin_mo_redir_header_enrichment = function he_pin_mo_redir_header_enrichme
711
707
  case 4:
712
708
  heResult = _context4.sent;
713
709
 
714
- if (!(heResult.msisdn !== undefined && heResult.msisdn !== "")) {
710
+ if (!(heResult.msisdn !== undefined && heResult.msisdn !== '')) {
715
711
  _context4.next = 20;
716
712
  break;
717
713
  }
@@ -723,7 +719,7 @@ var he_pin_mo_redir_header_enrichment = function he_pin_mo_redir_header_enrichme
723
719
  msisdn: msisdn
724
720
  });
725
721
 
726
- if (!(!!operator && operator !== "")) {
722
+ if (!(!!operator && operator !== '')) {
727
723
  _context4.next = 14;
728
724
  break;
729
725
  }
@@ -781,14 +777,14 @@ var he_pin_mo_redir_header_enrichment = function he_pin_mo_redir_header_enrichme
781
777
  _context4.t1 = _context4["catch"](30);
782
778
  console.warn(_context4.t1);
783
779
 
784
- _.tracker.sendOptInFlowEvent("Pin");
780
+ _.tracker.sendOptInFlowEvent('Pin');
785
781
 
786
782
  dispatch({
787
- type: "IDENTIFY_FLOW_BY_HE",
783
+ type: 'IDENTIFY_FLOW_BY_HE',
788
784
  payload: {
789
- type: "PIN",
785
+ type: 'PIN',
790
786
  result: {
791
- nextAction: "submitMSISDNAction",
787
+ nextAction: 'submitMSISDNAction',
792
788
  config: defaultFlow.flowConfig
793
789
  }
794
790
  }
@@ -1,6 +1,6 @@
1
- import { IStrategy, IFlow, IStrategyReducerState, IConfig } from "./StrategyTypes";
2
- import { ILinkExtraParams } from "../oneClickFlow/OneClickTypes";
3
- import Either from "../../common-types/Either";
1
+ import Either from '../../common-types/Either';
2
+ import { ILinkExtraParams } from '../oneClickFlow/OneClickTypes';
3
+ import { IConfig, IFlow, IStrategy, IStrategyReducerState } from './StrategyTypes';
4
4
  export declare const wait: (ms: number) => Promise<unknown>;
5
5
  export declare const loop: <I extends {}, R extends {}>(f: () => Promise<R>, max: number, stop: (r: R) => boolean, i: number) => Promise<R>;
6
6
  export declare function right<L, R>(r: R): Either<L, R>;