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
|
@@ -96,16 +96,16 @@ exports.additionalQueryString = additionalQueryString;
|
|
|
96
96
|
|
|
97
97
|
var fetchJsonp = function fetchJsonp(_url) {
|
|
98
98
|
var url = _url;
|
|
99
|
-
var ouisys_callback_function = "ouisys_callback_function"
|
|
99
|
+
var ouisys_callback_function = "ouisys_callback_function".concat(Math.floor(Math.random() * 10000));
|
|
100
100
|
return new Promise(function (resolve, reject) {
|
|
101
|
-
|
|
101
|
+
// @ts-ignore
|
|
102
102
|
window[ouisys_callback_function] = function (arg) {
|
|
103
103
|
resolve(arg);
|
|
104
104
|
};
|
|
105
105
|
|
|
106
106
|
url += url.indexOf('?') === -1 ? '?' : '&';
|
|
107
107
|
url += "jsonp=".concat(ouisys_callback_function);
|
|
108
|
-
var script = document.createElement(
|
|
108
|
+
var script = document.createElement('script');
|
|
109
109
|
script.src = url;
|
|
110
110
|
script.id = ouisys_callback_function;
|
|
111
111
|
document.body.appendChild(script); // Caught if got 404/500
|
|
@@ -120,13 +120,13 @@ var uniqidResult;
|
|
|
120
120
|
|
|
121
121
|
var getRedirectUrl = /*#__PURE__*/function () {
|
|
122
122
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(window, maybeConfig, extraParams) {
|
|
123
|
-
var host, country, slug, queryString, device, apiAction, bupperizeCountry, offer, s, search, extraParamsQs, rockmanId, _url2, result, identifyError, _url3, _result, _identifyError, mcpShieldResult, mcpSessionCheckWithBlock, _url4, _result2, _identifyError2;
|
|
123
|
+
var host, country, slug, queryString, device, apiAction, customDomain, bupperizeCountry, offer, s, search, extraParamsQs, rockmanId, _url2, result, identifyError, _url3, _result, _identifyError, mcpShieldResult, mcpSessionCheckWithBlock, _url4, _result2, _identifyError2;
|
|
124
124
|
|
|
125
125
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
126
126
|
while (1) {
|
|
127
127
|
switch (_context.prev = _context.next) {
|
|
128
128
|
case 0:
|
|
129
|
-
if (!(typeof window
|
|
129
|
+
if (!(typeof window === 'undefined')) {
|
|
130
130
|
_context.next = 4;
|
|
131
131
|
break;
|
|
132
132
|
}
|
|
@@ -135,6 +135,7 @@ var getRedirectUrl = /*#__PURE__*/function () {
|
|
|
135
135
|
|
|
136
136
|
case 4:
|
|
137
137
|
host = maybeConfig.host, country = maybeConfig.country, slug = maybeConfig.slug, queryString = maybeConfig.queryString, device = maybeConfig.device, apiAction = maybeConfig.apiAction;
|
|
138
|
+
customDomain = slug === 'evina-test-handle' ? 'dev.ng.eu.ngrok.io' : 'de-ads.tallymans.com';
|
|
138
139
|
|
|
139
140
|
bupperizeCountry = function bupperizeCountry(c) {
|
|
140
141
|
return c == 'gb' ? 'uk' : c;
|
|
@@ -149,33 +150,33 @@ var getRedirectUrl = /*#__PURE__*/function () {
|
|
|
149
150
|
|
|
150
151
|
return "".concat(k, "=").concat(v);
|
|
151
152
|
})).join('&');
|
|
152
|
-
extraParamsQs = !extraParams ? '' :
|
|
153
|
+
extraParamsQs = !extraParams ? '' : "&".concat(Object.keys(extraParams).map(function (k) {
|
|
153
154
|
return "".concat(k, "=").concat(extraParams[k]);
|
|
154
|
-
}).join('&');
|
|
155
|
+
}).join('&'));
|
|
155
156
|
rockmanId = window.pac_analytics.visitor.rockmanId;
|
|
156
157
|
|
|
157
|
-
if (!(apiAction ==
|
|
158
|
-
_context.next =
|
|
158
|
+
if (!(apiAction == 'identify-user')) {
|
|
159
|
+
_context.next = 26;
|
|
159
160
|
break;
|
|
160
161
|
}
|
|
161
162
|
|
|
162
|
-
_url2 = "https://de.tallymans.com/tallyman/v1/?action=identify-user&country=".concat(bupperizeCountry(country), "&slug=").concat(slug, "&device=",
|
|
163
|
-
_context.next =
|
|
163
|
+
_url2 = "https://de.tallymans.com/tallyman/v1/?action=identify-user&country=".concat(bupperizeCountry(country), "&slug=").concat(slug, "&device=", 'smart', "&offerId=").concat(offer, "&rockman_id=").concat(rockmanId).concat(extraParamsQs, "&").concat(search);
|
|
164
|
+
_context.next = 16;
|
|
164
165
|
return fetchJsonp(_url2);
|
|
165
166
|
|
|
166
|
-
case
|
|
167
|
+
case 16:
|
|
167
168
|
result = _context.sent;
|
|
168
169
|
|
|
169
|
-
if (!(
|
|
170
|
-
_context.next =
|
|
170
|
+
if (!(result.success === false)) {
|
|
171
|
+
_context.next = 23;
|
|
171
172
|
break;
|
|
172
173
|
}
|
|
173
174
|
|
|
174
175
|
identifyError = new Error("Error in getRedirectUrl() identify-user action:\n".concat(result.message));
|
|
175
|
-
identifyError
|
|
176
|
+
identifyError.type = 'NotOn3g';
|
|
176
177
|
throw identifyError;
|
|
177
178
|
|
|
178
|
-
case
|
|
179
|
+
case 23:
|
|
179
180
|
return _context.abrupt("return", {
|
|
180
181
|
subscription_url: result.subscription_url || result.redirect_url,
|
|
181
182
|
action: function action() {
|
|
@@ -183,58 +184,58 @@ var getRedirectUrl = /*#__PURE__*/function () {
|
|
|
183
184
|
}
|
|
184
185
|
});
|
|
185
186
|
|
|
186
|
-
case
|
|
187
|
-
_context.next =
|
|
187
|
+
case 24:
|
|
188
|
+
_context.next = 63;
|
|
188
189
|
break;
|
|
189
190
|
|
|
190
|
-
case
|
|
191
|
-
if (!(apiAction ==
|
|
192
|
-
_context.next =
|
|
191
|
+
case 26:
|
|
192
|
+
if (!(apiAction == 'he')) {
|
|
193
|
+
_context.next = 41;
|
|
193
194
|
break;
|
|
194
195
|
}
|
|
195
196
|
|
|
196
|
-
_url3 = "https://de.tallymans.com/tallyman/v1/?action=he&country=".concat(bupperizeCountry(country), "&slug=").concat(slug, "&device=",
|
|
197
|
-
_context.next =
|
|
197
|
+
_url3 = "https://de.tallymans.com/tallyman/v1/?action=he&country=".concat(bupperizeCountry(country), "&slug=").concat(slug, "&device=", 'smart', "&offerId=").concat(offer, "&rockman_id=").concat(rockmanId).concat(extraParamsQs, "&").concat(search);
|
|
198
|
+
_context.next = 30;
|
|
198
199
|
return fetch(_url3).then(function (x) {
|
|
199
200
|
return x.json();
|
|
200
201
|
});
|
|
201
202
|
|
|
202
|
-
case
|
|
203
|
+
case 30:
|
|
203
204
|
_result = _context.sent;
|
|
204
205
|
|
|
205
|
-
if (!(
|
|
206
|
-
_context.next =
|
|
206
|
+
if (!(_result.success === false)) {
|
|
207
|
+
_context.next = 37;
|
|
207
208
|
break;
|
|
208
209
|
}
|
|
209
210
|
|
|
210
211
|
_identifyError = new Error("Error in getRedirectUrl() identify-user action:\n".concat(_result.message));
|
|
211
|
-
_identifyError
|
|
212
|
+
_identifyError.type = 'NotOn3g';
|
|
212
213
|
throw _identifyError;
|
|
213
214
|
|
|
214
|
-
case
|
|
215
|
+
case 37:
|
|
215
216
|
(0, _loadScriptInnerHtml.default)(_result.source);
|
|
216
217
|
return _context.abrupt("return", {
|
|
217
218
|
redirect_url: _result.redirectUrlWithReplacedUniqid
|
|
218
219
|
});
|
|
219
220
|
|
|
220
|
-
case
|
|
221
|
-
_context.next =
|
|
221
|
+
case 39:
|
|
222
|
+
_context.next = 63;
|
|
222
223
|
break;
|
|
223
224
|
|
|
224
|
-
case
|
|
225
|
-
if (!(country.toLowerCase() ===
|
|
226
|
-
_context.next =
|
|
225
|
+
case 41:
|
|
226
|
+
if (!(country.toLowerCase() === 'za' && slug !== 'evina-test-handle')) {
|
|
227
|
+
_context.next = 52;
|
|
227
228
|
break;
|
|
228
229
|
}
|
|
229
230
|
|
|
230
|
-
_context.prev =
|
|
231
|
-
_context.next =
|
|
231
|
+
_context.prev = 42;
|
|
232
|
+
_context.next = 45;
|
|
232
233
|
return window.tallymanApi.mcpShield(host, country, slug, device, offer, rockmanId);
|
|
233
234
|
|
|
234
|
-
case
|
|
235
|
+
case 45:
|
|
235
236
|
mcpShieldResult = _context.sent;
|
|
236
237
|
|
|
237
|
-
if (
|
|
238
|
+
if (mcpShieldResult.success == false) {
|
|
238
239
|
console.warn(mcpShieldResult.message);
|
|
239
240
|
} else {
|
|
240
241
|
(0, _loadScriptInnerHtml.default)(mcpShieldResult.source);
|
|
@@ -243,44 +244,44 @@ var getRedirectUrl = /*#__PURE__*/function () {
|
|
|
243
244
|
(0, _loadScriptInnerHtml.default)(mcpSessionCheckWithBlock);
|
|
244
245
|
}
|
|
245
246
|
|
|
246
|
-
_context.next =
|
|
247
|
+
_context.next = 52;
|
|
247
248
|
break;
|
|
248
249
|
|
|
249
|
-
case
|
|
250
|
-
_context.prev =
|
|
251
|
-
_context.t0 = _context["catch"](
|
|
250
|
+
case 49:
|
|
251
|
+
_context.prev = 49;
|
|
252
|
+
_context.t0 = _context["catch"](42);
|
|
252
253
|
console.warn(_context.t0);
|
|
253
254
|
|
|
254
|
-
case
|
|
255
|
-
_url4 = "https://
|
|
256
|
-
_context.next =
|
|
255
|
+
case 52:
|
|
256
|
+
_url4 = "https://".concat(customDomain, "/tallyman/v1/?action=redirect&country=").concat(bupperizeCountry(country), "&slug=").concat(slug, "&device=", 'smart', "&offerId=").concat(offer, "&rockman_id=").concat(rockmanId).concat(extraParamsQs, "&").concat(search);
|
|
257
|
+
_context.next = 55;
|
|
257
258
|
return fetch(_url4).then(function (x) {
|
|
258
259
|
return x.json();
|
|
259
260
|
});
|
|
260
261
|
|
|
261
|
-
case
|
|
262
|
+
case 55:
|
|
262
263
|
_result2 = _context.sent;
|
|
263
264
|
|
|
264
|
-
if (!(
|
|
265
|
-
_context.next =
|
|
265
|
+
if (!(_result2.success === false)) {
|
|
266
|
+
_context.next = 62;
|
|
266
267
|
break;
|
|
267
268
|
}
|
|
268
269
|
|
|
269
270
|
_identifyError2 = new Error("Error in getRedirectUrl() identify-user action:\n".concat(_result2.message));
|
|
270
|
-
_identifyError2
|
|
271
|
+
_identifyError2.type = 'NotOn3g';
|
|
271
272
|
throw _identifyError2;
|
|
272
273
|
|
|
273
|
-
case
|
|
274
|
+
case 62:
|
|
274
275
|
return _context.abrupt("return", {
|
|
275
276
|
redirect_url: _result2.redirect_url
|
|
276
277
|
});
|
|
277
278
|
|
|
278
|
-
case
|
|
279
|
+
case 63:
|
|
279
280
|
case "end":
|
|
280
281
|
return _context.stop();
|
|
281
282
|
}
|
|
282
283
|
}
|
|
283
|
-
}, _callee, null, [[
|
|
284
|
+
}, _callee, null, [[42, 49]]);
|
|
284
285
|
}));
|
|
285
286
|
|
|
286
287
|
return function getRedirectUrl(_x, _x2, _x3) {
|
|
@@ -297,11 +298,11 @@ var subscribe = /*#__PURE__*/function () {
|
|
|
297
298
|
while (1) {
|
|
298
299
|
switch (_context2.prev = _context2.next) {
|
|
299
300
|
case 0:
|
|
300
|
-
evinaTid = typeof window
|
|
301
|
-
extraParamsQs = !extraParams ? '' :
|
|
301
|
+
evinaTid = typeof window !== 'undefined' && window.tid ? window.tid : '';
|
|
302
|
+
extraParamsQs = !extraParams ? '' : "&".concat(Object.keys(extraParams).map(function (k) {
|
|
302
303
|
return "".concat(k, "=").concat(extraParams[k]);
|
|
303
|
-
}).join('&');
|
|
304
|
-
isCleanTraffic = typeof window
|
|
304
|
+
}).join('&'));
|
|
305
|
+
isCleanTraffic = typeof window !== 'undefined' && window.shouldBlock === true ? '&is-clean-traffic=false' : '&is-clean-traffic=true';
|
|
305
306
|
_context2.next = 5;
|
|
306
307
|
return fetch("".concat(url, "&sam_evina_tid=").concat(evinaTid).concat(isCleanTraffic).concat(extraParamsQs)).then(function (x) {
|
|
307
308
|
return x.json();
|
|
@@ -310,14 +311,14 @@ var subscribe = /*#__PURE__*/function () {
|
|
|
310
311
|
case 5:
|
|
311
312
|
result = _context2.sent;
|
|
312
313
|
|
|
313
|
-
if (!(
|
|
314
|
+
if (!(result.success === false)) {
|
|
314
315
|
_context2.next = 13;
|
|
315
316
|
break;
|
|
316
317
|
}
|
|
317
318
|
|
|
318
319
|
subscribeError = new Error("Error in subscribe() one-click-subscribe action:\n".concat(result.message));
|
|
319
|
-
subscribeError
|
|
320
|
-
subscribeError
|
|
320
|
+
subscribeError.type = result.message == 'ALREADY SUBSCRIBED' ? 'AlreadySubscribed' : 'SubscriptionError';
|
|
321
|
+
subscribeError.productUrl = result.product_url ? result.product_url : '';
|
|
321
322
|
throw subscribeError;
|
|
322
323
|
|
|
323
324
|
case 13:
|
|
@@ -345,14 +346,14 @@ var getRedirectUrlBupperWay = /*#__PURE__*/function () {
|
|
|
345
346
|
while (1) {
|
|
346
347
|
switch (_context3.prev = _context3.next) {
|
|
347
348
|
case 0:
|
|
348
|
-
if (!(typeof window
|
|
349
|
-
_context3.next =
|
|
349
|
+
if (!(typeof window === 'undefined')) {
|
|
350
|
+
_context3.next = 2;
|
|
350
351
|
break;
|
|
351
352
|
}
|
|
352
353
|
|
|
353
354
|
return _context3.abrupt("return", "javascript: console.error('SSR'); void 6");
|
|
354
355
|
|
|
355
|
-
case
|
|
356
|
+
case 2:
|
|
356
357
|
host = maybeConfig.host, country = maybeConfig.country, slug = maybeConfig.slug, queryString = maybeConfig.queryString;
|
|
357
358
|
|
|
358
359
|
bupperizeCountry = function bupperizeCountry(c) {
|
|
@@ -368,14 +369,14 @@ var getRedirectUrlBupperWay = /*#__PURE__*/function () {
|
|
|
368
369
|
|
|
369
370
|
return "".concat(k, "=").concat(v);
|
|
370
371
|
})).join('&');
|
|
371
|
-
extraParamsQs = !extraParams ? '' :
|
|
372
|
+
extraParamsQs = !extraParams ? '' : "&".concat(Object.keys(extraParams).map(function (k) {
|
|
372
373
|
return "".concat(k, "=").concat(extraParams[k]);
|
|
373
|
-
}).join('&'); // one click flow must use http not https
|
|
374
|
+
}).join('&')); // one click flow must use http not https
|
|
374
375
|
|
|
375
|
-
xcid = window.location.href.split(
|
|
376
|
+
xcid = window.location.href.split('/')[3].split('?')[0];
|
|
376
377
|
return _context3.abrupt("return", "http://".concat(host, "/").concat(bupperizeCountry(country), "/").concat(slug, "?offer=").concat(offer, "&atmobirun=1&rockman_id=").concat(window.pac_analytics.visitor.rockmanId, "&redirPixels=").concat(window.location.host, "&x-xcid=").concat(xcid).concat(extraParamsQs).concat(search));
|
|
377
378
|
|
|
378
|
-
case
|
|
379
|
+
case 10:
|
|
379
380
|
case "end":
|
|
380
381
|
return _context3.stop();
|
|
381
382
|
}
|
|
@@ -391,8 +392,8 @@ var getRedirectUrlBupperWay = /*#__PURE__*/function () {
|
|
|
391
392
|
exports.getRedirectUrlBupperWay = getRedirectUrlBupperWay;
|
|
392
393
|
var mockedRedirectUrlSuccessState = {
|
|
393
394
|
currentState: {
|
|
394
|
-
type:
|
|
395
|
-
|
|
395
|
+
type: 'GET_REDIRECT_URL',
|
|
396
|
+
// @ts-ignore
|
|
396
397
|
result: RDS.Success({
|
|
397
398
|
redirectUrl: '/mock-product-url'
|
|
398
399
|
})
|
|
@@ -401,8 +402,8 @@ var mockedRedirectUrlSuccessState = {
|
|
|
401
402
|
exports.mockedRedirectUrlSuccessState = mockedRedirectUrlSuccessState;
|
|
402
403
|
var mockedSubscribeAjaxState = {
|
|
403
404
|
currentState: {
|
|
404
|
-
type:
|
|
405
|
-
|
|
405
|
+
type: 'SUBCRIBE_AJAX',
|
|
406
|
+
// @ts-ignore
|
|
406
407
|
result: RDS.NothingYet()
|
|
407
408
|
}
|
|
408
409
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare type IPinConstants =
|
|
1
|
+
declare type IPinConstants = 'PIN_FLOW_MSISDN_SUBMIT' | 'PIN_FLOW_MSISDN_SUBMIT_ERROR' | 'PIN_SUBMIT' | 'BACK_TO_START' | 'PIN_SUBMIT_ERROR' | 'MOCK_PIN_FLOW_STATE';
|
|
2
2
|
export default IPinConstants;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { AppThunk } from '../../common-types/AppThunk';
|
|
2
|
+
import * as RDS from '../../common-types/RemoteDataState';
|
|
3
3
|
export declare type IPinFlowCurrentState = {
|
|
4
|
-
type:
|
|
4
|
+
type: 'MSISDNEntry';
|
|
5
5
|
result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
|
|
6
6
|
} | {
|
|
7
|
-
type:
|
|
7
|
+
type: 'PINEntry';
|
|
8
8
|
result: RDS.RemoteDataState<PINEntryFailure, PINEntrySuccess>;
|
|
9
9
|
data: IMsisdnSumbitNextData;
|
|
10
10
|
};
|
|
11
|
-
export declare type MSISDNEntryErrorTypes =
|
|
11
|
+
export declare type MSISDNEntryErrorTypes = 'AlreadySubscribed' | 'UnknownError' | 'InvalidMSISDN';
|
|
12
12
|
export declare type MSISDNEntryFailure = {
|
|
13
13
|
errorType: MSISDNEntryErrorTypes;
|
|
14
14
|
error: any;
|
|
15
15
|
productUrl?: string;
|
|
16
16
|
};
|
|
17
17
|
export declare type MSISDNEntrySuccess = {
|
|
18
|
-
type:
|
|
18
|
+
type: 'PINEntry';
|
|
19
19
|
result: RDS.RemoteDataState<PINEntryFailure, PINEntrySuccess>;
|
|
20
20
|
};
|
|
21
21
|
export declare type PINEntryFailure = {
|
|
@@ -27,53 +27,53 @@ export declare type PINEntrySuccess = {
|
|
|
27
27
|
msisdn?: string;
|
|
28
28
|
isAlreadySubscribed?: boolean;
|
|
29
29
|
};
|
|
30
|
-
export declare type PINEntryErrorTypes =
|
|
30
|
+
export declare type PINEntryErrorTypes = 'UnknownError' | 'TooEarly' | 'InvalidPIN' | 'UnexpectedState' | 'SessionBlocked';
|
|
31
31
|
export declare type IMsisdnSumbitNextData = {
|
|
32
32
|
actualPIN: string;
|
|
33
|
-
nextAction:
|
|
33
|
+
nextAction: 'submitPinAction';
|
|
34
34
|
msisdn: string;
|
|
35
35
|
pinMaxLength?: number | null;
|
|
36
36
|
operator?: string;
|
|
37
37
|
};
|
|
38
38
|
export declare type IMsisnSubmitActionPayload = {
|
|
39
|
-
type:
|
|
39
|
+
type: 'MSISDNEntry';
|
|
40
40
|
result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
|
|
41
41
|
data: IMsisdnSumbitNextData;
|
|
42
42
|
};
|
|
43
43
|
export declare type IMsisdnSubmitErrorPayload = {
|
|
44
|
-
type:
|
|
44
|
+
type: 'MSISDNEntry';
|
|
45
45
|
result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
|
|
46
46
|
};
|
|
47
47
|
export declare type IPinSubmitPayload = {
|
|
48
|
-
type:
|
|
48
|
+
type: 'PINEntry';
|
|
49
49
|
result: RDS.RemoteDataState<PINEntryFailure, PINEntrySuccess>;
|
|
50
50
|
actualPIN?: string;
|
|
51
51
|
};
|
|
52
52
|
export declare type IPinErrorPayload = {
|
|
53
|
-
type:
|
|
53
|
+
type: 'PINEntry';
|
|
54
54
|
result: RDS.RemoteDataState<PINEntryFailure, PINEntrySuccess>;
|
|
55
55
|
};
|
|
56
56
|
export declare type IBackToStartPayload = {
|
|
57
|
-
type:
|
|
57
|
+
type: 'MSISDNEntry';
|
|
58
58
|
result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
|
|
59
59
|
};
|
|
60
60
|
export declare type IPinActions = {
|
|
61
|
-
type:
|
|
61
|
+
type: 'PIN_FLOW_MSISDN_SUBMIT';
|
|
62
62
|
payload: IMsisnSubmitActionPayload;
|
|
63
63
|
} | {
|
|
64
|
-
type:
|
|
64
|
+
type: 'PIN_FLOW_MSISDN_SUBMIT_ERROR';
|
|
65
65
|
payload: IMsisdnSubmitErrorPayload;
|
|
66
66
|
} | {
|
|
67
|
-
type:
|
|
67
|
+
type: 'PIN_SUBMIT';
|
|
68
68
|
payload: IPinSubmitPayload;
|
|
69
69
|
} | {
|
|
70
|
-
type:
|
|
70
|
+
type: 'BACK_TO_START';
|
|
71
71
|
payload: IBackToStartPayload;
|
|
72
72
|
} | {
|
|
73
|
-
type:
|
|
73
|
+
type: 'PIN_SUBMIT_ERROR';
|
|
74
74
|
payload: IPinErrorPayload;
|
|
75
75
|
} | {
|
|
76
|
-
type:
|
|
76
|
+
type: 'MOCK_PIN_FLOW_STATE';
|
|
77
77
|
payload: IPinFlowCurrentState;
|
|
78
78
|
};
|
|
79
79
|
export interface IPinFlowReducerState {
|
|
@@ -84,7 +84,7 @@ export declare type IConfig = {
|
|
|
84
84
|
slug?: string;
|
|
85
85
|
country?: string;
|
|
86
86
|
host?: string;
|
|
87
|
-
device?:
|
|
87
|
+
device?: 'smart' | 'feature';
|
|
88
88
|
automaticallySubmitAllOperators?: boolean;
|
|
89
89
|
operators?: string[];
|
|
90
90
|
};
|
|
@@ -125,13 +125,13 @@ export interface IHash {
|
|
|
125
125
|
[key: string]: string;
|
|
126
126
|
}
|
|
127
127
|
export declare type SingleMSISDNSubmissionResult = {
|
|
128
|
-
type:
|
|
128
|
+
type: 'SingleMSISDNSubmissionResult';
|
|
129
129
|
operator: string;
|
|
130
130
|
pin?: string;
|
|
131
131
|
uniqidResult?: string;
|
|
132
132
|
};
|
|
133
133
|
export declare type MultiOperatorMSISDNSubmissionResult = {
|
|
134
|
-
type:
|
|
134
|
+
type: 'MultiOperatorMSISDNSubmissionResult';
|
|
135
135
|
};
|
|
136
136
|
export declare type IMcpShieldResult = {
|
|
137
137
|
success: true;
|
|
@@ -143,7 +143,7 @@ export declare type IMcpShieldResult = {
|
|
|
143
143
|
rockman_id: string;
|
|
144
144
|
message: string;
|
|
145
145
|
};
|
|
146
|
-
export declare type IMockPinFlowStates =
|
|
146
|
+
export declare type IMockPinFlowStates = 'msisdn-state' | 'pin-state' | 'completed-state' | 'msisdn-failure-state';
|
|
147
147
|
export declare type IPinFlowActionMaps = {
|
|
148
148
|
submitMSISDNAction: (msisdn: string, extraParams?: IHash) => AppThunk;
|
|
149
149
|
submitPinAction: (msisdn: string, pin: string, extraParams?: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { AppThunk } from '../../common-types/AppThunk';
|
|
2
|
+
import * as RDS from '../../common-types/RemoteDataState';
|
|
3
|
+
import { IHash, IMockPinFlowStates, IPinActions, IPinFlowActionMaps, IPinFlowReducerState, MSISDNEntryFailure, MSISDNEntrySuccess } from './PinTypes';
|
|
4
4
|
export declare function submitMSISDNAction(msisdn: string, extraParams?: IHash): AppThunk;
|
|
5
5
|
export declare function reSubmitMSISDNAction(msisdn: string, extraParams?: IHash): AppThunk;
|
|
6
6
|
export declare function submitPinAction(msisdn: string, pin: string, extraParams?: {
|