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