ouisys-engine 3.0.1 → 3.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +4 -8
- package/.eslintrc.js +1 -1
- package/.husky/pre-commit +4 -0
- package/.nvmrc +1 -1
- package/.prettierignore +2 -1
- package/.vscode/settings.json +1 -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 +70 -69
- package/dist/reducers/pinFlow/IPinConstants.d.ts +1 -1
- package/dist/reducers/pinFlow/PinTypes.d.ts +24 -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 +3 -2
- package/dist/reducers/strategy/strategies/ask_mobile_number.js +132 -74
- 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/mockData/config.json +1 -1
- package/package.json +23 -15
- package/setupJest.js +1 -1
- package/tsconfig.json +2 -2
- 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/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 -217
- package/src/reducers/pinFlow/IPinConstants.ts +0 -9
- package/src/reducers/pinFlow/PinTypes.ts +0 -189
- 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 -375
- package/src/reducers/strategy/index.ts +0 -321
- package/src/reducers/strategy/strategies/ask_mobile_number.ts +0 -316
- 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
|
@@ -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>;
|
|
@@ -65,22 +65,22 @@ require("core-js/modules/es.object.keys.js");
|
|
|
65
65
|
|
|
66
66
|
require("core-js/modules/es.string.match.js");
|
|
67
67
|
|
|
68
|
-
var _tryGetIPRangeName = _interopRequireDefault(require("../../ips/tryGetIPRangeName"));
|
|
69
|
-
|
|
70
68
|
var RDS = _interopRequireWildcard(require("../../common-types/RemoteDataState"));
|
|
71
69
|
|
|
70
|
+
var _tryGetIPRangeName = _interopRequireDefault(require("../../ips/tryGetIPRangeName"));
|
|
71
|
+
|
|
72
72
|
var _utilities = require("../../utilities");
|
|
73
73
|
|
|
74
74
|
var _loadScriptInnerHtml = _interopRequireDefault(require("../../utilities/loadScriptInnerHtml"));
|
|
75
75
|
|
|
76
76
|
var _utils = require("../strategy/utils");
|
|
77
77
|
|
|
78
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
79
|
+
|
|
78
80
|
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); }
|
|
79
81
|
|
|
80
82
|
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; }
|
|
81
83
|
|
|
82
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
83
|
-
|
|
84
84
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
85
85
|
|
|
86
86
|
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; }
|
|
@@ -132,14 +132,14 @@ function _submitMSISDNWithConfig() {
|
|
|
132
132
|
case 0:
|
|
133
133
|
slug = config.slug, country = config.country, device = config.device, offer = config.offer, host = config.host;
|
|
134
134
|
search = window.location.search.substr(1) || '';
|
|
135
|
-
extraParamsQs = !extraParams ? '' :
|
|
135
|
+
extraParamsQs = !extraParams ? '' : "&".concat(Object.keys(extraParams).map(function (k) {
|
|
136
136
|
return "".concat(k, "=").concat(extraParams[k]);
|
|
137
|
-
}).join('&');
|
|
137
|
+
}).join('&'));
|
|
138
138
|
msisdn = internationalMSISDN.match(/\d+/gi).join('');
|
|
139
139
|
visitor = window.pac_analytics.visitor;
|
|
140
140
|
rockmanId = visitor.rockmanId;
|
|
141
141
|
|
|
142
|
-
if (!(country ==
|
|
142
|
+
if (!(country == 'ci')) {
|
|
143
143
|
_context2.next = 12;
|
|
144
144
|
break;
|
|
145
145
|
}
|
|
@@ -163,14 +163,14 @@ function _submitMSISDNWithConfig() {
|
|
|
163
163
|
case 16:
|
|
164
164
|
result = _context2.sent;
|
|
165
165
|
|
|
166
|
-
if (!(
|
|
166
|
+
if (!(result.success === false)) {
|
|
167
167
|
_context2.next = 25;
|
|
168
168
|
break;
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
type = result.message == 'ALREADY SUBSCRIBED' ?
|
|
171
|
+
type = result.message == 'ALREADY SUBSCRIBED' ? 'AlreadySubscribed' : 'InvalidMSISDN';
|
|
172
172
|
error = new Error("".concat(type, ":\n").concat(result.message));
|
|
173
|
-
error
|
|
173
|
+
error.type = type;
|
|
174
174
|
console.error(error);
|
|
175
175
|
throw error;
|
|
176
176
|
|
|
@@ -192,7 +192,7 @@ var startEvinaAgency = function startEvinaAgency(config) {
|
|
|
192
192
|
var configs = (0, _utils.getConfig)();
|
|
193
193
|
var defaultFlowConfig = configs.strategyConfigs.default;
|
|
194
194
|
|
|
195
|
-
var _ref =
|
|
195
|
+
var _ref = config || defaultFlowConfig.flowConfig,
|
|
196
196
|
host = _ref.host;
|
|
197
197
|
|
|
198
198
|
var newHost = (0, _utilities.getHost)({
|
|
@@ -208,19 +208,19 @@ var startEvinaAgency = function startEvinaAgency(config) {
|
|
|
208
208
|
console.log('Ev ready');
|
|
209
209
|
var event = new Event('DCBProtectRun');
|
|
210
210
|
|
|
211
|
-
if (typeof window
|
|
211
|
+
if (typeof window !== 'undefined') {
|
|
212
212
|
document.dispatchEvent(event);
|
|
213
213
|
}
|
|
214
214
|
});
|
|
215
215
|
} catch (err) {
|
|
216
|
-
console.error(
|
|
216
|
+
console.error('startEvinaAgency ERROR', err);
|
|
217
217
|
}
|
|
218
218
|
};
|
|
219
219
|
|
|
220
220
|
exports.startEvinaAgency = startEvinaAgency;
|
|
221
221
|
var mockedMSISDNEntrySuccess = {
|
|
222
222
|
currentState: {
|
|
223
|
-
type:
|
|
223
|
+
type: 'MSISDNEntry',
|
|
224
224
|
result: RDS.Success({
|
|
225
225
|
href: '/mock-product-url'
|
|
226
226
|
})
|
|
@@ -229,10 +229,10 @@ var mockedMSISDNEntrySuccess = {
|
|
|
229
229
|
exports.mockedMSISDNEntrySuccess = mockedMSISDNEntrySuccess;
|
|
230
230
|
var mockedMSISDNEntryFailure = {
|
|
231
231
|
currentState: {
|
|
232
|
-
type:
|
|
232
|
+
type: 'MSISDNEntry',
|
|
233
233
|
result: RDS.Failure({
|
|
234
|
-
errorType:
|
|
235
|
-
error:
|
|
234
|
+
errorType: 'InvalidMSISDN',
|
|
235
|
+
error: 'Invalid Mobile Number'
|
|
236
236
|
})
|
|
237
237
|
}
|
|
238
238
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare type IOneClickConstants =
|
|
1
|
+
declare type IOneClickConstants = 'GET_REDIRECT_URL' | 'SUBCRIBE_AJAX';
|
|
2
2
|
export default IOneClickConstants;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { AppThunk } from '../../common-types/AppThunk';
|
|
2
|
+
import * as RDS from '../../common-types/RemoteDataState';
|
|
3
3
|
export declare type IGETREDIRECTURLFailure = {
|
|
4
4
|
errorType: string;
|
|
5
5
|
};
|
|
6
6
|
export declare type IGETREDIRECTURLSuccess = {
|
|
7
7
|
redirectUrl: string;
|
|
8
|
-
nextAction:
|
|
8
|
+
nextAction: 'getRedirectUrlAction';
|
|
9
9
|
};
|
|
10
|
-
export declare type SubscribeUserErrorTypes =
|
|
10
|
+
export declare type SubscribeUserErrorTypes = 'SubscriptionError' | 'UnknownError' | 'AlreadySubscribed';
|
|
11
11
|
export declare type SubscribeSuccess = {
|
|
12
12
|
productUrl: string;
|
|
13
13
|
};
|
|
@@ -17,30 +17,30 @@ export declare type SubscribeFailure = {
|
|
|
17
17
|
productUrl?: string;
|
|
18
18
|
};
|
|
19
19
|
export declare type IOneClickCurrentState = {
|
|
20
|
-
type:
|
|
20
|
+
type: 'GET_REDIRECT_URL';
|
|
21
21
|
result: RDS.RemoteDataState<IGETREDIRECTURLFailure, IGETREDIRECTURLSuccess>;
|
|
22
22
|
} | {
|
|
23
|
-
type:
|
|
23
|
+
type: 'SUBCRIBE_AJAX';
|
|
24
24
|
result: RDS.RemoteDataState<SubscribeFailure, SubscribeSuccess>;
|
|
25
25
|
};
|
|
26
26
|
export declare type IOneClickFlowReducerState = {
|
|
27
27
|
currentState: IOneClickCurrentState;
|
|
28
28
|
};
|
|
29
29
|
export declare type IGetRedirectUrlPayload = {
|
|
30
|
-
type:
|
|
30
|
+
type: 'GET_REDIRECT_URL';
|
|
31
31
|
result: RDS.RemoteDataState<IGETREDIRECTURLFailure, IGETREDIRECTURLSuccess>;
|
|
32
32
|
};
|
|
33
33
|
export declare type IOneClickFlowActionMaps = {
|
|
34
34
|
getRedirectUrlAction: (extraParams?: ILinkExtraParams, autoRedirect?: boolean) => AppThunk;
|
|
35
35
|
};
|
|
36
36
|
export declare type IOneClickActions = {
|
|
37
|
-
type:
|
|
37
|
+
type: 'GET_REDIRECT_URL';
|
|
38
38
|
payload: IGetRedirectUrlPayload;
|
|
39
39
|
};
|
|
40
40
|
export interface ILinkExtraParams {
|
|
41
41
|
[key: string]: string;
|
|
42
42
|
}
|
|
43
|
-
export declare type IClickActionTypes =
|
|
43
|
+
export declare type IClickActionTypes = 'he' | 'redirect' | 'identify-user';
|
|
44
44
|
export declare type IConfig = {
|
|
45
45
|
host?: string;
|
|
46
46
|
country?: string;
|
|
@@ -82,4 +82,4 @@ export declare type ISubscribeResult = {
|
|
|
82
82
|
message: string;
|
|
83
83
|
product_url?: string;
|
|
84
84
|
};
|
|
85
|
-
export declare type IMockOneClickFlowStates =
|
|
85
|
+
export declare type IMockOneClickFlowStates = 'redirect-url-success-state' | 'subscribe-ajax-state';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { AppThunk } from '../../common-types/AppThunk';
|
|
2
|
+
import { IHash } from '../strategy/StrategyTypes';
|
|
3
|
+
import { ILinkExtraParams, IMockOneClickFlowStates, IOneClickActions, IOneClickFlowActionMaps, IOneClickFlowReducerState } from './OneClickTypes';
|
|
4
4
|
export declare function getRedirectUrlAction({ extraParams, autoRedirect, isGetRedirectBupperWay }: {
|
|
5
5
|
extraParams?: ILinkExtraParams;
|
|
6
6
|
autoRedirect?: boolean;
|