ouisys-engine 3.0.2 → 3.0.6

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 (198) hide show
  1. package/.babelrc +4 -8
  2. package/.eslintrc.js +1 -1
  3. package/.nvmrc +1 -1
  4. package/.prettierignore +2 -1
  5. package/README.md +2 -4
  6. package/dist/api/index.d.ts +5 -5
  7. package/dist/api/index.js +76 -76
  8. package/dist/common-types/AppThunk.d.ts +11 -12
  9. package/dist/common-types/IOptInFlowName.d.ts +1 -1
  10. package/dist/common-types/ITracker.js +1 -2
  11. package/dist/common-types/RemoteDataState.d.ts +4 -4
  12. package/dist/common-types/RemoteDataState.js +17 -17
  13. package/dist/flows/click2smsFlow.d.ts +2 -2
  14. package/dist/flows/moFlow.d.ts +2 -2
  15. package/dist/flows/moRedirFlow.d.ts +2 -2
  16. package/dist/flows/oneClickFlow.d.ts +2 -2
  17. package/dist/flows/pinFlow.d.ts +2 -2
  18. package/dist/flows/pinFlow.js +2 -0
  19. package/dist/flows/strategy.d.ts +8 -8
  20. package/dist/flows/ussdFlow.d.ts +2 -2
  21. package/dist/ips/tryGetIPRangeName.d.ts +1 -1
  22. package/dist/ips/tryGetIPRangeName.js +7 -5
  23. package/dist/jest.config.js +1 -1
  24. package/dist/pacman/index.d.ts +2 -2
  25. package/dist/pacman/index.js +41 -41
  26. package/dist/pacman/queryString.js +11 -9
  27. package/dist/reducers/click2smsFlow/Click2smsTypes.d.ts +19 -19
  28. package/dist/reducers/click2smsFlow/IClick2smsConstants.d.ts +1 -1
  29. package/dist/reducers/click2smsFlow/index.d.ts +2 -2
  30. package/dist/reducers/click2smsFlow/index.js +24 -24
  31. package/dist/reducers/click2smsFlow/utils.d.ts +1 -1
  32. package/dist/reducers/click2smsFlow/utils.js +30 -30
  33. package/dist/reducers/moFlow/IMoConstants.d.ts +1 -1
  34. package/dist/reducers/moFlow/MoTypes.d.ts +13 -13
  35. package/dist/reducers/moFlow/index.d.ts +3 -3
  36. package/dist/reducers/moFlow/index.js +27 -27
  37. package/dist/reducers/moFlow/utils.d.ts +1 -2
  38. package/dist/reducers/moFlow/utils.js +28 -26
  39. package/dist/reducers/moRedirFlow/IMoRedirConstants.d.ts +1 -1
  40. package/dist/reducers/moRedirFlow/MoRedirTypes.d.ts +13 -13
  41. package/dist/reducers/moRedirFlow/index.d.ts +3 -3
  42. package/dist/reducers/moRedirFlow/index.js +27 -27
  43. package/dist/reducers/moRedirFlow/utils.d.ts +1 -1
  44. package/dist/reducers/moRedirFlow/utils.js +17 -17
  45. package/dist/reducers/oneClickFlow/IOneClickConstants.d.ts +1 -1
  46. package/dist/reducers/oneClickFlow/OneClickTypes.d.ts +10 -10
  47. package/dist/reducers/oneClickFlow/index.d.ts +3 -3
  48. package/dist/reducers/oneClickFlow/index.js +75 -68
  49. package/dist/reducers/oneClickFlow/utils.d.ts +2 -2
  50. package/dist/reducers/oneClickFlow/utils.js +70 -69
  51. package/dist/reducers/pinFlow/IPinConstants.d.ts +1 -1
  52. package/dist/reducers/pinFlow/PinTypes.d.ts +23 -23
  53. package/dist/reducers/pinFlow/index.d.ts +3 -3
  54. package/dist/reducers/pinFlow/index.js +76 -76
  55. package/dist/reducers/pinFlow/utils.d.ts +1 -1
  56. package/dist/reducers/pinFlow/utils.js +61 -65
  57. package/dist/reducers/strategy/IStategyActionContants.d.ts +1 -1
  58. package/dist/reducers/strategy/StrategyTypes.d.ts +56 -56
  59. package/dist/reducers/strategy/index.d.ts +2 -2
  60. package/dist/reducers/strategy/index.js +99 -99
  61. package/dist/reducers/strategy/strategies/ask_mobile_number.d.ts +3 -2
  62. package/dist/reducers/strategy/strategies/ask_mobile_number.js +132 -74
  63. package/dist/reducers/strategy/strategies/ask_operator.d.ts +2 -2
  64. package/dist/reducers/strategy/strategies/ask_operator.js +64 -68
  65. package/dist/reducers/strategy/strategies/detect_operator_by_ip.d.ts +2 -2
  66. package/dist/reducers/strategy/strategies/detect_operator_by_ip.js +97 -97
  67. package/dist/reducers/strategy/strategies/header_enrichment.d.ts +2 -2
  68. package/dist/reducers/strategy/strategies/header_enrichment.js +116 -120
  69. package/dist/reducers/strategy/utils.d.ts +3 -3
  70. package/dist/reducers/strategy/utils.js +115 -111
  71. package/dist/reducers/ussdFlow/IUssdConstants.d.ts +1 -1
  72. package/dist/reducers/ussdFlow/UssdTypes.d.ts +13 -13
  73. package/dist/reducers/ussdFlow/index.d.ts +3 -3
  74. package/dist/reducers/ussdFlow/index.js +27 -27
  75. package/dist/reducers/ussdFlow/utils.d.ts +1 -2
  76. package/dist/reducers/ussdFlow/utils.js +19 -17
  77. package/dist/store/index.d.ts +8 -8
  78. package/dist/store/index.js +87 -83
  79. package/dist/store/reducers.d.ts +7 -7
  80. package/dist/store/reducers.js +4 -4
  81. package/dist/utilities/handleSubmitNumber.d.ts +7 -3
  82. package/dist/utilities/handleSubmitNumber.js +15 -18
  83. package/dist/utilities/index.d.ts +1 -1
  84. package/dist/utilities/index.js +13 -11
  85. package/dist/utilities/loadScriptInnerHtml.js +0 -1
  86. package/index.html +21 -28
  87. package/package.json +23 -15
  88. package/setupJest.js +1 -1
  89. package/tsconfig.json +2 -2
  90. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  91. package/.idea/modules.xml +0 -8
  92. package/.idea/ouisys-engine.iml +0 -12
  93. package/.idea/vcs.xml +0 -6
  94. package/.vscode/settings.json +0 -6
  95. package/dist/api/click2sms.js +0 -357
  96. package/dist/api/mo.js +0 -274
  97. package/dist/api/moRedir.js +0 -186
  98. package/dist/api/oneClick.js +0 -366
  99. package/dist/api/pin.js +0 -493
  100. package/dist/api/strategies.js +0 -704
  101. package/dist/api/ussd.js +0 -1
  102. package/dist/app/store.js +0 -35
  103. package/dist/features/strategies/categories/askMobileNumber.js +0 -395
  104. package/dist/features/strategies/categories/askOperator.js +0 -311
  105. package/dist/features/strategies/categories/detectOperatorByIp.js +0 -606
  106. package/dist/features/strategies/categories/headerEnrichment.js +0 -670
  107. package/dist/features/strategies/categories/typings/click2smsSliceTypes.js +0 -12
  108. package/dist/features/strategies/categories/typings/identifySliceTypes.js +0 -22
  109. package/dist/features/strategies/categories/typings/moFlowSliceTypes.js +0 -22
  110. package/dist/features/strategies/categories/typings/moRedirFlowSliceTypes.js +0 -21
  111. package/dist/features/strategies/categories/typings/oneClickSliceTypes.js +0 -13
  112. package/dist/features/strategies/categories/typings/pinFlowSliceTypes.js +0 -13
  113. package/dist/features/strategies/click2smsFlowSlice.js +0 -172
  114. package/dist/features/strategies/identifySlice.js +0 -455
  115. package/dist/features/strategies/moFlowSlice.js +0 -196
  116. package/dist/features/strategies/moRedirFlowSlice.js +0 -190
  117. package/dist/features/strategies/oneClickFlowSlice.js +0 -277
  118. package/dist/features/strategies/pinFlowSlice.js +0 -313
  119. package/dist/features/strategies/ussdFlowSlice.js +0 -1
  120. package/dist/flows/tpayHeFlow.d.ts +0 -7
  121. package/dist/flows/tpayHeFlow.js +0 -23
  122. package/dist/mockServer/browser.js +0 -48
  123. package/dist/mockServer/handlers.js +0 -22
  124. package/dist/mockServer/server.js +0 -48
  125. package/dist/reducers/tpayHeFlow/ITpayHeConstants.d.ts +0 -2
  126. package/dist/reducers/tpayHeFlow/ITpayHeConstants.js +0 -1
  127. package/dist/reducers/tpayHeFlow/TpayHeTypes.d.ts +0 -114
  128. package/dist/reducers/tpayHeFlow/TpayHeTypes.js +0 -1
  129. package/dist/reducers/tpayHeFlow/index.d.ts +0 -7
  130. package/dist/reducers/tpayHeFlow/index.js +0 -331
  131. package/dist/reducers/tpayHeFlow/utils.d.ts +0 -20
  132. package/dist/reducers/tpayHeFlow/utils.js +0 -510
  133. package/dist/test/setup.js +0 -24
  134. package/dist/test/test-utils.js +0 -51
  135. package/mockData/config.json +0 -28
  136. package/prettier.config.js +0 -7
  137. package/src/@types/react-tracker.d.ts +0 -16
  138. package/src/@types/redux-cli-logger.d.ts +0 -1
  139. package/src/@types/tiny-async-pool.d.ts +0 -3
  140. package/src/@types/window.d.ts +0 -74
  141. package/src/api/index.ts +0 -225
  142. package/src/common-types/AppThunk.ts +0 -19
  143. package/src/common-types/Either.ts +0 -3
  144. package/src/common-types/IError.ts +0 -5
  145. package/src/common-types/IOptInFlowName.ts +0 -1
  146. package/src/common-types/ITracker.ts +0 -10
  147. package/src/common-types/IVisitor.ts +0 -16
  148. package/src/common-types/RemoteDataState.ts +0 -88
  149. package/src/flows/click2smsFlow.ts +0 -18
  150. package/src/flows/moFlow.ts +0 -20
  151. package/src/flows/moRedirFlow.ts +0 -20
  152. package/src/flows/oneClickFlow.ts +0 -20
  153. package/src/flows/pinFlow.ts +0 -25
  154. package/src/flows/strategy.ts +0 -51
  155. package/src/flows/ussdFlow.ts +0 -20
  156. package/src/index.ts +0 -3
  157. package/src/ips/tryGetIPRangeName.ts +0 -22
  158. package/src/jest.config.js +0 -194
  159. package/src/pacman/index.ts +0 -71
  160. package/src/pacman/queryString.ts +0 -24
  161. package/src/reducers/click2smsFlow/Click2smsTypes.ts +0 -93
  162. package/src/reducers/click2smsFlow/IClick2smsConstants.ts +0 -4
  163. package/src/reducers/click2smsFlow/index.ts +0 -105
  164. package/src/reducers/click2smsFlow/utils.ts +0 -126
  165. package/src/reducers/moFlow/IMoConstants.ts +0 -7
  166. package/src/reducers/moFlow/MoTypes.ts +0 -125
  167. package/src/reducers/moFlow/index.ts +0 -150
  168. package/src/reducers/moFlow/utils.ts +0 -135
  169. package/src/reducers/moRedirFlow/IMoRedirConstants.ts +0 -7
  170. package/src/reducers/moRedirFlow/MoRedirTypes.ts +0 -99
  171. package/src/reducers/moRedirFlow/index.ts +0 -137
  172. package/src/reducers/moRedirFlow/utils.ts +0 -78
  173. package/src/reducers/oneClickFlow/IOneClickConstants.ts +0 -3
  174. package/src/reducers/oneClickFlow/OneClickTypes.ts +0 -108
  175. package/src/reducers/oneClickFlow/index.ts +0 -268
  176. package/src/reducers/oneClickFlow/utils.ts +0 -217
  177. package/src/reducers/pinFlow/IPinConstants.ts +0 -9
  178. package/src/reducers/pinFlow/PinTypes.ts +0 -190
  179. package/src/reducers/pinFlow/index.ts +0 -331
  180. package/src/reducers/pinFlow/utils.ts +0 -232
  181. package/src/reducers/strategy/IStategyActionContants.ts +0 -17
  182. package/src/reducers/strategy/StrategyTypes.ts +0 -375
  183. package/src/reducers/strategy/index.ts +0 -321
  184. package/src/reducers/strategy/strategies/ask_mobile_number.ts +0 -316
  185. package/src/reducers/strategy/strategies/ask_operator.ts +0 -195
  186. package/src/reducers/strategy/strategies/detect_operator_by_ip.ts +0 -414
  187. package/src/reducers/strategy/strategies/header_enrichment.ts +0 -489
  188. package/src/reducers/strategy/utils.ts +0 -357
  189. package/src/reducers/ussdFlow/IUssdConstants.ts +0 -7
  190. package/src/reducers/ussdFlow/UssdTypes.ts +0 -112
  191. package/src/reducers/ussdFlow/index.ts +0 -146
  192. package/src/reducers/ussdFlow/utils.ts +0 -88
  193. package/src/store/index.ts +0 -150
  194. package/src/store/reducers.ts +0 -37
  195. package/src/utilities/handleSubmitNumber.ts +0 -65
  196. package/src/utilities/index.ts +0 -114
  197. package/src/utilities/loadScriptInnerHtml.ts +0 -14
  198. package/src/utilities/loadScriptSrc.ts +0 -26
