ouisys-engine 3.0.2 → 3.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +70 -69
- 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 +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/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 -217
- 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 -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
|
@@ -70,10 +70,10 @@ require("core-js/modules/es.array.find.js");
|
|
|
70
70
|
|
|
71
71
|
var RDS = _interopRequireWildcard(require("../../common-types/RemoteDataState"));
|
|
72
72
|
|
|
73
|
-
var _utils = require("../strategy/utils");
|
|
74
|
-
|
|
75
73
|
var _loadScriptInnerHtml = _interopRequireDefault(require("../../utilities/loadScriptInnerHtml"));
|
|
76
74
|
|
|
75
|
+
var _utils = require("../strategy/utils");
|
|
76
|
+
|
|
77
77
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
78
78
|
|
|
79
79
|
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); }
|
|
@@ -107,17 +107,17 @@ function _submitMSISDN() {
|
|
|
107
107
|
offer: window.pac_analytics.visitor.offer
|
|
108
108
|
}, maybeConfig || {});
|
|
109
109
|
|
|
110
|
-
if (!(
|
|
111
|
-
_context.next =
|
|
110
|
+
if (!(config.automaticallySubmitAllOperators == true && !!config.operators && config.operators.length > 0)) {
|
|
111
|
+
_context.next = 3;
|
|
112
112
|
break;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
return _context.abrupt("return", submitMSISDNForMultipleOperators(window, config, internationalMSISDN, config.operators, extraParams));
|
|
116
116
|
|
|
117
|
-
case
|
|
117
|
+
case 3:
|
|
118
118
|
return _context.abrupt("return", submitMSISDNOnce(window, config, internationalMSISDN, extraParams));
|
|
119
119
|
|
|
120
|
-
case
|
|
120
|
+
case 4:
|
|
121
121
|
case "end":
|
|
122
122
|
return _context.stop();
|
|
123
123
|
}
|
|
@@ -131,7 +131,7 @@ var bupperizeCountry = function bupperizeCountry(c) {
|
|
|
131
131
|
return c == 'gb' ? 'uk' : c;
|
|
132
132
|
};
|
|
133
133
|
|
|
134
|
-
var uniqidResult =
|
|
134
|
+
var uniqidResult = '';
|
|
135
135
|
|
|
136
136
|
function loadMcpShield(_x5, _x6) {
|
|
137
137
|
return _loadMcpShield.apply(this, arguments);
|
|
@@ -154,7 +154,7 @@ function _loadMcpShield() {
|
|
|
154
154
|
case 6:
|
|
155
155
|
mcpShieldResult = _context2.sent;
|
|
156
156
|
|
|
157
|
-
if (!(
|
|
157
|
+
if (!(mcpShieldResult.success == false)) {
|
|
158
158
|
_context2.next = 11;
|
|
159
159
|
break;
|
|
160
160
|
}
|
|
@@ -204,21 +204,21 @@ function _submitMSISDNOnce() {
|
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
submissionError = new Error("Error in submitMSISDN() trigger-pin action");
|
|
207
|
-
submissionError
|
|
207
|
+
submissionError.type = 'InvalidMSISDN';
|
|
208
208
|
throw submissionError;
|
|
209
209
|
|
|
210
210
|
case 4:
|
|
211
|
-
msisdn = !!extraParams && extraParams[
|
|
211
|
+
msisdn = !!extraParams && extraParams['skip-validation'] === '1' // Special case Digital Virgo sents encrypted msisdn we dont need to validate is
|
|
212
212
|
? internationalMSISDN : internationalMSISDN.match(/\d+/gi).join(''); // tallyman API expects international msisdn without any special character
|
|
213
213
|
|
|
214
214
|
rockmanId = window.pac_analytics.visitor.rockmanId; // HARDCODING This for now if the concerpt works we move this to configs
|
|
215
215
|
|
|
216
216
|
supportedSlugs = {
|
|
217
|
-
|
|
218
|
-
|
|
217
|
+
'kuwait-agency-mix-gamezone-puzzle1': 'kuwait-agency-mix-gamezone-puzzle1',
|
|
218
|
+
'kuwait-agency-mix-yourspot-riddles': 'kuwait-agency-mix-yourspot-riddles'
|
|
219
219
|
};
|
|
220
220
|
|
|
221
|
-
if (!(config.country.toLowerCase() ==
|
|
221
|
+
if (!(config.country.toLowerCase() == 'k2' && supportedSlugs[config.slug])) {
|
|
222
222
|
_context3.next = 12;
|
|
223
223
|
break;
|
|
224
224
|
}
|
|
@@ -229,48 +229,48 @@ function _submitMSISDNOnce() {
|
|
|
229
229
|
case 10:
|
|
230
230
|
identifiedUser = _context3.sent;
|
|
231
231
|
|
|
232
|
-
if (identifiedUser.operator && identifiedUser.operator ==
|
|
233
|
-
window.hostCountry =
|
|
234
|
-
window.hostSlug =
|
|
232
|
+
if (identifiedUser.operator && identifiedUser.operator == 'K2_ZAIN') {
|
|
233
|
+
window.hostCountry = 'KW';
|
|
234
|
+
window.hostSlug = 'kw-mt2-hosted-flow-mobfun';
|
|
235
235
|
config.country = window.hostCountry;
|
|
236
236
|
config.slug = window.hostSlug;
|
|
237
237
|
}
|
|
238
238
|
|
|
239
239
|
case 12:
|
|
240
240
|
slug = config.slug, country = config.country, device = config.device, offer = config.offer, host = config.host;
|
|
241
|
-
search = window.location.search.indexOf(
|
|
242
|
-
extraParamsQs = !extraParams ? '' :
|
|
241
|
+
search = window.location.search.indexOf('redirect-back=1') == -1 ? window.location.search.substr(1) || '' : '';
|
|
242
|
+
extraParamsQs = !extraParams ? '' : "&".concat(Object.keys(extraParams).map(function (k) {
|
|
243
243
|
return "".concat(k, "=").concat(extraParams[k]);
|
|
244
|
-
}).join('&');
|
|
245
|
-
uniqid = !!uniqidResult && uniqidResult !=
|
|
244
|
+
}).join('&'));
|
|
245
|
+
uniqid = !!uniqidResult && uniqidResult != '' ? "&mcpUniqid=".concat(uniqidResult) : '';
|
|
246
246
|
_context3.next = 18;
|
|
247
247
|
return window.tallymanApi.triggerPin(host, country, slug, device, offer, msisdn, rockmanId, extraParamsQs, search, uniqid);
|
|
248
248
|
|
|
249
249
|
case 18:
|
|
250
250
|
result = _context3.sent;
|
|
251
251
|
|
|
252
|
-
if (!(
|
|
252
|
+
if (!(result.success === false)) {
|
|
253
253
|
_context3.next = 27;
|
|
254
254
|
break;
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
error = new Error("Error in submitMSISDN() trigger-pin action:\n".concat(result.message));
|
|
258
|
-
error
|
|
259
|
-
error
|
|
258
|
+
error.type = result.message == 'ALREADY SUBSCRIBED' ? 'AlreadySubscribed' : 'InvalidMSISDN';
|
|
259
|
+
error.productUrl = result.product_url ? result.product_url : '';
|
|
260
260
|
console.error(error);
|
|
261
261
|
throw error;
|
|
262
262
|
|
|
263
263
|
case 27:
|
|
264
264
|
kwCodesWithMcpShied = {
|
|
265
265
|
kw: {
|
|
266
|
-
kw_viva:
|
|
266
|
+
kw_viva: 'kw_viva'
|
|
267
267
|
},
|
|
268
268
|
k2: {
|
|
269
|
-
k2_viva:
|
|
269
|
+
k2_viva: 'k2_viva'
|
|
270
270
|
}
|
|
271
271
|
};
|
|
272
272
|
|
|
273
|
-
if (!(country && result.operator && (kwCodesWithMcpShied[country.toLowerCase()] && kwCodesWithMcpShied[country.toLowerCase()][result.operator.toLowerCase()] || country.toLowerCase() ==
|
|
273
|
+
if (!(country && result.operator && (kwCodesWithMcpShied[country.toLowerCase()] && kwCodesWithMcpShied[country.toLowerCase()][result.operator.toLowerCase()] || country.toLowerCase() == 'iq'))) {
|
|
274
274
|
_context3.next = 39;
|
|
275
275
|
break;
|
|
276
276
|
}
|
|
@@ -282,7 +282,7 @@ function _submitMSISDNOnce() {
|
|
|
282
282
|
case 32:
|
|
283
283
|
mcpShieldResult = _context3.sent;
|
|
284
284
|
|
|
285
|
-
if (
|
|
285
|
+
if (mcpShieldResult.success == false) {
|
|
286
286
|
console.warn(mcpShieldResult.message);
|
|
287
287
|
} else {
|
|
288
288
|
(0, _loadScriptInnerHtml.default)(mcpShieldResult.source);
|
|
@@ -299,7 +299,7 @@ function _submitMSISDNOnce() {
|
|
|
299
299
|
|
|
300
300
|
case 39:
|
|
301
301
|
return _context3.abrupt("return", {
|
|
302
|
-
type:
|
|
302
|
+
type: 'SingleMSISDNSubmissionResult',
|
|
303
303
|
pin: result.pin,
|
|
304
304
|
uniqidResult: uniqidResult,
|
|
305
305
|
operator: result.operator
|
|
@@ -366,7 +366,7 @@ function _submitMSISDNForMultipleOperators() {
|
|
|
366
366
|
|
|
367
367
|
case 2:
|
|
368
368
|
results = _context5.sent;
|
|
369
|
-
|
|
369
|
+
// @ts-ignore
|
|
370
370
|
alreadySubscribed = results.find(function (r) {
|
|
371
371
|
return r.type == 'left' && r.value.type == 'AlreadySubscribed';
|
|
372
372
|
});
|
|
@@ -390,7 +390,7 @@ function _submitMSISDNForMultipleOperators() {
|
|
|
390
390
|
|
|
391
391
|
case 12:
|
|
392
392
|
return _context5.abrupt("return", {
|
|
393
|
-
type:
|
|
393
|
+
type: 'MultiOperatorMSISDNSubmissionResult'
|
|
394
394
|
});
|
|
395
395
|
|
|
396
396
|
case 13:
|
|
@@ -422,9 +422,9 @@ function _submitPIN() {
|
|
|
422
422
|
|
|
423
423
|
slug = config.slug, country = config.country, device = config.device, host = config.host;
|
|
424
424
|
offer = window.pac_analytics.visitor.offer;
|
|
425
|
-
extraParamsQs = !extraParams ? '' :
|
|
425
|
+
extraParamsQs = !extraParams ? '' : "&".concat(Object.keys(extraParams).map(function (k) {
|
|
426
426
|
return "".concat(k, "=").concat(extraParams[k]);
|
|
427
|
-
}).join('&');
|
|
427
|
+
}).join('&'));
|
|
428
428
|
rockmanId = window.pac_analytics.visitor.rockmanId;
|
|
429
429
|
|
|
430
430
|
if (pin) {
|
|
@@ -433,35 +433,35 @@ function _submitPIN() {
|
|
|
433
433
|
}
|
|
434
434
|
|
|
435
435
|
emptyPinError = new Error("Error in submitMSISDN() verify-pin action:\n Pin Cannot Be Empty");
|
|
436
|
-
emptyPinError
|
|
436
|
+
emptyPinError.type = 'InvalidPIN';
|
|
437
437
|
throw emptyPinError;
|
|
438
438
|
|
|
439
439
|
case 9:
|
|
440
|
-
uniqid = uniqidResult !=
|
|
441
|
-
evinaTid = typeof window
|
|
440
|
+
uniqid = uniqidResult != '' ? "&mcpUniqid=".concat(uniqidResult) : '';
|
|
441
|
+
evinaTid = typeof window !== 'undefined' && window.tid ? window.tid : '';
|
|
442
442
|
_context6.next = 13;
|
|
443
443
|
return window.tallymanApi.verifyPin(host, country, slug, device, offer, rockmanId, pin, extraParamsQs, uniqid, evinaTid);
|
|
444
444
|
|
|
445
445
|
case 13:
|
|
446
446
|
pinResult = _context6.sent;
|
|
447
447
|
|
|
448
|
-
if (!(
|
|
448
|
+
if (!(pinResult.success === false)) {
|
|
449
449
|
_context6.next = 22;
|
|
450
450
|
break;
|
|
451
451
|
}
|
|
452
452
|
|
|
453
453
|
pinErrorTypeMap = {
|
|
454
|
-
|
|
455
|
-
|
|
454
|
+
'pin does not match': 'InvalidPIN',
|
|
455
|
+
'mcp blocked': 'SessionBlocked'
|
|
456
456
|
};
|
|
457
457
|
errorMessage = pinErrorTypeMap[pinResult.message];
|
|
458
458
|
pinError = new Error("Error in submitMSISDN() verify-pin action:\n".concat(errorMessage));
|
|
459
|
-
pinError
|
|
459
|
+
pinError.type = errorMessage || 'InvalidPIN';
|
|
460
460
|
throw pinError;
|
|
461
461
|
|
|
462
462
|
case 22:
|
|
463
|
-
if (!(
|
|
464
|
-
_context6.next =
|
|
463
|
+
if (!(pinResult.async === true)) {
|
|
464
|
+
_context6.next = 35;
|
|
465
465
|
break;
|
|
466
466
|
}
|
|
467
467
|
|
|
@@ -477,34 +477,30 @@ function _submitPIN() {
|
|
|
477
477
|
case 26:
|
|
478
478
|
checkResult = _context6.sent;
|
|
479
479
|
|
|
480
|
-
if (!(
|
|
481
|
-
_context6.next =
|
|
480
|
+
if (!(checkResult.success === true)) {
|
|
481
|
+
_context6.next = 30;
|
|
482
482
|
break;
|
|
483
483
|
}
|
|
484
484
|
|
|
485
|
-
isAlreadySubscribed = pinResult.message ==
|
|
485
|
+
isAlreadySubscribed = pinResult.message == 'ALREADY SUBSCRIBED';
|
|
486
486
|
return _context6.abrupt("return", {
|
|
487
487
|
productUrl: checkResult.product_url || null,
|
|
488
488
|
isAlreadySubscribed: isAlreadySubscribed
|
|
489
489
|
});
|
|
490
490
|
|
|
491
|
-
case
|
|
491
|
+
case 30:
|
|
492
492
|
_pinError = new Error("Error in submitMSISDN() verify-pin action:\n".concat(checkResult.message));
|
|
493
|
-
_pinError
|
|
493
|
+
_pinError.type = 'InvalidPIN';
|
|
494
494
|
throw _pinError;
|
|
495
495
|
|
|
496
496
|
case 35:
|
|
497
|
-
|
|
498
|
-
break;
|
|
499
|
-
|
|
500
|
-
case 37:
|
|
501
|
-
_isAlreadySubscribed = pinResult.message == "ALREADY SUBSCRIBED" ? true : false;
|
|
497
|
+
_isAlreadySubscribed = pinResult.message == 'ALREADY SUBSCRIBED';
|
|
502
498
|
return _context6.abrupt("return", {
|
|
503
499
|
productUrl: pinResult.product_url || null,
|
|
504
500
|
isAlreadySubscribed: _isAlreadySubscribed
|
|
505
501
|
});
|
|
506
502
|
|
|
507
|
-
case
|
|
503
|
+
case 37:
|
|
508
504
|
case "end":
|
|
509
505
|
return _context6.stop();
|
|
510
506
|
}
|
|
@@ -516,38 +512,38 @@ function _submitPIN() {
|
|
|
516
512
|
|
|
517
513
|
var mockedPINState = {
|
|
518
514
|
currentState: {
|
|
519
|
-
type:
|
|
515
|
+
type: 'PINEntry',
|
|
520
516
|
result: RDS.NothingYet({
|
|
521
|
-
finalUrl:
|
|
517
|
+
finalUrl: ''
|
|
522
518
|
}),
|
|
523
519
|
data: {
|
|
524
|
-
actualPIN:
|
|
525
|
-
nextAction:
|
|
526
|
-
msisdn:
|
|
520
|
+
actualPIN: '',
|
|
521
|
+
nextAction: 'submitPinAction',
|
|
522
|
+
msisdn: ''
|
|
527
523
|
}
|
|
528
524
|
}
|
|
529
525
|
};
|
|
530
526
|
exports.mockedPINState = mockedPINState;
|
|
531
527
|
var mockedCompletedState = {
|
|
532
528
|
currentState: {
|
|
533
|
-
type:
|
|
529
|
+
type: 'PINEntry',
|
|
534
530
|
result: RDS.Success({
|
|
535
|
-
finalUrl:
|
|
531
|
+
finalUrl: '/mock-product-url'
|
|
536
532
|
}),
|
|
537
533
|
data: {
|
|
538
|
-
actualPIN:
|
|
539
|
-
nextAction:
|
|
540
|
-
msisdn:
|
|
534
|
+
actualPIN: '',
|
|
535
|
+
nextAction: 'submitPinAction',
|
|
536
|
+
msisdn: ''
|
|
541
537
|
}
|
|
542
538
|
}
|
|
543
539
|
};
|
|
544
540
|
exports.mockedCompletedState = mockedCompletedState;
|
|
545
541
|
var mockedMSISDNEntryFailure = {
|
|
546
542
|
currentState: {
|
|
547
|
-
type:
|
|
543
|
+
type: 'MSISDNEntry',
|
|
548
544
|
result: RDS.Failure({
|
|
549
|
-
errorType:
|
|
550
|
-
error:
|
|
545
|
+
errorType: 'InvalidMSISDN',
|
|
546
|
+
error: 'Invalid Mobile Number'
|
|
551
547
|
})
|
|
552
548
|
}
|
|
553
549
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare type IStategyActionContants =
|
|
1
|
+
declare type IStategyActionContants = 'IDENTIFY_FLOW_BY_OPERATOR_SELECT' | 'IDENTIFY_STRATEGY' | 'OPERATOR_SELECT' | 'MSISDN_ENTRY_SUBMIT' | 'IDENTIFY_FLOW_BY_MSISDN' | 'IDENTIFY_FLOW_BY_MSISDN_SUBMIT' | 'IDENTIFY_FLOW_BY_MSISDN_SUBMIT_ERROR' | 'IDENTIFY_FLOW_BY_MSISDN_ERROR' | 'DETECT_OPERATOR_BY_IP' | 'IDENTIFY_FLOW_BY_IP_OPERATOR' | 'CHECK_SUBSCRIPTION' | 'HE_IDENTIFY' | 'IDENTIFY_FLOW_BY_HE' | 'MOCK_STRATEGY_STATE';
|
|
2
2
|
export default IStategyActionContants;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { AppThunk } from '../../common-types/AppThunk';
|
|
2
|
+
import * as RDS from '../../common-types/RemoteDataState';
|
|
3
3
|
export declare type IIdentifyResult = {
|
|
4
4
|
operator: string;
|
|
5
5
|
flow?: string;
|
|
@@ -11,7 +11,7 @@ export declare type ConfigDetails = {
|
|
|
11
11
|
host: string;
|
|
12
12
|
slug: string;
|
|
13
13
|
country: string;
|
|
14
|
-
device?:
|
|
14
|
+
device?: 'smart' | 'feature';
|
|
15
15
|
queryString?: Array<[string, string]>;
|
|
16
16
|
automaticallySubmitAllOperators?: boolean;
|
|
17
17
|
operators?: string[];
|
|
@@ -23,11 +23,11 @@ export declare type IConfig = {
|
|
|
23
23
|
slug?: string;
|
|
24
24
|
country?: string;
|
|
25
25
|
host?: string;
|
|
26
|
-
device?:
|
|
26
|
+
device?: 'smart' | 'feature';
|
|
27
27
|
automaticallySubmitAllOperators?: boolean;
|
|
28
28
|
operators?: string[];
|
|
29
29
|
};
|
|
30
|
-
export declare type ISupportedFlows =
|
|
30
|
+
export declare type ISupportedFlows = 'pin' | 'mo' | 'oneClick' | 'click2sms' | 'moRedir' | 'ussd' | 'tpayHe';
|
|
31
31
|
export declare type IFlow = {
|
|
32
32
|
flow: ISupportedFlows;
|
|
33
33
|
operator?: string;
|
|
@@ -47,11 +47,11 @@ export declare type IStrategy = {
|
|
|
47
47
|
country: string;
|
|
48
48
|
strategyConfigs: StrategyConfig;
|
|
49
49
|
};
|
|
50
|
-
export declare type IStrategyNames =
|
|
50
|
+
export declare type IStrategyNames = 'pin' | 'mo' | 'mo-redir' | 'click2sms' | 'one-click' | 'ussd' | 'tpay-he' | 'tallyman-one-click' | 'pin-mo-ask-operator' | 'pin-mo-ask-mobile-number' | 'pin-one-click-ask-operator' | 'pin-one-click-detect-operator-by-ip' | 'one-click-mo-pin-detect-operator-by-ip-or-msisdn' | 'pin-click2sms-ask-operator' | 'mo-redir-one-click-detect-operator-by-ip' | 'pin-mo-redir-ask-mobile-number' | 'pin-click2sms-ask-mobile-number' | 'mo-one-click-detect-operator-by-ip' | 'click2sms-one-click-detect-operator-by-ip' | 'pin-header-enrichment' | 'pin-msisdn-fowarding-pin-header-enrichment' | 'he-pin-mo-redir-header-enrichment' | 'he-pin-one-click-header-enrichment' | 'he-pin-one-click-ask-operator' | 'click2sms-one-click-ask-operator' | 'pin-mo-detect-operator-by-ip' | 'he-mo-redir-one-click-header-enrichment' | 'pin-combo-ask-mobile-number';
|
|
51
51
|
export interface IHash {
|
|
52
52
|
[key: string]: string;
|
|
53
53
|
}
|
|
54
|
-
export declare type IDENTIFYMSISDNEntryErrorTypes =
|
|
54
|
+
export declare type IDENTIFYMSISDNEntryErrorTypes = 'AlreadySubscribed' | 'UnknownError' | 'InvalidMSISDN';
|
|
55
55
|
export declare type IDENTIFYMSISDNEntryFailure = {
|
|
56
56
|
errorType: IDENTIFYMSISDNEntryErrorTypes;
|
|
57
57
|
error: any;
|
|
@@ -70,28 +70,28 @@ export declare type IdentifyFlowOptionsResult<F> = {
|
|
|
70
70
|
};
|
|
71
71
|
export declare type IDENTIFYMSISDNEntrySuccess = {};
|
|
72
72
|
export declare type OPERATORSelectFailure = {};
|
|
73
|
-
export declare type OPERATORSelectSuccess = IdentifyFlowOptionsResult<
|
|
73
|
+
export declare type OPERATORSelectSuccess = IdentifyFlowOptionsResult<'submitMSISDNAction' | 'loadOc2sms'>;
|
|
74
74
|
export declare type IDETECTYOPERATOBYIPFailure = {};
|
|
75
|
-
export declare type IDETECTYOPERATOBYIPSuccess = IdentifyFlowOptionsResult<
|
|
76
|
-
export declare type IDENTIFY_OPERATOR_MSISDNEntrySuccess = IdentifyFlowOptionsResult<
|
|
77
|
-
export declare type IDENTIFY_FLOW_HESuccess = IdentifyFlowOptionsResult<
|
|
75
|
+
export declare type IDETECTYOPERATOBYIPSuccess = IdentifyFlowOptionsResult<'getRedirectUrlAction'>;
|
|
76
|
+
export declare type IDENTIFY_OPERATOR_MSISDNEntrySuccess = IdentifyFlowOptionsResult<'submitMSISDNAction'>;
|
|
77
|
+
export declare type IDENTIFY_FLOW_HESuccess = IdentifyFlowOptionsResult<'subscribeAction'>;
|
|
78
78
|
export declare type OPERATORSelectFlowIdentifyFailure = {};
|
|
79
79
|
export declare type OPERATORSelectFlowIdentifySuccess = {
|
|
80
80
|
operators: Array<string>;
|
|
81
81
|
msisdn?: string;
|
|
82
|
-
nextAction:
|
|
82
|
+
nextAction: 'selectOperator';
|
|
83
83
|
};
|
|
84
84
|
export declare type IDENTIFYFailure = {};
|
|
85
85
|
export declare type IDENTIFYSuccess = {};
|
|
86
86
|
export declare type IOperatorSelectFlowIdentifyPayload = {
|
|
87
|
-
type:
|
|
87
|
+
type: 'IDENTIFY_FLOW_BY_OPERATOR_SELECT';
|
|
88
88
|
result: RDS.RemoteDataState<OPERATORSelectFlowIdentifyFailure, OPERATORSelectFlowIdentifySuccess>;
|
|
89
89
|
};
|
|
90
90
|
export declare type IDetectOperatorByIpPayload = {
|
|
91
|
-
type:
|
|
91
|
+
type: 'DETECT_OPERATOR_BY_IP';
|
|
92
92
|
result: RDS.RemoteDataState<IDETECTYOPERATOBYIPFailure, IDETECTYOPERATOBYIPSuccess>;
|
|
93
93
|
};
|
|
94
|
-
export declare type IPossibleFlows =
|
|
94
|
+
export declare type IPossibleFlows = 'PIN' | 'MO' | 'MO_REDIR' | 'ONE_CLICK' | 'CLICK2SMS' | 'USSD' | 'TPAY_HE';
|
|
95
95
|
export declare type IOperatorSelectPayload = {
|
|
96
96
|
type: IPossibleFlows;
|
|
97
97
|
result: OPERATORSelectSuccess;
|
|
@@ -108,97 +108,97 @@ export declare type IIdentifyFlowByHePayload = {
|
|
|
108
108
|
type: IPossibleFlows;
|
|
109
109
|
result: IDENTIFY_FLOW_HESuccess;
|
|
110
110
|
};
|
|
111
|
-
export declare type IIdentfyFlowByMsisdnNextAction =
|
|
112
|
-
export declare type IIdentfyFlowByOperatorNextAction =
|
|
113
|
-
export declare type IIdentfyFlowByIPOperatorNextAction =
|
|
111
|
+
export declare type IIdentfyFlowByMsisdnNextAction = 'submitMSISDNAction' | 'loadOc2sms';
|
|
112
|
+
export declare type IIdentfyFlowByOperatorNextAction = 'submitMSISDNAction' | 'loadOc2sms';
|
|
113
|
+
export declare type IIdentfyFlowByIPOperatorNextAction = 'getRedirectUrlAction' | 'submitMSISDNAction';
|
|
114
114
|
export declare type IIdenyifyFlowByMsisdnSumbitNextData = {
|
|
115
115
|
nextAction: IIdentfyFlowByMsisdnNextAction;
|
|
116
116
|
};
|
|
117
117
|
export declare type IIdenyifyFlowByMsisdnPayload = {
|
|
118
|
-
type:
|
|
118
|
+
type: 'IDENTIFY_FLOW_BY_MSISDN';
|
|
119
119
|
result: RDS.RemoteDataState<IDENTIFYMSISDNEntryFailure, IDENTIFYMSISDNEntrySuccess>;
|
|
120
120
|
data: IIdenyifyFlowByMsisdnSumbitNextData;
|
|
121
121
|
};
|
|
122
122
|
export declare type IIdenyifyStrategyPayload = {
|
|
123
|
-
type:
|
|
123
|
+
type: 'IDENTIFY_FLOW_BY_MSISDN';
|
|
124
124
|
result: RDS.RemoteDataState<IDENTIFYMSISDNEntryFailure, IDENTIFYMSISDNEntrySuccess>;
|
|
125
125
|
data: IIdenyifyFlowByMsisdnSumbitNextData;
|
|
126
126
|
};
|
|
127
127
|
export declare type IStrategyActions = {
|
|
128
|
-
type:
|
|
128
|
+
type: 'IDENTIFY_STRATEGY';
|
|
129
129
|
payload: IIdenyifyStrategyPayload;
|
|
130
130
|
} | {
|
|
131
|
-
type:
|
|
131
|
+
type: 'DETECT_OPERATOR_BY_IP';
|
|
132
132
|
payload: IDetectOperatorByIpPayload;
|
|
133
133
|
} | {
|
|
134
|
-
type:
|
|
134
|
+
type: 'HE_IDENTIFY';
|
|
135
135
|
payload: IIdenyifyStrategyPayload;
|
|
136
136
|
} | {
|
|
137
|
-
type:
|
|
137
|
+
type: 'IDENTIFY_FLOW_BY_OPERATOR_SELECT';
|
|
138
138
|
payload: IOperatorSelectFlowIdentifyPayload;
|
|
139
139
|
} | {
|
|
140
|
-
type:
|
|
140
|
+
type: 'IDENTIFY_FLOW_BY_IP';
|
|
141
141
|
payload: IIdentifyFlowByIpOperatorPayload;
|
|
142
142
|
} | {
|
|
143
|
-
type:
|
|
143
|
+
type: 'OPERATOR_SELECT';
|
|
144
144
|
payload: IOperatorSelectPayload;
|
|
145
145
|
} | {
|
|
146
|
-
type:
|
|
146
|
+
type: 'IDENTIFY_FLOW_BY_MSISDN';
|
|
147
147
|
payload: IIdenyifyFlowByMsisdnPayload;
|
|
148
148
|
} | {
|
|
149
|
-
type:
|
|
149
|
+
type: 'IDENTIFY_FLOW_BY_MSISDN_SUBMIT';
|
|
150
150
|
payload: ISubmitMsisdnPayload;
|
|
151
151
|
} | {
|
|
152
|
-
type:
|
|
152
|
+
type: 'IDENTIFY_FLOW_BY_IP_OPERATOR';
|
|
153
153
|
payload: IIdentifyFlowByIpOperatorPayload;
|
|
154
154
|
} | {
|
|
155
|
-
type:
|
|
155
|
+
type: 'IDENTIFY_FLOW_BY_HE';
|
|
156
156
|
payload: IIdentifyFlowByHePayload;
|
|
157
157
|
} | {
|
|
158
|
-
type:
|
|
158
|
+
type: 'MOCK_STRATEGY_STATE';
|
|
159
159
|
payload: any;
|
|
160
160
|
};
|
|
161
161
|
export declare type IStrategyCurrentState = {
|
|
162
|
-
type:
|
|
162
|
+
type: 'IDENTIFY_STRATEGY';
|
|
163
163
|
result: RDS.RemoteDataState<IDENTIFYFailure, IDENTIFYSuccess>;
|
|
164
164
|
} | {
|
|
165
|
-
type:
|
|
165
|
+
type: 'IDENTIFY_FLOW_BY_OPERATOR_SELECT';
|
|
166
166
|
result: OPERATORSelectFlowIdentifySuccess;
|
|
167
167
|
} | {
|
|
168
|
-
type:
|
|
168
|
+
type: 'DETECT_OPERATOR_BY_IP';
|
|
169
169
|
result: RDS.RemoteDataState<IDETECTYOPERATOBYIPFailure, IDETECTYOPERATOBYIPSuccess>;
|
|
170
170
|
} | {
|
|
171
|
-
type:
|
|
171
|
+
type: 'HE_IDENTIFY';
|
|
172
172
|
result: RDS.RemoteDataState<IDENTIFYFailure, IDENTIFYSuccess>;
|
|
173
173
|
} | {
|
|
174
|
-
type:
|
|
174
|
+
type: 'OPERATOR_SELECT';
|
|
175
175
|
result: RDS.RemoteDataState<OPERATORSelectFailure, OPERATORSelectSuccess>;
|
|
176
176
|
config: IConfig;
|
|
177
177
|
} | {
|
|
178
|
-
type:
|
|
178
|
+
type: 'IDENTIFY_FLOW_BY_MSISDN';
|
|
179
179
|
result: RDS.RemoteDataState<IDENTIFYMSISDNEntryFailure, IDENTIFYMSISDNEntrySuccess>;
|
|
180
180
|
nextData: IIdenyifyFlowByMsisdnSumbitNextData;
|
|
181
181
|
} | {
|
|
182
|
-
type:
|
|
183
|
-
result: IdentifyFlowOptionsResult<
|
|
182
|
+
type: 'PIN';
|
|
183
|
+
result: IdentifyFlowOptionsResult<'submitMSISDNAction'>;
|
|
184
184
|
} | {
|
|
185
|
-
type:
|
|
186
|
-
result: IdentifyFlowOptionsResult<
|
|
185
|
+
type: 'MO';
|
|
186
|
+
result: IdentifyFlowOptionsResult<'submitMSISDNAction'>;
|
|
187
187
|
} | {
|
|
188
|
-
type:
|
|
189
|
-
result: IdentifyFlowOptionsResult<
|
|
188
|
+
type: 'USSD';
|
|
189
|
+
result: IdentifyFlowOptionsResult<'submitMSISDNAction'>;
|
|
190
190
|
} | {
|
|
191
|
-
type:
|
|
192
|
-
result: IdentifyFlowOptionsResult<
|
|
191
|
+
type: 'MO_REDIR';
|
|
192
|
+
result: IdentifyFlowOptionsResult<'submitMSISDNAction'>;
|
|
193
193
|
} | {
|
|
194
|
-
type:
|
|
195
|
-
result: IdentifyFlowOptionsResult<
|
|
194
|
+
type: 'ONE_CLICK';
|
|
195
|
+
result: IdentifyFlowOptionsResult<'getRedirectUrlAction'>;
|
|
196
196
|
} | {
|
|
197
|
-
type:
|
|
198
|
-
result: IdentifyFlowOptionsResult<
|
|
197
|
+
type: 'CLICK2SMS';
|
|
198
|
+
result: IdentifyFlowOptionsResult<'loadOc2sms'>;
|
|
199
199
|
} | {
|
|
200
|
-
type:
|
|
201
|
-
result: IdentifyFlowOptionsResult<
|
|
200
|
+
type: 'TPAY_HE';
|
|
201
|
+
result: IdentifyFlowOptionsResult<'loadTpayAction'>;
|
|
202
202
|
};
|
|
203
203
|
export declare type IStrategyReducerState = {
|
|
204
204
|
currentState: IStrategyCurrentState;
|
|
@@ -215,15 +215,15 @@ export declare type IStrategyIDentifyUserResult = {
|
|
|
215
215
|
operator?: string;
|
|
216
216
|
subscription_url?: string;
|
|
217
217
|
redirect_url?: string;
|
|
218
|
-
|
|
218
|
+
'redirect-back'?: string;
|
|
219
219
|
} | {
|
|
220
220
|
success: false;
|
|
221
221
|
rockman_id: string;
|
|
222
222
|
message: string;
|
|
223
|
-
|
|
223
|
+
'redirect-back'?: string;
|
|
224
224
|
};
|
|
225
|
-
export declare type IMockFlows =
|
|
225
|
+
export declare type IMockFlows = 'pin' | 'mo' | 'oneclick' | 'click2sms' | 'moredir' | 'ussd' | 'tpay';
|
|
226
226
|
export interface IMockFlowParams<T> {
|
|
227
|
-
|
|
228
|
-
|
|
227
|
+
'mock-flow': IMockFlows;
|
|
228
|
+
'current-state': T;
|
|
229
229
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AppThunk } from
|
|
2
|
-
import {
|
|
1
|
+
import { AppThunk } from '../../common-types/AppThunk';
|
|
2
|
+
import { IStrategyActionMaps, IStrategyActions, IStrategyReducerState } from './StrategyTypes';
|
|
3
3
|
export declare const tracker: import("pacman-client/.build-lib/Pacman/types").ITrackerFlowEvents;
|
|
4
4
|
export declare function mockStrategyStateByUrlParam(): AppThunk;
|
|
5
5
|
export declare function identifyStrategy(): AppThunk;
|