ouisys-engine 4.6.3 → 4.7.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/RemoteDataState-CwHLI23e.js +75 -0
- package/dist/RemoteDataState-CwHLI23e.js.map +1 -0
- package/dist/bupperizeCountry-CCDIOHP6.js +4 -0
- package/dist/bupperizeCountry-CCDIOHP6.js.map +1 -0
- package/dist/checkSubscriptionByRockmanIdOnly-C89Ph9cV.js +27 -0
- package/dist/checkSubscriptionByRockmanIdOnly-C89Ph9cV.js.map +1 -0
- package/dist/checkSubscriptionHander.js +53 -0
- package/dist/checkSubscriptionHander.js.map +1 -0
- package/dist/click2smsFlow.js +246 -0
- package/dist/click2smsFlow.js.map +1 -0
- package/dist/creditCardFlow.js +248 -0
- package/dist/creditCardFlow.js.map +1 -0
- package/dist/getConfig.js +14 -0
- package/dist/getConfig.js.map +1 -0
- package/dist/handleClickChainFlow.js +32 -0
- package/dist/handleClickChainFlow.js.map +1 -0
- package/dist/handleSubmitNumber.js +65 -0
- package/dist/handleSubmitNumber.js.map +1 -0
- package/dist/helpers-J_h-ZgxH.js +29 -0
- package/dist/helpers-J_h-ZgxH.js.map +1 -0
- package/dist/loadScriptInnerHtml-DPcoY467.js +26 -0
- package/dist/loadScriptInnerHtml-DPcoY467.js.map +1 -0
- package/dist/moFlow.js +275 -0
- package/dist/moFlow.js.map +1 -0
- package/dist/moRedirFlow.js +225 -0
- package/dist/moRedirFlow.js.map +1 -0
- package/dist/oneClickFlow.js +464 -0
- package/dist/oneClickFlow.js.map +1 -0
- package/dist/pinFlow.js +697 -0
- package/dist/pinFlow.js.map +1 -0
- package/dist/searchToObject.js +19 -0
- package/dist/searchToObject.js.map +1 -0
- package/dist/storeMsisdn-ChiBh8mI.js +58 -0
- package/dist/storeMsisdn-ChiBh8mI.js.map +1 -0
- package/dist/strategy.js +50 -0
- package/dist/strategy.js.map +1 -0
- package/dist/strategySlice-bF74rxDK.js +842 -0
- package/dist/strategySlice-bF74rxDK.js.map +1 -0
- package/dist/tracker-B_zsMRN2.js +79 -0
- package/dist/tracker-B_zsMRN2.js.map +1 -0
- package/dist/tracker.js +5 -0
- package/dist/tracker.js.map +1 -0
- package/dist/tryGetIPRangeName-C69HEG5W.js +42 -0
- package/dist/tryGetIPRangeName-C69HEG5W.js.map +1 -0
- package/dist/types/CreditCardTypes-B-IT-l6I.d.ts +72 -0
- package/dist/types/IHash-0OgZ_1ij.d.ts +5 -0
- package/dist/types/MoRedirTypes-4tEJjT1g.d.ts +31 -0
- package/dist/types/MoTypes-D-UK92gs.d.ts +45 -0
- package/dist/types/OneClickTypes-DF0jodl-.d.ts +69 -0
- package/dist/types/PinTypes-BLJDBZe6.d.ts +128 -0
- package/dist/types/RemoteDataState-D1aFrz8W.d.ts +61 -0
- package/dist/types/StrategyTypes-BEIYqoJV.d.ts +325 -0
- package/dist/types/UssdTypes-C7QlIW11.d.ts +34 -0
- package/dist/types/checkSubscriptionHander.d.ts +8 -0
- package/dist/types/click2smsFlow.d.ts +37 -0
- package/dist/types/creditCardFlow.d.ts +37 -0
- package/dist/types/getConfig.d.ts +38 -0
- package/dist/types/handleClickChainFlow.d.ts +6 -0
- package/dist/types/handleSubmitNumber.d.ts +26 -0
- package/dist/types/moFlow.d.ts +70 -0
- package/dist/types/moRedirFlow.d.ts +82 -0
- package/dist/types/oneClickFlow.d.ts +56 -0
- package/dist/types/pinFlow.d.ts +179 -0
- package/dist/types/searchToObject.d.ts +3 -0
- package/dist/types/strategy.d.ts +86 -0
- package/dist/types/tracker.d.ts +5 -0
- package/dist/types/ussdFlow.d.ts +84 -0
- package/dist/ussdFlow.js +211 -0
- package/dist/ussdFlow.js.map +1 -0
- package/package.json +85 -9
- package/.babelrc +0 -30
- package/.browserslistrc +0 -6
- package/.eslintrc.js +0 -3
- package/.nvmrc +0 -1
- package/.prettierignore +0 -4
- package/dist/@types/react-tracker.d.js +0 -1
- package/dist/@types/redux-cli-logger.d.js +0 -1
- package/dist/@types/tiny-async-pool.d.js +0 -1
- package/dist/@types/window.d.js +0 -1
- package/dist/api/index.d.ts +0 -43
- package/dist/api/index.js +0 -1
- package/dist/common-types/AppThunk.d.ts +0 -13
- package/dist/common-types/AppThunk.js +0 -1
- package/dist/common-types/Either.d.ts +0 -8
- package/dist/common-types/Either.js +0 -1
- package/dist/common-types/IError.d.ts +0 -3
- package/dist/common-types/IError.js +0 -1
- package/dist/common-types/IOptInFlowName.d.ts +0 -1
- package/dist/common-types/IOptInFlowName.js +0 -1
- package/dist/common-types/ITracker.d.ts +0 -9
- package/dist/common-types/ITracker.js +0 -1
- package/dist/common-types/IVisitor.d.ts +0 -14
- package/dist/common-types/IVisitor.js +0 -1
- package/dist/common-types/RemoteDataState.d.ts +0 -38
- package/dist/common-types/RemoteDataState.js +0 -1
- package/dist/custom-hooks/useOneClickRedirectUrl.d.ts +0 -3
- package/dist/custom-hooks/useOneClickRedirectUrl.js +0 -1
- package/dist/custom-hooks/usePinEntryState.d.ts +0 -8
- package/dist/custom-hooks/usePinEntryState.js +0 -1
- package/dist/custom-hooks/useStrategyConfig.d.ts +0 -4
- package/dist/custom-hooks/useStrategyConfig.js +0 -1
- package/dist/flows/click2smsFlow.d.ts +0 -6
- package/dist/flows/click2smsFlow.js +0 -1
- package/dist/flows/creditCardFlow.d.ts +0 -6
- package/dist/flows/creditCardFlow.js +0 -1
- package/dist/flows/moFlow.d.ts +0 -6
- package/dist/flows/moFlow.js +0 -1
- package/dist/flows/moRedirFlow.d.ts +0 -6
- package/dist/flows/moRedirFlow.js +0 -1
- package/dist/flows/oneClickFlow.d.ts +0 -7
- package/dist/flows/oneClickFlow.js +0 -1
- package/dist/flows/pinFlow.d.ts +0 -7
- package/dist/flows/pinFlow.js +0 -1
- package/dist/flows/strategy.d.ts +0 -14
- package/dist/flows/strategy.js +0 -1
- package/dist/flows/ussdFlow.d.ts +0 -6
- package/dist/flows/ussdFlow.js +0 -1
- package/dist/index.d.ts +0 -0
- package/dist/index.js +0 -1
- package/dist/ips/tryGetIPRangeName.d.ts +0 -2
- package/dist/ips/tryGetIPRangeName.js +0 -1
- package/dist/jest.config.js +0 -194
- package/dist/pacman/index.d.ts +0 -6
- package/dist/pacman/index.js +0 -1
- package/dist/pacman/queryString.d.ts +0 -3
- package/dist/pacman/queryString.js +0 -1
- package/dist/reducers/click2smsFlow/Click2smsTypes.d.ts +0 -76
- package/dist/reducers/click2smsFlow/Click2smsTypes.js +0 -1
- package/dist/reducers/click2smsFlow/IClick2smsConstants.d.ts +0 -2
- package/dist/reducers/click2smsFlow/IClick2smsConstants.js +0 -1
- package/dist/reducers/click2smsFlow/index.d.ts +0 -5
- package/dist/reducers/click2smsFlow/index.js +0 -1
- package/dist/reducers/click2smsFlow/utils.d.ts +0 -4
- package/dist/reducers/click2smsFlow/utils.js +0 -1
- package/dist/reducers/creditCardFlow/CreditCardTypes.d.ts +0 -79
- package/dist/reducers/creditCardFlow/CreditCardTypes.js +0 -1
- package/dist/reducers/creditCardFlow/ICreditCardConstants.d.ts +0 -2
- package/dist/reducers/creditCardFlow/ICreditCardConstants.js +0 -1
- package/dist/reducers/creditCardFlow/index.d.ts +0 -5
- package/dist/reducers/creditCardFlow/index.js +0 -1
- package/dist/reducers/creditCardFlow/utils.d.ts +0 -8
- package/dist/reducers/creditCardFlow/utils.js +0 -1
- package/dist/reducers/moFlow/IMoConstants.d.ts +0 -2
- package/dist/reducers/moFlow/IMoConstants.js +0 -1
- package/dist/reducers/moFlow/MoTypes.d.ts +0 -88
- package/dist/reducers/moFlow/MoTypes.js +0 -1
- package/dist/reducers/moFlow/index.d.ts +0 -16
- package/dist/reducers/moFlow/index.js +0 -1
- package/dist/reducers/moFlow/utils.d.ts +0 -12
- package/dist/reducers/moFlow/utils.js +0 -1
- package/dist/reducers/moRedirFlow/IMoRedirConstants.d.ts +0 -2
- package/dist/reducers/moRedirFlow/IMoRedirConstants.js +0 -1
- package/dist/reducers/moRedirFlow/MoRedirTypes.d.ts +0 -64
- package/dist/reducers/moRedirFlow/MoRedirTypes.js +0 -1
- package/dist/reducers/moRedirFlow/index.d.ts +0 -14
- package/dist/reducers/moRedirFlow/index.js +0 -1
- package/dist/reducers/moRedirFlow/utils.d.ts +0 -10
- package/dist/reducers/moRedirFlow/utils.js +0 -1
- package/dist/reducers/oneClickFlow/IOneClickConstants.d.ts +0 -2
- package/dist/reducers/oneClickFlow/IOneClickConstants.js +0 -1
- package/dist/reducers/oneClickFlow/OneClickTypes.d.ts +0 -85
- package/dist/reducers/oneClickFlow/OneClickTypes.js +0 -1
- package/dist/reducers/oneClickFlow/index.d.ts +0 -13
- package/dist/reducers/oneClickFlow/index.js +0 -1
- package/dist/reducers/oneClickFlow/utils.d.ts +0 -16
- package/dist/reducers/oneClickFlow/utils.js +0 -1
- package/dist/reducers/pinFlow/IPinConstants.d.ts +0 -2
- package/dist/reducers/pinFlow/IPinConstants.js +0 -1
- package/dist/reducers/pinFlow/PinTypes.d.ts +0 -156
- package/dist/reducers/pinFlow/PinTypes.js +0 -1
- package/dist/reducers/pinFlow/index.d.ts +0 -19
- package/dist/reducers/pinFlow/index.js +0 -1
- package/dist/reducers/pinFlow/utils.d.ts +0 -11
- package/dist/reducers/pinFlow/utils.js +0 -1
- package/dist/reducers/strategy/IStategyActionContants.d.ts +0 -2
- package/dist/reducers/strategy/IStategyActionContants.js +0 -1
- package/dist/reducers/strategy/StrategyTypes.d.ts +0 -248
- package/dist/reducers/strategy/StrategyTypes.js +0 -1
- package/dist/reducers/strategy/index.d.ts +0 -13
- package/dist/reducers/strategy/index.js +0 -1
- package/dist/reducers/strategy/strategies/ask_mobile_number.d.ts +0 -15
- package/dist/reducers/strategy/strategies/ask_mobile_number.js +0 -1
- package/dist/reducers/strategy/strategies/ask_operator.d.ts +0 -5
- package/dist/reducers/strategy/strategies/ask_operator.js +0 -1
- package/dist/reducers/strategy/strategies/detect_operator_by_ip.d.ts +0 -10
- package/dist/reducers/strategy/strategies/detect_operator_by_ip.js +0 -1
- package/dist/reducers/strategy/strategies/header_enrichment.d.ts +0 -7
- package/dist/reducers/strategy/strategies/header_enrichment.js +0 -1
- package/dist/reducers/strategy/strategies/injectHeaderEnrichmentScript.d.ts +0 -7
- package/dist/reducers/strategy/strategies/injectHeaderEnrichmentScript.js +0 -1
- package/dist/reducers/strategy/utils.d.ts +0 -30
- package/dist/reducers/strategy/utils.js +0 -1
- package/dist/reducers/ussdFlow/IUssdConstants.d.ts +0 -2
- package/dist/reducers/ussdFlow/IUssdConstants.js +0 -1
- package/dist/reducers/ussdFlow/UssdTypes.d.ts +0 -77
- package/dist/reducers/ussdFlow/UssdTypes.js +0 -1
- package/dist/reducers/ussdFlow/index.d.ts +0 -14
- package/dist/reducers/ussdFlow/index.js +0 -1
- package/dist/reducers/ussdFlow/utils.d.ts +0 -11
- package/dist/reducers/ussdFlow/utils.js +0 -1
- package/dist/store/index.d.ts +0 -14
- package/dist/store/index.js +0 -1
- package/dist/store/reducers.d.ts +0 -20
- package/dist/store/reducers.js +0 -1
- package/dist/utilities/addEmpelloToken.d.ts +0 -4
- package/dist/utilities/addEmpelloToken.js +0 -1
- package/dist/utilities/handleSubmitNumber.d.ts +0 -21
- package/dist/utilities/handleSubmitNumber.js +0 -1
- package/dist/utilities/index.d.ts +0 -17
- package/dist/utilities/index.js +0 -1
- package/dist/utilities/loadScriptInnerHtml.d.ts +0 -2
- package/dist/utilities/loadScriptInnerHtml.js +0 -1
- package/dist/utilities/loadScriptSrc.d.ts +0 -8
- package/dist/utilities/loadScriptSrc.js +0 -1
- package/dist/utilities/replaceUrlParam.d.ts +0 -1
- package/dist/utilities/replaceUrlParam.js +0 -1
- package/dist/utilities/storeMsisdn.d.ts +0 -3
- package/dist/utilities/storeMsisdn.js +0 -1
- package/index.html +0 -49
- package/mockData/config.json +0 -28
- package/setupJest.js +0 -6
- package/tsconfig.json +0 -28
package/dist/ussdFlow.js
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { __awaiter, __generator, __assign, __read } from 'tslib';
|
|
2
|
+
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
3
|
+
import { S as Success, N as NothingYet, L as Loading, F as Failure } from './RemoteDataState-CwHLI23e.js';
|
|
4
|
+
import { checkSubscriptionHander } from './checkSubscriptionHander.js';
|
|
5
|
+
import { s as storeMsisdn } from './storeMsisdn-ChiBh8mI.js';
|
|
6
|
+
import { t as tracker } from './tracker-B_zsMRN2.js';
|
|
7
|
+
import './checkSubscriptionByRockmanIdOnly-C89Ph9cV.js';
|
|
8
|
+
import './helpers-J_h-ZgxH.js';
|
|
9
|
+
import './searchToObject.js';
|
|
10
|
+
import 'pacman-client';
|
|
11
|
+
import 'uuid';
|
|
12
|
+
|
|
13
|
+
var useUssdFlowState = function (useSelector) {
|
|
14
|
+
var currentState = useSelector(function (state) { return state.ussdFlow.currentState; });
|
|
15
|
+
return currentState;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
function ussdFlowMatch(_a) {
|
|
19
|
+
var msisdnEntry = _a.msisdnEntry;
|
|
20
|
+
return function (state) {
|
|
21
|
+
switch (state.type) {
|
|
22
|
+
case 'MSISDNEntry':
|
|
23
|
+
return msisdnEntry(state.result);
|
|
24
|
+
default:
|
|
25
|
+
// TODO - this should be an error or something
|
|
26
|
+
return msisdnEntry(state.result);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
var ussd = function (window, slug, country, msisdn, device, offer, rockmanId, search, extraParamsQs) { return __awaiter(void 0, void 0, void 0, function () {
|
|
32
|
+
var params, host, url;
|
|
33
|
+
return __generator(this, function (_a) {
|
|
34
|
+
params = new URLSearchParams(__assign({ action: 'ussd', slug: slug, country: country, msisdn: msisdn, device: device, offerId: offer.toString(), rockman_id: rockmanId }, (search && { search: search })));
|
|
35
|
+
if (extraParamsQs) {
|
|
36
|
+
extraParamsQs.split('&').forEach(function (param) {
|
|
37
|
+
var _a = __read(param.split('='), 2), key = _a[0], value = _a[1];
|
|
38
|
+
if (key)
|
|
39
|
+
params.append(key, value);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
host = window.DEV_BASE_URL || '';
|
|
43
|
+
url = "".concat(host, "/tallyman/v1/?").concat(params.toString());
|
|
44
|
+
return [2 /*return*/, fetch(url).then(function (response) { return response.json(); })];
|
|
45
|
+
});
|
|
46
|
+
}); };
|
|
47
|
+
|
|
48
|
+
function submitMSISDN(window, maybeConfig, internationalMSISDN, extraParams) {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
50
|
+
var config;
|
|
51
|
+
return __generator(this, function (_a) {
|
|
52
|
+
config = __assign({ offer: window.pac_analytics.visitor.offer }, (maybeConfig || {}));
|
|
53
|
+
return [2 /*return*/, submitMSISDNWithConfig(window, config, internationalMSISDN, extraParams)];
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function submitMSISDNWithConfig(window, config, internationalMSISDN, extraParams) {
|
|
58
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
59
|
+
var slug, country, device, offer, search, extraParamsQs, msisdn, rockmanId, result, type, error;
|
|
60
|
+
return __generator(this, function (_a) {
|
|
61
|
+
switch (_a.label) {
|
|
62
|
+
case 0:
|
|
63
|
+
slug = config.slug, country = config.country, device = config.device, offer = config.offer;
|
|
64
|
+
search = window.location.search.substr(1) || '';
|
|
65
|
+
extraParamsQs = !extraParams
|
|
66
|
+
? ''
|
|
67
|
+
: "&".concat(Object.keys(extraParams)
|
|
68
|
+
.map(function (k) { return "".concat(k, "=").concat(extraParams[k]); })
|
|
69
|
+
.join('&'));
|
|
70
|
+
msisdn = internationalMSISDN.match(/\d+/gi).join('');
|
|
71
|
+
rockmanId = window.pac_analytics.visitor.rockmanId;
|
|
72
|
+
return [4 /*yield*/, ussd(window, slug, country, msisdn, device, offer, rockmanId, search, extraParamsQs)];
|
|
73
|
+
case 1:
|
|
74
|
+
result = _a.sent();
|
|
75
|
+
if (result.success === false) {
|
|
76
|
+
type = result.message === 'ALREADY SUBSCRIBED' ? 'AlreadySubscribed' : 'InvalidMSISDN';
|
|
77
|
+
error = new Error("".concat(type, ":\n").concat(result.message));
|
|
78
|
+
error.type = type;
|
|
79
|
+
console.error(error);
|
|
80
|
+
throw error;
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
return [2 /*return*/, result];
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
var initialState = {
|
|
91
|
+
currentState: {
|
|
92
|
+
type: 'MSISDNEntry',
|
|
93
|
+
result: NothingYet()
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* submitMSISDNAction
|
|
98
|
+
* @returns {type: ' 'pinFlow/submitMSISDNAction', payload: {type: PossibleTypes, result: MSISDNEntryState}}
|
|
99
|
+
|
|
100
|
+
* Calls ussd api that open ussd prompt on mobile
|
|
101
|
+
*
|
|
102
|
+
*/
|
|
103
|
+
var submitMSISDNAction = createAsyncThunk('ussdFlow/submitMSISDNAction', function (_a, _b) {
|
|
104
|
+
var window = _a.window, msisdn = _a.msisdn, extraParams = _a.extraParams;
|
|
105
|
+
var getState = _b.getState, rejectWithValue = _b.rejectWithValue;
|
|
106
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
107
|
+
var state, config, keywordAndShortcode, ex_1, errorType;
|
|
108
|
+
return __generator(this, function (_c) {
|
|
109
|
+
switch (_c.label) {
|
|
110
|
+
case 0:
|
|
111
|
+
state = getState();
|
|
112
|
+
config = state.strategy.currentState.data.config;
|
|
113
|
+
_c.label = 1;
|
|
114
|
+
case 1:
|
|
115
|
+
_c.trys.push([1, 5, , 6]);
|
|
116
|
+
// Start Ussd Api Call
|
|
117
|
+
tracker.advancedInFlow('tallyman.v1-ussd', 'msisdn-submitted', { msisdn: msisdn });
|
|
118
|
+
return [4 /*yield*/, submitMSISDN(window, config, msisdn, extraParams)];
|
|
119
|
+
case 2:
|
|
120
|
+
keywordAndShortcode = _c.sent();
|
|
121
|
+
tracker.advancedInFlow('tallyman.v1-ussd', 'msisdn-submission-success', { msisdn: msisdn });
|
|
122
|
+
if (!(extraParams && extraParams.storeMsisdn && extraParams.storeMsisdn === 'true')) return [3 /*break*/, 4];
|
|
123
|
+
return [4 /*yield*/, storeMsisdn(msisdn)
|
|
124
|
+
.then(function (data) {
|
|
125
|
+
if (data && data.data && data.data.success) {
|
|
126
|
+
tracker.customEvent('Flow', 'advance-auto', 'msisdn-stored-success');
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
tracker.customEvent('Flow', 'advance-auto', 'msisdn-stored-failed');
|
|
130
|
+
}
|
|
131
|
+
})
|
|
132
|
+
.catch(function (error) {
|
|
133
|
+
tracker.customEvent('Flow', 'advance-auto', 'msisdn-stored-error', error);
|
|
134
|
+
})];
|
|
135
|
+
case 3:
|
|
136
|
+
_c.sent();
|
|
137
|
+
_c.label = 4;
|
|
138
|
+
case 4:
|
|
139
|
+
// End Store Msisdn
|
|
140
|
+
// Check For Subscription by rockman id and redirect to product url
|
|
141
|
+
checkSubscriptionHander({
|
|
142
|
+
window: window,
|
|
143
|
+
flow: 'tallyman.v1-ussd',
|
|
144
|
+
action: 'sale',
|
|
145
|
+
args: {
|
|
146
|
+
msisdn: msisdn
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
return [2 /*return*/, {
|
|
150
|
+
type: 'MSISDNEntry',
|
|
151
|
+
result: Success(__assign({}, keywordAndShortcode))
|
|
152
|
+
}];
|
|
153
|
+
case 5:
|
|
154
|
+
ex_1 = _c.sent();
|
|
155
|
+
console.warn(ex_1);
|
|
156
|
+
errorType = void 0;
|
|
157
|
+
switch (ex_1.type) {
|
|
158
|
+
case 'AlreadySubscribed':
|
|
159
|
+
errorType = 'AlreadySubscribed';
|
|
160
|
+
break;
|
|
161
|
+
case 'InvalidMSISDN':
|
|
162
|
+
errorType = 'InvalidMSISDN';
|
|
163
|
+
break;
|
|
164
|
+
default:
|
|
165
|
+
errorType = 'UnknownError';
|
|
166
|
+
}
|
|
167
|
+
tracker.recedeInFlow('tallyman.v1-ussd', 'msisdn-submission-failure', {
|
|
168
|
+
msisdn: msisdn,
|
|
169
|
+
errorType: errorType || 'UnknownError'
|
|
170
|
+
});
|
|
171
|
+
return [2 /*return*/, rejectWithValue({
|
|
172
|
+
errorType: errorType,
|
|
173
|
+
productUrl: ex_1.productUrl
|
|
174
|
+
})];
|
|
175
|
+
case 6: return [2 /*return*/];
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
var ussdFlowSlice = createSlice({
|
|
181
|
+
name: 'ussdFlow',
|
|
182
|
+
initialState: initialState,
|
|
183
|
+
reducers: {
|
|
184
|
+
backToStartAction: function (state) {
|
|
185
|
+
tracker.recedeInFlow('tallyman.v1-ussd', 'ussd-state', 'requested to change phone number');
|
|
186
|
+
// TODO GO BACK TO IDENTIFY BY MSISDN BASED ON STRATEGY
|
|
187
|
+
state.currentState = { type: 'MSISDNEntry', result: NothingYet() };
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
extraReducers: function (builder) {
|
|
191
|
+
builder
|
|
192
|
+
.addCase(submitMSISDNAction.pending, function (state) {
|
|
193
|
+
state.currentState = { type: 'MSISDNEntry', result: Loading() };
|
|
194
|
+
})
|
|
195
|
+
.addCase(submitMSISDNAction.fulfilled, function (state, action) {
|
|
196
|
+
state.currentState = action.payload;
|
|
197
|
+
})
|
|
198
|
+
.addCase(submitMSISDNAction.rejected, function (state, action) {
|
|
199
|
+
state.currentState = {
|
|
200
|
+
type: 'MSISDNEntry',
|
|
201
|
+
result: Failure(action.payload)
|
|
202
|
+
};
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
// Export reducers and actions
|
|
207
|
+
var ussdFlowReducer = ussdFlowSlice.reducer, ussdFlowActions = ussdFlowSlice.actions;
|
|
208
|
+
var backToStartAction = ussdFlowActions.backToStartAction;
|
|
209
|
+
|
|
210
|
+
export { backToStartAction, submitMSISDNAction, useUssdFlowState, ussdFlowMatch, ussdFlowReducer };
|
|
211
|
+
//# sourceMappingURL=ussdFlow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ussdFlow.js","sources":["../src/flows/ussdFlow/hooks/useUssdFlowState.ts","../src/flows/ussdFlow/match.ts","../src/flows/ussdFlow/api.ts","../src/flows/ussdFlow/main.ts","../src/flows/ussdFlow/ussdFlowSlice.ts"],"sourcesContent":["import { useSelector as IuseSelector } from 'react-redux';\nimport { RootState } from '../../../sharedFlowTypes/StrategyTypes';\n\nexport const useUssdFlowState = (useSelector: typeof IuseSelector) => {\n const currentState = useSelector((state: RootState) => state.ussdFlow.currentState);\n return currentState;\n};\n","import * as RDS from '../../common-types/RemoteDataState';\nimport { MSISDNEntryFailure, MSISDNEntrySuccess, UssdFlowCurrentState } from '../../sharedFlowTypes/UssdTypes';\n\nfunction ussdFlowMatch<R>({\n msisdnEntry\n}: {\n msisdnEntry: (rds: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>) => R;\n}): (state: UssdFlowCurrentState) => R {\n return (state) => {\n switch (state.type) {\n case 'MSISDNEntry':\n return msisdnEntry(state.result);\n default:\n // TODO - this should be an error or something\n return msisdnEntry(state.result);\n }\n };\n}\n\nexport { ussdFlowMatch };\n","import { IMSISDNSubmissionResult } from '../../sharedFlowTypes/UssdTypes';\n\nconst ussd = async (\n window: Window,\n slug: string,\n country: string,\n msisdn: string,\n device: string,\n offer: string,\n rockmanId: string,\n search: string,\n extraParamsQs: string\n): Promise<IMSISDNSubmissionResult> => {\n const params = new URLSearchParams({\n action: 'ussd',\n slug,\n country,\n msisdn,\n device,\n offerId: offer.toString(),\n rockman_id: rockmanId,\n ...(search && { search })\n });\n\n if (extraParamsQs) {\n extraParamsQs.split('&').forEach((param) => {\n const [key, value] = param.split('=');\n if (key) params.append(key, value);\n });\n }\n const host = (window as Window).DEV_BASE_URL || '';\n const url = `${host}/tallyman/v1/?${params.toString()}`;\n return fetch(url).then((response) => response.json());\n};\n\nexport { ussd };\n","import { IError } from '../../common-types/IError';\nimport * as RDS from '../../common-types/RemoteDataState';\nimport { IConfig } from '../../sharedFlowTypes/StrategyTypes';\nimport {\n IKeywordShortcode,\n IMSISDNSubmissionResult,\n MSISDNEntryFailure,\n MSISDNEntrySuccess,\n UssdFlowState\n} from '../../sharedFlowTypes/UssdTypes';\nimport { ussd } from './api';\n\nexport default async function submitMSISDN(\n window: Window,\n maybeConfig: IConfig,\n internationalMSISDN: string,\n extraParams?: { [key: string]: string }\n): Promise<IKeywordShortcode> {\n const config: IConfig = { offer: window.pac_analytics.visitor.offer, ...(maybeConfig || {}) };\n return submitMSISDNWithConfig(window, config, internationalMSISDN, extraParams);\n}\n\nexport async function submitMSISDNWithConfig(\n window: Window,\n config: IConfig,\n internationalMSISDN: string,\n extraParams?: { [key: string]: string }\n): Promise<IKeywordShortcode> {\n const { slug, country, device, offer } = config;\n const search = window.location.search.substr(1) || '';\n const extraParamsQs = !extraParams\n ? ''\n : `&${Object.keys(extraParams)\n .map((k) => `${k}=${extraParams[k]}`)\n .join('&')}`;\n const msisdn = internationalMSISDN.match(/\\d+/gi).join('');\n const { rockmanId } = window.pac_analytics.visitor;\n const result: IMSISDNSubmissionResult = await ussd(\n window,\n slug,\n country,\n msisdn,\n device,\n offer,\n rockmanId,\n search,\n extraParamsQs\n );\n\n if (result.success === false) {\n const type = result.message === 'ALREADY SUBSCRIBED' ? 'AlreadySubscribed' : 'InvalidMSISDN';\n const error = new Error(`${type}:\\n${result.message}`) as IError & { type: string };\n error.type = type;\n console.error(error);\n throw error;\n } else {\n return result;\n }\n}\n\nexport const formatSMSLink = (keywordAndShortcode: IKeywordShortcode) =>\n // @ts-ignore\n // eslint-disable-next-line no-nested-ternary\n !!window.pac_analytics.visitor['x-requested-with'] &&\n // @ts-ignore\n window.pac_analytics.visitor['x-requested-with'] !== null &&\n // @ts-ignore\n window.pac_analytics.visitor['x-requested-with'].indexOf('com.facebook') !== -1\n ? `sms://${keywordAndShortcode.shortcode}?body=${keywordAndShortcode.keyword}`\n : typeof navigator !== 'undefined' && (/iPhone/i.test(navigator.userAgent) || /Mac OS/i.test(navigator.userAgent))\n ? `sms:${keywordAndShortcode.shortcode}&body=${keywordAndShortcode.keyword}`\n : `sms:${keywordAndShortcode.shortcode}?body=${keywordAndShortcode.keyword}`;\n\nexport const mockedMSISDNEntrySuccess: UssdFlowState = {\n currentState: {\n type: 'MSISDNEntry',\n result: RDS.Success<MSISDNEntryFailure, MSISDNEntrySuccess>({\n keyword: 'TEST OK',\n shortcode: '777'\n })\n }\n};\n\nexport const mockedMSISDNEntryFailure: UssdFlowState = {\n currentState: {\n type: 'MSISDNEntry',\n result: RDS.Failure<MSISDNEntryFailure, MSISDNEntrySuccess>({\n errorType: 'InvalidMSISDN',\n error: 'Invalid Mobile Number'\n })\n }\n};\n","import { createAsyncThunk, createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport { IHash } from '../../common-types/IHash';\nimport * as RDS from '../../common-types/RemoteDataState';\nimport { RootState } from '../../sharedFlowTypes/StrategyTypes';\nimport {\n MSISDNEntryErrorTypes,\n MSISDNEntryFailure,\n MSISDNEntryState,\n MSISDNEntrySuccess,\n UssdFlowState\n} from '../../sharedFlowTypes/UssdTypes';\nimport { checkSubscriptionHander } from '../../utilities/checkSubscriptionHander';\nimport { storeMsisdn } from '../../utilities/storeMsisdn';\nimport { tracker } from '../../utilities/tracker';\nimport submitMSISDN from './main';\n\nconst initialState: UssdFlowState = {\n currentState: {\n type: 'MSISDNEntry',\n result: RDS.NothingYet()\n }\n};\n\ninterface SubmitMSISDNArgs {\n window: Window;\n msisdn: string;\n extraParams?: IHash;\n}\n/**\n * submitMSISDNAction\n * @returns {type: ' 'pinFlow/submitMSISDNAction', payload: {type: PossibleTypes, result: MSISDNEntryState}}\n \n * Calls ussd api that open ussd prompt on mobile\n *\n */\nexport const submitMSISDNAction = createAsyncThunk<\n MSISDNEntryState,\n SubmitMSISDNArgs,\n {\n rejectValue: MSISDNEntryFailure;\n }\n>('ussdFlow/submitMSISDNAction', async ({ window, msisdn, extraParams }, { getState, rejectWithValue }) => {\n const state: RootState = getState();\n\n const { config } = state.strategy.currentState.data;\n\n try {\n // Start Ussd Api Call\n tracker.advancedInFlow('tallyman.v1-ussd', 'msisdn-submitted', { msisdn });\n const keywordAndShortcode = await submitMSISDN(window, config, msisdn, extraParams);\n tracker.advancedInFlow('tallyman.v1-ussd', 'msisdn-submission-success', { msisdn });\n // End Ussd Api Call\n\n // Start Store Msisdn\n // if storeMsisdn is true, encrypt msisdn and save it in cookie, localStorage, and zürch\n if (extraParams && extraParams.storeMsisdn && extraParams.storeMsisdn === 'true') {\n await storeMsisdn(msisdn)\n .then((data: any) => {\n if (data && data.data && data.data.success) {\n tracker.customEvent('Flow', 'advance-auto', 'msisdn-stored-success');\n } else {\n tracker.customEvent('Flow', 'advance-auto', 'msisdn-stored-failed');\n }\n })\n .catch((error) => {\n tracker.customEvent('Flow', 'advance-auto', 'msisdn-stored-error', error);\n });\n }\n // End Store Msisdn\n\n // Check For Subscription by rockman id and redirect to product url\n checkSubscriptionHander({\n window,\n flow: 'tallyman.v1-ussd',\n action: 'sale',\n args: {\n msisdn\n }\n });\n\n return {\n type: 'MSISDNEntry',\n result: RDS.Success<MSISDNEntryFailure, MSISDNEntrySuccess>({ ...keywordAndShortcode })\n };\n } catch (ex) {\n console.warn(ex);\n let errorType: MSISDNEntryErrorTypes;\n switch (ex.type) {\n case 'AlreadySubscribed':\n errorType = 'AlreadySubscribed';\n break;\n case 'InvalidMSISDN':\n errorType = 'InvalidMSISDN';\n break;\n default:\n errorType = 'UnknownError';\n }\n\n tracker.recedeInFlow('tallyman.v1-ussd', 'msisdn-submission-failure', {\n msisdn,\n errorType: errorType || 'UnknownError'\n });\n\n return rejectWithValue({\n errorType,\n productUrl: ex.productUrl\n });\n }\n});\n\nconst ussdFlowSlice = createSlice({\n name: 'ussdFlow',\n initialState,\n reducers: {\n backToStartAction(state) {\n tracker.recedeInFlow('tallyman.v1-ussd', 'ussd-state', 'requested to change phone number');\n\n // TODO GO BACK TO IDENTIFY BY MSISDN BASED ON STRATEGY\n state.currentState = { type: 'MSISDNEntry', result: RDS.NothingYet() };\n }\n },\n extraReducers: (builder) => {\n builder\n .addCase(submitMSISDNAction.pending, (state) => {\n state.currentState = { type: 'MSISDNEntry', result: RDS.Loading() };\n })\n .addCase(submitMSISDNAction.fulfilled, (state, action: PayloadAction<MSISDNEntryState>) => {\n state.currentState = action.payload;\n })\n .addCase(submitMSISDNAction.rejected, (state, action: PayloadAction<MSISDNEntryFailure>) => {\n state.currentState = {\n type: 'MSISDNEntry',\n result: RDS.Failure(action.payload)\n };\n });\n }\n});\n\n// Export reducers and actions\nexport const { reducer: ussdFlowReducer, actions: ussdFlowActions } = ussdFlowSlice;\nexport const { backToStartAction } = ussdFlowActions;\n\n// If you have selectors or thunks related to this slice, export them as named exports as well\nexport const selectUssdFlowState = (state: any) => state.ussdFlow;\n"],"names":["RDS.NothingYet","RDS.Success","RDS.Loading","RDS.Failure"],"mappings":";;;;;;;;;;;;AAGO,IAAM,gBAAgB,GAAG,UAAC,WAAgC,EAAA;AAC/D,IAAA,IAAM,YAAY,GAAG,WAAW,CAAC,UAAC,KAAgB,EAAK,EAAA,OAAA,KAAK,CAAC,QAAQ,CAAC,YAAY,CAA3B,EAA2B,CAAC,CAAC;AACpF,IAAA,OAAO,YAAY,CAAC;AACtB;;ACHA,SAAS,aAAa,CAAI,EAIzB,EAAA;AAHC,IAAA,IAAA,WAAW,GAAA,EAAA,CAAA,WAAA,CAAA;AAIX,IAAA,OAAO,UAAC,KAAK,EAAA;QACX,QAAQ,KAAK,CAAC,IAAI;AAChB,YAAA,KAAK,aAAa;AAChB,gBAAA,OAAO,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,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EAAA;YACrB,OAAO,CAAC,YAAY,CAAC,kBAAkB,EAAE,YAAY,EAAE,kCAAkC,CAAC,CAAC;;AAG3F,YAAA,KAAK,CAAC,YAAY,GAAG,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAED,UAAc,EAAE,EAAE,CAAC;SACxE;AACF,KAAA;IACD,aAAa,EAAE,UAAC,OAAO,EAAA;QACrB,OAAO;AACJ,aAAA,OAAO,CAAC,kBAAkB,CAAC,OAAO,EAAE,UAAC,KAAK,EAAA;AACzC,YAAA,KAAK,CAAC,YAAY,GAAG,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAEE,OAAW,EAAE,EAAE,CAAC;AACtE,SAAC,CAAC;aACD,OAAO,CAAC,kBAAkB,CAAC,SAAS,EAAE,UAAC,KAAK,EAAE,MAAuC,EAAA;AACpF,YAAA,KAAK,CAAC,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC;AACtC,SAAC,CAAC;aACD,OAAO,CAAC,kBAAkB,CAAC,QAAQ,EAAE,UAAC,KAAK,EAAE,MAAyC,EAAA;YACrF,KAAK,CAAC,YAAY,GAAG;AACnB,gBAAA,IAAI,EAAE,aAAa;gBACnB,MAAM,EAAEC,OAAW,CAAC,MAAM,CAAC,OAAO,CAAC;aACpC,CAAC;AACJ,SAAC,CAAC,CAAC;KACN;AACF,CAAA,CAAC,CAAC;AAEH;AACwB,IAAA,eAAe,GAA+B,aAAa,CAA5C,OAAA,CAAA,CAAW,eAAe,GAAK,aAAa,CAAA,QAAC;AACrE,IAAA,iBAAiB,GAAK,eAAe;;;;"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ouisys-engine",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.7.0-alpha.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"directories": "dist dev-tools",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"prepare": "husky install",
|
|
9
9
|
"test": "testing=true jest",
|
|
10
|
-
"build": "rm -rf dist &&
|
|
10
|
+
"build": "rm -rf dist && rollup -c rollup.config.mjs",
|
|
11
|
+
"watch": "rollup -c rollup.config.mjs -w",
|
|
11
12
|
"build:types": "tsc --emitDeclarationOnly",
|
|
12
13
|
"build:init": "tsc --init --declaration --allowSyntheticDefaultImports --target esnext --outDir dist",
|
|
13
14
|
"release": "git push && yarn build && npm version patch && npm publish && git push",
|
|
@@ -17,15 +18,82 @@
|
|
|
17
18
|
},
|
|
18
19
|
"author": "",
|
|
19
20
|
"license": "ISC",
|
|
21
|
+
"type": "module",
|
|
22
|
+
"sideEffects": false,
|
|
23
|
+
"files": [
|
|
24
|
+
"dist"
|
|
25
|
+
],
|
|
26
|
+
"exports": {
|
|
27
|
+
"./strategy": "./dist/strategy.js",
|
|
28
|
+
"./pinFlow": "./dist/pinFlow.js",
|
|
29
|
+
"./moFlow": "./dist/moFlow.js",
|
|
30
|
+
"./moRedirFlow": "./dist/moRedirFlow.js",
|
|
31
|
+
"./ussdFlow": "./dist/ussdFlow.js",
|
|
32
|
+
"./oneClickFlow": "./dist/oneClickFlow.js",
|
|
33
|
+
"./click2smsFlow": "./dist/click2smsFlow.js",
|
|
34
|
+
"./creditCardFlow": "./dist/creditCardFlow.js",
|
|
35
|
+
"./utilities/tracker": "./dist/tracker.js",
|
|
36
|
+
"./utilities/handleSubmitNumber": "./dist/handleSubmitNumber.js",
|
|
37
|
+
"./utilities/searchToObject": "./dist/searchToObject.js",
|
|
38
|
+
"./utilities/getConfig": "./dist/getConfig.js",
|
|
39
|
+
"./utilities/handleClickChainFlow": "./dist/handleClickChainFlow.js",
|
|
40
|
+
"./utilities/checkSubscriptionHander": "./dist/checkSubscriptionHander.js"
|
|
41
|
+
},
|
|
42
|
+
"typesVersions": {
|
|
43
|
+
"*": {
|
|
44
|
+
"strategy": [
|
|
45
|
+
"dist/types/strategy.d.ts"
|
|
46
|
+
],
|
|
47
|
+
"pinFlow": [
|
|
48
|
+
"dist/types/pinFlow.d.ts"
|
|
49
|
+
],
|
|
50
|
+
"moFlow": [
|
|
51
|
+
"dist/types/moFlow.d.ts"
|
|
52
|
+
],
|
|
53
|
+
"moRedirFlow": [
|
|
54
|
+
"dist/types/moRedirFlow.d.ts"
|
|
55
|
+
],
|
|
56
|
+
"ussdFlow": [
|
|
57
|
+
"dist/types/ussdFlow.d.ts"
|
|
58
|
+
],
|
|
59
|
+
"oneClickFlow": [
|
|
60
|
+
"dist/types/oneClickFlow.d.ts"
|
|
61
|
+
],
|
|
62
|
+
"click2smsFlow": [
|
|
63
|
+
"dist/types/click2smsFlow.d.ts"
|
|
64
|
+
],
|
|
65
|
+
"creditCardFlow": [
|
|
66
|
+
"dist/types/creditCardFlow.d.ts"
|
|
67
|
+
],
|
|
68
|
+
"utilities/tracker": [
|
|
69
|
+
"dist/types/tracker.d.ts"
|
|
70
|
+
],
|
|
71
|
+
"utilities/handleSubmitNumber": [
|
|
72
|
+
"dist/types/handleSubmitNumber.d.ts"
|
|
73
|
+
],
|
|
74
|
+
"utilities/searchToObject": [
|
|
75
|
+
"dist/types/searchToObject.d.ts"
|
|
76
|
+
],
|
|
77
|
+
"utilities/getConfig": [
|
|
78
|
+
"dist/types/getConfig.d.ts"
|
|
79
|
+
],
|
|
80
|
+
"utilities/handleClickChainFlow": [
|
|
81
|
+
"dist/types/handleClickChainFlow.d.ts"
|
|
82
|
+
],
|
|
83
|
+
"utilities/checkSubscriptionHander": [
|
|
84
|
+
"dist/types/checkSubscriptionHander.d.ts"
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
},
|
|
20
88
|
"dependencies": {
|
|
21
|
-
"
|
|
89
|
+
"@reduxjs/toolkit": "^2.2.3",
|
|
90
|
+
"awesome-phonenumber": "2.73.0",
|
|
22
91
|
"immutability-helper": "3.1.1",
|
|
23
92
|
"pacman-client": "1.5.6",
|
|
24
93
|
"react-addons-update": "15.6.3",
|
|
25
|
-
"react-redux": "
|
|
26
|
-
"redux": "
|
|
27
|
-
"
|
|
28
|
-
"redux-thunk": "2.4.1",
|
|
94
|
+
"react-redux": "^9.1.0",
|
|
95
|
+
"redux": "^5.0.1",
|
|
96
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
29
97
|
"rxjs": "7.5.5",
|
|
30
98
|
"rxjs-compat": "6.6.7",
|
|
31
99
|
"typescript": "4.7.4",
|
|
@@ -39,7 +107,10 @@
|
|
|
39
107
|
"@babel/preset-env": "7.18.6",
|
|
40
108
|
"@babel/preset-typescript": "7.18.6",
|
|
41
109
|
"@babel/runtime": "7.18.6",
|
|
42
|
-
"@
|
|
110
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
111
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
112
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
113
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
43
114
|
"@types/chai": "4.3.1",
|
|
44
115
|
"@types/fs-extra": "9.0.13",
|
|
45
116
|
"@types/inquirer": "8.2.1",
|
|
@@ -83,10 +154,15 @@
|
|
|
83
154
|
"react-test-renderer": "18.2.0",
|
|
84
155
|
"redux-cli-logger": "2.1.0",
|
|
85
156
|
"redux-mock-store": "1.5.4",
|
|
157
|
+
"rollup": "^4.13.1",
|
|
158
|
+
"rollup-plugin-analyzer": "^4.0.0",
|
|
159
|
+
"rollup-plugin-dts": "^6.1.0",
|
|
160
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
161
|
+
"rollup-plugin-typescript2": "^0.36.0",
|
|
86
162
|
"ts-node": "10.8.2"
|
|
87
163
|
},
|
|
88
164
|
"peerDependencies": {
|
|
89
|
-
"
|
|
165
|
+
"awesome-phonenumber": "2.73.0"
|
|
90
166
|
},
|
|
91
167
|
"resolutions": {
|
|
92
168
|
"@types/react": "18.0.14",
|
package/.babelrc
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"presets": [
|
|
3
|
-
[
|
|
4
|
-
"@babel/preset-env",
|
|
5
|
-
{
|
|
6
|
-
"useBuiltIns": "usage",
|
|
7
|
-
"debug": true,
|
|
8
|
-
"corejs": "3.6.5"
|
|
9
|
-
}
|
|
10
|
-
],
|
|
11
|
-
"@babel/preset-typescript",
|
|
12
|
-
[
|
|
13
|
-
"minify",
|
|
14
|
-
{
|
|
15
|
-
"builtIns": false,
|
|
16
|
-
"evaluate": false,
|
|
17
|
-
"mangle": false
|
|
18
|
-
}
|
|
19
|
-
]
|
|
20
|
-
],
|
|
21
|
-
"plugins": ["@babel/plugin-proposal-class-properties"],
|
|
22
|
-
"env": {
|
|
23
|
-
"development": {
|
|
24
|
-
"plugins": ["react-hot-loader/babel"]
|
|
25
|
-
},
|
|
26
|
-
"test": {
|
|
27
|
-
"plugins": []
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
package/.browserslistrc
DELETED
package/.eslintrc.js
DELETED
package/.nvmrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
v16.10.0
|
package/.prettierignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
package/dist/@types/window.d.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
package/dist/api/index.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { IFetchResult } from '../reducers/click2smsFlow/Click2smsTypes';
|
|
2
|
-
import { IUserDetails, IUserDetailsEcardon, IUserDetailsSubmissionResult } from '../reducers/creditCardFlow/CreditCardTypes';
|
|
3
|
-
import { IGoogleReCaptcha, IMSISDNSubmissionResult as IMoMSISDNSubmissionResult } from '../reducers/moFlow/MoTypes';
|
|
4
|
-
import { IMSISDNSubmissionResult as IMoRedirMSISDNSubmissionResult } from '../reducers/moRedirFlow/MoRedirTypes';
|
|
5
|
-
import { ICheckSubscriptionResult, IMcpShieldResult, IMSISDNSubmissionResult, IPINSubmissionResult } from '../reducers/pinFlow/PinTypes';
|
|
6
|
-
import { IHash, IIdentifyResult } from '../reducers/strategy/StrategyTypes';
|
|
7
|
-
export interface IStoreEmailResult {
|
|
8
|
-
success: boolean;
|
|
9
|
-
message?: string;
|
|
10
|
-
}
|
|
11
|
-
export interface IRedirectRequest {
|
|
12
|
-
host: string;
|
|
13
|
-
slug: string;
|
|
14
|
-
country: string;
|
|
15
|
-
msisdn?: string;
|
|
16
|
-
device: string;
|
|
17
|
-
offer: number;
|
|
18
|
-
rockmanId: string;
|
|
19
|
-
ip_range_name?: string;
|
|
20
|
-
search: string;
|
|
21
|
-
extraParamsQs?: string;
|
|
22
|
-
email?: string;
|
|
23
|
-
password?: string;
|
|
24
|
-
}
|
|
25
|
-
export interface ITallyman {
|
|
26
|
-
identify: (host: string, slug: string, country: string, msisdn: string, device: string, offer: number, rockmanId: string) => Promise<IIdentifyResult>;
|
|
27
|
-
triggerPin: (host: string, country: string, slug: string, device: string, offer: number, msisdn: string, rockmanId: string, extraParams: IHash, search: string, uniqid?: string, evinaTid?: string) => Promise<IMSISDNSubmissionResult>;
|
|
28
|
-
verifyPin: (host: string, country: string, slug: string, device: string, offer: number, rockmanId: string, pin: string, extraParams: IHash, uniqid: string, evinaTid: string) => Promise<IPINSubmissionResult>;
|
|
29
|
-
checkSubscriptionByRockmanIdOnly: (host: string, rockmanId: string) => Promise<ICheckSubscriptionResult>;
|
|
30
|
-
checkSubscription: (host: string, country: string, slug: string, device: string, offer: number, rockmanId: string, pin: string, extraParams: IHash) => Promise<ICheckSubscriptionResult>;
|
|
31
|
-
triggerMessage: (host: string, slug: string, country: string, msisdn: string, device: string, offer: number, rockmanId: string, search: string, extraParamsQs: string) => Promise<IMoMSISDNSubmissionResult>;
|
|
32
|
-
redirect: ({ host, slug, country, msisdn, device, offer, rockmanId, ip_range_name, search, extraParamsQs, email, password }: IRedirectRequest) => Promise<IMoRedirMSISDNSubmissionResult>;
|
|
33
|
-
ussd: (host: string, slug: string, country: string, msisdn: string, device: string, offer: number, rockmanId: string, search: string, extraParamsQs: string) => Promise<IMoMSISDNSubmissionResult>;
|
|
34
|
-
oc2sms: (host: string, country: string, slug: string, offer: number, rockmanId: string, keyword: string, operator: string, search: string) => Promise<IFetchResult>;
|
|
35
|
-
mcpShield: (host: string, country: string, slug: string, device: string, offer: number, rockmanId: string, operator?: string, uniqid?: string) => Promise<IMcpShieldResult>;
|
|
36
|
-
getGoogleCaptcha: (host: string, country: string, slug: string, device: string, domain: string) => Promise<IGoogleReCaptcha>;
|
|
37
|
-
storeEmail: (host: string, slug: string, rockmanId: string, email: string, service: string) => Promise<IStoreEmailResult>;
|
|
38
|
-
creditCardPayment: (userDetails: IUserDetails | IUserDetailsEcardon, extraConfig: {
|
|
39
|
-
serviceId: string;
|
|
40
|
-
}) => Promise<IUserDetailsSubmissionResult>;
|
|
41
|
-
}
|
|
42
|
-
export declare const MockTallyman: ITallyman;
|
|
43
|
-
export declare const RealTallyman: ITallyman;
|
package/dist/api/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}require("core-js/modules/es.symbol.js"),require("core-js/modules/es.symbol.description.js"),require("core-js/modules/es.symbol.iterator.js"),require("core-js/modules/es.array.iterator.js"),require("core-js/modules/es.string.iterator.js"),require("core-js/modules/web.dom-collections.iterator.js"),require("core-js/modules/es.symbol.async-iterator.js"),require("core-js/modules/es.symbol.to-string-tag.js"),require("core-js/modules/es.json.to-string-tag.js"),require("core-js/modules/es.math.to-string-tag.js"),require("core-js/modules/es.object.get-prototype-of.js"),require("core-js/modules/web.dom-collections.for-each.js"),require("core-js/modules/es.function.name.js"),require("core-js/modules/es.object.set-prototype-of.js"),require("core-js/modules/es.array.slice.js"),require("core-js/modules/es.array.from.js"),require("core-js/modules/es.object.get-own-property-descriptor.js"),require("core-js/modules/es.object.get-own-property-descriptors.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.RealTallyman=exports.MockTallyman=void 0,require("core-js/modules/es.regexp.exec.js"),require("core-js/modules/es.string.search.js"),require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.promise.js"),require("core-js/modules/es.array.concat.js"),require("core-js/modules/es.array.join.js"),require("core-js/modules/es.array.map.js"),require("core-js/modules/es.object.keys.js"),require("core-js/modules/es.array.filter.js"),require("core-js/modules/es.object.entries.js"),require("core-js/modules/es.array.includes.js"),require("core-js/modules/es.string.includes.js"),require("core-js/modules/es.regexp.test.js"),require("core-js/modules/es.json.stringify.js");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}function _objectSpread(target){for(var source,i=1;i<arguments.length;i++)source=null==arguments[i]?{}:arguments[i],i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))});return target}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!(i&&_arr.length===i));_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i["return"]||_i["return"]()}finally{if(_d)throw _e}}return _arr}}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function _regeneratorRuntime(){"use strict";function define(obj,key,value){return Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}),obj[key]}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}}}function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}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(void 0===method){if(context.delegate=null,"throw"===context.method){if(delegate.iterator.return&&(context.method="return",context.arg=void 0,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=void 0),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=void 0,next.done=!0,next};return next.next=next}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}_regeneratorRuntime=function(){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";try{define({},"")}catch(err){define=function(obj,key,value){return obj[key]=value}}exports.wrap=wrap;var ContinueSentinel={},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);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=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!skipTempReset)for(var name in this)"t"===name.charAt(0)&&hasOwn.call(this,name)&&!isNaN(+name.slice(1))&&(this[name]=void 0)},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){function handle(loc,caught){return record.type="throw",record.arg=exception,context.next=loc,caught&&(context.method="next",context.arg=void 0),!!caught}if(this.done)throw exception;for(var context=this,i=this.tryEntries.length-1;0<=i;--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(!hasFinally)throw new Error("try statement without catch or finally");if(this.prev<entry.finallyLoc)return handle(entry.finallyLoc)}else if(this.prev<entry.catchLoc)return handle(entry.catchLoc,!0)}}},abrupt:function abrupt(type,arg){for(var entry,i=this.tryEntries.length-1;0<=i;--i)if(entry=this.tryEntries[i],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 entry,i=this.tryEntries.length-1;0<=i;--i)if(entry=this.tryEntries[i],entry.finallyLoc===finallyLoc)return this.complete(entry.completion,entry.afterLoc),resetTryEntry(entry),ContinueSentinel},catch:function _catch(tryLoc){for(var entry,i=this.tryEntries.length-1;0<=i;--i)if(entry=this.tryEntries[i],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=void 0),ContinueSentinel}},exports}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}var gen=fn.apply(self,args);_next(void 0)})}}var bupperizeCountry=function(c){return"gb"===c?"uk":c},logMockTallyman=function(mock){return console.log(mock)},checkIsCleanTraffic=function(country){return"be"===country?"undefined"!=typeof window&&!0===window.shouldBlock?"&is-clean-traffic=false":"&is-clean-traffic=true":""};function sleep(milliseconds){var date=Date.now(),currentDate=null;do currentDate=Date.now();while(currentDate-date<milliseconds)}var MockTallyman={identify:function(){function identify(){return _identify.apply(this,arguments)}var _identify=_asyncToGenerator(_regeneratorRuntime().mark(function _callee(){return _regeneratorRuntime().wrap(function _callee$(_context){for(;1;)switch(_context.prev=_context.next){case 0:return logMockTallyman("MockTallyman"),sleep(2e3),_context.abrupt("return",{operator:"",flow:"",success:!0,rockman_id:""});case 3:case"end":return _context.stop();}},_callee)}));return identify}(),triggerPin:function(){function triggerPin(_x8,_x9,_x10,_x11,_x12,_x13,_x14,_x15,_x16,_x17,_x18){return _triggerPin.apply(this,arguments)}var _triggerPin=_asyncToGenerator(_regeneratorRuntime().mark(function _callee2(_host,_country,_slug,_device,_offer,_msisdn,_rockmanId,_extraParams,_search,_uniqid,_evinaTid){return _regeneratorRuntime().wrap(function _callee2$(_context2){for(;1;)switch(_context2.prev=_context2.next){case 0:return logMockTallyman("MockTallyman"),sleep(2e3),_context2.abrupt("return",{success:!0,operator:"",rockman_id:"",pin:"",product_url:""});case 3:case"end":return _context2.stop();}},_callee2)}));return triggerPin}(),verifyPin:function(){function verifyPin(_x19,_x20,_x21,_x22,_x23,_x24,_x25,_x26,_x27){return _verifyPin.apply(this,arguments)}var _verifyPin=_asyncToGenerator(_regeneratorRuntime().mark(function _callee3(_host,_country,_slug,_device,_offer,_rockmanId,_pin,_extraParams,_uniqid){return _regeneratorRuntime().wrap(function _callee3$(_context3){for(;1;)switch(_context3.prev=_context3.next){case 0:return logMockTallyman("MockTallyman"),sleep(2e3),_context3.abrupt("return",{success:!0,rockman_id:"000",product_url:"/product",async:!1});case 3:case"end":return _context3.stop();}},_callee3)}));return verifyPin}(),checkSubscription:function(){function checkSubscription(_x28,_x29,_x30,_x31,_x32,_x33,_x34,_x35){return _checkSubscription.apply(this,arguments)}var _checkSubscription=_asyncToGenerator(_regeneratorRuntime().mark(function _callee4(_host,_country,_slug,_device,_offer,_rockmanId,_pin,extraParams){return _regeneratorRuntime().wrap(function _callee4$(_context4){for(;1;)switch(_context4.prev=_context4.next){case 0:return logMockTallyman("MockTallyman"),sleep(2e3),_context4.abrupt("return",{success:!0,rockman_id:"000",product_url:"/product",msisdn:"000"});case 3:case"end":return _context4.stop();}},_callee4)}));return checkSubscription}(),checkSubscriptionByRockmanIdOnly:function(){function checkSubscriptionByRockmanIdOnly(_x36,_x37){return _checkSubscriptionByRockmanIdOnly.apply(this,arguments)}var _checkSubscriptionByRockmanIdOnly=_asyncToGenerator(_regeneratorRuntime().mark(function _callee5(_host,_rockmanId){return _regeneratorRuntime().wrap(function _callee5$(_context5){for(;1;)switch(_context5.prev=_context5.next){case 0:return logMockTallyman("MockTallyman"),sleep(2e3),_context5.abrupt("return",{success:!0,rockman_id:"000",product_url:"/product",msisdn:"000"});case 3:case"end":return _context5.stop();}},_callee5)}));return checkSubscriptionByRockmanIdOnly}(),redirect:function(){function redirect(_x38){return _redirect.apply(this,arguments)}var _redirect=_asyncToGenerator(_regeneratorRuntime().mark(function _callee6(_ref){var host,slug,country,msisdn,device,offer,rockmanId,ip_range_name,search,extraParamsQs,email,password;return _regeneratorRuntime().wrap(function _callee6$(_context6){for(;1;)switch(_context6.prev=_context6.next){case 0:return host=_ref.host,slug=_ref.slug,country=_ref.country,msisdn=_ref.msisdn,device=_ref.device,offer=_ref.offer,rockmanId=_ref.rockmanId,ip_range_name=_ref.ip_range_name,search=_ref.search,extraParamsQs=_ref.extraParamsQs,email=_ref.email,password=_ref.password,logMockTallyman("MockTallyman"),sleep(2e3),_context6.abrupt("return",{success:!0,rockman_id:"000",redirect_url:"/product"});case 4:case"end":return _context6.stop();}},_callee6)}));return redirect}(),triggerMessage:function(){function triggerMessage(_x39,_x40,_x41,_x42,_x43,_x44,_x45,_x46,_x47){return _triggerMessage.apply(this,arguments)}var _triggerMessage=_asyncToGenerator(_regeneratorRuntime().mark(function _callee7(_host,_slug,_country,_msisdn,_device,_offer,_rockmanId,_search,_extraParamsQs){return _regeneratorRuntime().wrap(function _callee7$(_context7){for(;1;)switch(_context7.prev=_context7.next){case 0:return logMockTallyman("MockTallyman"),sleep(2e3),_context7.abrupt("return",{success:!0,rockman_id:"0000",keyword:"TEST OK",shortcode:"777",displayKeyword:"TEST OK"});case 3:case"end":return _context7.stop();}},_callee7)}));return triggerMessage}(),ussd:function(){function ussd(_x48,_x49,_x50,_x51,_x52,_x53,_x54,_x55,_x56){return _ussd.apply(this,arguments)}var _ussd=_asyncToGenerator(_regeneratorRuntime().mark(function _callee8(_host,_slug,_country,_msisdn,_device,_offer,_rockmanId,_search,_extraParamsQs){return _regeneratorRuntime().wrap(function _callee8$(_context8){for(;1;)switch(_context8.prev=_context8.next){case 0:return logMockTallyman("MockTallyman"),sleep(2e3),_context8.abrupt("return",{success:!0,rockman_id:"0000",keyword:"TEST OK",shortcode:"777",displayKeyword:"TEST OK"});case 3:case"end":return _context8.stop();}},_callee8)}));return ussd}(),oc2sms:function(){function oc2sms(_x57,_x58,_x59,_x60,_x61,_x62,_x63,_x64){return _oc2sms.apply(this,arguments)}var _oc2sms=_asyncToGenerator(_regeneratorRuntime().mark(function _callee9(_host,_country,_slug,_offer,_rockmanId,_keyword,_operator,_search){return _regeneratorRuntime().wrap(function _callee9$(_context9){for(;1;)switch(_context9.prev=_context9.next){case 0:return logMockTallyman("MockTallyman"),sleep(2e3),_context9.abrupt("return",{success:!0,uid:"1",keyword:"TEST OK",displayKeyword:"TEST OK",shortcode:"777"});case 3:case"end":return _context9.stop();}},_callee9)}));return oc2sms}(),mcpShield:function(){function mcpShield(_x65,_x66,_x67,_x68,_x69,_x70,_x71){return _mcpShield.apply(this,arguments)}var _mcpShield=_asyncToGenerator(_regeneratorRuntime().mark(function _callee10(_host,_country,_slug,_device,_offer,_rockmanId,_operator){return _regeneratorRuntime().wrap(function _callee10$(_context10){for(;1;)switch(_context10.prev=_context10.next){case 0:return logMockTallyman("MockTallyman"),sleep(2e3),_context10.abrupt("return",{source:"**********some very long text**********",uniqid:"a26e7c3983a9cebd469601d695c7dbc4",success:!0,rockman_id:"d66ac1a3ee6d40c289c23322ecd9aa79"});case 3:case"end":return _context10.stop();}},_callee10)}));return mcpShield}(),getGoogleCaptcha:function(){function getGoogleCaptcha(_x72,_x73,_x74,_x75,_x76){return _getGoogleCaptcha.apply(this,arguments)}var _getGoogleCaptcha=_asyncToGenerator(_regeneratorRuntime().mark(function _callee11(_host,_country,_slug,_device,_domain){return _regeneratorRuntime().wrap(function _callee11$(_context11){for(;1;)switch(_context11.prev=_context11.next){case 0:return _context11.abrupt("return",{site_key:"6LfMTS8fAAAAAHw-cibJXMfnsIYNpWh81GatD1lw",secret_key:"6LfMTS8fAAAAAIAET7tvHjrU-tRPGuqSdfCZZX6G",domains:"",success:!0});case 1:case"end":return _context11.stop();}},_callee11)}));return getGoogleCaptcha}(),storeEmail:function(){function storeEmail(_x77,_x78,_x79,_x80,_x81){return _storeEmail.apply(this,arguments)}var _storeEmail=_asyncToGenerator(_regeneratorRuntime().mark(function _callee12(_host,_slug,_service,_rockmanId,_email){return _regeneratorRuntime().wrap(function _callee12$(_context12){for(;1;)switch(_context12.prev=_context12.next){case 0:return _context12.abrupt("return",{success:!0});case 1:case"end":return _context12.stop();}},_callee12)}));return storeEmail}(),creditCardPayment:function creditCardPayment(_userDetails,_extraConfig){return{gateway_url:"/product",success:!0}}};exports.MockTallyman=MockTallyman;var RealTallyman={identify:function(){function identify(_x82,_x83,_x84,_x85,_x86,_x87,_x88){return _identify2.apply(this,arguments)}var _identify2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee13(host,slug,country,msisdn,device,offer,rockmanId){var _window$pac_analytics,_window$pac_analytics2,_window$pac_analytics3,_window$pac_analytics4,_window,_window$location,isDMB,newHost,languageCode;return _regeneratorRuntime().wrap(function _callee13$(_context13){for(;1;)switch(_context13.prev=_context13.next){case 0:return isDMB=null!==window.pac_analytics.visitor.xaid&&-1!==(-1!==(null===(_window$pac_analytics=window.pac_analytics.visitor.xaid)||void 0===_window$pac_analytics||null===(_window$pac_analytics2=_window$pac_analytics.toLowerCase())||void 0===_window$pac_analytics2?void 0:_window$pac_analytics2.indexOf("dmb"))||(null===(_window$pac_analytics3=window.pac_analytics.visitor.xaid)||void 0===_window$pac_analytics3||null===(_window$pac_analytics4=_window$pac_analytics3.toLowerCase())||void 0===_window$pac_analytics4?void 0:_window$pac_analytics4.indexOf("amb"))),newHost=isDMB?"de.tallymans.com":host,languageCode=window.languageCode?"&language_code=".concat(window.languageCode):"",_context13.abrupt("return",fetch("https://".concat(newHost,"/tallyman/v1/?action=identify&slug=").concat(slug,"&country=").concat(country,"&msisdn=").concat(msisdn,"&device=").concat(device,"&offerId=").concat(offer,"&rockman_id=").concat(rockmanId,"&page=").concat(encodeURIComponent(null===(_window=window)||void 0===_window||null===(_window$location=_window.location)||void 0===_window$location?void 0:_window$location.href)).concat(languageCode)).then(function(x){return x.json()}));case 4:case"end":return _context13.stop();}},_callee13)}));return identify}(),triggerPin:function(){function triggerPin(_x89,_x90,_x91,_x92,_x93,_x94,_x95,_x96,_x97,_x98,_x99){return _triggerPin2.apply(this,arguments)}var _triggerPin2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee14(host,country,slug,device,offer,msisdn,rockmanId,extraParams,search,uniqid,evinaTid){var _window$pac_analytics5,_window$pac_analytics6,_window$pac_analytics7,_window$pac_analytics8,_window2,_window2$location,isDMB,newHost,cleanTrafficString,extraParamsQs,params,queryString,url;return _regeneratorRuntime().wrap(function _callee14$(_context14){for(;1;)switch(_context14.prev=_context14.next){case 0:return isDMB=null!==window.pac_analytics.visitor.xaid&&-1!==(-1!==(null===(_window$pac_analytics5=window.pac_analytics.visitor.xaid)||void 0===_window$pac_analytics5||null===(_window$pac_analytics6=_window$pac_analytics5.toLowerCase())||void 0===_window$pac_analytics6?void 0:_window$pac_analytics6.indexOf("dmb"))||(null===(_window$pac_analytics7=window.pac_analytics.visitor.xaid)||void 0===_window$pac_analytics7||null===(_window$pac_analytics8=_window$pac_analytics7.toLowerCase())||void 0===_window$pac_analytics8?void 0:_window$pac_analytics8.indexOf("amb"))),newHost=isDMB?"de.tallymans.com":host,cleanTrafficString=checkIsCleanTraffic(country),extraParamsQs="&".concat(Object.keys(extraParams).map(function(k){return"".concat(k,"=").concat(extraParams[k])}).join("&")),params={action:"trigger-pin",country:bupperizeCountry(country),slug:slug,device:device,offerId:offer,msisdn:msisdn,rockman_id:rockmanId,sam_evina_tid:evinaTid,page:encodeURIComponent(null===(_window2=window)||void 0===_window2||null===(_window2$location=_window2.location)||void 0===_window2$location?void 0:_window2$location.href),language_code:window.languageCode||"",antifraud_id:window.antifraud_id||"",partner_transaction_id:window.partner_transaction_id||"",partner_timestamp:window.partner_timestamp||"",partner_cid:window.partner_cid||"",uniqid:uniqid||""},queryString=Object.entries(params).filter(function(_ref2){var _ref3=_slicedToArray(_ref2,2),_=_ref3[0],value=_ref3[1];return value}).map(function(_ref4){var _ref5=_slicedToArray(_ref4,2),key=_ref5[0],value=_ref5[1];return"".concat(key,"=").concat(value)}).join("&"),url="https://".concat(newHost,"/tallyman/v1/?").concat(queryString).concat(cleanTrafficString).concat(extraParamsQs,"&").concat(search),_context14.abrupt("return",fetch(url).then(function(x){return x.json()}));case 8:case"end":return _context14.stop();}},_callee14)}));return triggerPin}(),verifyPin:function(){function verifyPin(_x100,_x101,_x102,_x103,_x104,_x105,_x106,_x107,_x108,_x109){return _verifyPin2.apply(this,arguments)}var _verifyPin2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee15(host,country,slug,device,offer,rockmanId,pin,extraParams,uniqid,evinaTid){var _window$pac_analytics9,_window$pac_analytics10,_window$pac_analytics11,_window$pac_analytics12,_window3,_window3$location,isDMB,newHost,cleanTrafficString,extraParamsQs,params,queryString,url;return _regeneratorRuntime().wrap(function _callee15$(_context15){for(;1;)switch(_context15.prev=_context15.next){case 0:return isDMB=null!==window.pac_analytics.visitor.xaid&&-1!==(-1!==(null===(_window$pac_analytics9=window.pac_analytics.visitor.xaid)||void 0===_window$pac_analytics9||null===(_window$pac_analytics10=_window$pac_analytics9.toLowerCase())||void 0===_window$pac_analytics10?void 0:_window$pac_analytics10.indexOf("dmb"))||(null===(_window$pac_analytics11=window.pac_analytics.visitor.xaid)||void 0===_window$pac_analytics11||null===(_window$pac_analytics12=_window$pac_analytics11.toLowerCase())||void 0===_window$pac_analytics12?void 0:_window$pac_analytics12.indexOf("amb"))),newHost=isDMB?"de.tallymans.com":host,cleanTrafficString=checkIsCleanTraffic(country),extraParamsQs="&".concat(Object.keys(extraParams).map(function(k){return"".concat(k,"=").concat(extraParams[k])}).join("&")),params={action:"verify-pin",country:bupperizeCountry(country),slug:slug,device:device,offerId:offer,rockman_id:rockmanId,pin:pin,page:encodeURIComponent(null===(_window3=window)||void 0===_window3||null===(_window3$location=_window3.location)||void 0===_window3$location?void 0:_window3$location.href),language_code:window.languageCode||"",antifraud_id:window.antifraud_id||"",ClickID:window.antifraud_click_id||"",partner_cid:window.partner_cid||"",sam_evina_tid:evinaTid,uniqid:uniqid},queryString=Object.entries(params).filter(function(_ref6){var _ref7=_slicedToArray(_ref6,2),_=_ref7[0],value=_ref7[1];return value}).map(function(_ref8){var _ref9=_slicedToArray(_ref8,2),key=_ref9[0],value=_ref9[1];return"".concat(key,"=").concat(value)}).join("&"),url="https://".concat(newHost,"/tallyman/v1/?").concat(queryString).concat(cleanTrafficString).concat(extraParamsQs),_context15.abrupt("return",fetch(url).then(function(x){return x.json()}));case 8:case"end":return _context15.stop();}},_callee15)}));return verifyPin}(),checkSubscription:function(){function checkSubscription(_x110,_x111,_x112,_x113,_x114,_x115,_x116,_x117){return _checkSubscription2.apply(this,arguments)}var _checkSubscription2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee16(host,country,slug,device,offer,rockmanId,_pin,_extraParams){var _window$pac_analytics13,_window$pac_analytics14,_window$pac_analytics15,_window$pac_analytics16,isDMB,newHost;return _regeneratorRuntime().wrap(function _callee16$(_context16){for(;1;)switch(_context16.prev=_context16.next){case 0:return isDMB=null!==window.pac_analytics.visitor.xaid&&-1!==(-1!==(null===(_window$pac_analytics13=window.pac_analytics.visitor.xaid)||void 0===_window$pac_analytics13||null===(_window$pac_analytics14=_window$pac_analytics13.toLowerCase())||void 0===_window$pac_analytics14?void 0:_window$pac_analytics14.indexOf("dmb"))||(null===(_window$pac_analytics15=window.pac_analytics.visitor.xaid)||void 0===_window$pac_analytics15||null===(_window$pac_analytics16=_window$pac_analytics15.toLowerCase())||void 0===_window$pac_analytics16?void 0:_window$pac_analytics16.indexOf("amb"))),newHost=isDMB?"de.tallymans.com":host,_context16.abrupt("return",fetch("https://".concat(newHost,"/tallyman/v1/?action=check-subscription&country=").concat(bupperizeCountry(country),"&slug=").concat(slug,"&device=").concat(device,"&offerId=").concat(offer,"&rockman_id=").concat(rockmanId)).then(function(x){return x.json()}));case 3:case"end":return _context16.stop();}},_callee16)}));return checkSubscription}(),checkSubscriptionByRockmanIdOnly:function(){function checkSubscriptionByRockmanIdOnly(_x118,_x119){return _checkSubscriptionByRockmanIdOnly2.apply(this,arguments)}var _checkSubscriptionByRockmanIdOnly2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee17(host,rockmanId){var _window$pac_analytics17,_window$pac_analytics18,_window$pac_analytics19,_window$pac_analytics20,isDMB,newHost;return _regeneratorRuntime().wrap(function _callee17$(_context17){for(;1;)switch(_context17.prev=_context17.next){case 0:return isDMB=null!==window.pac_analytics.visitor.xaid&&-1!==(-1!==(null===(_window$pac_analytics17=window.pac_analytics.visitor.xaid)||void 0===_window$pac_analytics17||null===(_window$pac_analytics18=_window$pac_analytics17.toLowerCase())||void 0===_window$pac_analytics18?void 0:_window$pac_analytics18.indexOf("dmb"))||(null===(_window$pac_analytics19=window.pac_analytics.visitor.xaid)||void 0===_window$pac_analytics19||null===(_window$pac_analytics20=_window$pac_analytics19.toLowerCase())||void 0===_window$pac_analytics20?void 0:_window$pac_analytics20.indexOf("amb"))),newHost=isDMB?"de.tallymans.com":host,_context17.abrupt("return",fetch("https://".concat(newHost,"/tallyman/v1/?action=check-subscription&rockman_id=").concat(rockmanId)).then(function(x){return x.json()}));case 3:case"end":return _context17.stop();}},_callee17)}));return checkSubscriptionByRockmanIdOnly}(),redirect:function(){function redirect(_x120){return _redirect2.apply(this,arguments)}var _redirect2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee18(_ref10){var _window$pac_analytics21,_window$pac_analytics22,_window4,_window5,_window5$location,host,slug,country,msisdn,device,offer,rockmanId,ip_range_name,search,extraParamsQs,email,password,isDMB,newHost,evinaTid,securityProcessId,languageCode,userDetails,searchQs,url;return _regeneratorRuntime().wrap(function _callee18$(_context18){for(;1;)switch(_context18.prev=_context18.next){case 0:if(host=_ref10.host,slug=_ref10.slug,country=_ref10.country,msisdn=_ref10.msisdn,device=_ref10.device,offer=_ref10.offer,rockmanId=_ref10.rockmanId,ip_range_name=_ref10.ip_range_name,search=_ref10.search,extraParamsQs=_ref10.extraParamsQs,email=_ref10.email,password=_ref10.password,isDMB=null!==window.pac_analytics.visitor.xaid&&-1!==(-1!==(null===(_window$pac_analytics21=window.pac_analytics.visitor.xaid)||void 0===_window$pac_analytics21?void 0:_window$pac_analytics21.toLowerCase().indexOf("dmb"))||(null===(_window$pac_analytics22=window.pac_analytics.visitor.xaid)||void 0===_window$pac_analytics22?void 0:_window$pac_analytics22.toLowerCase().indexOf("amb"))),newHost=isDMB?"de.tallymans.com":host,evinaTid="a2"===(null===country||void 0===country?void 0:country.toLowerCase())?"&evinaTi=".concat(rockmanId):"",securityProcessId=null!==(_window4=window)&&void 0!==_window4&&_window4.securityProcessId?"&securityProcessId=".concat(window.securityProcessId):"",languageCode=window.languageCode?"&language_code=".concat(window.languageCode):"",userDetails=email&&password?"&email=".concat(email,"&password=").concat(password):"&msisdn=".concat(msisdn),searchQs=search&&""!==search?"".concat(search,"&"):"",url="https://".concat(newHost,"/tallyman/v1/?action=redirect&slug=").concat(slug,"&country=").concat(country,"&device=").concat(device,"&offerId=").concat(offer,"&rockman_id=").concat(rockmanId,"&page=").concat(encodeURIComponent(null===(_window5=window)||void 0===_window5||null===(_window5$location=_window5.location)||void 0===_window5$location?void 0:_window5$location.href),"&network_type=").concat(ip_range_name?"":"wifi","&").concat(searchQs,"&").concat(evinaTid).concat(securityProcessId).concat(languageCode).concat(userDetails,"&").concat(extraParamsQs||""),!slug.includes("za-mtn-beyondvr-r7")){_context18.next=11;break}return _context18.abrupt("return",{success:!0,rockman_id:rockmanId,redirect_url:url});case 11:return _context18.abrupt("return",fetch(url).then(function(x){return x.json()}));case 12:case"end":return _context18.stop();}},_callee18)}));return redirect}(),triggerMessage:function(){function triggerMessage(_x121,_x122,_x123,_x124,_x125,_x126,_x127,_x128,_x129){return _triggerMessage2.apply(this,arguments)}var _triggerMessage2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee19(host,slug,country,msisdn,device,offer,rockmanId,search,extraParamsQs){var _window6,_window6$location,isDMB,newHost,partnerAjaxResopnse,params,queryString,url;return _regeneratorRuntime().wrap(function _callee19$(_context19){for(;1;)switch(_context19.prev=_context19.next){case 0:if(isDMB=null!==window.pac_analytics.visitor.xaid&&/dmb|amb/i.test(window.pac_analytics.visitor.xaid),newHost=isDMB?"de.tallymans.com":host,!window.api_ajax_url){_context19.next=8;break}return _context19.next=5,fetch(window.api_ajax_url).then(function(x){return x.json()});case 5:_context19.t0=_context19.sent,_context19.next=9;break;case 8:_context19.t0=null;case 9:return partnerAjaxResopnse=_context19.t0,params={action:"trigger-message",slug:slug,country:country,msisdn:msisdn,device:device,offerId:offer,rockman_id:rockmanId,page:encodeURIComponent(null===(_window6=window)||void 0===_window6||null===(_window6$location=_window6.location)||void 0===_window6$location?void 0:_window6$location.href),sam_g_token:window.reCaptchaToken||"",antifraud_id:window.antifraud_id||"",language_code:window.languageCode||"",partner_form_action:null!==partnerAjaxResopnse&&void 0!==partnerAjaxResopnse&&partnerAjaxResopnse.form_action?encodeURIComponent(null===partnerAjaxResopnse||void 0===partnerAjaxResopnse?void 0:partnerAjaxResopnse.form_action):""},queryString=Object.entries(params).filter(function(_ref11){var _ref12=_slicedToArray(_ref11,2),_=_ref12[0],value=_ref12[1];return value}).map(function(_ref13){var _ref14=_slicedToArray(_ref13,2),key=_ref14[0],value=_ref14[1];return"".concat(key,"=").concat(value)}).join("&"),url="https://".concat(newHost,"/tallyman/v1/?").concat(queryString,"&").concat(extraParamsQs),_context19.abrupt("return",fetch(url).then(function(x){return x.json()}));case 14:case"end":return _context19.stop();}},_callee19)}));return triggerMessage}(),ussd:function(){function ussd(_x130,_x131,_x132,_x133,_x134,_x135,_x136,_x137,_x138){return _ussd2.apply(this,arguments)}var _ussd2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee20(host,slug,country,msisdn,device,offer,rockmanId,search,extraParamsQs){var _window$pac_analytics23,_window$pac_analytics24,_window$pac_analytics25,_window$pac_analytics26,isDMB,newHost;return _regeneratorRuntime().wrap(function _callee20$(_context20){for(;1;)switch(_context20.prev=_context20.next){case 0:return isDMB=null!==window.pac_analytics.visitor.xaid&&-1!==(-1!==(null===(_window$pac_analytics23=window.pac_analytics.visitor.xaid)||void 0===_window$pac_analytics23||null===(_window$pac_analytics24=_window$pac_analytics23.toLowerCase())||void 0===_window$pac_analytics24?void 0:_window$pac_analytics24.indexOf("dmb"))||(null===(_window$pac_analytics25=window.pac_analytics.visitor.xaid)||void 0===_window$pac_analytics25||null===(_window$pac_analytics26=_window$pac_analytics25.toLowerCase())||void 0===_window$pac_analytics26?void 0:_window$pac_analytics26.indexOf("amb"))),newHost=isDMB?"de.tallymans.com":host,_context20.abrupt("return",fetch("https://".concat(newHost,"/tallyman/v1/?action=ussd&slug=").concat(slug,"&country=").concat(country,"&msisdn=").concat(msisdn,"&device=").concat(device,"&offerId=").concat(offer,"&rockman_id=").concat(rockmanId,"&").concat(search).concat(extraParamsQs)).then(function(x){return x.json()}));case 3:case"end":return _context20.stop();}},_callee20)}));return ussd}(),oc2sms:function(){function oc2sms(_x139,_x140,_x141,_x142,_x143,_x144,_x145,_x146){return _oc2sms2.apply(this,arguments)}var _oc2sms2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee21(host,country,slug,offer,rockmanId,keyword,operator,search){var _window$pac_analytics27,_window$pac_analytics28,_window$pac_analytics29,_window$pac_analytics30,_window$pac_analytics31,_window7,_window7$location,isDMB,newHost;return _regeneratorRuntime().wrap(function _callee21$(_context21){for(;1;)switch(_context21.prev=_context21.next){case 0:return isDMB=null!==(null===(_window$pac_analytics27=window.pac_analytics.visitor)||void 0===_window$pac_analytics27?void 0:_window$pac_analytics27.xaid)&&-1!==(-1!==(null===(_window$pac_analytics28=window.pac_analytics.visitor)||void 0===_window$pac_analytics28||null===(_window$pac_analytics29=_window$pac_analytics28.xaid)||void 0===_window$pac_analytics29?void 0:_window$pac_analytics29.toLowerCase().indexOf("dmb"))||(null===(_window$pac_analytics30=window.pac_analytics.visitor)||void 0===_window$pac_analytics30||null===(_window$pac_analytics31=_window$pac_analytics30.xaid)||void 0===_window$pac_analytics31?void 0:_window$pac_analytics31.toLowerCase().indexOf("amb"))),newHost=isDMB?"de.tallymans.com":host,_context21.abrupt("return",fetch("https://".concat(newHost,"/tallyman/v1/?action=oc2sms&country=").concat(country,"&slug=").concat(slug,"&offerId=").concat(offer,"&page=").concat(encodeURIComponent(null===(_window7=window)||void 0===_window7||null===(_window7$location=_window7.location)||void 0===_window7$location?void 0:_window7$location.href)).concat(keyword?"&keyword=".concat(keyword):"","&device=smart&rockman_id=").concat(rockmanId).concat(operator?"&operator=".concat(operator):"","&").concat(search)).then(function(x){return x.json()}));case 3:case"end":return _context21.stop();}},_callee21)}));return oc2sms}(),mcpShield:function(){function mcpShield(_x147,_x148,_x149,_x150,_x151,_x152,_x153,_x154){return _mcpShield2.apply(this,arguments)}var _mcpShield2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee22(host,country,slug,device,offer,rockmanId,operator,uniqid){var _window$pac_analytics32,_window$pac_analytics33,_window$pac_analytics34,_window$pac_analytics35,isDMB,newHost,pageUrl,ipAdd,userIp;return _regeneratorRuntime().wrap(function _callee22$(_context22){for(;1;)switch(_context22.prev=_context22.next){case 0:return isDMB=null!=window.pac_analytics.visitor.xaid&&-1!==(-1!==(null===(_window$pac_analytics32=window.pac_analytics.visitor.xaid)||void 0===_window$pac_analytics32||null===(_window$pac_analytics33=_window$pac_analytics32.toLowerCase())||void 0===_window$pac_analytics33?void 0:_window$pac_analytics33.indexOf("dmb"))||(null===(_window$pac_analytics34=window.pac_analytics.visitor.xaid)||void 0===_window$pac_analytics34||null===(_window$pac_analytics35=_window$pac_analytics34.toLowerCase())||void 0===_window$pac_analytics35?void 0:_window$pac_analytics35.indexOf("amb"))),newHost=isDMB?"de.tallymans.com":host,pageUrl=window.location.href,ipAdd=window.pac_analytics.visitor.ip,userIp=ipAdd?"&client_ip=".concat(ipAdd):"",_context22.abrupt("return",fetch("https://".concat(newHost,"/tallyman/v1/?action=mcp-shield&country=").concat(country,"&slug=").concat(slug,"&device=").concat(device,"&offerId=").concat(offer,"&operator=").concat(operator||"","&rockman_id=").concat(rockmanId,"&client_lpu=").concat(pageUrl).concat(userIp).concat(uniqid||"")).then(function(x){return x.json()}));case 6:case"end":return _context22.stop();}},_callee22)}));return mcpShield}(),getGoogleCaptcha:function(){function getGoogleCaptcha(_x155,_x156,_x157,_x158,_x159){return _getGoogleCaptcha2.apply(this,arguments)}var _getGoogleCaptcha2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee23(host,country,slug,device,domain){var _window$pac_analytics36,_window$pac_analytics37,_window$pac_analytics38,_window$pac_analytics39,isDMB,newHost;return _regeneratorRuntime().wrap(function _callee23$(_context23){for(;1;)switch(_context23.prev=_context23.next){case 0:return isDMB=null!=window.pac_analytics.visitor.xaid&&-1!==(-1!==(null===(_window$pac_analytics36=window.pac_analytics.visitor.xaid)||void 0===_window$pac_analytics36||null===(_window$pac_analytics37=_window$pac_analytics36.toLowerCase())||void 0===_window$pac_analytics37?void 0:_window$pac_analytics37.indexOf("dmb"))||(null===(_window$pac_analytics38=window.pac_analytics.visitor.xaid)||void 0===_window$pac_analytics38||null===(_window$pac_analytics39=_window$pac_analytics38.toLowerCase())||void 0===_window$pac_analytics39?void 0:_window$pac_analytics39.indexOf("amb"))),newHost=isDMB?"de.tallymans.com":host,_context23.abrupt("return",fetch("https://".concat(newHost,"/tallyman/helper/?action=google-captcha-v3-config&country=").concat(country,"&slug=").concat(slug,"&device=").concat(device,"&domain=").concat(domain)).then(function(x){return x.json()}));case 3:case"end":return _context23.stop();}},_callee23)}));return getGoogleCaptcha}(),storeEmail:function(){function storeEmail(_x160,_x161,_x162,_x163,_x164){return _storeEmail2.apply(this,arguments)}var _storeEmail2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee24(host,slug,service,rockmanId,email){var _window$pac_analytics40,_window$pac_analytics41,_window$pac_analytics42,_window$pac_analytics43,isDMB,newHost;return _regeneratorRuntime().wrap(function _callee24$(_context24){for(;1;)switch(_context24.prev=_context24.next){case 0:return isDMB=null!=window.pac_analytics.visitor.xaid&&-1!==(-1!==(null===(_window$pac_analytics40=window.pac_analytics.visitor.xaid)||void 0===_window$pac_analytics40||null===(_window$pac_analytics41=_window$pac_analytics40.toLowerCase())||void 0===_window$pac_analytics41?void 0:_window$pac_analytics41.indexOf("dmb"))||(null===(_window$pac_analytics42=window.pac_analytics.visitor.xaid)||void 0===_window$pac_analytics42||null===(_window$pac_analytics43=_window$pac_analytics42.toLowerCase())||void 0===_window$pac_analytics43?void 0:_window$pac_analytics43.indexOf("amb"))),newHost=isDMB?"de.tallymans.com":host,_context24.abrupt("return",fetch("https://".concat(newHost,"/tallyman/helper/?action=store-email&slug=").concat(slug,"&rockman_id=").concat(rockmanId,"&email=").concat(email,"&product_identifier=").concat(service)).then(function(x){return x.json()}));case 3:case"end":return _context24.stop();}},_callee24)}));return storeEmail}(),creditCardPayment:function creditCardPayment(userDetails,extraConfig){var _window9,_window9$pac_analytic,_window9$pac_analytic2,myHeaders=new Headers;if(myHeaders.append("Content-Type","application/json"),"cc_number"in userDetails){var _window8,_window8$pac_analytic,_window8$pac_analytic2,_newUserDetails=_objectSpread({rockman_id:null===(_window8=window)||void 0===_window8||null===(_window8$pac_analytic=_window8.pac_analytics)||void 0===_window8$pac_analytic||null===(_window8$pac_analytic2=_window8$pac_analytic.visitor)||void 0===_window8$pac_analytic2?void 0:_window8$pac_analytic2.rockmanId,landing_page_url:window.location.href,service_id:null===extraConfig||void 0===extraConfig?void 0:extraConfig.serviceId},userDetails),_requestOptions={method:"POST",body:JSON.stringify(_newUserDetails),headers:myHeaders};return fetch("https://cc.tallymans.com/api/v1/maxpay/frontend/initiate-payment",_requestOptions).then(function(x){return x.json()})}var newUserDetails=_objectSpread({rockman_id:null===(_window9=window)||void 0===_window9||null===(_window9$pac_analytic=_window9.pac_analytics)||void 0===_window9$pac_analytic||null===(_window9$pac_analytic2=_window9$pac_analytic.visitor)||void 0===_window9$pac_analytic2?void 0:_window9$pac_analytic2.rockmanId,landing_page_url:window.location.href,service_id:2,user_agent:window.navigator.userAgent,ip:window.pac_analytics.visitor.ip},userDetails),requestOptions={method:"POST",body:JSON.stringify(newUserDetails),headers:myHeaders};return fetch("https://cc.tallymans.com/api/v1/ecardon/frontend/initiate-payment",requestOptions).then(function(x){return x.json()})}};exports.RealTallyman=RealTallyman;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Action } from 'redux';
|
|
2
|
-
import { ThunkAction } from 'redux-thunk';
|
|
3
|
-
import IClick2smsConstants from '../reducers/click2smsFlow/IClick2smsConstants';
|
|
4
|
-
import ICreditCardConstants from '../reducers/creditCardFlow/ICreditCardConstants';
|
|
5
|
-
import IMoConstants from '../reducers/moFlow/IMoConstants';
|
|
6
|
-
import IMoRedirConstants from '../reducers/moRedirFlow/IMoRedirConstants';
|
|
7
|
-
import IOneClickConstants from '../reducers/oneClickFlow/IOneClickConstants';
|
|
8
|
-
import IPinConstants from '../reducers/pinFlow/IPinConstants';
|
|
9
|
-
import IStategyActionContants from '../reducers/strategy/IStategyActionContants';
|
|
10
|
-
import IUssdConstants from '../reducers/ussdFlow/IUssdConstants';
|
|
11
|
-
import { IApplicationState } from '../store/reducers';
|
|
12
|
-
export declare type IAllActionConstants = IStategyActionContants | IPinConstants | IMoConstants | IMoRedirConstants | IOneClickConstants | IClick2smsConstants | IUssdConstants | ICreditCardConstants;
|
|
13
|
-
export declare type AppThunk<ReturnType = void> = ThunkAction<ReturnType, IApplicationState, unknown, Action<IAllActionConstants>>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|