@@ -1,331 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
-
5
- require("core-js/modules/es.symbol");
6
-
7
- require("core-js/modules/es.symbol.description");
8
-
9
- require("core-js/modules/es.symbol.iterator");
10
-
11
- require("core-js/modules/es.array.iterator");
12
-
13
- require("core-js/modules/es.object.get-own-property-descriptor");
14
-
15
- require("core-js/modules/es.object.to-string");
16
-
17
- require("core-js/modules/es.promise");
18
-
19
- require("core-js/modules/es.string.iterator");
20
-
21
- require("core-js/modules/es.weak-map");
22
-
23
- require("core-js/modules/web.dom-collections.iterator");
24
-
25
- Object.defineProperty(exports, "__esModule", {
26
- value: true
27
- });
28
- exports.loadTpayAction = loadTpayAction;
29
- exports.confirmTpayAction = confirmTpayAction;
30
- exports.mockTpayFlow = mockTpayFlow;
31
- exports.default = TpayHeFlowReducer;
32
- exports.TpayHeFlowFlowActionMaps = void 0;
33
-
34
- require("regenerator-runtime/runtime");
35
-
36
- var RDS = _interopRequireWildcard(require("../../common-types/RemoteDataState"));
37
-
38
- var _utils = require("./utils");
39
-
40
- var _strategy = require("../strategy");
41
-
42
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
43
-
44
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
45
-
46
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
47
-
48
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
49
-
50
- //ACTION CREATORS
51
- function loadTpayAction(theme, locale) {
52
- return /*#__PURE__*/function () {
53
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(dispatch, store) {
54
- var currentState, config, product_url, result, errorType;
55
- return regeneratorRuntime.wrap(function _callee$(_context) {
56
- while (1) {
57
- switch (_context.prev = _context.next) {
58
- case 0:
59
- currentState = store().strategy.currentState;
60
-
61
- if (!(currentState.type === "TPAY_HE")) {
62
- _context.next = 28;
63
- break;
64
- }
65
-
66
- config = currentState.result.config;
67
- _context.prev = 3;
68
- _context.next = 6;
69
- return (0, _utils.confirmTPayCheck)();
70
-
71
- case 6:
72
- product_url = _context.sent;
73
-
74
- if (!(product_url !== null)) {
75
- _context.next = 11;
76
- break;
77
- }
78
-
79
- window.location.href = product_url;
80
- _context.next = 17;
81
- break;
82
-
83
- case 11:
84
- dispatch({
85
- type: "LOAD_TPAY_HE",
86
- payload: {
87
- type: "LOAD_TPAY_HE",
88
- result: RDS.Loading()
89
- }
90
- });
91
- _context.next = 14;
92
- return (0, _utils.getTpayConfig)(window, config);
93
-
94
- case 14:
95
- result = _context.sent;
96
-
97
- // await addLookUpTpay(result, theme, locale);
98
- _strategy.tracker.advancedInFlow('tallyman.v1-tpay-he', 'load-tpay-success');
99
-
100
- dispatch({
101
- type: "LOAD_TPAY_HE_SUCCESS",
102
- payload: {
103
- type: "LOAD_TPAY_HE",
104
- result: RDS.Success(result)
105
- }
106
- });
107
-
108
- case 17:
109
- _context.next = 26;
110
- break;
111
-
112
- case 19:
113
- _context.prev = 19;
114
- _context.t0 = _context["catch"](3);
115
- console.warn(_context.t0); //@ts-ignore
116
-
117
- errorType = "AlreadySubscribed" === _context.t0.type ? "AlreadySubscribed" : "NotSupported" === _context.t0.type ? "NotSupported" : "SubscriptionFailed" === _context.t0.type ? "SubscriptionFailed" : "UnknownError";
118
-
119
- _strategy.tracker.recedeInFlow('tallyman.v1-tpay-he', 'tpay-config-failure', {
120
- errorType: errorType || 'UnknownError'
121
- });
122
-
123
- dispatch({
124
- type: "LOAD_TPAY_HE",
125
- payload: {
126
- type: "LOAD_TPAY_HE",
127
- result: RDS.Failure({
128
- errorType: errorType,
129
- error: _context.t0
130
- })
131
- }
132
- });
133
- dispatch({
134
- type: "IDENTIFY_STRATEGY",
135
- payload: {
136
- type: "PIN",
137
- result: {
138
- nextAction: "submitMSISDNAction",
139
- config: config
140
- }
141
- }
142
- });
143
-
144
- case 26:
145
- _context.next = 31;
146
- break;
147
-
148
- case 28:
149
- _strategy.tracker.recedeInFlow('tallyman.v1-tpay-he', 'tpay-config-failure', {
150
- errorType: 'UnknownError'
151
- });
152
-
153
- dispatch({
154
- type: "LOAD_TPAY_HE",
155
- payload: {
156
- type: "LOAD_TPAY_HE",
157
- result: RDS.Failure({
158
- errorType: "UnexpectedState"
159
- })
160
- }
161
- });
162
- throw "Unexpected state";
163
-
164
- case 31:
165
- case "end":
166
- return _context.stop();
167
- }
168
- }
169
- }, _callee, null, [[3, 19]]);
170
- }));
171
-
172
- return function (_x, _x2) {
173
- return _ref.apply(this, arguments);
174
- };
175
- }();
176
- }
177
-
178
- function confirmTpayAction(locale, redirectUrl) {
179
- return /*#__PURE__*/function () {
180
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(dispatch, store) {
181
- var currentState, tpayConfig, result, errorType;
182
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
183
- while (1) {
184
- switch (_context2.prev = _context2.next) {
185
- case 0:
186
- _context2.prev = 0;
187
- dispatch({
188
- type: "CONFIRM_TPAY_CLICK",
189
- payload: {
190
- type: "CONFIRM_TPAY",
191
- result: RDS.Loading()
192
- }
193
- });
194
-
195
- _strategy.tracker.advancedInFlow('tallyman.v1-tpay-he', 'confirm-tpay-clicked', {});
196
-
197
- currentState = store().strategy.currentState;
198
-
199
- if (!(currentState.type === "TPAY_HE")) {
200
- _context2.next = 13;
201
- break;
202
- }
203
-
204
- tpayConfig = store().tpayHeFlow.tpayConfig; //@ts-ignore
205
-
206
- _context2.next = 8;
207
- return (0, _utils.confirmTPay)(window, tpayConfig, locale, redirectUrl);
208
-
209
- case 8:
210
- result = _context2.sent;
211
-
212
- _strategy.tracker.advancedInFlow('tallyman.v1-tpay-he', 'confirm-tpay-success', {
213
- finalUrl: result
214
- });
215
-
216
- dispatch({
217
- type: "CONFIRM_TPAY_CLICK",
218
- payload: {
219
- type: "CONFIRM_TPAY",
220
- result: RDS.Success({
221
- finalUrl: ""
222
- })
223
- }
224
- });
225
- _context2.next = 16;
226
- break;
227
-
228
- case 13:
229
- _strategy.tracker.recedeInFlow('tallyman.v1-tpay-he', 'confirm-tpay-failure', {});
230
-
231
- dispatch({
232
- type: "CONFIRM_TPAY_CLICK",
233
- payload: {
234
- type: "CONFIRM_TPAY",
235
- result: RDS.Failure({
236
- errorType: "UnexpectedState"
237
- })
238
- }
239
- });
240
- throw "Unexpected state";
241
-
242
- case 16:
243
- _context2.next = 24;
244
- break;
245
-
246
- case 18:
247
- _context2.prev = 18;
248
- _context2.t0 = _context2["catch"](0);
249
- console.error(_context2.t0);
250
- errorType = "AlreadySubscribed" === _context2.t0.type ? "AlreadySubscribed" : "ConfirmError" === _context2.t0.type ? "ConfirmError" : "UnknownError";
251
-
252
- _strategy.tracker.recedeInFlow('tallyman.v1-tpay-he', 'confirm-tpay', {
253
- errorType: errorType || 'UnknownError'
254
- });
255
-
256
- dispatch({
257
- type: "CONFIRM_TPAY_CLICK",
258
- payload: {
259
- type: "CONFIRM_TPAY",
260
- result: RDS.Failure({
261
- errorType: errorType || 'UnknownError'
262
- })
263
- }
264
- });
265
-
266
- case 24:
267
- case "end":
268
- return _context2.stop();
269
- }
270
- }
271
- }, _callee2, null, [[0, 18]]);
272
- }));
273
-
274
- return function (_x3, _x4) {
275
- return _ref2.apply(this, arguments);
276
- };
277
- }();
278
- }
279
-
280
- function mockTpayFlow(mockState) {
281
- return function (dispatch) {
282
- if (mockState !== undefined) {
283
- switch (mockState) {
284
- case "confirm-state":
285
- return dispatch({
286
- type: "MOCK_TPAY_FLOW_STATE",
287
- payload: _utils.mockedConfirmState.currentState
288
- });
289
-
290
- default:
291
- throw "Mock Flow not supported";
292
- }
293
- }
294
- };
295
- }
296
-
297
- var initialState = {
298
- currentState: {
299
- type: "LOAD_TPAY_HE",
300
- result: RDS.NothingYet()
301
- },
302
- tpayConfig: null
303
- };
304
- var TpayHeFlowFlowActionMaps = {
305
- loadTpayAction: loadTpayAction
306
- };
307
- exports.TpayHeFlowFlowActionMaps = TpayHeFlowFlowActionMaps;
308
-
309
- function TpayHeFlowReducer() {
310
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
311
- var action = arguments.length > 1 ? arguments[1] : undefined;
312
-
313
- switch (action.type) {
314
- case "LOAD_TPAY_HE":
315
- return (0, _strategy.genericHandler)(state, action.payload);
316
-
317
- case "CONFIRM_TPAY_CLICK":
318
- //@ts-ignore
319
- return (0, _strategy.genericHandler)(state, action.payload);
320
-
321
- case "LOAD_TPAY_HE_SUCCESS":
322
- return (0, _strategy.genericHandler)(state, action.payload);
323
-
324
- case "MOCK_TPAY_FLOW_STATE":
325
- //@ts-ignore
326
- return handleMockFlow(state, action.payload);
327
-
328
- default:
329
- return state;
330
- }
331
- }
@@ -1,20 +0,0 @@
1
- import { IConfig, ITpayHeFlowReducerState } from "./TpayHeTypes";
2
- import { ITpayConsentResult } from "./TpayHeTypes";
3
- export declare const additionalQueryString = "msisdnSubmitted=Y&legalCheckbox=Y&incentivizedCheckbox=Y&op_confirmCheckbox=N";
4
- export default class ScriptLoader {
5
- private src;
6
- private global;
7
- private protocol;
8
- private isLoaded;
9
- constructor(options: {
10
- src: string;
11
- global: string;
12
- protocol?: string;
13
- });
14
- loadScript(): Promise<unknown>;
15
- load(): Promise<unknown>;
16
- }
17
- export declare const getTpayConfig: (window: Window, maybeConfig: IConfig) => Promise<ITpayConsentResult>;
18
- export declare const confirmTPayCheck: () => Promise<string | null>;
19
- export declare const confirmTPay: (window: Window, tpayConfig: ITpayConsentResult, locale: string, redirectUrl?: string) => void;
20
- export declare const mockedConfirmState: ITpayHeFlowReducerState;