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
@@ -70,10 +70,10 @@ require("core-js/modules/es.array.find.js");
70
70
 
71
71
  var RDS = _interopRequireWildcard(require("../../common-types/RemoteDataState"));
72
72
 
73
- var _utils = require("../strategy/utils");
74
-
75
73
  var _loadScriptInnerHtml = _interopRequireDefault(require("../../utilities/loadScriptInnerHtml"));
76
74
 
75
+ var _utils = require("../strategy/utils");
76
+
77
77
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
78
78
 
79
79
  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); }
@@ -107,17 +107,17 @@ function _submitMSISDN() {
107
107
  offer: window.pac_analytics.visitor.offer
108
108
  }, maybeConfig || {});
109
109
 
110
- if (!(true == config.automaticallySubmitAllOperators && !!config.operators && config.operators.length > 0)) {
111
- _context.next = 5;
110
+ if (!(config.automaticallySubmitAllOperators == true && !!config.operators && config.operators.length > 0)) {
111
+ _context.next = 3;
112
112
  break;
113
113
  }
114
114
 
115
115
  return _context.abrupt("return", submitMSISDNForMultipleOperators(window, config, internationalMSISDN, config.operators, extraParams));
116
116
 
117
- case 5:
117
+ case 3:
118
118
  return _context.abrupt("return", submitMSISDNOnce(window, config, internationalMSISDN, extraParams));
119
119
 
120
- case 6:
120
+ case 4:
121
121
  case "end":
122
122
  return _context.stop();
123
123
  }
@@ -131,7 +131,7 @@ var bupperizeCountry = function bupperizeCountry(c) {
131
131
  return c == 'gb' ? 'uk' : c;
132
132
  };
133
133
 
134
- var uniqidResult = "";
134
+ var uniqidResult = '';
135
135
 
