ouisys-engine 4.1.47-alpha.0 → 4.3.0-alpha.0
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/@types/window.d.js +1 -1
- package/dist/api/index.js +728 -1
- package/dist/app/store.js +20 -0
- package/dist/common-types/AppThunk.js +1 -1
- package/dist/common-types/Either.js +1 -1
- package/dist/common-types/IError.js +1 -1
- package/dist/common-types/ITracker.js +3 -1
- package/dist/common-types/IVisitor.js +1 -1
- package/dist/common-types/RemoteDataState.js +135 -1
- package/dist/features/strategies/categories/askMobileNumber.js +388 -0
- package/dist/features/strategies/categories/askOperator.js +313 -0
- package/dist/features/strategies/categories/detectOperatorByIp.js +599 -0
- package/dist/features/strategies/categories/headerEnrichment.js +665 -0
- package/dist/features/strategies/categories/singleFlows/pin.js +1 -0
- package/dist/features/strategies/identifySlice.js +355 -0
- package/dist/features/strategies/pinFlowSlice.js +338 -0
- package/dist/flows/click2smsFlow.js +19 -1
- package/dist/flows/moFlow.js +19 -1
- package/dist/flows/moRedirFlow.js +19 -1
- package/dist/flows/oneClickFlow.js +23 -1
- package/dist/flows/pinFlow.js +23 -1
- package/dist/flows/strategy.js +53 -1
- package/dist/flows/tpayHeFlow.js +23 -0
- package/dist/flows/ussdFlow.js +19 -1
- package/dist/index.js +2 -0
- package/dist/ips/tryGetIPRangeName.js +74 -1
- package/dist/mockServer/browser.js +48 -0
- package/dist/mockServer/handlers.js +22 -0
- package/dist/mockServer/server.js +48 -0
- package/dist/pacman/index.js +108 -1
- package/dist/pacman/queryString.js +45 -1
- package/dist/reducers/click2smsFlow/Click2smsTypes.js +1 -1
- package/dist/reducers/click2smsFlow/IClick2smsConstants.js +1 -1
- package/dist/reducers/click2smsFlow/index.js +183 -1
- package/dist/reducers/click2smsFlow/utils.js +357 -1
- package/dist/reducers/moFlow/IMoConstants.js +1 -1
- package/dist/reducers/moFlow/MoTypes.js +1 -1
- package/dist/reducers/moFlow/index.js +251 -1
- package/dist/reducers/moFlow/utils.js +284 -1
- package/dist/reducers/moRedirFlow/IMoRedirConstants.js +1 -1
- package/dist/reducers/moRedirFlow/MoRedirTypes.js +1 -1
- package/dist/reducers/moRedirFlow/index.js +226 -1
- package/dist/reducers/moRedirFlow/utils.js +186 -1
- package/dist/reducers/oneClickFlow/IOneClickConstants.js +1 -1
- package/dist/reducers/oneClickFlow/OneClickTypes.js +1 -1
- package/dist/reducers/oneClickFlow/index.js +409 -1
- package/dist/reducers/oneClickFlow/utils.js +366 -1
- package/dist/reducers/pinFlow/IPinConstants.js +1 -1
- package/dist/reducers/pinFlow/PinTypes.js +1 -1
- package/dist/reducers/pinFlow/index.js +514 -1
- package/dist/reducers/pinFlow/utils.js +494 -1
- package/dist/reducers/strategy/IStategyActionContants.js +1 -1
- package/dist/reducers/strategy/StrategyTypes.js +1 -1
- package/dist/reducers/strategy/index.js +389 -1
- package/dist/reducers/strategy/strategies/ask_mobile_number.js +403 -1
- package/dist/reducers/strategy/strategies/ask_operator.js +305 -1
- package/dist/reducers/strategy/strategies/detect_operator_by_ip.js +459 -1
- package/dist/reducers/strategy/strategies/header_enrichment.js +783 -1
- package/dist/reducers/strategy/utils.js +702 -1
- package/dist/reducers/tpayHeFlow/ITpayHeConstants.js +1 -0
- package/dist/reducers/tpayHeFlow/TpayHeTypes.js +1 -0
- package/dist/reducers/tpayHeFlow/index.js +331 -0
- package/dist/reducers/tpayHeFlow/utils.js +510 -0
- package/dist/reducers/ussdFlow/IUssdConstants.js +1 -1
- package/dist/reducers/ussdFlow/UssdTypes.js +1 -1
- package/dist/reducers/ussdFlow/index.js +251 -1
- package/dist/reducers/ussdFlow/utils.js +225 -1
- package/dist/store/index.js +177 -1
- package/dist/store/reducers.js +41 -1
- package/dist/test/setup.js +24 -0
- package/dist/test/test-utils.js +51 -0
- package/dist/utilities/handleSubmitNumber.js +59 -1
- package/package.json +2 -2
- package/dist/api/index.d.ts +0 -43
- package/dist/common-types/AppThunk.d.ts +0 -13
- package/dist/common-types/Either.d.ts +0 -8
- package/dist/common-types/IError.d.ts +0 -3
- package/dist/common-types/IOptInFlowName.d.ts +0 -1
- package/dist/common-types/ITracker.d.ts +0 -9
- package/dist/common-types/IVisitor.d.ts +0 -14
- package/dist/common-types/RemoteDataState.d.ts +0 -38
- 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/creditCardFlow.d.ts +0 -6
- package/dist/flows/creditCardFlow.js +0 -1
- package/dist/flows/moFlow.d.ts +0 -6
- package/dist/flows/moRedirFlow.d.ts +0 -6
- package/dist/flows/oneClickFlow.d.ts +0 -7
- package/dist/flows/pinFlow.d.ts +0 -7
- package/dist/flows/strategy.d.ts +0 -14
- package/dist/flows/ussdFlow.d.ts +0 -6
- package/dist/index.d.ts +0 -0
- package/dist/ips/tryGetIPRangeName.d.ts +0 -2
- package/dist/jest.config.js +0 -194
- package/dist/pacman/index.d.ts +0 -6
- package/dist/pacman/queryString.d.ts +0 -3
- package/dist/reducers/click2smsFlow/Click2smsTypes.d.ts +0 -76
- package/dist/reducers/click2smsFlow/IClick2smsConstants.d.ts +0 -2
- package/dist/reducers/click2smsFlow/index.d.ts +0 -5
- package/dist/reducers/click2smsFlow/utils.d.ts +0 -4
- 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/MoTypes.d.ts +0 -88
- package/dist/reducers/moFlow/index.d.ts +0 -16
- package/dist/reducers/moFlow/utils.d.ts +0 -12
- package/dist/reducers/moRedirFlow/IMoRedirConstants.d.ts +0 -2
- package/dist/reducers/moRedirFlow/MoRedirTypes.d.ts +0 -64
- package/dist/reducers/moRedirFlow/index.d.ts +0 -14
- package/dist/reducers/moRedirFlow/utils.d.ts +0 -10
- package/dist/reducers/oneClickFlow/IOneClickConstants.d.ts +0 -2
- package/dist/reducers/oneClickFlow/OneClickTypes.d.ts +0 -85
- package/dist/reducers/oneClickFlow/index.d.ts +0 -13
- package/dist/reducers/oneClickFlow/utils.d.ts +0 -16
- package/dist/reducers/pinFlow/IPinConstants.d.ts +0 -2
- package/dist/reducers/pinFlow/PinTypes.d.ts +0 -156
- package/dist/reducers/pinFlow/index.d.ts +0 -19
- package/dist/reducers/pinFlow/utils.d.ts +0 -11
- package/dist/reducers/strategy/IStategyActionContants.d.ts +0 -2
- package/dist/reducers/strategy/StrategyTypes.d.ts +0 -248
- package/dist/reducers/strategy/index.d.ts +0 -13
- package/dist/reducers/strategy/strategies/ask_mobile_number.d.ts +0 -15
- package/dist/reducers/strategy/strategies/ask_operator.d.ts +0 -5
- package/dist/reducers/strategy/strategies/detect_operator_by_ip.d.ts +0 -10
- package/dist/reducers/strategy/strategies/header_enrichment.d.ts +0 -7
- 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/ussdFlow/IUssdConstants.d.ts +0 -2
- package/dist/reducers/ussdFlow/UssdTypes.d.ts +0 -77
- package/dist/reducers/ussdFlow/index.d.ts +0 -14
- package/dist/reducers/ussdFlow/utils.d.ts +0 -11
- package/dist/store/index.d.ts +0 -14
- package/dist/store/reducers.d.ts +0 -20
- 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/index.d.ts +0 -14
- 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
|
@@ -0,0 +1,665 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.to-string");
|
|
4
|
+
|
|
5
|
+
require("core-js/modules/es.promise");
|
|
6
|
+
|
|
7
|
+
require("core-js/modules/es.regexp.to-string");
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "__esModule", {
|
|
10
|
+
value: true
|
|
11
|
+
});
|
|
12
|
+
exports.identifyUserByHe = exports.heMoRedirOneClickHeaderEnrichment = exports.hePinOneClickHeaderEnrichment = exports.hePinMoRedirHeaderEnrichment = exports.pinHeaderEnrichment = void 0;
|
|
13
|
+
|
|
14
|
+
require("regenerator-runtime/runtime");
|
|
15
|
+
|
|
16
|
+
var _tryGetIPRangeName = _interopRequireDefault(require("../../../ips/tryGetIPRangeName"));
|
|
17
|
+
|
|
18
|
+
var _utils = require("../../../reducers/strategy/utils");
|
|
19
|
+
|
|
20
|
+
var _identifySlice = require("../identifySlice");
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
|
|
24
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
25
|
+
|
|
26
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
27
|
+
|
|
28
|
+
var oneClick = function oneClick(_ref) {
|
|
29
|
+
var flowObj = _ref.flowObj,
|
|
30
|
+
msisdn = _ref.msisdn,
|
|
31
|
+
operator = _ref.operator,
|
|
32
|
+
isHeaderEnrichmentSuccess = _ref.isHeaderEnrichmentSuccess,
|
|
33
|
+
subscriptionUrl = _ref.subscriptionUrl,
|
|
34
|
+
redirectUrl = _ref.redirectUrl;
|
|
35
|
+
|
|
36
|
+
_identifySlice.tracker.sendOptInFlowEvent('3G click');
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
type: _identifySlice.StrategyStates.ONE_CLICK,
|
|
40
|
+
result: {
|
|
41
|
+
config: flowObj.flowConfig,
|
|
42
|
+
operator: flowObj.operator,
|
|
43
|
+
msisdn: msisdn,
|
|
44
|
+
redirectUrl: redirectUrl,
|
|
45
|
+
subscriptionUrl: subscriptionUrl,
|
|
46
|
+
isHeaderEnrichmentSuccess: isHeaderEnrichmentSuccess
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
var pin = function pin(_ref2) {
|
|
52
|
+
var flowObj = _ref2.flowObj,
|
|
53
|
+
msisdn = _ref2.msisdn,
|
|
54
|
+
isHeaderEnrichmentSuccess = _ref2.isHeaderEnrichmentSuccess;
|
|
55
|
+
|
|
56
|
+
if (isHeaderEnrichmentSuccess !== true) {
|
|
57
|
+
_identifySlice.tracker.sendOptInFlowEvent('Pin');
|
|
58
|
+
} else {
|
|
59
|
+
_identifySlice.tracker.sendOptInFlowEvent('Hybrid Pin');
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return {
|
|
63
|
+
type: _identifySlice.StrategyStates.PIN,
|
|
64
|
+
result: {
|
|
65
|
+
config: flowObj.flowConfig,
|
|
66
|
+
operator: flowObj.operator,
|
|
67
|
+
msisdn: msisdn,
|
|
68
|
+
isHeaderEnrichmentSuccess: isHeaderEnrichmentSuccess
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
var moRedir = function moRedir(_ref3) {
|
|
74
|
+
var flowObj = _ref3.flowObj,
|
|
75
|
+
msisdn = _ref3.msisdn,
|
|
76
|
+
isHeaderEnrichmentSuccess = _ref3.isHeaderEnrichmentSuccess;
|
|
77
|
+
|
|
78
|
+
_identifySlice.tracker.sendOptInFlowEvent('Redirect');
|
|
79
|
+
|
|
80
|
+
return {
|
|
81
|
+
type: _identifySlice.StrategyStates.MO_REDIR,
|
|
82
|
+
result: {
|
|
83
|
+
config: flowObj.flowConfig,
|
|
84
|
+
operator: flowObj.operator,
|
|
85
|
+
msisdn: msisdn,
|
|
86
|
+
isHeaderEnrichmentSuccess: isHeaderEnrichmentSuccess
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
var pinHeaderEnrichment = /*#__PURE__*/function () {
|
|
92
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(_ref4) {
|
|
93
|
+
var configs, strategyConfigs, defaultFlow, ipRangeName, heResult, msisdn, operator, isHeaderEnrichmentSuccess;
|
|
94
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
95
|
+
while (1) {
|
|
96
|
+
switch (_context.prev = _context.next) {
|
|
97
|
+
case 0:
|
|
98
|
+
configs = _ref4.configs;
|
|
99
|
+
strategyConfigs = configs.strategyConfigs;
|
|
100
|
+
defaultFlow = strategyConfigs.default;
|
|
101
|
+
_context.prev = 3;
|
|
102
|
+
_context.next = 6;
|
|
103
|
+
return (0, _tryGetIPRangeName.default)(window.pac_analytics.visitor);
|
|
104
|
+
|
|
105
|
+
case 6:
|
|
106
|
+
ipRangeName = _context.sent;
|
|
107
|
+
|
|
108
|
+
if (!(ipRangeName == null)) {
|
|
109
|
+
_context.next = 9;
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return _context.abrupt("return", pin({
|
|
114
|
+
flowObj: defaultFlow
|
|
115
|
+
}));
|
|
116
|
+
|
|
117
|
+
case 9:
|
|
118
|
+
_context.next = 11;
|
|
119
|
+
return (0, _utils.identifyUser)({
|
|
120
|
+
configs: configs
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
case 11:
|
|
124
|
+
heResult = _context.sent;
|
|
125
|
+
msisdn = heResult.msisdn;
|
|
126
|
+
operator = heResult.operator;
|
|
127
|
+
isHeaderEnrichmentSuccess = !!msisdn;
|
|
128
|
+
return _context.abrupt("return", pin({
|
|
129
|
+
flowObj: defaultFlow,
|
|
130
|
+
msisdn: msisdn,
|
|
131
|
+
operator: operator,
|
|
132
|
+
isHeaderEnrichmentSuccess: isHeaderEnrichmentSuccess
|
|
133
|
+
}));
|
|
134
|
+
|
|
135
|
+
case 18:
|
|
136
|
+
_context.prev = 18;
|
|
137
|
+
_context.t0 = _context["catch"](3);
|
|
138
|
+
console.warn(_context.t0);
|
|
139
|
+
return _context.abrupt("return", pin({
|
|
140
|
+
flowObj: defaultFlow
|
|
141
|
+
}));
|
|
142
|
+
|
|
143
|
+
case 22:
|
|
144
|
+
case "end":
|
|
145
|
+
return _context.stop();
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}, _callee, null, [[3, 18]]);
|
|
149
|
+
}));
|
|
150
|
+
|
|
151
|
+
return function pinHeaderEnrichment(_x) {
|
|
152
|
+
return _ref5.apply(this, arguments);
|
|
153
|
+
};
|
|
154
|
+
}();
|
|
155
|
+
|
|
156
|
+
exports.pinHeaderEnrichment = pinHeaderEnrichment;
|
|
157
|
+
|
|
158
|
+
var hePinMoRedirHeaderEnrichment = /*#__PURE__*/function () {
|
|
159
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(_ref6) {
|
|
160
|
+
var configs, strategyConfigs, defaultFlow, switchState, heResult, msisdn, operator, _flowObj2, _flowObj, flowObj, _flowObj3;
|
|
161
|
+
|
|
162
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
163
|
+
while (1) {
|
|
164
|
+
switch (_context2.prev = _context2.next) {
|
|
165
|
+
case 0:
|
|
166
|
+
configs = _ref6.configs;
|
|
167
|
+
strategyConfigs = configs.strategyConfigs;
|
|
168
|
+
defaultFlow = strategyConfigs.default;
|
|
169
|
+
|
|
170
|
+
switchState = function switchState(flowObj, msisdn, operator) {
|
|
171
|
+
var isHeaderEnrichmentSuccess = !!(msisdn !== undefined && msisdn !== '');
|
|
172
|
+
|
|
173
|
+
switch (flowObj.flow) {
|
|
174
|
+
case 'moRedir':
|
|
175
|
+
return moRedir({
|
|
176
|
+
flowObj: flowObj,
|
|
177
|
+
msisdn: msisdn,
|
|
178
|
+
operator: operator,
|
|
179
|
+
isHeaderEnrichmentSuccess: isHeaderEnrichmentSuccess
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
case 'pin':
|
|
183
|
+
return pin({
|
|
184
|
+
flowObj: flowObj,
|
|
185
|
+
msisdn: msisdn,
|
|
186
|
+
operator: operator,
|
|
187
|
+
isHeaderEnrichmentSuccess: isHeaderEnrichmentSuccess
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
default:
|
|
191
|
+
return pin({
|
|
192
|
+
flowObj: defaultFlow
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
_context2.prev = 4;
|
|
198
|
+
_context2.next = 7;
|
|
199
|
+
return (0, _utils.identifyUser)({
|
|
200
|
+
configs: configs
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
case 7:
|
|
204
|
+
heResult = _context2.sent;
|
|
205
|
+
|
|
206
|
+
if (!(heResult.msisdn !== undefined && heResult.msisdn !== '')) {
|
|
207
|
+
_context2.next = 19;
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
msisdn = heResult.msisdn;
|
|
212
|
+
operator = heResult.operator;
|
|
213
|
+
|
|
214
|
+
_identifySlice.tracker.customEvent('identify-user', 'msisdn-detected', 'msisdn-detected', {
|
|
215
|
+
msisdn: msisdn
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
if (!(!!operator && operator !== '')) {
|
|
219
|
+
_context2.next = 15;
|
|
220
|
+
break;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
_flowObj2 = (0, _utils.determineFlowByOperator)({
|
|
224
|
+
configs: configs,
|
|
225
|
+
operator: operator
|
|
226
|
+
});
|
|
227
|
+
return _context2.abrupt("return", switchState(_flowObj2, msisdn, operator));
|
|
228
|
+
|
|
229
|
+
case 15:
|
|
230
|
+
_context2.next = 17;
|
|
231
|
+
return (0, _utils.determineFlowByOperatorFromIp)({
|
|
232
|
+
configs: configs
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
case 17:
|
|
236
|
+
_flowObj = _context2.sent;
|
|
237
|
+
return _context2.abrupt("return", switchState(_flowObj, msisdn));
|
|
238
|
+
|
|
239
|
+
case 19:
|
|
240
|
+
_context2.next = 21;
|
|
241
|
+
return (0, _utils.determineFlowByOperatorFromIp)({
|
|
242
|
+
configs: configs
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
case 21:
|
|
246
|
+
flowObj = _context2.sent;
|
|
247
|
+
return _context2.abrupt("return", switchState(flowObj));
|
|
248
|
+
|
|
249
|
+
case 25:
|
|
250
|
+
_context2.prev = 25;
|
|
251
|
+
_context2.t0 = _context2["catch"](4);
|
|
252
|
+
console.warn(_context2.t0);
|
|
253
|
+
|
|
254
|
+
_identifySlice.tracker.customEvent('tallyman.v1-pin', 'msisdn-detection-failure', 'msisdn-detection-failure', {
|
|
255
|
+
errorType: _context2.t0.toString()
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
_context2.prev = 29;
|
|
259
|
+
_context2.next = 32;
|
|
260
|
+
return (0, _utils.determineFlowByOperatorFromIp)({
|
|
261
|
+
configs: configs
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
case 32:
|
|
265
|
+
_flowObj3 = _context2.sent;
|
|
266
|
+
return _context2.abrupt("return", switchState(_flowObj3));
|
|
267
|
+
|
|
268
|
+
case 36:
|
|
269
|
+
_context2.prev = 36;
|
|
270
|
+
_context2.t1 = _context2["catch"](29);
|
|
271
|
+
console.warn(_context2.t1);
|
|
272
|
+
return _context2.abrupt("return", pin({
|
|
273
|
+
flowObj: defaultFlow
|
|
274
|
+
}));
|
|
275
|
+
|
|
276
|
+
case 40:
|
|
277
|
+
case "end":
|
|
278
|
+
return _context2.stop();
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}, _callee2, null, [[4, 25], [29, 36]]);
|
|
282
|
+
}));
|
|
283
|
+
|
|
284
|
+
return function hePinMoRedirHeaderEnrichment(_x2) {
|
|
285
|
+
return _ref7.apply(this, arguments);
|
|
286
|
+
};
|
|
287
|
+
}();
|
|
288
|
+
|
|
289
|
+
exports.hePinMoRedirHeaderEnrichment = hePinMoRedirHeaderEnrichment;
|
|
290
|
+
|
|
291
|
+
var hePinOneClickHeaderEnrichment = /*#__PURE__*/function () {
|
|
292
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(_ref8) {
|
|
293
|
+
var configs, strategyConfigs, defaultFlow, switchState, ipRangeName, flowObj, heResult, msisdn, _subscriptionUrl, _redirectUrl, operator;
|
|
294
|
+
|
|
295
|
+
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
296
|
+
while (1) {
|
|
297
|
+
switch (_context3.prev = _context3.next) {
|
|
298
|
+
case 0:
|
|
299
|
+
configs = _ref8.configs;
|
|
300
|
+
strategyConfigs = configs.strategyConfigs;
|
|
301
|
+
defaultFlow = strategyConfigs.default;
|
|
302
|
+
|
|
303
|
+
switchState = function switchState(_ref10) {
|
|
304
|
+
var flowObj = _ref10.flowObj,
|
|
305
|
+
msisdn = _ref10.msisdn,
|
|
306
|
+
operator = _ref10.operator,
|
|
307
|
+
subscriptionUrl = _ref10.subscriptionUrl,
|
|
308
|
+
redirectUrl = _ref10.redirectUrl;
|
|
309
|
+
var isHeaderEnrichmentSuccess = !!(msisdn !== undefined && msisdn !== '');
|
|
310
|
+
|
|
311
|
+
switch (flowObj.flow) {
|
|
312
|
+
case 'oneClick':
|
|
313
|
+
return oneClick({
|
|
314
|
+
flowObj: flowObj,
|
|
315
|
+
msisdn: msisdn,
|
|
316
|
+
operator: operator,
|
|
317
|
+
isHeaderEnrichmentSuccess: isHeaderEnrichmentSuccess,
|
|
318
|
+
subscriptionUrl: subscriptionUrl,
|
|
319
|
+
redirectUrl: redirectUrl
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
case 'pin':
|
|
323
|
+
return pin({
|
|
324
|
+
flowObj: flowObj,
|
|
325
|
+
msisdn: msisdn,
|
|
326
|
+
operator: operator,
|
|
327
|
+
isHeaderEnrichmentSuccess: isHeaderEnrichmentSuccess
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
default:
|
|
331
|
+
return pin({
|
|
332
|
+
flowObj: defaultFlow
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
_context3.next = 6;
|
|
338
|
+
return (0, _tryGetIPRangeName.default)(window.pac_analytics.visitor);
|
|
339
|
+
|
|
340
|
+
case 6:
|
|
341
|
+
ipRangeName = _context3.sent;
|
|
342
|
+
|
|
343
|
+
if (!(ipRangeName == null)) {
|
|
344
|
+
_context3.next = 9;
|
|
345
|
+
break;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
return _context3.abrupt("return", pin({
|
|
349
|
+
flowObj: defaultFlow
|
|
350
|
+
}));
|
|
351
|
+
|
|
352
|
+
case 9:
|
|
353
|
+
_context3.prev = 9;
|
|
354
|
+
flowObj = (0, _utils.determineFlowByOperator)({
|
|
355
|
+
configs: configs,
|
|
356
|
+
operator: ipRangeName.toUpperCase()
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
if (!(flowObj.flow === 'oneClick')) {
|
|
360
|
+
_context3.next = 23;
|
|
361
|
+
break;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
_context3.next = 14;
|
|
365
|
+
return (0, _utils.identifyUser)({
|
|
366
|
+
configs: configs
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
case 14:
|
|
370
|
+
heResult = _context3.sent;
|
|
371
|
+
msisdn = heResult.msisdn, _subscriptionUrl = heResult.subscriptionUrl, _redirectUrl = heResult.redirectUrl;
|
|
372
|
+
operator = heResult.operator ? heResult.operator.toUpperCase() : ipRangeName.toUpperCase();
|
|
373
|
+
|
|
374
|
+
if (!(msisdn && msisdn !== '')) {
|
|
375
|
+
_context3.next = 21;
|
|
376
|
+
break;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
_identifySlice.tracker.customEvent('identify-user', 'msisdn-detected', 'msisdn-detected', {
|
|
380
|
+
msisdn: msisdn
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
flowObj = (0, _utils.determineFlowByOperator)({
|
|
384
|
+
configs: configs,
|
|
385
|
+
operator: operator
|
|
386
|
+
});
|
|
387
|
+
return _context3.abrupt("return", switchState({
|
|
388
|
+
flowObj: flowObj,
|
|
389
|
+
msisdn: msisdn,
|
|
390
|
+
operator: operator,
|
|
391
|
+
subscriptionUrl: _subscriptionUrl,
|
|
392
|
+
redirectUrl: _redirectUrl
|
|
393
|
+
}));
|
|
394
|
+
|
|
395
|
+
case 21:
|
|
396
|
+
flowObj = (0, _utils.determineFlowByOperator)({
|
|
397
|
+
configs: configs,
|
|
398
|
+
operator: operator
|
|
399
|
+
});
|
|
400
|
+
return _context3.abrupt("return", switchState({
|
|
401
|
+
flowObj: flowObj,
|
|
402
|
+
subscriptionUrl: _subscriptionUrl,
|
|
403
|
+
redirectUrl: _redirectUrl,
|
|
404
|
+
operator: operator
|
|
405
|
+
}));
|
|
406
|
+
|
|
407
|
+
case 23:
|
|
408
|
+
return _context3.abrupt("return", pin({
|
|
409
|
+
flowObj: defaultFlow
|
|
410
|
+
}));
|
|
411
|
+
|
|
412
|
+
case 26:
|
|
413
|
+
_context3.prev = 26;
|
|
414
|
+
_context3.t0 = _context3["catch"](9);
|
|
415
|
+
console.warn(_context3.t0);
|
|
416
|
+
|
|
417
|
+
_identifySlice.tracker.customEvent('identify-user', 'msisdn-detection-failure', 'msisdn-detection-failure', {
|
|
418
|
+
errorType: _context3.t0.toString()
|
|
419
|
+
});
|
|
420
|
+
|
|
421
|
+
return _context3.abrupt("return", pin({
|
|
422
|
+
flowObj: defaultFlow
|
|
423
|
+
}));
|
|
424
|
+
|
|
425
|
+
case 31:
|
|
426
|
+
case "end":
|
|
427
|
+
return _context3.stop();
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}, _callee3, null, [[9, 26]]);
|
|
431
|
+
}));
|
|
432
|
+
|
|
433
|
+
return function hePinOneClickHeaderEnrichment(_x3) {
|
|
434
|
+
return _ref9.apply(this, arguments);
|
|
435
|
+
};
|
|
436
|
+
}();
|
|
437
|
+
|
|
438
|
+
exports.hePinOneClickHeaderEnrichment = hePinOneClickHeaderEnrichment;
|
|
439
|
+
|
|
440
|
+
var heMoRedirOneClickHeaderEnrichment = /*#__PURE__*/function () {
|
|
441
|
+
var _ref12 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(_ref11) {
|
|
442
|
+
var configs, strategyConfigs, defaultFlow, switchState, ipRangeName, flowObj, heResult, msisdn, _subscriptionUrl2, _redirectUrl2, operator;
|
|
443
|
+
|
|
444
|
+
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
445
|
+
while (1) {
|
|
446
|
+
switch (_context4.prev = _context4.next) {
|
|
447
|
+
case 0:
|
|
448
|
+
configs = _ref11.configs;
|
|
449
|
+
strategyConfigs = configs.strategyConfigs;
|
|
450
|
+
defaultFlow = strategyConfigs.default;
|
|
451
|
+
|
|
452
|
+
switchState = function switchState(_ref13) {
|
|
453
|
+
var flowObj = _ref13.flowObj,
|
|
454
|
+
msisdn = _ref13.msisdn,
|
|
455
|
+
operator = _ref13.operator;
|
|
456
|
+
var isHeaderEnrichmentSuccess = !!(msisdn !== undefined && msisdn !== '');
|
|
457
|
+
|
|
458
|
+
switch (flowObj.flow) {
|
|
459
|
+
case 'oneClick':
|
|
460
|
+
return oneClick({
|
|
461
|
+
flowObj: flowObj,
|
|
462
|
+
msisdn: msisdn,
|
|
463
|
+
operator: operator,
|
|
464
|
+
isHeaderEnrichmentSuccess: isHeaderEnrichmentSuccess,
|
|
465
|
+
subscriptionUrl: subscriptionUrl,
|
|
466
|
+
redirectUrl: redirectUrl
|
|
467
|
+
});
|
|
468
|
+
|
|
469
|
+
case 'moRedir':
|
|
470
|
+
return moRedir({
|
|
471
|
+
flowObj: flowObj,
|
|
472
|
+
msisdn: msisdn,
|
|
473
|
+
operator: operator,
|
|
474
|
+
isHeaderEnrichmentSuccess: isHeaderEnrichmentSuccess
|
|
475
|
+
});
|
|
476
|
+
|
|
477
|
+
default:
|
|
478
|
+
return moRedir({
|
|
479
|
+
flowObj: defaultFlow
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
};
|
|
483
|
+
|
|
484
|
+
_context4.next = 6;
|
|
485
|
+
return (0, _tryGetIPRangeName.default)(window.pac_analytics.visitor);
|
|
486
|
+
|
|
487
|
+
case 6:
|
|
488
|
+
ipRangeName = _context4.sent;
|
|
489
|
+
|
|
490
|
+
if (!(ipRangeName == null)) {
|
|
491
|
+
_context4.next = 9;
|
|
492
|
+
break;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
return _context4.abrupt("return", moRedir({
|
|
496
|
+
flowObj: defaultFlow
|
|
497
|
+
}));
|
|
498
|
+
|
|
499
|
+
case 9:
|
|
500
|
+
_context4.prev = 9;
|
|
501
|
+
flowObj = (0, _utils.determineFlowByOperator)({
|
|
502
|
+
configs: configs,
|
|
503
|
+
operator: ipRangeName.toUpperCase()
|
|
504
|
+
});
|
|
505
|
+
|
|
506
|
+
if (!(flowObj.flow === 'oneClick')) {
|
|
507
|
+
_context4.next = 23;
|
|
508
|
+
break;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
_context4.next = 14;
|
|
512
|
+
return (0, _utils.identifyUser)({
|
|
513
|
+
configs: configs
|
|
514
|
+
});
|
|
515
|
+
|
|
516
|
+
case 14:
|
|
517
|
+
heResult = _context4.sent;
|
|
518
|
+
msisdn = heResult.msisdn, _subscriptionUrl2 = heResult.subscriptionUrl, _redirectUrl2 = heResult.redirectUrl;
|
|
519
|
+
operator = heResult.operator ? heResult.operator.toUpperCase() : ipRangeName.toUpperCase();
|
|
520
|
+
|
|
521
|
+
if (!(msisdn && msisdn !== '')) {
|
|
522
|
+
_context4.next = 21;
|
|
523
|
+
break;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
_identifySlice.tracker.customEvent('identify-user', 'msisdn-detected', 'msisdn-detected', {
|
|
527
|
+
msisdn: msisdn
|
|
528
|
+
});
|
|
529
|
+
|
|
530
|
+
flowObj = (0, _utils.determineFlowByOperator)({
|
|
531
|
+
configs: configs,
|
|
532
|
+
operator: operator
|
|
533
|
+
});
|
|
534
|
+
return _context4.abrupt("return", switchState({
|
|
535
|
+
flowObj: flowObj,
|
|
536
|
+
msisdn: msisdn,
|
|
537
|
+
operator: operator,
|
|
538
|
+
subscriptionUrl: _subscriptionUrl2,
|
|
539
|
+
redirectUrl: _redirectUrl2
|
|
540
|
+
}));
|
|
541
|
+
|
|
542
|
+
case 21:
|
|
543
|
+
flowObj = (0, _utils.determineFlowByOperator)({
|
|
544
|
+
configs: configs,
|
|
545
|
+
operator: operator
|
|
546
|
+
});
|
|
547
|
+
return _context4.abrupt("return", switchState({
|
|
548
|
+
flowObj: flowObj,
|
|
549
|
+
subscriptionUrl: _subscriptionUrl2,
|
|
550
|
+
redirectUrl: _redirectUrl2,
|
|
551
|
+
operator: operator
|
|
552
|
+
}));
|
|
553
|
+
|
|
554
|
+
case 23:
|
|
555
|
+
return _context4.abrupt("return", moRedir({
|
|
556
|
+
flowObj: defaultFlow
|
|
557
|
+
}));
|
|
558
|
+
|
|
559
|
+
case 26:
|
|
560
|
+
_context4.prev = 26;
|
|
561
|
+
_context4.t0 = _context4["catch"](9);
|
|
562
|
+
console.warn(_context4.t0);
|
|
563
|
+
|
|
564
|
+
_identifySlice.tracker.customEvent('identify-user', 'msisdn-detection-failure', 'msisdn-detection-failure', {
|
|
565
|
+
errorType: _context4.t0.toString()
|
|
566
|
+
});
|
|
567
|
+
|
|
568
|
+
return _context4.abrupt("return", moRedir({
|
|
569
|
+
flowObj: defaultFlow
|
|
570
|
+
}));
|
|
571
|
+
|
|
572
|
+
case 31:
|
|
573
|
+
case "end":
|
|
574
|
+
return _context4.stop();
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
}, _callee4, null, [[9, 26]]);
|
|
578
|
+
}));
|
|
579
|
+
|
|
580
|
+
return function heMoRedirOneClickHeaderEnrichment(_x4) {
|
|
581
|
+
return _ref12.apply(this, arguments);
|
|
582
|
+
};
|
|
583
|
+
}();
|
|
584
|
+
|
|
585
|
+
exports.heMoRedirOneClickHeaderEnrichment = heMoRedirOneClickHeaderEnrichment;
|
|
586
|
+
|
|
587
|
+
var identifyUserByHe = /*#__PURE__*/function () {
|
|
588
|
+
var _ref15 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(_ref14) {
|
|
589
|
+
var configs, strategy;
|
|
590
|
+
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
591
|
+
while (1) {
|
|
592
|
+
switch (_context5.prev = _context5.next) {
|
|
593
|
+
case 0:
|
|
594
|
+
configs = _ref14.configs;
|
|
595
|
+
strategy = configs.strategy;
|
|
596
|
+
_context5.prev = 2;
|
|
597
|
+
_context5.t0 = strategy;
|
|
598
|
+
_context5.next = _context5.t0 === 'pin-header-enrichment' ? 6 : _context5.t0 === 'he-pin-mo-redir-header-enrichment' ? 9 : _context5.t0 === 'he-pin-one-click-header-enrichment' ? 12 : _context5.t0 === 'he-mo-redir-one-click-header-enrichment' ? 15 : 18;
|
|
599
|
+
break;
|
|
600
|
+
|
|
601
|
+
case 6:
|
|
602
|
+
_context5.next = 8;
|
|
603
|
+
return pinHeaderEnrichment({
|
|
604
|
+
configs: configs
|
|
605
|
+
});
|
|
606
|
+
|
|
607
|
+
case 8:
|
|
608
|
+
return _context5.abrupt("return", _context5.sent);
|
|
609
|
+
|
|
610
|
+
case 9:
|
|
611
|
+
_context5.next = 11;
|
|
612
|
+
return hePinMoRedirHeaderEnrichment({
|
|
613
|
+
configs: configs
|
|
614
|
+
});
|
|
615
|
+
|
|
616
|
+
case 11:
|
|
617
|
+
return _context5.abrupt("return", _context5.sent);
|
|
618
|
+
|
|
619
|
+
case 12:
|
|
620
|
+
_context5.next = 14;
|
|
621
|
+
return hePinOneClickHeaderEnrichment({
|
|
622
|
+
configs: configs
|
|
623
|
+
});
|
|
624
|
+
|
|
625
|
+
case 14:
|
|
626
|
+
return _context5.abrupt("return", _context5.sent);
|
|
627
|
+
|
|
628
|
+
case 15:
|
|
629
|
+
_context5.next = 17;
|
|
630
|
+
return heMoRedirOneClickHeaderEnrichment({
|
|
631
|
+
configs: configs
|
|
632
|
+
});
|
|
633
|
+
|
|
634
|
+
case 17:
|
|
635
|
+
return _context5.abrupt("return", _context5.sent);
|
|
636
|
+
|
|
637
|
+
case 18:
|
|
638
|
+
console.error('detectOperatorByIp', 'Strategy not supported');
|
|
639
|
+
return _context5.abrupt("return", null);
|
|
640
|
+
|
|
641
|
+
case 20:
|
|
642
|
+
_context5.next = 26;
|
|
643
|
+
break;
|
|
644
|
+
|
|
645
|
+
case 22:
|
|
646
|
+
_context5.prev = 22;
|
|
647
|
+
_context5.t1 = _context5["catch"](2);
|
|
648
|
+
console.error('detectOperatorByIp', _context5.t1); // You can choose to use the message attached to err or write a custom error
|
|
649
|
+
|
|
650
|
+
return _context5.abrupt("return", null);
|
|
651
|
+
|
|
652
|
+
case 26:
|
|
653
|
+
case "end":
|
|
654
|
+
return _context5.stop();
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
}, _callee5, null, [[2, 22]]);
|
|
658
|
+
}));
|
|
659
|
+
|
|
660
|
+
return function identifyUserByHe(_x5) {
|
|
661
|
+
return _ref15.apply(this, arguments);
|
|
662
|
+
};
|
|
663
|
+
}();
|
|
664
|
+
|
|
665
|
+
exports.identifyUserByHe = identifyUserByHe;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|