ouisys-engine 3.0.3 → 3.0.7
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/.babelrc +4 -8
- package/.eslintrc.js +1 -1
- package/.nvmrc +1 -1
- package/.prettierignore +2 -1
- package/README.md +2 -4
- package/dist/api/index.d.ts +5 -5
- package/dist/api/index.js +76 -76
- package/dist/common-types/AppThunk.d.ts +11 -12
- package/dist/common-types/IOptInFlowName.d.ts +1 -1
- package/dist/common-types/ITracker.js +1 -2
- package/dist/common-types/RemoteDataState.d.ts +4 -4
- package/dist/common-types/RemoteDataState.js +17 -17
- package/dist/flows/click2smsFlow.d.ts +2 -2
- package/dist/flows/moFlow.d.ts +2 -2
- package/dist/flows/moRedirFlow.d.ts +2 -2
- package/dist/flows/oneClickFlow.d.ts +2 -2
- package/dist/flows/pinFlow.d.ts +2 -2
- package/dist/flows/pinFlow.js +2 -0
- package/dist/flows/strategy.d.ts +8 -8
- package/dist/flows/ussdFlow.d.ts +2 -2
- package/dist/ips/tryGetIPRangeName.d.ts +1 -1
- package/dist/ips/tryGetIPRangeName.js +7 -5
- package/dist/jest.config.js +1 -1
- package/dist/pacman/index.d.ts +2 -2
- package/dist/pacman/index.js +41 -41
- package/dist/pacman/queryString.js +11 -9
- package/dist/reducers/click2smsFlow/Click2smsTypes.d.ts +19 -19
- package/dist/reducers/click2smsFlow/IClick2smsConstants.d.ts +1 -1
- package/dist/reducers/click2smsFlow/index.d.ts +2 -2
- package/dist/reducers/click2smsFlow/index.js +24 -24
- package/dist/reducers/click2smsFlow/utils.d.ts +1 -1
- package/dist/reducers/click2smsFlow/utils.js +30 -30
- package/dist/reducers/moFlow/IMoConstants.d.ts +1 -1
- package/dist/reducers/moFlow/MoTypes.d.ts +13 -13
- package/dist/reducers/moFlow/index.d.ts +3 -3
- package/dist/reducers/moFlow/index.js +27 -27
- package/dist/reducers/moFlow/utils.d.ts +1 -2
- package/dist/reducers/moFlow/utils.js +28 -26
- package/dist/reducers/moRedirFlow/IMoRedirConstants.d.ts +1 -1
- package/dist/reducers/moRedirFlow/MoRedirTypes.d.ts +13 -13
- package/dist/reducers/moRedirFlow/index.d.ts +3 -3
- package/dist/reducers/moRedirFlow/index.js +27 -27
- package/dist/reducers/moRedirFlow/utils.d.ts +1 -1
- package/dist/reducers/moRedirFlow/utils.js +17 -17
- package/dist/reducers/oneClickFlow/IOneClickConstants.d.ts +1 -1
- package/dist/reducers/oneClickFlow/OneClickTypes.d.ts +10 -10
- package/dist/reducers/oneClickFlow/index.d.ts +3 -3
- package/dist/reducers/oneClickFlow/index.js +75 -68
- package/dist/reducers/oneClickFlow/utils.d.ts +2 -2
- package/dist/reducers/oneClickFlow/utils.js +38 -38
- package/dist/reducers/pinFlow/IPinConstants.d.ts +1 -1
- package/dist/reducers/pinFlow/PinTypes.d.ts +23 -23
- package/dist/reducers/pinFlow/index.d.ts +3 -3
- package/dist/reducers/pinFlow/index.js +76 -76
- package/dist/reducers/pinFlow/utils.d.ts +1 -1
- package/dist/reducers/pinFlow/utils.js +61 -65
- package/dist/reducers/strategy/IStategyActionContants.d.ts +1 -1
- package/dist/reducers/strategy/StrategyTypes.d.ts +56 -56
- package/dist/reducers/strategy/index.d.ts +2 -2
- package/dist/reducers/strategy/index.js +99 -99
- package/dist/reducers/strategy/strategies/ask_mobile_number.d.ts +2 -2
- package/dist/reducers/strategy/strategies/ask_mobile_number.js +78 -78
- package/dist/reducers/strategy/strategies/ask_operator.d.ts +2 -2
- package/dist/reducers/strategy/strategies/ask_operator.js +64 -68
- package/dist/reducers/strategy/strategies/detect_operator_by_ip.d.ts +2 -2
- package/dist/reducers/strategy/strategies/detect_operator_by_ip.js +97 -97
- package/dist/reducers/strategy/strategies/header_enrichment.d.ts +2 -2
- package/dist/reducers/strategy/strategies/header_enrichment.js +116 -120
- package/dist/reducers/strategy/utils.d.ts +3 -3
- package/dist/reducers/strategy/utils.js +115 -111
- package/dist/reducers/ussdFlow/IUssdConstants.d.ts +1 -1
- package/dist/reducers/ussdFlow/UssdTypes.d.ts +13 -13
- package/dist/reducers/ussdFlow/index.d.ts +3 -3
- package/dist/reducers/ussdFlow/index.js +27 -27
- package/dist/reducers/ussdFlow/utils.d.ts +1 -2
- package/dist/reducers/ussdFlow/utils.js +19 -17
- package/dist/store/index.d.ts +8 -8
- package/dist/store/index.js +87 -83
- package/dist/store/reducers.d.ts +7 -7
- package/dist/store/reducers.js +4 -4
- package/dist/utilities/handleSubmitNumber.d.ts +7 -3
- package/dist/utilities/handleSubmitNumber.js +15 -18
- package/dist/utilities/index.d.ts +1 -1
- package/dist/utilities/index.js +13 -11
- package/dist/utilities/loadScriptInnerHtml.js +0 -1
- package/index.html +21 -28
- package/package.json +23 -15
- package/setupJest.js +1 -1
- package/tsconfig.json +2 -2
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/ouisys-engine.iml +0 -12
- package/.idea/vcs.xml +0 -6
- package/.vscode/settings.json +0 -6
- package/dist/api/click2sms.js +0 -357
- package/dist/api/mo.js +0 -274
- package/dist/api/moRedir.js +0 -186
- package/dist/api/oneClick.js +0 -366
- package/dist/api/pin.js +0 -493
- package/dist/api/strategies.js +0 -704
- package/dist/api/ussd.js +0 -1
- package/dist/app/store.js +0 -35
- package/dist/features/strategies/categories/askMobileNumber.js +0 -395
- package/dist/features/strategies/categories/askOperator.js +0 -311
- package/dist/features/strategies/categories/detectOperatorByIp.js +0 -606
- package/dist/features/strategies/categories/headerEnrichment.js +0 -670
- package/dist/features/strategies/categories/typings/click2smsSliceTypes.js +0 -12
- package/dist/features/strategies/categories/typings/identifySliceTypes.js +0 -22
- package/dist/features/strategies/categories/typings/moFlowSliceTypes.js +0 -22
- package/dist/features/strategies/categories/typings/moRedirFlowSliceTypes.js +0 -21
- package/dist/features/strategies/categories/typings/oneClickSliceTypes.js +0 -13
- package/dist/features/strategies/categories/typings/pinFlowSliceTypes.js +0 -13
- package/dist/features/strategies/click2smsFlowSlice.js +0 -172
- package/dist/features/strategies/identifySlice.js +0 -455
- package/dist/features/strategies/moFlowSlice.js +0 -196
- package/dist/features/strategies/moRedirFlowSlice.js +0 -190
- package/dist/features/strategies/oneClickFlowSlice.js +0 -277
- package/dist/features/strategies/pinFlowSlice.js +0 -313
- package/dist/features/strategies/ussdFlowSlice.js +0 -1
- package/dist/flows/tpayHeFlow.d.ts +0 -7
- package/dist/flows/tpayHeFlow.js +0 -23
- package/dist/mockServer/browser.js +0 -48
- package/dist/mockServer/handlers.js +0 -22
- package/dist/mockServer/server.js +0 -48
- package/dist/reducers/tpayHeFlow/ITpayHeConstants.d.ts +0 -2
- package/dist/reducers/tpayHeFlow/ITpayHeConstants.js +0 -1
- package/dist/reducers/tpayHeFlow/TpayHeTypes.d.ts +0 -114
- package/dist/reducers/tpayHeFlow/TpayHeTypes.js +0 -1
- package/dist/reducers/tpayHeFlow/index.d.ts +0 -7
- package/dist/reducers/tpayHeFlow/index.js +0 -331
- package/dist/reducers/tpayHeFlow/utils.d.ts +0 -20
- package/dist/reducers/tpayHeFlow/utils.js +0 -510
- package/dist/test/setup.js +0 -24
- package/dist/test/test-utils.js +0 -51
- package/mockData/config.json +0 -28
- package/prettier.config.js +0 -7
- package/src/@types/react-tracker.d.ts +0 -16
- package/src/@types/redux-cli-logger.d.ts +0 -1
- package/src/@types/tiny-async-pool.d.ts +0 -3
- package/src/@types/window.d.ts +0 -74
- package/src/api/index.ts +0 -225
- package/src/common-types/AppThunk.ts +0 -19
- package/src/common-types/Either.ts +0 -3
- package/src/common-types/IError.ts +0 -5
- package/src/common-types/IOptInFlowName.ts +0 -1
- package/src/common-types/ITracker.ts +0 -10
- package/src/common-types/IVisitor.ts +0 -16
- package/src/common-types/RemoteDataState.ts +0 -88
- package/src/flows/click2smsFlow.ts +0 -18
- package/src/flows/moFlow.ts +0 -20
- package/src/flows/moRedirFlow.ts +0 -20
- package/src/flows/oneClickFlow.ts +0 -20
- package/src/flows/pinFlow.ts +0 -25
- package/src/flows/strategy.ts +0 -51
- package/src/flows/ussdFlow.ts +0 -20
- package/src/index.ts +0 -3
- package/src/ips/tryGetIPRangeName.ts +0 -22
- package/src/jest.config.js +0 -194
- package/src/pacman/index.ts +0 -71
- package/src/pacman/queryString.ts +0 -24
- package/src/reducers/click2smsFlow/Click2smsTypes.ts +0 -93
- package/src/reducers/click2smsFlow/IClick2smsConstants.ts +0 -4
- package/src/reducers/click2smsFlow/index.ts +0 -105
- package/src/reducers/click2smsFlow/utils.ts +0 -126
- package/src/reducers/moFlow/IMoConstants.ts +0 -7
- package/src/reducers/moFlow/MoTypes.ts +0 -125
- package/src/reducers/moFlow/index.ts +0 -150
- package/src/reducers/moFlow/utils.ts +0 -135
- package/src/reducers/moRedirFlow/IMoRedirConstants.ts +0 -7
- package/src/reducers/moRedirFlow/MoRedirTypes.ts +0 -99
- package/src/reducers/moRedirFlow/index.ts +0 -137
- package/src/reducers/moRedirFlow/utils.ts +0 -78
- package/src/reducers/oneClickFlow/IOneClickConstants.ts +0 -3
- package/src/reducers/oneClickFlow/OneClickTypes.ts +0 -108
- package/src/reducers/oneClickFlow/index.ts +0 -268
- package/src/reducers/oneClickFlow/utils.ts +0 -219
- package/src/reducers/pinFlow/IPinConstants.ts +0 -9
- package/src/reducers/pinFlow/PinTypes.ts +0 -190
- package/src/reducers/pinFlow/index.ts +0 -331
- package/src/reducers/pinFlow/utils.ts +0 -232
- package/src/reducers/strategy/IStategyActionContants.ts +0 -17
- package/src/reducers/strategy/StrategyTypes.ts +0 -376
- package/src/reducers/strategy/index.ts +0 -322
- package/src/reducers/strategy/strategies/ask_mobile_number.ts +0 -366
- package/src/reducers/strategy/strategies/ask_operator.ts +0 -195
- package/src/reducers/strategy/strategies/detect_operator_by_ip.ts +0 -414
- package/src/reducers/strategy/strategies/header_enrichment.ts +0 -489
- package/src/reducers/strategy/utils.ts +0 -357
- package/src/reducers/ussdFlow/IUssdConstants.ts +0 -7
- package/src/reducers/ussdFlow/UssdTypes.ts +0 -112
- package/src/reducers/ussdFlow/index.ts +0 -146
- package/src/reducers/ussdFlow/utils.ts +0 -88
- package/src/store/index.ts +0 -150
- package/src/store/reducers.ts +0 -37
- package/src/utilities/handleSubmitNumber.ts +0 -65
- package/src/utilities/index.ts +0 -114
- package/src/utilities/loadScriptInnerHtml.ts +0 -14
- package/src/utilities/loadScriptSrc.ts +0 -26
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { AppThunk } from '../../common-types/AppThunk';
|
|
2
|
+
import * as RDS from '../../common-types/RemoteDataState';
|
|
3
3
|
export declare type IMoFlowCurrentState = {
|
|
4
|
-
type:
|
|
4
|
+
type: 'MSISDNEntry';
|
|
5
5
|
result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
|
|
6
6
|
};
|
|
7
|
-
export declare type MSISDNEntryErrorTypes =
|
|
7
|
+
export declare type MSISDNEntryErrorTypes = 'AlreadySubscribed' | 'UnknownError' | 'InvalidMSISDN' | 'UnexpectedState';
|
|
8
8
|
export declare type MSISDNEntryFailure = {
|
|
9
9
|
errorType: MSISDNEntryErrorTypes;
|
|
10
10
|
error: any;
|
|
@@ -12,7 +12,7 @@ export declare type MSISDNEntryFailure = {
|
|
|
12
12
|
};
|
|
13
13
|
export declare type MSISDNEntrySuccess = IKeywordShortcode;
|
|
14
14
|
export declare type IMsisnSubmitActionPayload = {
|
|
15
|
-
type:
|
|
15
|
+
type: 'MSISDNEntry';
|
|
16
16
|
result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
|
|
17
17
|
};
|
|
18
18
|
export interface IMoFlowReducerState {
|
|
@@ -23,7 +23,7 @@ export declare type IConfig = {
|
|
|
23
23
|
slug?: string;
|
|
24
24
|
country?: string;
|
|
25
25
|
host?: string;
|
|
26
|
-
device?:
|
|
26
|
+
device?: 'smart' | 'feature';
|
|
27
27
|
operators?: string[];
|
|
28
28
|
};
|
|
29
29
|
export declare type IKeywordShortcode = {
|
|
@@ -52,30 +52,30 @@ export declare type ICheckSubscriptionResult = {
|
|
|
52
52
|
rockman_id: string;
|
|
53
53
|
};
|
|
54
54
|
export declare type IBackToStartPayload = {
|
|
55
|
-
type:
|
|
55
|
+
type: 'MSISDNEntry';
|
|
56
56
|
result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
|
|
57
57
|
};
|
|
58
58
|
export declare type IMoActions = {
|
|
59
|
-
type:
|
|
59
|
+
type: 'MO_MSISDN_SUBMIT';
|
|
60
60
|
payload: IMsisnSubmitActionPayload;
|
|
61
61
|
} | {
|
|
62
|
-
type:
|
|
62
|
+
type: 'MO_MSISDN_SUBMIT_ERROR';
|
|
63
63
|
payload: IMsisdnSubmitErrorPayload;
|
|
64
64
|
} | {
|
|
65
|
-
type:
|
|
65
|
+
type: 'MO_BACK_TO_START';
|
|
66
66
|
payload: IBackToStartPayload;
|
|
67
67
|
} | {
|
|
68
|
-
type:
|
|
68
|
+
type: 'MOCK_MO_FLOW_STATE';
|
|
69
69
|
payload: IMoFlowCurrentState;
|
|
70
70
|
};
|
|
71
71
|
export declare type IMsisdnSubmitErrorPayload = {
|
|
72
|
-
type:
|
|
72
|
+
type: 'MSISDNEntry';
|
|
73
73
|
result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
|
|
74
74
|
};
|
|
75
75
|
export declare type IMoFlowActionMaps = {
|
|
76
76
|
submitMSISDNAction: (msisdn: string) => AppThunk;
|
|
77
77
|
};
|
|
78
|
-
export declare type IMockMoFlowStates =
|
|
78
|
+
export declare type IMockMoFlowStates = 'msisdn-entry-success-state' | 'msisdn-entry-failure-state';
|
|
79
79
|
export declare type IGoogleReCaptcha = {
|
|
80
80
|
site_key: string;
|
|
81
81
|
secret_key: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { AppThunk } from '../../common-types/AppThunk';
|
|
2
|
+
import * as RDS from '../../common-types/RemoteDataState';
|
|
3
|
+
import { IMoActions, IMockMoFlowStates, IMoFlowActionMaps, IMoFlowReducerState, MSISDNEntryFailure } from './MoTypes';
|
|
4
4
|
export declare function submitMSISDNAction(msisdn: string, extraParams?: {
|
|
5
5
|
[key: string]: string;
|
|
6
6
|
}): AppThunk;
|
|
@@ -57,10 +57,10 @@ require("core-js/modules/es.promise.js");
|
|
|
57
57
|
|
|
58
58
|
var RDS = _interopRequireWildcard(require("../../common-types/RemoteDataState"));
|
|
59
59
|
|
|
60
|
-
var _utils = _interopRequireWildcard(require("./utils"));
|
|
61
|
-
|
|
62
60
|
var _strategy = require("../strategy");
|
|
63
61
|
|
|
62
|
+
var _utils = _interopRequireWildcard(require("./utils"));
|
|
63
|
+
|
|
64
64
|
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); }
|
|
65
65
|
|
|
66
66
|
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; }
|
|
@@ -77,7 +77,7 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
77
77
|
|
|
78
78
|
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); }); }; }
|
|
79
79
|
|
|
80
|
-
//ACTION CREATORS
|
|
80
|
+
// ACTION CREATORS
|
|
81
81
|
function submitMSISDNAction(msisdn, extraParams) {
|
|
82
82
|
return /*#__PURE__*/function () {
|
|
83
83
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(dispatch, store) {
|
|
@@ -88,7 +88,7 @@ function submitMSISDNAction(msisdn, extraParams) {
|
|
|
88
88
|
case 0:
|
|
89
89
|
currentState = store().strategy.currentState;
|
|
90
90
|
|
|
91
|
-
if (!(currentState.type ===
|
|
91
|
+
if (!(currentState.type === 'MO')) {
|
|
92
92
|
_context.next = 28;
|
|
93
93
|
break;
|
|
94
94
|
}
|
|
@@ -96,9 +96,9 @@ function submitMSISDNAction(msisdn, extraParams) {
|
|
|
96
96
|
config = currentState.result.config;
|
|
97
97
|
_context.prev = 3;
|
|
98
98
|
dispatch({
|
|
99
|
-
type:
|
|
99
|
+
type: 'MO_MSISDN_SUBMIT',
|
|
100
100
|
payload: {
|
|
101
|
-
type:
|
|
101
|
+
type: 'MSISDNEntry',
|
|
102
102
|
result: RDS.Loading()
|
|
103
103
|
}
|
|
104
104
|
});
|
|
@@ -118,9 +118,9 @@ function submitMSISDNAction(msisdn, extraParams) {
|
|
|
118
118
|
});
|
|
119
119
|
|
|
120
120
|
dispatch({
|
|
121
|
-
type:
|
|
121
|
+
type: 'MO_MSISDN_SUBMIT',
|
|
122
122
|
payload: {
|
|
123
|
-
type:
|
|
123
|
+
type: 'MSISDNEntry',
|
|
124
124
|
result: RDS.Success(_objectSpread({}, keywordAndShortcode))
|
|
125
125
|
}
|
|
126
126
|
});
|
|
@@ -150,7 +150,7 @@ function submitMSISDNAction(msisdn, extraParams) {
|
|
|
150
150
|
_context.prev = 20;
|
|
151
151
|
_context.t1 = _context["catch"](3);
|
|
152
152
|
console.warn(_context.t1);
|
|
153
|
-
errorType =
|
|
153
|
+
errorType = _context.t1.type === 'AlreadySubscribed' ? 'AlreadySubscribed' : _context.t1.type == 'InvalidMSISDN' ? 'InvalidMSISDN' : 'UnknownError';
|
|
154
154
|
|
|
155
155
|
_strategy.tracker.recedeInFlow('tallyman.v1-mo', 'msisdn-submission-failure', {
|
|
156
156
|
msisdn: msisdn,
|
|
@@ -158,9 +158,9 @@ function submitMSISDNAction(msisdn, extraParams) {
|
|
|
158
158
|
});
|
|
159
159
|
|
|
160
160
|
dispatch({
|
|
161
|
-
type:
|
|
161
|
+
type: 'MO_MSISDN_SUBMIT_ERROR',
|
|
162
162
|
payload: {
|
|
163
|
-
type:
|
|
163
|
+
type: 'MSISDNEntry',
|
|
164
164
|
result: RDS.Failure({
|
|
165
165
|
errorType: errorType,
|
|
166
166
|
error: _context.t1,
|
|
@@ -175,16 +175,16 @@ function submitMSISDNAction(msisdn, extraParams) {
|
|
|
175
175
|
|
|
176
176
|
case 28:
|
|
177
177
|
dispatch({
|
|
178
|
-
type:
|
|
178
|
+
type: 'MO_MSISDN_SUBMIT_ERROR',
|
|
179
179
|
payload: {
|
|
180
|
-
type:
|
|
180
|
+
type: 'MSISDNEntry',
|
|
181
181
|
result: RDS.Failure({
|
|
182
|
-
errorType:
|
|
182
|
+
errorType: 'UnexpectedState',
|
|
183
183
|
error: null
|
|
184
184
|
})
|
|
185
185
|
}
|
|
186
186
|
});
|
|
187
|
-
throw
|
|
187
|
+
throw 'Unexpected state';
|
|
188
188
|
|
|
189
189
|
case 30:
|
|
190
190
|
case "end":
|
|
@@ -202,9 +202,9 @@ function submitMSISDNAction(msisdn, extraParams) {
|
|
|
202
202
|
|
|
203
203
|
function backToStart() {
|
|
204
204
|
return {
|
|
205
|
-
type:
|
|
205
|
+
type: 'MO_BACK_TO_START',
|
|
206
206
|
payload: {
|
|
207
|
-
type:
|
|
207
|
+
type: 'MSISDNEntry',
|
|
208
208
|
result: RDS.NothingYet()
|
|
209
209
|
}
|
|
210
210
|
};
|
|
@@ -214,20 +214,20 @@ function mockMoFlow(mockState) {
|
|
|
214
214
|
return function (dispatch) {
|
|
215
215
|
if (mockState !== undefined) {
|
|
216
216
|
switch (mockState) {
|
|
217
|
-
case
|
|
217
|
+
case 'msisdn-entry-failure-state':
|
|
218
218
|
return dispatch({
|
|
219
|
-
type:
|
|
219
|
+
type: 'MOCK_MO_FLOW_STATE',
|
|
220
220
|
payload: _utils.mockedMSISDNEntryFailure.currentState
|
|
221
221
|
});
|
|
222
222
|
|
|
223
|
-
case
|
|
223
|
+
case 'msisdn-entry-success-state':
|
|
224
224
|
return dispatch({
|
|
225
|
-
type:
|
|
225
|
+
type: 'MOCK_MO_FLOW_STATE',
|
|
226
226
|
payload: _utils.mockedMSISDNEntrySuccess.currentState
|
|
227
227
|
});
|
|
228
228
|
|
|
229
229
|
default:
|
|
230
|
-
throw
|
|
230
|
+
throw 'Mock Flow not supported';
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
};
|
|
@@ -235,7 +235,7 @@ function mockMoFlow(mockState) {
|
|
|
235
235
|
|
|
236
236
|
var initialState = {
|
|
237
237
|
currentState: {
|
|
238
|
-
type:
|
|
238
|
+
type: 'MSISDNEntry',
|
|
239
239
|
result: RDS.NothingYet()
|
|
240
240
|
}
|
|
241
241
|
};
|
|
@@ -249,16 +249,16 @@ function MoFlowReducer() {
|
|
|
249
249
|
var action = arguments.length > 1 ? arguments[1] : undefined;
|
|
250
250
|
|
|
251
251
|
switch (action.type) {
|
|
252
|
-
case
|
|
252
|
+
case 'MO_MSISDN_SUBMIT':
|
|
253
253
|
return (0, _strategy.genericHandler)(state, action.payload);
|
|
254
254
|
|
|
255
|
-
case
|
|
255
|
+
case 'MO_BACK_TO_START':
|
|
256
256
|
return (0, _strategy.genericHandler)(state, action.payload);
|
|
257
257
|
|
|
258
|
-
case
|
|
258
|
+
case 'MO_MSISDN_SUBMIT_ERROR':
|
|
259
259
|
return (0, _strategy.genericHandler)(state, action.payload);
|
|
260
260
|
|
|
261
|
-
case
|
|
261
|
+
case 'MOCK_MO_FLOW_STATE':
|
|
262
262
|
return (0, _strategy.genericHandler)(state, action.payload);
|
|
263
263
|
|
|
264
264
|
default:
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { IConfig,
|
|
2
|
-
import { IKeywordShortcode } from "./MoTypes";
|
|
1
|
+
import { IConfig, IGoogleReCaptcha, IKeywordShortcode, IMoFlowReducerState } from './MoTypes';
|
|
3
2
|
export default function submitMSISDN(window: Window, maybeConfig: IConfig, internationalMSISDN: string, extraParams?: {
|
|
4
3
|
[key: string]: string;
|
|
5
4
|
}): Promise<IKeywordShortcode>;
|
|
@@ -91,7 +91,7 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
91
91
|
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); }); }; }
|
|
92
92
|
|
|
93
93
|
var wait = function wait(ms) {
|
|
94
|
-
return (
|
|
94
|
+
return (// @ts-ignore
|
|
95
95
|
new Promise(function (resolve) {
|
|
96
96
|
return setTimeout(function () {
|
|
97
97
|
return resolve();
|
|
@@ -114,20 +114,20 @@ var loop = /*#__PURE__*/function () {
|
|
|
114
114
|
r = _context.sent;
|
|
115
115
|
|
|
116
116
|
if (!(stop(r) || i >= max)) {
|
|
117
|
-
_context.next =
|
|
117
|
+
_context.next = 5;
|
|
118
118
|
break;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
return _context.abrupt("return", r);
|
|
122
122
|
|
|
123
|
-
case
|
|
124
|
-
_context.next =
|
|
123
|
+
case 5:
|
|
124
|
+
_context.next = 7;
|
|
125
125
|
return wait(1000);
|
|
126
126
|
|
|
127
|
-
case
|
|
127
|
+
case 7:
|
|
128
128
|
return _context.abrupt("return", loop(f, max, stop, i + 1));
|
|
129
129
|
|
|
130
|
-
case
|
|
130
|
+
case 8:
|
|
131
131
|
case "end":
|
|
132
132
|
return _context.stop();
|
|
133
133
|
}
|
|
@@ -142,11 +142,11 @@ var loop = /*#__PURE__*/function () {
|
|
|
142
142
|
|
|
143
143
|
var getConfig = function getConfig() {
|
|
144
144
|
try {
|
|
145
|
-
var configs = require(
|
|
145
|
+
var configs = require('../../../../../config.json');
|
|
146
146
|
|
|
147
147
|
return configs;
|
|
148
148
|
} catch (ex) {
|
|
149
|
-
throw
|
|
149
|
+
throw 'config.json not found';
|
|
150
150
|
}
|
|
151
151
|
};
|
|
152
152
|
|
|
@@ -230,9 +230,9 @@ function _submitMSISDNWithConfig() {
|
|
|
230
230
|
case 0:
|
|
231
231
|
slug = config.slug, country = config.country, device = config.device, offer = config.offer, host = config.host;
|
|
232
232
|
search = window.location.search.substr(1) || '';
|
|
233
|
-
extraParamsQs = !extraParams ? '' :
|
|
233
|
+
extraParamsQs = !extraParams ? '' : "&".concat(Object.keys(extraParams).map(function (k) {
|
|
234
234
|
return "".concat(k, "=").concat(extraParams[k]);
|
|
235
|
-
}).join('&');
|
|
235
|
+
}).join('&'));
|
|
236
236
|
msisdn = internationalMSISDN.match(/\d+/gi).join('');
|
|
237
237
|
rockmanId = window.pac_analytics.visitor.rockmanId;
|
|
238
238
|
_context4.next = 7;
|
|
@@ -241,15 +241,15 @@ function _submitMSISDNWithConfig() {
|
|
|
241
241
|
case 7:
|
|
242
242
|
result = _context4.sent;
|
|
243
243
|
|
|
244
|
-
if (!(
|
|
244
|
+
if (!(result.success === false)) {
|
|
245
245
|
_context4.next = 17;
|
|
246
246
|
break;
|
|
247
247
|
}
|
|
248
248
|
|
|
249
|
-
type = result.message == 'ALREADY SUBSCRIBED' ?
|
|
249
|
+
type = result.message == 'ALREADY SUBSCRIBED' ? 'AlreadySubscribed' : 'InvalidMSISDN';
|
|
250
250
|
error = new Error("".concat(type, ":\n").concat(result.message));
|
|
251
|
-
error
|
|
252
|
-
error
|
|
251
|
+
error.type = type;
|
|
252
|
+
error.productUrl = result.product_url ? result.product_url : '';
|
|
253
253
|
console.error(error);
|
|
254
254
|
throw error;
|
|
255
255
|
|
|
@@ -295,20 +295,20 @@ function _checkSubscription() {
|
|
|
295
295
|
case 6:
|
|
296
296
|
checkResult = _context5.sent;
|
|
297
297
|
|
|
298
|
-
if (!(
|
|
299
|
-
_context5.next =
|
|
298
|
+
if (!(checkResult.success === true)) {
|
|
299
|
+
_context5.next = 10;
|
|
300
300
|
break;
|
|
301
301
|
}
|
|
302
302
|
|
|
303
303
|
window.location.href = checkResult.product_url;
|
|
304
304
|
return _context5.abrupt("return", checkResult.product_url || null);
|
|
305
305
|
|
|
306
|
-
case
|
|
307
|
-
error = new Error(
|
|
308
|
-
error
|
|
306
|
+
case 10:
|
|
307
|
+
error = new Error('SubscriptionFailed'.concat(":\n", checkResult.message));
|
|
308
|
+
error.type = 'SubscriptionFailed';
|
|
309
309
|
throw error;
|
|
310
310
|
|
|
311
|
-
case
|
|
311
|
+
case 13:
|
|
312
312
|
case "end":
|
|
313
313
|
return _context5.stop();
|
|
314
314
|
}
|
|
@@ -319,15 +319,17 @@ function _checkSubscription() {
|
|
|
319
319
|
}
|
|
320
320
|
|
|
321
321
|
var formatSMSLink = function formatSMSLink(keywordAndShortcode) {
|
|
322
|
-
return (
|
|
323
|
-
!!window.pac_analytics.visitor[
|
|
322
|
+
return (// @ts-ignore
|
|
323
|
+
!!window.pac_analytics.visitor['x-requested-with'] && // @ts-ignore
|
|
324
|
+
window.pac_analytics.visitor['x-requested-with'] !== null && // @ts-ignore
|
|
325
|
+
window.pac_analytics.visitor['x-requested-with'].indexOf('com.facebook') !== -1 ? "sms://".concat(keywordAndShortcode.shortcode, "?body=").concat(keywordAndShortcode.keyword) : typeof navigator !== 'undefined' && (/iPhone/i.test(navigator.userAgent) || /Mac OS/i.test(navigator.userAgent)) ? "sms:".concat(keywordAndShortcode.shortcode, "&body=").concat(keywordAndShortcode.keyword) : "sms:".concat(keywordAndShortcode.shortcode, "?body=").concat(keywordAndShortcode.keyword)
|
|
324
326
|
);
|
|
325
327
|
};
|
|
326
328
|
|
|
327
329
|
exports.formatSMSLink = formatSMSLink;
|
|
328
330
|
var mockedMSISDNEntrySuccess = {
|
|
329
331
|
currentState: {
|
|
330
|
-
type:
|
|
332
|
+
type: 'MSISDNEntry',
|
|
331
333
|
result: RDS.Success({
|
|
332
334
|
keyword: 'TEST OK',
|
|
333
335
|
shortcode: '666'
|
|
@@ -337,10 +339,10 @@ var mockedMSISDNEntrySuccess = {
|
|
|
337
339
|
exports.mockedMSISDNEntrySuccess = mockedMSISDNEntrySuccess;
|
|
338
340
|
var mockedMSISDNEntryFailure = {
|
|
339
341
|
currentState: {
|
|
340
|
-
type:
|
|
342
|
+
type: 'MSISDNEntry',
|
|
341
343
|
result: RDS.Failure({
|
|
342
|
-
errorType:
|
|
343
|
-
error:
|
|
344
|
+
errorType: 'InvalidMSISDN',
|
|
345
|
+
error: 'Invalid Mobile Number'
|
|
344
346
|
})
|
|
345
347
|
}
|
|
346
348
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare type IMoRedirConstants =
|
|
1
|
+
declare type IMoRedirConstants = 'MO_REDIR_MSISDN_SUBMIT' | 'MO_REDIR_MSISDN_SUBMIT_ERROR' | 'MO_REDIR_BACK_TO_START' | 'MOCK_MO_REDIR_FLOW_STATE';
|
|
2
2
|
export default IMoRedirConstants;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { AppThunk } from '../../common-types/AppThunk';
|
|
2
|
+
import * as RDS from '../../common-types/RemoteDataState';
|
|
3
3
|
export declare type IMoRedirFlowCurrentState = {
|
|
4
|
-
type:
|
|
4
|
+
type: 'MSISDNEntry';
|
|
5
5
|
result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
|
|
6
6
|
};
|
|
7
|
-
export declare type MSISDNEntryErrorTypes =
|
|
7
|
+
export declare type MSISDNEntryErrorTypes = 'AlreadySubscribed' | 'UnknownError' | 'InvalidMSISDN' | 'UnexpectedState';
|
|
8
8
|
export declare type MSISDNEntryFailure = {
|
|
9
9
|
errorType: MSISDNEntryErrorTypes;
|
|
10
10
|
error: any;
|
|
@@ -14,7 +14,7 @@ export declare type MSISDNEntrySuccess = {
|
|
|
14
14
|
href: string;
|
|
15
15
|
};
|
|
16
16
|
export declare type IMsisnSubmitActionPayload = {
|
|
17
|
-
type:
|
|
17
|
+
type: 'MSISDNEntry';
|
|
18
18
|
result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
|
|
19
19
|
};
|
|
20
20
|
export interface IMoRedirFlowReducerState {
|
|
@@ -25,7 +25,7 @@ export declare type IConfig = {
|
|
|
25
25
|
slug?: string;
|
|
26
26
|
country?: string;
|
|
27
27
|
host?: string;
|
|
28
|
-
device?:
|
|
28
|
+
device?: 'smart' | 'feature';
|
|
29
29
|
operators?: string[];
|
|
30
30
|
};
|
|
31
31
|
export declare type IMSISDNSubmissionResult = {
|
|
@@ -38,27 +38,27 @@ export declare type IMSISDNSubmissionResult = {
|
|
|
38
38
|
message: string;
|
|
39
39
|
};
|
|
40
40
|
export declare type IBackToStartPayload = {
|
|
41
|
-
type:
|
|
41
|
+
type: 'MSISDNEntry';
|
|
42
42
|
result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
|
|
43
43
|
};
|
|
44
44
|
export declare type IMoRedirActions = {
|
|
45
|
-
type:
|
|
45
|
+
type: 'MO_REDIR_MSISDN_SUBMIT';
|
|
46
46
|
payload: IMsisnSubmitActionPayload;
|
|
47
47
|
} | {
|
|
48
|
-
type:
|
|
48
|
+
type: 'MO_REDIR_MSISDN_SUBMIT_ERROR';
|
|
49
49
|
payload: IMsisdnSubmitErrorPayload;
|
|
50
50
|
} | {
|
|
51
|
-
type:
|
|
51
|
+
type: 'MO_REDIR_BACK_TO_START';
|
|
52
52
|
payload: IBackToStartPayload;
|
|
53
53
|
} | {
|
|
54
|
-
type:
|
|
54
|
+
type: 'MOCK_MO_REDIR_FLOW_STATE';
|
|
55
55
|
payload: IMoRedirFlowCurrentState;
|
|
56
56
|
};
|
|
57
57
|
export declare type IMsisdnSubmitErrorPayload = {
|
|
58
|
-
type:
|
|
58
|
+
type: 'MSISDNEntry';
|
|
59
59
|
result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
|
|
60
60
|
};
|
|
61
61
|
export declare type IMoRedirFlowActionMaps = {
|
|
62
62
|
submitMSISDNAction: (internationalMSISDN: string, bupperMSISDN?: string, rockman_id?: string) => AppThunk;
|
|
63
63
|
};
|
|
64
|
-
export declare type IMockMoRedirFlowStates =
|
|
64
|
+
export declare type IMockMoRedirFlowStates = 'msisdn-entry-success-state' | 'msisdn-entry-failure-state';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { AppThunk } from '../../common-types/AppThunk';
|
|
2
|
+
import * as RDS from '../../common-types/RemoteDataState';
|
|
3
|
+
import { IMockMoRedirFlowStates, IMoRedirActions, IMoRedirFlowActionMaps, IMoRedirFlowReducerState, MSISDNEntryFailure, MSISDNEntrySuccess } from './MoRedirTypes';
|
|
4
4
|
export declare function submitMSISDNAction(msisdn: string): AppThunk;
|
|
5
5
|
export declare function backToStart(): {
|
|
6
6
|
type: string;
|
|
@@ -51,10 +51,10 @@ require("core-js/modules/es.promise.js");
|
|
|
51
51
|
|
|
52
52
|
var RDS = _interopRequireWildcard(require("../../common-types/RemoteDataState"));
|
|
53
53
|
|
|
54
|
-
var _utils = _interopRequireWildcard(require("./utils"));
|
|
55
|
-
|
|
56
54
|
var _strategy = require("../strategy");
|
|
57
55
|
|
|
56
|
+
var _utils = _interopRequireWildcard(require("./utils"));
|
|
57
|
+
|
|
58
58
|
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); }
|
|
59
59
|
|
|
60
60
|
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; }
|
|
@@ -65,7 +65,7 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
65
65
|
|
|
66
66
|
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); }); }; }
|
|
67
67
|
|
|
68
|
-
//ACTION CREATORS
|
|
68
|
+
// ACTION CREATORS
|
|
69
69
|
function submitMSISDNAction(msisdn) {
|
|
70
70
|
return /*#__PURE__*/function () {
|
|
71
71
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(dispatch, store) {
|
|
@@ -76,7 +76,7 @@ function submitMSISDNAction(msisdn) {
|
|
|
76
76
|
case 0:
|
|
77
77
|
currentState = store().strategy.currentState;
|
|
78
78
|
|
|
79
|
-
if (!(currentState.type ===
|
|
79
|
+
if (!(currentState.type === 'MO_REDIR')) {
|
|
80
80
|
_context.next = 21;
|
|
81
81
|
break;
|
|
82
82
|
}
|
|
@@ -84,9 +84,9 @@ function submitMSISDNAction(msisdn) {
|
|
|
84
84
|
config = currentState.result.config;
|
|
85
85
|
_context.prev = 3;
|
|
86
86
|
dispatch({
|
|
87
|
-
type:
|
|
87
|
+
type: 'MO_REDIR_MSISDN_SUBMIT',
|
|
88
88
|
payload: {
|
|
89
|
-
type:
|
|
89
|
+
type: 'MSISDNEntry',
|
|
90
90
|
result: RDS.Loading()
|
|
91
91
|
}
|
|
92
92
|
});
|
|
@@ -106,9 +106,9 @@ function submitMSISDNAction(msisdn) {
|
|
|
106
106
|
});
|
|
107
107
|
|
|
108
108
|
dispatch({
|
|
109
|
-
type:
|
|
109
|
+
type: 'MO_REDIR_MSISDN_SUBMIT',
|
|
110
110
|
payload: {
|
|
111
|
-
type:
|
|
111
|
+
type: 'MSISDNEntry',
|
|
112
112
|
result: RDS.Success({
|
|
113
113
|
href: href
|
|
114
114
|
})
|
|
@@ -121,7 +121,7 @@ function submitMSISDNAction(msisdn) {
|
|
|
121
121
|
_context.prev = 13;
|
|
122
122
|
_context.t0 = _context["catch"](3);
|
|
123
123
|
console.warn(_context.t0);
|
|
124
|
-
errorType =
|
|
124
|
+
errorType = _context.t0.type === 'SEAlreadySubscribed' ? 'AlreadySubscribed' : _context.t0.type == 'SEInvalidMSISDN' ? 'InvalidMSISDN' : 'UnknownError';
|
|
125
125
|
|
|
126
126
|
_strategy.tracker.recedeInFlow('tallyman.v1-mo-redir', 'msisdn-submission-failure', {
|
|
127
127
|
msisdn: msisdn,
|
|
@@ -129,9 +129,9 @@ function submitMSISDNAction(msisdn) {
|
|
|
129
129
|
});
|
|
130
130
|
|
|
131
131
|
dispatch({
|
|
132
|
-
type:
|
|
132
|
+
type: 'MO_REDIR_MSISDN_SUBMIT_ERROR',
|
|
133
133
|
payload: {
|
|
134
|
-
type:
|
|
134
|
+
type: 'MSISDNEntry',
|
|
135
135
|
result: RDS.Failure({
|
|
136
136
|
errorType: errorType,
|
|
137
137
|
error: _context.t0,
|
|
@@ -151,16 +151,16 @@ function submitMSISDNAction(msisdn) {
|
|
|
151
151
|
});
|
|
152
152
|
|
|
153
153
|
dispatch({
|
|
154
|
-
type:
|
|
154
|
+
type: 'MO_REDIR_MSISDN_SUBMIT_ERROR',
|
|
155
155
|
payload: {
|
|
156
|
-
type:
|
|
156
|
+
type: 'MSISDNEntry',
|
|
157
157
|
result: RDS.Failure({
|
|
158
|
-
errorType:
|
|
158
|
+
errorType: 'UnexpectedState',
|
|
159
159
|
error: null
|
|
160
160
|
})
|
|
161
161
|
}
|
|
162
162
|
});
|
|
163
|
-
throw
|
|
163
|
+
throw 'Unexpected state';
|
|
164
164
|
|
|
165
165
|
case 24:
|
|
166
166
|
case "end":
|
|
@@ -178,9 +178,9 @@ function submitMSISDNAction(msisdn) {
|
|
|
178
178
|
|
|
179
179
|
function backToStart() {
|
|
180
180
|
return {
|
|
181
|
-
type:
|
|
181
|
+
type: 'MO_REDIR_BACK_TO_START',
|
|
182
182
|
payload: {
|
|
183
|
-
type:
|
|
183
|
+
type: 'MSISDNEntry',
|
|
184
184
|
result: RDS.NothingYet()
|
|
185
185
|
}
|
|
186
186
|
};
|
|
@@ -190,20 +190,20 @@ function mockMoRedirFlow(mockState) {
|
|
|
190
190
|
return function (dispatch) {
|
|
191
191
|
if (mockState !== undefined) {
|
|
192
192
|
switch (mockState) {
|
|
193
|
-
case
|
|
193
|
+
case 'msisdn-entry-failure-state':
|
|
194
194
|
return dispatch({
|
|
195
|
-
type:
|
|
195
|
+
type: 'MOCK_MO_REDIR_FLOW_STATE',
|
|
196
196
|
payload: _utils.mockedMSISDNEntryFailure.currentState
|
|
197
197
|
});
|
|
198
198
|
|
|
199
|
-
case
|
|
199
|
+
case 'msisdn-entry-success-state':
|
|
200
200
|
return dispatch({
|
|
201
|
-
type:
|
|
201
|
+
type: 'MOCK_MO_REDIR_FLOW_STATE',
|
|
202
202
|
payload: _utils.mockedMSISDNEntrySuccess.currentState
|
|
203
203
|
});
|
|
204
204
|
|
|
205
205
|
default:
|
|
206
|
-
throw
|
|
206
|
+
throw 'Mock Flow not supported';
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
};
|
|
@@ -211,7 +211,7 @@ function mockMoRedirFlow(mockState) {
|
|
|
211
211
|
|
|
212
212
|
var initialState = {
|
|
213
213
|
currentState: {
|
|
214
|
-
type:
|
|
214
|
+
type: 'MSISDNEntry',
|
|
215
215
|
result: RDS.NothingYet()
|
|
216
216
|
}
|
|
217
217
|
};
|
|
@@ -225,16 +225,16 @@ function MoRedirFlowReducer() {
|
|
|
225
225
|
var action = arguments.length > 1 ? arguments[1] : undefined;
|
|
226
226
|
|
|
227
227
|
switch (action.type) {
|
|
228
|
-
case
|
|
228
|
+
case 'MO_REDIR_MSISDN_SUBMIT':
|
|
229
229
|
return (0, _strategy.genericHandler)(state, action.payload);
|
|
230
230
|
|
|
231
|
-
case
|
|
231
|
+
case 'MO_REDIR_BACK_TO_START':
|
|
232
232
|
return (0, _strategy.genericHandler)(state, action.payload);
|
|
233
233
|
|
|
234
|
-
case
|
|
234
|
+
case 'MO_REDIR_MSISDN_SUBMIT_ERROR':
|
|
235
235
|
return (0, _strategy.genericHandler)(state, action.payload);
|
|
236
236
|
|
|
237
|
-
case
|
|
237
|
+
case 'MOCK_MO_REDIR_FLOW_STATE':
|
|
238
238
|
return (0, _strategy.genericHandler)(state, action.payload);
|
|
239
239
|
|
|
240
240
|
default:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IConfig, IMoRedirFlowReducerState } from
|
|
1
|
+
import { IConfig, IMoRedirFlowReducerState } from './MoRedirTypes';
|
|
2
2
|
export default function submitMSISDN(window: Window, maybeConfig: IConfig, internationalMSISDN: string, extraParams?: {
|
|
3
3
|
[key: string]: string;
|
|
4
4
|
}): Promise<string>;
|