136
136
  function loadMcpShield(_x5, _x6) {
137
137
  return _loadMcpShield.apply(this, arguments);
@@ -154,7 +154,7 @@ function _loadMcpShield() {
154
154
  case 6:
155
155
  mcpShieldResult = _context2.sent;
156
156
 
157
- if (!(false == mcpShieldResult.success)) {
157
+ if (!(mcpShieldResult.success == false)) {
158
158
  _context2.next = 11;
159
159
  break;
160
160
  }
@@ -204,21 +204,21 @@ function _submitMSISDNOnce() {
204
204
  }
205
205
 
206
206
  submissionError = new Error("Error in submitMSISDN() trigger-pin action");
207
- submissionError['type'] = "InvalidMSISDN";
207
+ submissionError.type = 'InvalidMSISDN';
208
208
  throw submissionError;
209
209
 
210
210
  case 4:
211
- msisdn = !!extraParams && extraParams["skip-validation"] === "1" //Special case Digital Virgo sents encrypted msisdn we dont need to validate is
211
+ msisdn = !!extraParams && extraParams['skip-validation'] === '1' // Special case Digital Virgo sents encrypted msisdn we dont need to validate is
212
212
  ? internationalMSISDN : internationalMSISDN.match(/\d+/gi).join(''); // tallyman API expects international msisdn without any special character
213
213
 
214
214
  rockmanId = window.pac_analytics.visitor.rockmanId; // HARDCODING This for now if the concerpt works we move this to configs
215
215
 
216
216
  supportedSlugs = {
217
- "kuwait-agency-mix-gamezone-puzzle1": "kuwait-agency-mix-gamezone-puzzle1",
218
- "kuwait-agency-mix-yourspot-riddles": "kuwait-agency-mix-yourspot-riddles"
217
+ 'kuwait-agency-mix-gamezone-puzzle1': 'kuwait-agency-mix-gamezone-puzzle1',
218
+ 'kuwait-agency-mix-yourspot-riddles': 'kuwait-agency-mix-yourspot-riddles'
219
219
  };
220
220
 
221
- if (!(config.country.toLowerCase() == "k2" && supportedSlugs[config.slug])) {
221
+ if (!(config.country.toLowerCase() == 'k2' && supportedSlugs[config.slug])) {
222
222
  _context3.next = 12;
223
223
  break;
224
224
  }
@@ -229,48 +229,48 @@ function _submitMSISDNOnce() {
229
229
  case 10:
230
230
  identifiedUser = _context3.sent;
231
231
 
232
- if (identifiedUser.operator && identifiedUser.operator == "K2_ZAIN") {
233
- window.hostCountry = "KW";
234
- window.hostSlug = "kw-mt2-hosted-flow-mobfun";
232
+ if (identifiedUser.operator && identifiedUser.operator == 'K2_ZAIN') {
233
+ window.hostCountry = 'KW';
234
+ window.hostSlug = 'kw-mt2-hosted-flow-mobfun';
235
235
  config.country = window.hostCountry;
236
236
  config.slug = window.hostSlug;
237
237
  }
238
238
 
239
239
  case 12:
240
240
  slug = config.slug, country = config.country, device = config.device, offer = config.offer, host = config.host;
241
- search = window.location.search.indexOf("redirect-back=1") == -1 ? window.location.search.substr(1) || '' : '';
242
- extraParamsQs = !extraParams ? '' : '&' + Object.keys(extraParams).map(function (k) {
241
+ search = window.location.search.indexOf('redirect-back=1') == -1 ? window.location.search.substr(1) || '' : '';
242
+ extraParamsQs = !extraParams ? '' : "&".concat(Object.keys(extraParams).map(function (k) {
243
243
  return "".concat(k, "=").concat(extraParams[k]);
244
- }).join('&');
245
- uniqid = !!uniqidResult && uniqidResult != "" ? "&mcpUniqid=".concat(uniqidResult) : '';
244
+ }).join('&'));
245
+ uniqid = !!uniqidResult && uniqidResult != '' ? "&mcpUniqid=".concat(uniqidResult) : '';
246
246
  _context3.next = 18;
247
247
  return window.tallymanApi.triggerPin(host, country, slug, device, offer, msisdn, rockmanId, extraParamsQs, search, uniqid);
248
248
 
249
249
  case 18:
250
250
  result = _context3.sent;
251
251
 
252
- if (!(false === result.success)) {
252
+ if (!(result.success === false)) {
253
253
  _context3.next = 27;
254
254
  break;
255
255
  }
256
256
 
257
257
  error = new Error("Error in submitMSISDN() trigger-pin action:\n".concat(result.message));
258
- error['type'] = result.message == 'ALREADY SUBSCRIBED' ? "AlreadySubscribed" : "InvalidMSISDN";
259
- error['productUrl'] = result.product_url ? result.product_url : "";
258
+ error.type = result.message == 'ALREADY SUBSCRIBED' ? 'AlreadySubscribed' : 'InvalidMSISDN';
259
+ error.productUrl = result.product_url ? result.product_url : '';
260
260
  console.error(error);
261
261
  throw error;
262
262
 
263
263
  case 27:
264
264
  kwCodesWithMcpShied = {
265
265
  kw: {
266
- kw_viva: "kw_viva"
266
+ kw_viva: 'kw_viva'
267
267
  },
268
268
  k2: {
269
- k2_viva: "k2_viva"
269
+ k2_viva: 'k2_viva'
270
270
  }
271
271
  };
272
272
 
273
- if (!(country && result.operator && (kwCodesWithMcpShied[country.toLowerCase()] && kwCodesWithMcpShied[country.toLowerCase()][result.operator.toLowerCase()] || country.toLowerCase() == "iq"))) {
273
+ if (!(country && result.operator && (kwCodesWithMcpShied[country.toLowerCase()] && kwCodesWithMcpShied[country.toLowerCase()][result.operator.toLowerCase()] || country.toLowerCase() == 'iq'))) {
274
274
  _context3.next = 39;
275
275
  break;
276
276
  }
@@ -282,7 +282,7 @@ function _submitMSISDNOnce() {
282
282
  case 32:
283
283
  mcpShieldResult = _context3.sent;
284
284
 
285
- if (false == mcpShieldResult.success) {
285
+ if (mcpShieldResult.success == false) {
286
286
  console.warn(mcpShieldResult.message);
287
287
  } else {
288
288
  (0, _loadScriptInnerHtml.default)(mcpShieldResult.source);
@@ -299,7 +299,7 @@ function _submitMSISDNOnce() {
299
299
 
300
300
  case 39:
301
301
  return _context3.abrupt("return", {
302
- type: "SingleMSISDNSubmissionResult",
302
+ type: 'SingleMSISDNSubmissionResult',
303
303
  pin: result.pin,
304
304
  uniqidResult: uniqidResult,
305
305
  operator: result.operator
@@ -366,7 +366,7 @@ function _submitMSISDNForMultipleOperators() {
366
366
 
367
367
  case 2:
368
368
  results = _context5.sent;
369
- //@ts-ignore
369
+ // @ts-ignore
370
370
  alreadySubscribed = results.find(function (r) {
371
371
  return r.type == 'left' && r.value.type == 'AlreadySubscribed';
372
372
  });
@@ -390,7 +390,7 @@ function _submitMSISDNForMultipleOperators() {
390
390
 
391
391
  case 12:
392
392
  return _context5.abrupt("return", {
393
- type: "MultiOperatorMSISDNSubmissionResult"
393
+ type: 'MultiOperatorMSISDNSubmissionResult'
394
394
  });
395
395
 
396
396
  case 13:
@@ -422,9 +422,9 @@ function _submitPIN() {
422
422
 
423
423
  slug = config.slug, country = config.country, device = config.device, host = config.host;
424
424
  offer = window.pac_analytics.visitor.offer;
425
- extraParamsQs = !extraParams ? '' : '&' + Object.keys(extraParams).map(function (k) {
425
+ extraParamsQs = !extraParams ? '' : "&".concat(Object.keys(extraParams).map(function (k) {
426
426
  return "".concat(k, "=").concat(extraParams[k]);
427
- }).join('&');
427
+ }).join('&'));
428
428
  rockmanId = window.pac_analytics.visitor.rockmanId;
429
429
 
430
430
  if (pin) {
@@ -433,35 +433,35 @@ function _submitPIN() {
433
433
  }
434
434
 
435
435
  emptyPinError = new Error("Error in submitMSISDN() verify-pin action:\n Pin Cannot Be Empty");
436
- emptyPinError['type'] = "InvalidPIN";
436
+ emptyPinError.type = 'InvalidPIN';
437
437
  throw emptyPinError;
438
438
 
439
439
  case 9:
440
- uniqid = uniqidResult != "" ? "&mcpUniqid=".concat(uniqidResult) : '';
441
- evinaTid = typeof window != "undefined" && window.tid ? window.tid : "";
440
+ uniqid = uniqidResult != '' ? "&mcpUniqid=".concat(uniqidResult) : '';
441
+ evinaTid = typeof window !== 'undefined' && window.tid ? window.tid : '';
442
442
  _context6.next = 13;
443
443
  return window.tallymanApi.verifyPin(host, country, slug, device, offer, rockmanId, pin, extraParamsQs, uniqid, evinaTid);
444
444
 
445
445
  case 13:
446
446
  pinResult = _context6.sent;
447
447
 
448
- if (!(false === pinResult.success)) {
448
+ if (!(pinResult.success === false)) {
449
449
  _context6.next = 22;
450
450
  break;
451
451
  }
452
452
 
453
453
  pinErrorTypeMap = {
454
- "pin does not match": "InvalidPIN",
455
- "mcp blocked": "SessionBlocked"
454
+ 'pin does not match': 'InvalidPIN',
455
+ 'mcp blocked': 'SessionBlocked'
456
456
  };
457
457
  errorMessage = pinErrorTypeMap[pinResult.message];
458
458
  pinError = new Error("Error in submitMSISDN() verify-pin action:\n".concat(errorMessage));
459
- pinError['type'] = errorMessage ? errorMessage : "InvalidPIN";
459
+ pinError.type = errorMessage || 'InvalidPIN';
460
460
  throw pinError;
461
461
 
462
462
  case 22:
463
- if (!(true === pinResult.async)) {
464
- _context6.next = 37;
463
+ if (!(pinResult.async === true)) {
464
+ _context6.next = 35;
465
465
  break;
466
466
  }
467
467
 
@@ -477,34 +477,30 @@ function _submitPIN() {
477
477
  case 26:
478
478
  checkResult = _context6.sent;
479
479
 
480
- if (!(true === checkResult.success)) {
481
- _context6.next = 32;
480
+ if (!(checkResult.success === true)) {
481
+ _context6.next = 30;
482
482
  break;
483
483
  }
484
484
 
485
- isAlreadySubscribed = pinResult.message == "ALREADY SUBSCRIBED" ? true : false;
485
+ isAlreadySubscribed = pinResult.message == 'ALREADY SUBSCRIBED';
486
486
  return _context6.abrupt("return", {
487
487
  productUrl: checkResult.product_url || null,
488
488
  isAlreadySubscribed: isAlreadySubscribed
489
489
  });
490
490
 
491
- case 32:
491
+ case 30:
492
492
  _pinError = new Error("Error in submitMSISDN() verify-pin action:\n".concat(checkResult.message));
493
- _pinError['type'] = "InvalidPIN";
493
+ _pinError.type = 'InvalidPIN';
494
494
  throw _pinError;
495
495
 
496
496
  case 35:
497
- _context6.next = 39;
498
- break;
499
-
500
- case 37:
501
- _isAlreadySubscribed = pinResult.message == "ALREADY SUBSCRIBED" ? true : false;
497
+ _isAlreadySubscribed = pinResult.message == 'ALREADY SUBSCRIBED';
502
498
  return _context6.abrupt("return", {
503
499
  productUrl: pinResult.product_url || null,
504
500
  isAlreadySubscribed: _isAlreadySubscribed
505
501
  });
506
502
 
507
- case 39:
503
+ case 37:
508
504
  case "end":
509
505
  return _context6.stop();
510
506
  }
@@ -516,38 +512,38 @@ function _submitPIN() {
516
512
 
517
513
  var mockedPINState = {
518
514
  currentState: {
519
- type: "PINEntry",
515
+ type: 'PINEntry',
520
516
  result: RDS.NothingYet({
521
- finalUrl: ""
517
+ finalUrl: ''
522
518
  }),
523
519
  data: {
524
- actualPIN: "",
525
- nextAction: "submitPinAction",
526
- msisdn: ""
520
+ actualPIN: '',
521
+ nextAction: 'submitPinAction',
522
+ msisdn: ''
527
523
  }
528
524
  }
529
525
  };
530
526
  exports.mockedPINState = mockedPINState;
531
527
  var mockedCompletedState = {
532
528
  currentState: {
533
- type: "PINEntry",
529
+ type: 'PINEntry',
534
530
  result: RDS.Success({
535
- finalUrl: "/mock-product-url"
531
+ finalUrl: '/mock-product-url'
536
532
  }),
537
533
  data: {
538
- actualPIN: "",
539
- nextAction: "submitPinAction",
540
- msisdn: ""
534
+ actualPIN: '',
535
+ nextAction: 'submitPinAction',
536
+ msisdn: ''
541
537
  }
542
538
  }
543
539
  };
544
540
  exports.mockedCompletedState = mockedCompletedState;
545
541
  var mockedMSISDNEntryFailure = {
546
542
  currentState: {
547
- type: "MSISDNEntry",
543
+ type: 'MSISDNEntry',
548
544
  result: RDS.Failure({
549
- errorType: "InvalidMSISDN",
550
- error: "Invalid Mobile Number"
545
+ errorType: 'InvalidMSISDN',
546
+ error: 'Invalid Mobile Number'
551
547
  })
552
548
  }
553
549
  };
@@ -1,2 +1,2 @@
1
- declare type IStategyActionContants = "IDENTIFY_FLOW_BY_OPERATOR_SELECT" | "IDENTIFY_STRATEGY" | "OPERATOR_SELECT" | "MSISDN_ENTRY_SUBMIT" | "IDENTIFY_FLOW_BY_MSISDN" | "IDENTIFY_FLOW_BY_MSISDN_SUBMIT" | "IDENTIFY_FLOW_BY_MSISDN_SUBMIT_ERROR" | "IDENTIFY_FLOW_BY_MSISDN_ERROR" | "DETECT_OPERATOR_BY_IP" | "IDENTIFY_FLOW_BY_IP_OPERATOR" | "CHECK_SUBSCRIPTION" | "HE_IDENTIFY" | "IDENTIFY_FLOW_BY_HE" | "MOCK_STRATEGY_STATE";
1
+ declare type IStategyActionContants = 'IDENTIFY_FLOW_BY_OPERATOR_SELECT' | 'IDENTIFY_STRATEGY' | 'OPERATOR_SELECT' | 'MSISDN_ENTRY_SUBMIT' | 'IDENTIFY_FLOW_BY_MSISDN' | 'IDENTIFY_FLOW_BY_MSISDN_SUBMIT' | 'IDENTIFY_FLOW_BY_MSISDN_SUBMIT_ERROR' | 'IDENTIFY_FLOW_BY_MSISDN_ERROR' | 'DETECT_OPERATOR_BY_IP' | 'IDENTIFY_FLOW_BY_IP_OPERATOR' | 'CHECK_SUBSCRIPTION' | 'HE_IDENTIFY' | 'IDENTIFY_FLOW_BY_HE' | 'MOCK_STRATEGY_STATE';
2
2
  export default IStategyActionContants;
@@ -1,5 +1,5 @@
1
- import * as RDS from "../../common-types/RemoteDataState";
2
- import { AppThunk } from "../../common-types/AppThunk";
1
+ import { AppThunk } from '../../common-types/AppThunk';
2
+ import * as RDS from '../../common-types/RemoteDataState';
3
3
  export declare type IIdentifyResult = {
4
4
  operator: string;
5
5
  flow?: string;
@@ -11,7 +11,7 @@ export declare type ConfigDetails = {
11
11
  host: string;
12
12
  slug: string;
13
13
  country: string;
14
- device?: "smart" | "feature";
14
+ device?: 'smart' | 'feature';
15
15
  queryString?: Array<[string, string]>;
16
16
  automaticallySubmitAllOperators?: boolean;
17
17
  operators?: string[];
@@ -23,11 +23,11 @@ export declare type IConfig = {
23
23
  slug?: string;
24
24
  country?: string;
25
25
  host?: string;
26
- device?: "smart" | "feature";
26
+ device?: 'smart' | 'feature';
27
27
  automaticallySubmitAllOperators?: boolean;
28
28
  operators?: string[];
29
29
  };
30
- export declare type ISupportedFlows = "pin" | "mo" | "oneClick" | "click2sms" | "moRedir" | "ussd" | "tpayHe";
30
+ export declare type ISupportedFlows = 'pin' | 'mo' | 'oneClick' | 'click2sms' | 'moRedir' | 'ussd' | 'tpayHe';
31
31
  export declare type IFlow = {
32
32
  flow: ISupportedFlows;
33
33
  operator?: string;
@@ -47,11 +47,11 @@ export declare type IStrategy = {
47
47
  country: string;
48
48
  strategyConfigs: StrategyConfig;
49
49
  };
50
- export declare type IStrategyNames = "pin" | "mo" | "mo-redir" | "click2sms" | "one-click" | "ussd" | "tpay-he" | "tallyman-one-click" | "pin-mo-ask-operator" | "pin-mo-ask-mobile-number" | "pin-one-click-ask-operator" | "pin-one-click-detect-operator-by-ip" | "one-click-mo-pin-detect-operator-by-ip-or-msisdn" | "pin-click2sms-ask-operator" | "mo-redir-one-click-detect-operator-by-ip" | "pin-mo-redir-ask-mobile-number" | "pin-click2sms-ask-mobile-number" | "mo-one-click-detect-operator-by-ip" | "click2sms-one-click-detect-operator-by-ip" | "pin-header-enrichment" | "pin-msisdn-fowarding-pin-header-enrichment" | "he-pin-mo-redir-header-enrichment" | "he-pin-one-click-header-enrichment" | "he-pin-one-click-ask-operator" | "click2sms-one-click-ask-operator" | "pin-mo-detect-operator-by-ip" | "he-mo-redir-one-click-header-enrichment";
50
+ export declare type IStrategyNames = 'pin' | 'mo' | 'mo-redir' | 'click2sms' | 'one-click' | 'ussd' | 'tpay-he' | 'tallyman-one-click' | 'pin-mo-ask-operator' | 'pin-mo-ask-mobile-number' | 'pin-one-click-ask-operator' | 'pin-one-click-detect-operator-by-ip' | 'one-click-mo-pin-detect-operator-by-ip-or-msisdn' | 'pin-click2sms-ask-operator' | 'mo-redir-one-click-detect-operator-by-ip' | 'pin-mo-redir-ask-mobile-number' | 'pin-click2sms-ask-mobile-number' | 'mo-one-click-detect-operator-by-ip' | 'click2sms-one-click-detect-operator-by-ip' | 'pin-header-enrichment' | 'pin-msisdn-fowarding-pin-header-enrichment' | 'he-pin-mo-redir-header-enrichment' | 'he-pin-one-click-header-enrichment' | 'he-pin-one-click-ask-operator' | 'click2sms-one-click-ask-operator' | 'pin-mo-detect-operator-by-ip' | 'he-mo-redir-one-click-header-enrichment' | 'pin-combo-ask-mobile-number';
51
51
  export interface IHash {
52
52
  [key: string]: string;
53
53
  }
54
- export declare type IDENTIFYMSISDNEntryErrorTypes = "AlreadySubscribed" | "UnknownError" | "InvalidMSISDN";
54
+ export declare type IDENTIFYMSISDNEntryErrorTypes = 'AlreadySubscribed' | 'UnknownError' | 'InvalidMSISDN';
55
55
  export declare type IDENTIFYMSISDNEntryFailure = {
56
56
  errorType: IDENTIFYMSISDNEntryErrorTypes;
57
57
  error: any;
@@ -70,28 +70,28 @@ export declare type IdentifyFlowOptionsResult<F> = {
70
70
  };
71
71
  export declare type IDENTIFYMSISDNEntrySuccess = {};
72
72
  export declare type OPERATORSelectFailure = {};
73
- export declare type OPERATORSelectSuccess = IdentifyFlowOptionsResult<"submitMSISDNAction" | "loadOc2sms">;
73
+ export declare type OPERATORSelectSuccess = IdentifyFlowOptionsResult<'submitMSISDNAction' | 'loadOc2sms'>;
74
74
  export declare type IDETECTYOPERATOBYIPFailure = {};
75
- export declare type IDETECTYOPERATOBYIPSuccess = IdentifyFlowOptionsResult<"getRedirectUrlAction">;
76
- export declare type IDENTIFY_OPERATOR_MSISDNEntrySuccess = IdentifyFlowOptionsResult<"submitMSISDNAction">;
77
- export declare type IDENTIFY_FLOW_HESuccess = IdentifyFlowOptionsResult<"subscribeAction">;
75
+ export declare type IDETECTYOPERATOBYIPSuccess = IdentifyFlowOptionsResult<'getRedirectUrlAction'>;
76
+ export declare type IDENTIFY_OPERATOR_MSISDNEntrySuccess = IdentifyFlowOptionsResult<'submitMSISDNAction'>;
77
+ export declare type IDENTIFY_FLOW_HESuccess = IdentifyFlowOptionsResult<'subscribeAction'>;
78
78
  export declare type OPERATORSelectFlowIdentifyFailure = {};
79
79
  export declare type OPERATORSelectFlowIdentifySuccess = {
80
80
  operators: Array<string>;
81
81
  msisdn?: string;
82
- nextAction: "selectOperator";
82
+ nextAction: 'selectOperator';
83
83
  };
84
84
  export declare type IDENTIFYFailure = {};
85
85
  export declare type IDENTIFYSuccess = {};
86
86
  export declare type IOperatorSelectFlowIdentifyPayload = {
87
- type: "IDENTIFY_FLOW_BY_OPERATOR_SELECT";
87
+ type: 'IDENTIFY_FLOW_BY_OPERATOR_SELECT';
88
88
  result: RDS.RemoteDataState<OPERATORSelectFlowIdentifyFailure, OPERATORSelectFlowIdentifySuccess>;
89
89
  };
90
90
  export declare type IDetectOperatorByIpPayload = {
91
- type: "DETECT_OPERATOR_BY_IP";
91
+ type: 'DETECT_OPERATOR_BY_IP';
92
92
  result: RDS.RemoteDataState<IDETECTYOPERATOBYIPFailure, IDETECTYOPERATOBYIPSuccess>;
93
93
  };
94
- export declare type IPossibleFlows = "PIN" | "MO" | "MO_REDIR" | "ONE_CLICK" | "CLICK2SMS" | "USSD" | "TPAY_HE";
94
+ export declare type IPossibleFlows = 'PIN' | 'MO' | 'MO_REDIR' | 'ONE_CLICK' | 'CLICK2SMS' | 'USSD' | 'TPAY_HE';
95
95
  export declare type IOperatorSelectPayload = {
96
96
  type: IPossibleFlows;
97
97
  result: OPERATORSelectSuccess;
@@ -108,97 +108,97 @@ export declare type IIdentifyFlowByHePayload = {
108
108
  type: IPossibleFlows;
109
109
  result: IDENTIFY_FLOW_HESuccess;
110
110
  };
111
- export declare type IIdentfyFlowByMsisdnNextAction = "submitMSISDNAction" | "loadOc2sms";
112
- export declare type IIdentfyFlowByOperatorNextAction = "submitMSISDNAction" | "loadOc2sms";
113
- export declare type IIdentfyFlowByIPOperatorNextAction = "getRedirectUrlAction" | "submitMSISDNAction";
111
+ export declare type IIdentfyFlowByMsisdnNextAction = 'submitMSISDNAction' | 'loadOc2sms';
112
+ export declare type IIdentfyFlowByOperatorNextAction = 'submitMSISDNAction' | 'loadOc2sms';
113
+ export declare type IIdentfyFlowByIPOperatorNextAction = 'getRedirectUrlAction' | 'submitMSISDNAction';
114
114
  export declare type IIdenyifyFlowByMsisdnSumbitNextData = {
115
115
  nextAction: IIdentfyFlowByMsisdnNextAction;
116
116
  };
117
117
  export declare type IIdenyifyFlowByMsisdnPayload = {
118
- type: "IDENTIFY_FLOW_BY_MSISDN";
118
+ type: 'IDENTIFY_FLOW_BY_MSISDN';
119
119
  result: RDS.RemoteDataState<IDENTIFYMSISDNEntryFailure, IDENTIFYMSISDNEntrySuccess>;
120
120
  data: IIdenyifyFlowByMsisdnSumbitNextData;
121
121
  };
122
122
  export declare type IIdenyifyStrategyPayload = {
123
- type: "IDENTIFY_FLOW_BY_MSISDN";
123
+ type: 'IDENTIFY_FLOW_BY_MSISDN';
124
124
  result: RDS.RemoteDataState<IDENTIFYMSISDNEntryFailure, IDENTIFYMSISDNEntrySuccess>;
125
125
  data: IIdenyifyFlowByMsisdnSumbitNextData;
126
126
  };
127
127
  export declare type IStrategyActions = {
128
- type: "IDENTIFY_STRATEGY";
128
+ type: 'IDENTIFY_STRATEGY';
129
129
  payload: IIdenyifyStrategyPayload;
130
130
  } | {
131
- type: "DETECT_OPERATOR_BY_IP";
131
+ type: 'DETECT_OPERATOR_BY_IP';
132
132
  payload: IDetectOperatorByIpPayload;
133
133
  } | {
134
- type: "HE_IDENTIFY";
134
+ type: 'HE_IDENTIFY';
135
135
  payload: IIdenyifyStrategyPayload;
136
136
  } | {
137
- type: "IDENTIFY_FLOW_BY_OPERATOR_SELECT";
137
+ type: 'IDENTIFY_FLOW_BY_OPERATOR_SELECT';
138
138
  payload: IOperatorSelectFlowIdentifyPayload;
139
139
  } | {
140
- type: "IDENTIFY_FLOW_BY_IP";
140
+ type: 'IDENTIFY_FLOW_BY_IP';
141
141
  payload: IIdentifyFlowByIpOperatorPayload;
142
142
  } | {
143
- type: "OPERATOR_SELECT";
143
+ type: 'OPERATOR_SELECT';
144
144
  payload: IOperatorSelectPayload;
145
145
  } | {
146
- type: "IDENTIFY_FLOW_BY_MSISDN";
146
+ type: 'IDENTIFY_FLOW_BY_MSISDN';
147
147
  payload: IIdenyifyFlowByMsisdnPayload;
148
148
  } | {
149
- type: "IDENTIFY_FLOW_BY_MSISDN_SUBMIT";
149
+ type: 'IDENTIFY_FLOW_BY_MSISDN_SUBMIT';
150
150
  payload: ISubmitMsisdnPayload;
151
151
  } | {
152
- type: "IDENTIFY_FLOW_BY_IP_OPERATOR";
152
+ type: 'IDENTIFY_FLOW_BY_IP_OPERATOR';
153
153
  payload: IIdentifyFlowByIpOperatorPayload;
154
154
  } | {
155
- type: "IDENTIFY_FLOW_BY_HE";
155
+ type: 'IDENTIFY_FLOW_BY_HE';
156
156
  payload: IIdentifyFlowByHePayload;
157
157
  } | {
158
- type: "MOCK_STRATEGY_STATE";
158
+ type: 'MOCK_STRATEGY_STATE';
159
159
  payload: any;
160
160
  };
161
161
  export declare type IStrategyCurrentState = {
162
- type: "IDENTIFY_STRATEGY";
162
+ type: 'IDENTIFY_STRATEGY';
163
163
  result: RDS.RemoteDataState<IDENTIFYFailure, IDENTIFYSuccess>;
164
164
  } | {
165
- type: "IDENTIFY_FLOW_BY_OPERATOR_SELECT";
165
+ type: 'IDENTIFY_FLOW_BY_OPERATOR_SELECT';
166
166
  result: OPERATORSelectFlowIdentifySuccess;
167
167
  } | {
168
- type: "DETECT_OPERATOR_BY_IP";
168
+ type: 'DETECT_OPERATOR_BY_IP';
169
169
  result: RDS.RemoteDataState<IDETECTYOPERATOBYIPFailure, IDETECTYOPERATOBYIPSuccess>;
170
170
  } | {
171
- type: "HE_IDENTIFY";
171
+ type: 'HE_IDENTIFY';
172
172
  result: RDS.RemoteDataState<IDENTIFYFailure, IDENTIFYSuccess>;
173
173
  } | {
174
- type: "OPERATOR_SELECT";
174
+ type: 'OPERATOR_SELECT';
175
175
  result: RDS.RemoteDataState<OPERATORSelectFailure, OPERATORSelectSuccess>;
176
176
  config: IConfig;
177
177
  } | {
178
- type: "IDENTIFY_FLOW_BY_MSISDN";
178
+ type: 'IDENTIFY_FLOW_BY_MSISDN';
179
179
  result: RDS.RemoteDataState<IDENTIFYMSISDNEntryFailure, IDENTIFYMSISDNEntrySuccess>;
180
180
  nextData: IIdenyifyFlowByMsisdnSumbitNextData;
181
181
  } | {
182
- type: "PIN";
183
- result: IdentifyFlowOptionsResult<"submitMSISDNAction">;
182
+ type: 'PIN';
183
+ result: IdentifyFlowOptionsResult<'submitMSISDNAction'>;
184
184
  } | {
185
- type: "MO";
186
- result: IdentifyFlowOptionsResult<"submitMSISDNAction">;
185
+ type: 'MO';
186
+ result: IdentifyFlowOptionsResult<'submitMSISDNAction'>;
187
187
  } | {
188
- type: "USSD";
189
- result: IdentifyFlowOptionsResult<"submitMSISDNAction">;
188
+ type: 'USSD';
189
+ result: IdentifyFlowOptionsResult<'submitMSISDNAction'>;
190
190
  } | {
191
- type: "MO_REDIR";
192
- result: IdentifyFlowOptionsResult<"submitMSISDNAction">;
191
+ type: 'MO_REDIR';
192
+ result: IdentifyFlowOptionsResult<'submitMSISDNAction'>;
193
193
  } | {
194
- type: "ONE_CLICK";
195
- result: IdentifyFlowOptionsResult<"getRedirectUrlAction">;
194
+ type: 'ONE_CLICK';
195
+ result: IdentifyFlowOptionsResult<'getRedirectUrlAction'>;
196
196
  } | {
197
- type: "CLICK2SMS";
198
- result: IdentifyFlowOptionsResult<"loadOc2sms">;
197
+ type: 'CLICK2SMS';
198
+ result: IdentifyFlowOptionsResult<'loadOc2sms'>;
199
199
  } | {
200
- type: "TPAY_HE";
201
- result: IdentifyFlowOptionsResult<"loadTpayAction">;
200
+ type: 'TPAY_HE';
201
+ result: IdentifyFlowOptionsResult<'loadTpayAction'>;
202
202
  };
203
203
  export declare type IStrategyReducerState = {
204
204
  currentState: IStrategyCurrentState;
@@ -215,15 +215,15 @@ export declare type IStrategyIDentifyUserResult = {
215
215
  operator?: string;
216
216
  subscription_url?: string;
217
217
  redirect_url?: string;
218
- "redirect-back"?: string;
218
+ 'redirect-back'?: string;
219
219
  } | {
220
220
  success: false;
221
221
  rockman_id: string;
222
222
  message: string;
223
- "redirect-back"?: string;
223
+ 'redirect-back'?: string;
224
224
  };
225
- export declare type IMockFlows = "pin" | "mo" | "oneclick" | "click2sms" | "moredir" | "ussd" | "tpay";
225
+ export declare type IMockFlows = 'pin' | 'mo' | 'oneclick' | 'click2sms' | 'moredir' | 'ussd' | 'tpay';
226
226
  export interface IMockFlowParams<T> {
227
- "mock-flow": IMockFlows;
228
- "current-state": T;
227
+ 'mock-flow': IMockFlows;
228
+ 'current-state': T;
229
229
  }
@@ -1,5 +1,5 @@
1
- import { AppThunk } from "../../common-types/AppThunk";
2
- import { IStrategyReducerState, IStrategyActions, IStrategyActionMaps } from "./StrategyTypes";
1
+ import { AppThunk } from '../../common-types/AppThunk';
2
+ import { IStrategyActionMaps, IStrategyActions, IStrategyReducerState } from './StrategyTypes';
3
3
  export declare const tracker: import("pacman-client/.build-lib/Pacman/types").ITrackerFlowEvents;
4
4
  export declare function mockStrategyStateByUrlParam(): AppThunk;
5
5
  export declare function identifyStrategy(): AppThunk;