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
@@ -59,13 +59,13 @@ require("core-js/modules/es.promise.js");
59
59
 
60
60
  var RDS = _interopRequireWildcard(require("../../common-types/RemoteDataState"));
61
61
 
62
- var _utils = _interopRequireWildcard(require("./utils"));
62
+ var _utilities = require("../../utilities");
63
63
 
64
64
  var _strategy = require("../strategy");
65
65
 
66
- var _utilities = require("../../utilities");
66
+ var _utils = require("../strategy/utils");
67
67
 
68
- var _utils2 = require("../strategy/utils");
68
+ var _utils2 = _interopRequireWildcard(require("./utils"));
69
69
 
70
70
  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); }
71
71
 
@@ -85,9 +85,9 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
85
85
 
86
86
  var getConfigByMsisdnPrefix = function getConfigByMsisdnPrefix(msisdn) {
87
87
  var operatorByPrefix = (0, _utilities.getSAOperatorByMsisdnPrefix)(msisdn);
88
- var flowObj = (0, _utils2.determineFlowByOperator)(operatorByPrefix);
88
+ var flowObj = (0, _utils.determineFlowByOperator)(operatorByPrefix);
89
89
  return flowObj.flowConfig;
90
- }; //ACTION CREATORS
90
+ }; // ACTION CREATORS
91
91
 
92
92
 
