ouisys-engine 2.1.20 → 2.1.25
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.
- package/dist/api/click2sms.js +357 -0
- package/dist/api/index.d.ts +1 -3
- package/dist/api/index.js +97 -173
- package/dist/api/mo.js +274 -0
- package/dist/api/moRedir.js +186 -0
- package/dist/api/oneClick.js +366 -0
- package/dist/api/pin.js +493 -0
- package/dist/api/strategies.js +704 -0
- package/dist/api/ussd.js +1 -0
- package/dist/app/store.js +35 -0
- package/dist/common-types/AppThunk.d.ts +1 -2
- package/dist/features/strategies/categories/askMobileNumber.js +395 -0
- package/dist/features/strategies/categories/askOperator.js +311 -0
- package/dist/features/strategies/categories/detectOperatorByIp.js +606 -0
- package/dist/features/strategies/categories/headerEnrichment.js +670 -0
- package/dist/features/strategies/categories/typings/click2smsSliceTypes.js +12 -0
- package/dist/features/strategies/categories/typings/identifySliceTypes.js +22 -0
- package/dist/features/strategies/categories/typings/moFlowSliceTypes.js +22 -0
- package/dist/features/strategies/categories/typings/moRedirFlowSliceTypes.js +21 -0
- package/dist/features/strategies/categories/typings/oneClickSliceTypes.js +13 -0
- package/dist/features/strategies/categories/typings/pinFlowSliceTypes.js +13 -0
- package/dist/features/strategies/click2smsFlowSlice.js +172 -0
- package/dist/features/strategies/identifySlice.js +455 -0
- package/dist/features/strategies/moFlowSlice.js +196 -0
- package/dist/features/strategies/moRedirFlowSlice.js +190 -0
- package/dist/features/strategies/oneClickFlowSlice.js +277 -0
- package/dist/features/strategies/pinFlowSlice.js +313 -0
- package/dist/features/strategies/ussdFlowSlice.js +1 -0
- package/dist/flows/strategy.d.ts +1 -2
- package/dist/flows/strategy.js +1 -5
- package/dist/ips/tryGetIPRangeName.js +14 -13
- package/dist/mockServer/browser.js +48 -0
- package/dist/mockServer/handlers.js +22 -0
- package/dist/mockServer/server.js +48 -0
- package/dist/pacman/index.js +0 -1
- package/dist/reducers/click2smsFlow/utils.js +1 -3
- package/dist/reducers/moRedirFlow/utils.js +1 -1
- package/dist/reducers/oneClickFlow/utils.js +9 -8
- package/dist/reducers/pinFlow/utils.js +17 -16
- package/dist/reducers/strategy/utils.js +12 -13
- package/dist/reducers/tpayHeFlow/utils.js +1 -1
- package/dist/store/index.d.ts +1 -2
- package/dist/store/reducers.d.ts +0 -2
- package/dist/store/reducers.js +1 -4
- package/dist/test/setup.js +24 -0
- package/dist/test/test-utils.js +51 -0
- package/package.json +1 -1
- package/src/@types/window.d.ts +1 -0
- package/src/api/index.ts +8 -41
- package/src/common-types/AppThunk.ts +1 -2
- package/src/flows/strategy.ts +1 -5
- package/src/ips/tryGetIPRangeName.ts +3 -2
- package/src/pacman/index.ts +1 -1
- package/src/reducers/click2smsFlow/utils.ts +0 -3
- package/src/reducers/moRedirFlow/utils.ts +1 -1
- package/src/reducers/oneClickFlow/utils.ts +4 -3
- package/src/reducers/pinFlow/utils.ts +4 -2
- package/src/reducers/strategy/utils.ts +2 -3
- package/src/store/index.ts +1 -2
- package/src/store/reducers.ts +1 -5
- package/yarn.lock +5204 -0
- package/src/flows/tpayHeFlow.ts +0 -20
- package/src/reducers/tpayHeFlow/ITpayHeConstants.ts +0 -7
- package/src/reducers/tpayHeFlow/TpayHeTypes.ts +0 -135
- package/src/reducers/tpayHeFlow/index.ts +0 -207
- package/src/reducers/tpayHeFlow/utils.ts +0 -311
package/dist/api/ussd.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.store = void 0;
|
|
7
|
+
|
|
8
|
+
var _toolkit = require("@reduxjs/toolkit");
|
|
9
|
+
|
|
10
|
+
var _click2smsFlowSlice = _interopRequireDefault(require("../features/strategies/click2smsFlowSlice"));
|
|
11
|
+
|
|
12
|
+
var _identifySlice = _interopRequireDefault(require("../features/strategies/identifySlice"));
|
|
13
|
+
|
|
14
|
+
var _moFlowSlice = _interopRequireDefault(require("../features/strategies/moFlowSlice"));
|
|
15
|
+
|
|
16
|
+
var _moRedirFlowSlice = _interopRequireDefault(require("../features/strategies/moRedirFlowSlice"));
|
|
17
|
+
|
|
18
|
+
var _oneClickFlowSlice = _interopRequireDefault(require("../features/strategies/oneClickFlowSlice"));
|
|
19
|
+
|
|
20
|
+
var _pinFlowSlice = _interopRequireDefault(require("../features/strategies/pinFlowSlice"));
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
|
|
24
|
+
// acts like compbine reducers if we pass an object
|
|
25
|
+
var store = (0, _toolkit.configureStore)({
|
|
26
|
+
reducer: {
|
|
27
|
+
strategy: _identifySlice.default,
|
|
28
|
+
pinFlow: _pinFlowSlice.default,
|
|
29
|
+
moFlow: _moFlowSlice.default,
|
|
30
|
+
moRedirFlow: _moRedirFlowSlice.default,
|
|
31
|
+
click2smsFlow: _click2smsFlowSlice.default,
|
|
32
|
+
oneClickFlow: _oneClickFlowSlice.default
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
exports.store = store;
|
|
@@ -8,7 +8,6 @@ import IMoRedirConstants from "../reducers/moRedirFlow/IMoRedirConstants";
|
|
|
8
8
|
import IOneClickConstants from "../reducers/oneClickFlow/IOneClickConstants";
|
|
9
9
|
import IClick2smsConstants from "../reducers/click2smsFlow/IClick2smsConstants";
|
|
10
10
|
import IUssdConstants from "../reducers/ussdFlow/IUssdConstants";
|
|
11
|
-
|
|
12
|
-
declare type IAllActionConstants = IStategyActionContants | IPinConstants | IMoConstants | IMoRedirConstants | IOneClickConstants | IClick2smsConstants | IUssdConstants | ITpayHeConstants;
|
|
11
|
+
declare type IAllActionConstants = IStategyActionContants | IPinConstants | IMoConstants | IMoRedirConstants | IOneClickConstants | IClick2smsConstants | IUssdConstants;
|
|
13
12
|
export declare type AppThunk<ReturnType = void> = ThunkAction<ReturnType, IApplicationState, unknown, Action<IAllActionConstants>>;
|
|
14
13
|
export {};
|
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _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.filter");
|
|
12
|
+
|
|
13
|
+
require("core-js/modules/es.array.iterator");
|
|
14
|
+
|
|
15
|
+
require("core-js/modules/es.object.get-own-property-descriptor");
|
|
16
|
+
|
|
17
|
+
require("core-js/modules/es.object.get-own-property-descriptors");
|
|
18
|
+
|
|
19
|
+
require("core-js/modules/es.object.keys");
|
|
20
|
+
|
|
21
|
+
require("core-js/modules/es.object.to-string");
|
|
22
|
+
|
|
23
|
+
require("core-js/modules/es.promise");
|
|
24
|
+
|
|
25
|
+
require("core-js/modules/es.string.iterator");
|
|
26
|
+
|
|
27
|
+
require("core-js/modules/es.weak-map");
|
|
28
|
+
|
|
29
|
+
require("core-js/modules/web.dom-collections.for-each");
|
|
30
|
+
|
|
31
|
+
require("core-js/modules/web.dom-collections.iterator");
|
|
32
|
+
|
|
33
|
+
Object.defineProperty(exports, "__esModule", {
|
|
34
|
+
value: true
|
|
35
|
+
});
|
|
36
|
+
exports.pinMoRedirAskMobileNumber = exports.pinMoAskMobileNumber = exports.pin = exports.identifySubmitMSISDNAction = exports.askMobileNumber = void 0;
|
|
37
|
+
|
|
38
|
+
require("regenerator-runtime/runtime");
|
|
39
|
+
|
|
40
|
+
var _toolkit = require("@reduxjs/toolkit");
|
|
41
|
+
|
|
42
|
+
var _strategies = require("../../../api/strategies");
|
|
43
|
+
|
|
44
|
+
var RDS = _interopRequireWildcard(require("../../../common-types/RemoteDataState"));
|
|
45
|
+
|
|
46
|
+
var _identifySlice = require("../identifySlice");
|
|
47
|
+
|
|
48
|
+
var _identifySliceTypes = require("./typings/identifySliceTypes");
|
|
49
|
+
|
|
50
|
+
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); }
|
|
51
|
+
|
|
52
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
|
|
53
|
+
|
|
54
|
+
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); } }
|
|
55
|
+
|
|
56
|
+
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); }); }; }
|
|
57
|
+
|
|
58
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
59
|
+
|
|
60
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
61
|
+
|
|
62
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
63
|
+
|
|
64
|
+
var oneClick = function oneClick(_ref) {
|
|
65
|
+
var flowObj = _ref.flowObj,
|
|
66
|
+
msisdn = _ref.msisdn;
|
|
67
|
+
|
|
68
|
+
_identifySlice.tracker.sendOptInFlowEvent('3G click');
|
|
69
|
+
|
|
70
|
+
return {
|
|
71
|
+
type: _identifySliceTypes.StrategyStates.ONE_CLICK,
|
|
72
|
+
result: {},
|
|
73
|
+
nextData: {
|
|
74
|
+
config: flowObj.flowConfig,
|
|
75
|
+
operator: flowObj.operator,
|
|
76
|
+
msisdn: msisdn
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
var pin = function pin(_ref2) {
|
|
82
|
+
var flowObj = _ref2.flowObj,
|
|
83
|
+
msisdn = _ref2.msisdn;
|
|
84
|
+
|
|
85
|
+
_identifySlice.tracker.sendOptInFlowEvent('Pin');
|
|
86
|
+
|
|
87
|
+
return {
|
|
88
|
+
type: _identifySliceTypes.StrategyStates.PIN,
|
|
89
|
+
result: {},
|
|
90
|
+
nextData: {
|
|
91
|
+
config: flowObj.flowConfig,
|
|
92
|
+
operator: flowObj.operator,
|
|
93
|
+
msisdn: msisdn
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
exports.pin = pin;
|
|
99
|
+
|
|
100
|
+
var moRedir = function moRedir(_ref3) {
|
|
101
|
+
var flowObj = _ref3.flowObj,
|
|
102
|
+
msisdn = _ref3.msisdn;
|
|
103
|
+
|
|
104
|
+
_identifySlice.tracker.sendOptInFlowEvent('Redirect');
|
|
105
|
+
|
|
106
|
+
return {
|
|
107
|
+
type: _identifySliceTypes.StrategyStates.MO_REDIR,
|
|
108
|
+
result: {},
|
|
109
|
+
nextData: {
|
|
110
|
+
config: flowObj.flowConfig,
|
|
111
|
+
operator: flowObj.operator,
|
|
112
|
+
msisdn: msisdn
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
var click2sms = function click2sms(_ref4) {
|
|
118
|
+
var flowObj = _ref4.flowObj,
|
|
119
|
+
msisdn = _ref4.msisdn;
|
|
120
|
+
|
|
121
|
+
_identifySlice.tracker.sendOptInFlowEvent('Click to sms');
|
|
122
|
+
|
|
123
|
+
return {
|
|
124
|
+
type: _identifySliceTypes.StrategyStates.CLICK2SMS,
|
|
125
|
+
result: {},
|
|
126
|
+
nextData: {
|
|
127
|
+
config: _objectSpread({
|
|
128
|
+
operators: [flowObj.operator]
|
|
129
|
+
}, flowObj.flowConfig),
|
|
130
|
+
operator: flowObj.operator,
|
|
131
|
+
msisdn: msisdn
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
var mo = function mo(_ref5) {
|
|
137
|
+
var flowObj = _ref5.flowObj,
|
|
138
|
+
msisdn = _ref5.msisdn;
|
|
139
|
+
|
|
140
|
+
_identifySlice.tracker.sendOptInFlowEvent('Msisdn to sms');
|
|
141
|
+
|
|
142
|
+
return {
|
|
143
|
+
type: _identifySliceTypes.StrategyStates.MO,
|
|
144
|
+
result: {},
|
|
145
|
+
nextData: {
|
|
146
|
+
config: flowObj.flowConfig,
|
|
147
|
+
operator: flowObj.operator,
|
|
148
|
+
msisdn: msisdn
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
var pinMoRedirAskMobileNumber = /*#__PURE__*/function () {
|
|
154
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(_ref6) {
|
|
155
|
+
var configs, flowObj, internationalMSISDN, strategyConfigs, defaultFlow;
|
|
156
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
157
|
+
while (1) {
|
|
158
|
+
switch (_context.prev = _context.next) {
|
|
159
|
+
case 0:
|
|
160
|
+
configs = _ref6.configs, flowObj = _ref6.flowObj, internationalMSISDN = _ref6.internationalMSISDN;
|
|
161
|
+
strategyConfigs = configs.strategyConfigs;
|
|
162
|
+
defaultFlow = strategyConfigs.default;
|
|
163
|
+
_context.prev = 3;
|
|
164
|
+
_context.t0 = flowObj.flow;
|
|
165
|
+
_context.next = _context.t0 === 'pin' ? 7 : _context.t0 === 'moRedir' ? 8 : 9;
|
|
166
|
+
break;
|
|
167
|
+
|
|
168
|
+
case 7:
|
|
169
|
+
return _context.abrupt("return", pin({
|
|
170
|
+
flowObj: flowObj,
|
|
171
|
+
msisdn: internationalMSISDN
|
|
172
|
+
}));
|
|
173
|
+
|
|
174
|
+
case 8:
|
|
175
|
+
return _context.abrupt("return", moRedir({
|
|
176
|
+
flowObj: flowObj,
|
|
177
|
+
msisdn: internationalMSISDN
|
|
178
|
+
}));
|
|
179
|
+
|
|
180
|
+
case 9:
|
|
181
|
+
return _context.abrupt("return", pin({
|
|
182
|
+
flowObj: _objectSpread(_objectSpread({}, defaultFlow), {}, {
|
|
183
|
+
operator: flowObj.operator
|
|
184
|
+
}),
|
|
185
|
+
msisdn: internationalMSISDN
|
|
186
|
+
}));
|
|
187
|
+
|
|
188
|
+
case 10:
|
|
189
|
+
_context.next = 16;
|
|
190
|
+
break;
|
|
191
|
+
|
|
192
|
+
case 12:
|
|
193
|
+
_context.prev = 12;
|
|
194
|
+
_context.t1 = _context["catch"](3);
|
|
195
|
+
console.warn(_context.t1);
|
|
196
|
+
return _context.abrupt("return", pin({
|
|
197
|
+
flowObj: defaultFlow,
|
|
198
|
+
msisdn: internationalMSISDN
|
|
199
|
+
}));
|
|
200
|
+
|
|
201
|
+
case 16:
|
|
202
|
+
case "end":
|
|
203
|
+
return _context.stop();
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}, _callee, null, [[3, 12]]);
|
|
207
|
+
}));
|
|
208
|
+
|
|
209
|
+
return function pinMoRedirAskMobileNumber(_x) {
|
|
210
|
+
return _ref7.apply(this, arguments);
|
|
211
|
+
};
|
|
212
|
+
}();
|
|
213
|
+
|
|
214
|
+
exports.pinMoRedirAskMobileNumber = pinMoRedirAskMobileNumber;
|
|
215
|
+
|
|
216
|
+
var pinMoAskMobileNumber = /*#__PURE__*/function () {
|
|
217
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(_ref8) {
|
|
218
|
+
var configs, flowObj, internationalMSISDN, strategyConfigs, defaultFlow;
|
|
219
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
220
|
+
while (1) {
|
|
221
|
+
switch (_context2.prev = _context2.next) {
|
|
222
|
+
case 0:
|
|
223
|
+
configs = _ref8.configs, flowObj = _ref8.flowObj, internationalMSISDN = _ref8.internationalMSISDN;
|
|
224
|
+
strategyConfigs = configs.strategyConfigs;
|
|
225
|
+
defaultFlow = strategyConfigs.default;
|
|
226
|
+
_context2.prev = 3;
|
|
227
|
+
_context2.t0 = flowObj.flow;
|
|
228
|
+
_context2.next = _context2.t0 === 'pin' ? 7 : _context2.t0 === 'mo' ? 8 : 9;
|
|
229
|
+
break;
|
|
230
|
+
|
|
231
|
+
case 7:
|
|
232
|
+
return _context2.abrupt("return", pin({
|
|
233
|
+
flowObj: flowObj,
|
|
234
|
+
msisdn: internationalMSISDN
|
|
235
|
+
}));
|
|
236
|
+
|
|
237
|
+
case 8:
|
|
238
|
+
return _context2.abrupt("return", mo({
|
|
239
|
+
flowObj: flowObj,
|
|
240
|
+
msisdn: internationalMSISDN
|
|
241
|
+
}));
|
|
242
|
+
|
|
243
|
+
case 9:
|
|
244
|
+
return _context2.abrupt("return", pin({
|
|
245
|
+
flowObj: _objectSpread(_objectSpread({}, defaultFlow), {}, {
|
|
246
|
+
operator: flowObj.operator
|
|
247
|
+
}),
|
|
248
|
+
msisdn: internationalMSISDN
|
|
249
|
+
}));
|
|
250
|
+
|
|
251
|
+
case 10:
|
|
252
|
+
_context2.next = 16;
|
|
253
|
+
break;
|
|
254
|
+
|
|
255
|
+
case 12:
|
|
256
|
+
_context2.prev = 12;
|
|
257
|
+
_context2.t1 = _context2["catch"](3);
|
|
258
|
+
console.warn(_context2.t1);
|
|
259
|
+
return _context2.abrupt("return", pin({
|
|
260
|
+
flowObj: defaultFlow,
|
|
261
|
+
msisdn: internationalMSISDN
|
|
262
|
+
}));
|
|
263
|
+
|
|
264
|
+
case 16:
|
|
265
|
+
case "end":
|
|
266
|
+
return _context2.stop();
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}, _callee2, null, [[3, 12]]);
|
|
270
|
+
}));
|
|
271
|
+
|
|
272
|
+
return function pinMoAskMobileNumber(_x2) {
|
|
273
|
+
return _ref9.apply(this, arguments);
|
|
274
|
+
};
|
|
275
|
+
}();
|
|
276
|
+
|
|
277
|
+
exports.pinMoAskMobileNumber = pinMoAskMobileNumber;
|
|
278
|
+
|
|
279
|
+
var askMobileNumber = /*#__PURE__*/function () {
|
|
280
|
+
var _ref11 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(_ref10) {
|
|
281
|
+
var configs;
|
|
282
|
+
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
283
|
+
while (1) {
|
|
284
|
+
switch (_context3.prev = _context3.next) {
|
|
285
|
+
case 0:
|
|
286
|
+
configs = _ref10.configs;
|
|
287
|
+
return _context3.abrupt("return", {
|
|
288
|
+
type: _identifySliceTypes.StrategyStates.IDENTIFY_FLOW_BY_MSISDN,
|
|
289
|
+
result: RDS.NothingYet()
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
case 2:
|
|
293
|
+
case "end":
|
|
294
|
+
return _context3.stop();
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}, _callee3);
|
|
298
|
+
}));
|
|
299
|
+
|
|
300
|
+
return function askMobileNumber(_x3) {
|
|
301
|
+
return _ref11.apply(this, arguments);
|
|
302
|
+
};
|
|
303
|
+
}();
|
|
304
|
+
|
|
305
|
+
exports.askMobileNumber = askMobileNumber;
|
|
306
|
+
var identifySubmitMSISDNAction = (0, _toolkit.createAsyncThunk)('strategy/submitMSISDNAction',
|
|
307
|
+
/*#__PURE__*/
|
|
308
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
309
|
+
// @ts-ignore
|
|
310
|
+
function () {
|
|
311
|
+
var _ref12 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(payload, thunkApi) {
|
|
312
|
+
var configs, strategy, internationalMSISDN, flowObj, errorType;
|
|
313
|
+
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
314
|
+
while (1) {
|
|
315
|
+
switch (_context4.prev = _context4.next) {
|
|
316
|
+
case 0:
|
|
317
|
+
configs = payload.configs || (0, _strategies.getConfig)();
|
|
318
|
+
strategy = configs.strategy;
|
|
319
|
+
internationalMSISDN = payload.internationalMSISDN;
|
|
320
|
+
_context4.prev = 3;
|
|
321
|
+
_context4.next = 6;
|
|
322
|
+
return (0, _strategies.determineFlowByMsidn)({
|
|
323
|
+
internationalMSISDN: internationalMSISDN,
|
|
324
|
+
configs: configs
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
case 6:
|
|
328
|
+
flowObj = _context4.sent;
|
|
329
|
+
_context4.t0 = strategy;
|
|
330
|
+
_context4.next = _context4.t0 === 'pin-mo-redir-ask-mobile-number' ? 10 : _context4.t0 === 'pin-mo-ask-mobile-number' ? 13 : 16;
|
|
331
|
+
break;
|
|
332
|
+
|
|
333
|
+
case 10:
|
|
334
|
+
_context4.next = 12;
|
|
335
|
+
return pinMoRedirAskMobileNumber({
|
|
336
|
+
configs: configs,
|
|
337
|
+
flowObj: flowObj,
|
|
338
|
+
internationalMSISDN: internationalMSISDN
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
case 12:
|
|
342
|
+
return _context4.abrupt("return", _context4.sent);
|
|
343
|
+
|
|
344
|
+
case 13:
|
|
345
|
+
_context4.next = 15;
|
|
346
|
+
return pinMoAskMobileNumber({
|
|
347
|
+
configs: configs,
|
|
348
|
+
flowObj: flowObj,
|
|
349
|
+
internationalMSISDN: internationalMSISDN
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
case 15:
|
|
353
|
+
return _context4.abrupt("return", _context4.sent);
|
|
354
|
+
|
|
355
|
+
case 16:
|
|
356
|
+
console.error('identifySubmitMSISDNAction', 'Strategy not supported');
|
|
357
|
+
return _context4.abrupt("return", thunkApi.rejectWithValue({
|
|
358
|
+
type: _identifySliceTypes.StrategyStates.IDENTIFY_FLOW_BY_MSISDN,
|
|
359
|
+
result: RDS.Failure({
|
|
360
|
+
errorType: 'UnknownError',
|
|
361
|
+
error: 'Strategy Not Supported'
|
|
362
|
+
})
|
|
363
|
+
}));
|
|
364
|
+
|
|
365
|
+
case 18:
|
|
366
|
+
_context4.next = 25;
|
|
367
|
+
break;
|
|
368
|
+
|
|
369
|
+
case 20:
|
|
370
|
+
_context4.prev = 20;
|
|
371
|
+
_context4.t1 = _context4["catch"](3);
|
|
372
|
+
console.error('identifySubmitMSISDNAction', JSON.stringify(_context4.t1));
|
|
373
|
+
errorType = // eslint-disable-next-line no-nested-ternary
|
|
374
|
+
_context4.t1.type === 'SEAlreadySubscribed' ? 'AlreadySubscribed' : _context4.t1.type == 'SEInvalidMSISDN' ? 'InvalidMSISDN' : 'UnknownError';
|
|
375
|
+
return _context4.abrupt("return", thunkApi.rejectWithValue({
|
|
376
|
+
type: _identifySliceTypes.StrategyStates.IDENTIFY_FLOW_BY_MSISDN,
|
|
377
|
+
result: RDS.Failure({
|
|
378
|
+
errorType: errorType,
|
|
379
|
+
error: _context4.t1
|
|
380
|
+
})
|
|
381
|
+
}));
|
|
382
|
+
|
|
383
|
+
case 25:
|
|
384
|
+
case "end":
|
|
385
|
+
return _context4.stop();
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}, _callee4, null, [[3, 20]]);
|
|
389
|
+
}));
|
|
390
|
+
|
|
391
|
+
return function (_x4, _x5) {
|
|
392
|
+
return _ref12.apply(this, arguments);
|
|
393
|
+
};
|
|
394
|
+
}());
|
|
395
|
+
exports.identifySubmitMSISDNAction = identifySubmitMSISDNAction;
|