93
93
  function submitMSISDNAction(msisdn, extraParams) {
@@ -102,7 +102,7 @@ function submitMSISDNAction(msisdn, extraParams) {
102
102
  currentState = store().strategy.currentState;
103
103
  pinFlowCurrentState = store().pinFlow.currentState;
104
104
 
105
- if (!(currentState.type === "PIN")) {
105
+ if (!(currentState.type === 'PIN')) {
106
106
  _context.next = 26;
107
107
  break;
108
108
  }
@@ -110,15 +110,15 @@ function submitMSISDNAction(msisdn, extraParams) {
110
110
  _currentState$result = currentState.result, configByStrategy = _currentState$result.config, isUseMsisdnPrefix = _currentState$result.isUseMsisdnPrefix;
111
111
  config = isUseMsisdnPrefix ? getConfigByMsisdnPrefix(msisdn) : configByStrategy;
112
112
  pinMaxLengthByOp = {
113
- "SA_MOBILY": 6,
114
- "SA_STC": 4,
115
- "SA_ZAIN": 6
113
+ SA_MOBILY: 6,
114
+ SA_STC: 4,
115
+ SA_ZAIN: 6
116
116
  };
117
117
  _context.prev = 6;
118
118
  dispatch({
119
- type: "PIN_FLOW_MSISDN_SUBMIT",
119
+ type: 'PIN_FLOW_MSISDN_SUBMIT',
120
120
  payload: _objectSpread(_objectSpread({}, pinFlowCurrentState), {}, {
121
- type: "MSISDNEntry",
121
+ type: 'MSISDNEntry',
122
122
  result: RDS.Loading()
123
123
  })
124
124
  });
@@ -128,15 +128,15 @@ function submitMSISDNAction(msisdn, extraParams) {
128
128
  });
129
129
 
130
130
  _context.next = 11;
131
- return (0, _utils.default)(window, config, msisdn, extraParams);
131
+ return (0, _utils2.default)(window, config, msisdn, extraParams);
132
132
 
133
133
  case 11:
134
134
  msisdnSubmissionResult = _context.sent;
135
- operator = msisdnSubmissionResult.type == "SingleMSISDNSubmissionResult" ? msisdnSubmissionResult.operator : "";
135
+ operator = msisdnSubmissionResult.type == 'SingleMSISDNSubmissionResult' ? msisdnSubmissionResult.operator : '';
136
136
  dispatch({
137
- type: "PIN_FLOW_MSISDN_SUBMIT",
137
+ type: 'PIN_FLOW_MSISDN_SUBMIT',
138
138
  payload: _objectSpread(_objectSpread({}, pinFlowCurrentState), {}, {
139
- type: "MSISDNEntry",
139
+ type: 'MSISDNEntry',
140
140
  result: RDS.Success({})
141
141
  })
142
142
  });
@@ -146,16 +146,16 @@ function submitMSISDNAction(msisdn, extraParams) {
146
146
  });
147
147
 
148
148
  dispatch({
149
- type: "PIN_FLOW_MSISDN_SUBMIT",
149
+ type: 'PIN_FLOW_MSISDN_SUBMIT',
150
150
  payload: _objectSpread(_objectSpread({}, pinFlowCurrentState), {}, {
151
- type: "PINEntry",
151
+ type: 'PINEntry',
152
152
  result: RDS.NothingYet(),
153
153
  data: {
154
- actualPIN: msisdnSubmissionResult.type == "SingleMSISDNSubmissionResult" ? msisdnSubmissionResult.pin : null,
155
- nextAction: "submitPinAction",
154
+ actualPIN: msisdnSubmissionResult.type == 'SingleMSISDNSubmissionResult' ? msisdnSubmissionResult.pin : null,
155
+ nextAction: 'submitPinAction',
156
156
  msisdn: msisdn,
157
157
  operator: operator,
158
- pinMaxLength: operator != "" && pinMaxLengthByOp[operator] ? pinMaxLengthByOp[operator] : null
158
+ pinMaxLength: operator != '' && pinMaxLengthByOp[operator] ? pinMaxLengthByOp[operator] : null
159
159
  }
160
160
  })
161
161
  });
@@ -166,7 +166,7 @@ function submitMSISDNAction(msisdn, extraParams) {
166
166
  _context.prev = 18;
167
167
  _context.t0 = _context["catch"](6);
168
168
  console.warn(_context.t0);
169
- errorType = "AlreadySubscribed" === _context.t0.type ? "AlreadySubscribed" : "InvalidMSISDN" === _context.t0.type ? "InvalidMSISDN" : "UnknownError";
169
+ errorType = _context.t0.type === 'AlreadySubscribed' ? 'AlreadySubscribed' : _context.t0.type === 'InvalidMSISDN' ? 'InvalidMSISDN' : 'UnknownError';
170
170
 
171
171
  _strategy.tracker.recedeInFlow('tallyman.v1-pin', 'msisdn-submission-failure', {
172
172
  msisdn: msisdn,
@@ -174,9 +174,9 @@ function submitMSISDNAction(msisdn, extraParams) {
174
174
  });
175
175
 
176
176
  dispatch({
177
- type: "PIN_FLOW_MSISDN_SUBMIT_ERROR",
177
+ type: 'PIN_FLOW_MSISDN_SUBMIT_ERROR',
178
178
  payload: _objectSpread(_objectSpread({}, pinFlowCurrentState), {}, {
179
- type: "MSISDNEntry",
179
+ type: 'MSISDNEntry',
180
180
  result: RDS.Failure({
181
181
  errorType: errorType,
182
182
  error: _context.t0,
@@ -191,11 +191,11 @@ function submitMSISDNAction(msisdn, extraParams) {
191
191
 
192
192
  case 26:
193
193
  dispatch({
194
- type: "PIN_FLOW_MSISDN_SUBMIT_ERROR",
194
+ type: 'PIN_FLOW_MSISDN_SUBMIT_ERROR',
195
195
  payload: _objectSpread(_objectSpread({}, pinFlowCurrentState), {}, {
196
- type: "MSISDNEntry",
196
+ type: 'MSISDNEntry',
197
197
  result: RDS.Failure({
198
- errorType: "UnknownError",
198
+ errorType: 'UnknownError',
199
199
  error: null
200
200
  })
201
201
  })
@@ -206,7 +206,7 @@ function submitMSISDNAction(msisdn, extraParams) {
206
206
  errorType: 'UnexpectedState'
207
207
  });
208
208
 
209
- throw "Unexpected state";
209
+ throw 'Unexpected state';
210
210
 
211
211
  case 29:
212
212
  case "end":
@@ -233,7 +233,7 @@ function reSubmitMSISDNAction(msisdn, extraParams) {
233
233
  currentState = store().strategy.currentState;
234
234
  pinFlowCurrentState = store().pinFlow.currentState;
235
235
 
236
- if (!(currentState.type === "PIN")) {
236
+ if (!(currentState.type === 'PIN')) {
237
237
  _context2.next = 23;
238
238
  break;
239
239
  }
@@ -257,14 +257,14 @@ function reSubmitMSISDNAction(msisdn, extraParams) {
257
257
  });
258
258
 
259
259
  _context2.next = 9;
260
- return (0, _utils.default)(window, config, msisdn, extraParams);
260
+ return (0, _utils2.default)(window, config, msisdn, extraParams);
261
261
 
262
262
  case 9:
263
263
  msisdnSubmissionResult = _context2.sent;
264
264
  dispatch({
265
- type: "PIN_FLOW_MSISDN_SUBMIT",
265
+ type: 'PIN_FLOW_MSISDN_SUBMIT',
266
266
  payload: _objectSpread(_objectSpread({}, pinFlowCurrentState), {}, {
267
- type: "MSISDNEntry",
267
+ type: 'MSISDNEntry',
268
268
  result: RDS.Success({})
269
269
  })
270
270
  });
@@ -274,13 +274,13 @@ function reSubmitMSISDNAction(msisdn, extraParams) {
274
274
  });
275
275
 
276
276
  dispatch({
277
- type: "PIN_FLOW_MSISDN_SUBMIT",
277
+ type: 'PIN_FLOW_MSISDN_SUBMIT',
278
278
  payload: _objectSpread(_objectSpread({}, pinFlowCurrentState), {}, {
279
- type: "PINEntry",
279
+ type: 'PINEntry',
280
280
  result: RDS.NothingYet(),
281
281
  data: {
282
- actualPIN: msisdnSubmissionResult.type == "SingleMSISDNSubmissionResult" ? msisdnSubmissionResult.pin : null,
283
- nextAction: "submitPinAction",
282
+ actualPIN: msisdnSubmissionResult.type == 'SingleMSISDNSubmissionResult' ? msisdnSubmissionResult.pin : null,
283
+ nextAction: 'submitPinAction',
284
284
  msisdn: msisdn
285
285
  }
286
286
  })
@@ -292,7 +292,7 @@ function reSubmitMSISDNAction(msisdn, extraParams) {
292
292
  _context2.prev = 15;
293
293
  _context2.t0 = _context2["catch"](4);
294
294
  console.warn(_context2.t0);
295
- errorType = "AlreadySubscribed" === _context2.t0.type ? "AlreadySubscribed" : "InvalidMSISDN" === _context2.t0.type ? "InvalidMSISDN" : "UnknownError";
295
+ errorType = _context2.t0.type === 'AlreadySubscribed' ? 'AlreadySubscribed' : _context2.t0.type === 'InvalidMSISDN' ? 'InvalidMSISDN' : 'UnknownError';
296
296
 
297
297
  _strategy.tracker.recedeInFlow('tallyman.v1-pin', 'msisdn-submission-failure', {
298
298
  msisdn: msisdn,
@@ -300,9 +300,9 @@ function reSubmitMSISDNAction(msisdn, extraParams) {
300
300
  });
301
301
 
302
302
  dispatch({
303
- type: "PIN_FLOW_MSISDN_SUBMIT_ERROR",
303
+ type: 'PIN_FLOW_MSISDN_SUBMIT_ERROR',
304
304
  payload: _objectSpread(_objectSpread({}, pinFlowCurrentState), {}, {
305
- type: "MSISDNEntry",
305
+ type: 'MSISDNEntry',
306
306
  result: RDS.Failure({
307
307
  errorType: errorType,
308
308
  error: _context2.t0,
@@ -317,11 +317,11 @@ function reSubmitMSISDNAction(msisdn, extraParams) {
317
317
 
318
318
  case 23:
319
319
  dispatch({
320
- type: "PIN_FLOW_MSISDN_SUBMIT_ERROR",
320
+ type: 'PIN_FLOW_MSISDN_SUBMIT_ERROR',
321
321
  payload: _objectSpread(_objectSpread({}, pinFlowCurrentState), {}, {
322
- type: "MSISDNEntry",
322
+ type: 'MSISDNEntry',
323
323
  result: RDS.Failure({
324
- errorType: "UnknownError",
324
+ errorType: 'UnknownError',
325
325
  error: null
326
326
  })
327
327
  })
@@ -332,7 +332,7 @@ function reSubmitMSISDNAction(msisdn, extraParams) {
332
332
  errorType: 'UnexpectedState'
333
333
  });
334
334
 
335
- throw "Unexpected state";
335
+ throw 'Unexpected state';
336
336
 
337
337
  case 26:
338
338
  case "end":
@@ -360,9 +360,9 @@ function submitPinAction(msisdn, pin, extraParams) {
360
360
  pinFlowCurrentState = store().pinFlow.currentState;
361
361
  _context3.prev = 2;
362
362
  dispatch({
363
- type: "PIN_SUBMIT",
363
+ type: 'PIN_SUBMIT',
364
364
  payload: _objectSpread(_objectSpread({}, pinFlowCurrentState), {}, {
365
- type: "PINEntry",
365
+ type: 'PINEntry',
366
366
  result: RDS.Loading()
367
367
  })
368
368
  });
@@ -372,14 +372,14 @@ function submitPinAction(msisdn, pin, extraParams) {
372
372
  pin: pin
373
373
  });
374
374
 
375
- if (!(currentState.type === "PIN")) {
375
+ if (!(currentState.type === 'PIN')) {
376
376
  _context3.next = 14;
377
377
  break;
378
378
  }
379
379
 
380
380
  config = currentState.result.config;
381
381
  _context3.next = 9;
382
- return (0, _utils.submitPIN)(window, pin, config, extraParams);
382
+ return (0, _utils2.submitPIN)(window, pin, config, extraParams);
383
383
 
384
384
  case 9:
385
385
  result = _context3.sent;
@@ -391,9 +391,9 @@ function submitPinAction(msisdn, pin, extraParams) {
391
391
  });
392
392
 
393
393
  dispatch({
394
- type: "PIN_SUBMIT",
394
+ type: 'PIN_SUBMIT',
395
395
  payload: _objectSpread(_objectSpread({}, pinFlowCurrentState), {}, {
396
- type: "PINEntry",
396
+ type: 'PINEntry',
397
397
  result: RDS.Success({
398
398
  finalUrl: result.productUrl,
399
399
  isAlreadySubscribed: result.isAlreadySubscribed || false
@@ -410,15 +410,15 @@ function submitPinAction(msisdn, pin, extraParams) {
410
410
  });
411
411
 
412
412
  dispatch({
413
- type: "PIN_SUBMIT_ERROR",
413
+ type: 'PIN_SUBMIT_ERROR',
414
414
  payload: _objectSpread(_objectSpread({}, pinFlowCurrentState), {}, {
415
- type: "PINEntry",
415
+ type: 'PINEntry',
416
416
  result: RDS.Failure({
417
- errorType: "UnexpectedState"
417
+ errorType: 'UnexpectedState'
418
418
  })
419
419
  })
420
420
  });
421
- throw "Unexpected state";
421
+ throw 'Unexpected state';
422
422
 
423
423
  case 17:
424
424
  _context3.next = 25;
@@ -428,7 +428,7 @@ function submitPinAction(msisdn, pin, extraParams) {
428
428
  _context3.prev = 19;
429
429
  _context3.t0 = _context3["catch"](2);
430
430
  console.error(_context3.t0);
431
- errorType = _context3.t0.type || "UnknownError";
431
+ errorType = _context3.t0.type || 'UnknownError';
432
432
 
433
433
  _strategy.tracker.recedeInFlow('tallyman.v1-pin', 'pin-submission-failure', {
434
434
  msisdn: msisdn,
@@ -436,9 +436,9 @@ function submitPinAction(msisdn, pin, extraParams) {
436
436
  });
437
437
 
438
438
  dispatch({
439
- type: "PIN_SUBMIT_ERROR",
439
+ type: 'PIN_SUBMIT_ERROR',
440
440
  payload: _objectSpread(_objectSpread({}, pinFlowCurrentState), {}, {
441
- type: "PINEntry",
441
+ type: 'PINEntry',
442
442
  result: RDS.Failure({
443
443
  errorType: errorType
444
444
  })
@@ -463,38 +463,38 @@ function mockPinFlow(mockState) {
463
463
  return function (dispatch) {
464
464
  if (mockState !== undefined) {
465
465
  switch (mockState) {
466
- case "msisdn-failure-state":
466
+ case 'msisdn-failure-state':
467
467
  return dispatch({
468
- type: "MOCK_PIN_FLOW_STATE",
469
- payload: _utils.mockedMSISDNEntryFailure.currentState
468
+ type: 'MOCK_PIN_FLOW_STATE',
469
+ payload: _utils2.mockedMSISDNEntryFailure.currentState
470
470
  });
471
471
 
472
- case "pin-state":
472
+ case 'pin-state':
473
473
  return dispatch({
474
- type: "MOCK_PIN_FLOW_STATE",
475
- payload: _utils.mockedPINState.currentState
474
+ type: 'MOCK_PIN_FLOW_STATE',
475
+ payload: _utils2.mockedPINState.currentState
476
476
  });
477
477
 
478
- case "completed-state":
478
+ case 'completed-state':
479
479
  return dispatch({
480
- type: "MOCK_PIN_FLOW_STATE",
481
- payload: _utils.mockedCompletedState.currentState
480
+ type: 'MOCK_PIN_FLOW_STATE',
481
+ payload: _utils2.mockedCompletedState.currentState
482
482
  });
483
483
 
484
484
  default:
485
- throw "Mock Flow not supported";
485
+ throw 'Mock Flow not supported';
486
486
  }
487
487
  }
488
488
  };
489
489
  }
490
490
 
491
491
  function backToStart() {
492
- _strategy.tracker.recedeInFlow("tallyman.v1-pin", "pin-submission-backtostart", "requested to change phone number");
492
+ _strategy.tracker.recedeInFlow('tallyman.v1-pin', 'pin-submission-backtostart', 'requested to change phone number');
493
493
 
494
494
  return {
495
- type: "BACK_TO_START",
495
+ type: 'BACK_TO_START',
496
496
  payload: {
497
- type: "MSISDNEntry",
497
+ type: 'MSISDNEntry',
498
498
  result: RDS.NothingYet()
499
499
  }
500
500
  };
@@ -502,7 +502,7 @@ function backToStart() {
502
502
 
503
503
  var initialState = {
504
504
  currentState: {
505
- type: "MSISDNEntry",
505
+ type: 'MSISDNEntry',
506
506
  result: RDS.NothingYet()
507
507
  }
508
508
  };
@@ -517,23 +517,23 @@ function PinFlowReducer() {
517
517
  var action = arguments.length > 1 ? arguments[1] : undefined;
518
518
 
519
519
  switch (action.type) {
520
- case "PIN_FLOW_MSISDN_SUBMIT":
520
+ case 'PIN_FLOW_MSISDN_SUBMIT':
521
521
  return (0, _strategy.genericHandler)(state, action.payload);
522
522
 
523
- case "PIN_FLOW_MSISDN_SUBMIT_ERROR":
523
+ case 'PIN_FLOW_MSISDN_SUBMIT_ERROR':
524
524
  return (0, _strategy.genericHandler)(state, action.payload);
525
525
 
526
- case "PIN_SUBMIT":
526
+ case 'PIN_SUBMIT':
527
527
  return (0, _strategy.genericHandler)(state, action.payload);
528
528
 
529
- case "BACK_TO_START":
529
+ case 'BACK_TO_START':
530
530
  return (0, _strategy.genericHandler)(state, action.payload);
531
531
 
532
- case "PIN_SUBMIT_ERROR":
532
+ case 'PIN_SUBMIT_ERROR':
533
533
  return (0, _strategy.genericHandler)(state, action.payload);
534
534
 
535
- case "MOCK_PIN_FLOW_STATE":
536
- //@ts-ignore
535
+ case 'MOCK_PIN_FLOW_STATE':
536
+ // @ts-ignore
537
537
  return (0, _strategy.genericHandler)(state, action.payload);
538
538
 
539
539
  default:
@@ -1,4 +1,4 @@
1
- import { IConfig, IHash, SingleMSISDNSubmissionResult, MultiOperatorMSISDNSubmissionResult, IPinFlowReducerState, IMcpShieldResult } from "./PinTypes";
1
+ import { IConfig, IHash, IMcpShieldResult, IPinFlowReducerState, MultiOperatorMSISDNSubmissionResult, SingleMSISDNSubmissionResult } from './PinTypes';
2
2
  export default function submitMSISDN(window: Window, maybeConfig: IConfig, internationalMSISDN: string, extraParams?: IHash): Promise<SingleMSISDNSubmissionResult | MultiOperatorMSISDNSubmissionResult>;
3
3
  export declare function loadMcpShield(window: Window, config: IConfig): Promise<IMcpShieldResult>;
4
4
  export declare function submitPIN(window: Window, pin: string, config: IConfig, extraParams: IHash): Promise<{