ouisys-engine 4.3.0-alpha.0 → 4.5.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.d.ts +43 -0
- package/dist/api/index.js +1 -728
- package/dist/common-types/AppThunk.d.ts +13 -0
- package/dist/common-types/AppThunk.js +1 -1
- package/dist/common-types/Either.d.ts +8 -0
- package/dist/common-types/Either.js +1 -1
- package/dist/common-types/IError.d.ts +3 -0
- package/dist/common-types/IError.js +1 -1
- package/dist/common-types/IOptInFlowName.d.ts +1 -0
- package/dist/common-types/ITracker.d.ts +9 -0
- package/dist/common-types/ITracker.js +1 -3
- package/dist/common-types/IVisitor.d.ts +14 -0
- package/dist/common-types/IVisitor.js +1 -1
- package/dist/common-types/RemoteDataState.d.ts +38 -0
- package/dist/common-types/RemoteDataState.js +1 -135
- package/dist/custom-hooks/useOneClickRedirectUrl.d.ts +3 -0
- package/dist/custom-hooks/useOneClickRedirectUrl.js +1 -0
- package/dist/custom-hooks/usePinEntryState.d.ts +8 -0
- package/dist/custom-hooks/usePinEntryState.js +1 -0
- package/dist/custom-hooks/useStrategyConfig.d.ts +4 -0
- package/dist/custom-hooks/useStrategyConfig.js +1 -0
- package/dist/flows/click2smsFlow.d.ts +6 -0
- package/dist/flows/click2smsFlow.js +1 -19
- package/dist/flows/creditCardFlow.d.ts +6 -0
- package/dist/flows/creditCardFlow.js +1 -0
- package/dist/flows/moFlow.d.ts +6 -0
- package/dist/flows/moFlow.js +1 -19
- package/dist/flows/moRedirFlow.d.ts +6 -0
- package/dist/flows/moRedirFlow.js +1 -19
- package/dist/flows/oneClickFlow.d.ts +7 -0
- package/dist/flows/oneClickFlow.js +1 -23
- package/dist/flows/pinFlow.d.ts +7 -0
- package/dist/flows/pinFlow.js +1 -23
- package/dist/flows/strategy.d.ts +14 -0
- package/dist/flows/strategy.js +1 -53
- package/dist/flows/ussdFlow.d.ts +6 -0
- package/dist/flows/ussdFlow.js +1 -19
- package/dist/index.d.ts +0 -0
- package/dist/index.js +0 -2
- package/dist/ips/tryGetIPRangeName.d.ts +2 -0
- package/dist/ips/tryGetIPRangeName.js +1 -74
- package/dist/jest.config.js +194 -0
- package/dist/pacman/index.d.ts +6 -0
- package/dist/pacman/index.js +1 -108
- package/dist/pacman/queryString.d.ts +3 -0
- package/dist/pacman/queryString.js +1 -45
- package/dist/reducers/click2smsFlow/Click2smsTypes.d.ts +76 -0
- package/dist/reducers/click2smsFlow/Click2smsTypes.js +1 -1
- package/dist/reducers/click2smsFlow/IClick2smsConstants.d.ts +2 -0
- package/dist/reducers/click2smsFlow/IClick2smsConstants.js +1 -1
- package/dist/reducers/click2smsFlow/index.d.ts +5 -0
- package/dist/reducers/click2smsFlow/index.js +1 -183
- package/dist/reducers/click2smsFlow/utils.d.ts +4 -0
- package/dist/reducers/click2smsFlow/utils.js +1 -357
- package/dist/reducers/creditCardFlow/CreditCardTypes.d.ts +79 -0
- package/dist/reducers/creditCardFlow/CreditCardTypes.js +1 -0
- package/dist/reducers/creditCardFlow/ICreditCardConstants.d.ts +2 -0
- package/dist/reducers/creditCardFlow/ICreditCardConstants.js +1 -0
- package/dist/reducers/creditCardFlow/index.d.ts +5 -0
- package/dist/reducers/creditCardFlow/index.js +1 -0
- package/dist/reducers/creditCardFlow/utils.d.ts +8 -0
- package/dist/reducers/creditCardFlow/utils.js +1 -0
- package/dist/reducers/moFlow/IMoConstants.d.ts +2 -0
- package/dist/reducers/moFlow/IMoConstants.js +1 -1
- package/dist/reducers/moFlow/MoTypes.d.ts +88 -0
- package/dist/reducers/moFlow/MoTypes.js +1 -1
- package/dist/reducers/moFlow/index.d.ts +16 -0
- package/dist/reducers/moFlow/index.js +1 -251
- package/dist/reducers/moFlow/utils.d.ts +12 -0
- package/dist/reducers/moFlow/utils.js +1 -284
- package/dist/reducers/moRedirFlow/IMoRedirConstants.d.ts +2 -0
- package/dist/reducers/moRedirFlow/IMoRedirConstants.js +1 -1
- package/dist/reducers/moRedirFlow/MoRedirTypes.d.ts +64 -0
- package/dist/reducers/moRedirFlow/MoRedirTypes.js +1 -1
- package/dist/reducers/moRedirFlow/index.d.ts +14 -0
- package/dist/reducers/moRedirFlow/index.js +1 -226
- package/dist/reducers/moRedirFlow/utils.d.ts +10 -0
- package/dist/reducers/moRedirFlow/utils.js +1 -186
- package/dist/reducers/oneClickFlow/IOneClickConstants.d.ts +2 -0
- package/dist/reducers/oneClickFlow/IOneClickConstants.js +1 -1
- package/dist/reducers/oneClickFlow/OneClickTypes.d.ts +85 -0
- package/dist/reducers/oneClickFlow/OneClickTypes.js +1 -1
- package/dist/reducers/oneClickFlow/index.d.ts +13 -0
- package/dist/reducers/oneClickFlow/index.js +1 -409
- package/dist/reducers/oneClickFlow/utils.d.ts +16 -0
- package/dist/reducers/oneClickFlow/utils.js +1 -366
- package/dist/reducers/pinFlow/IPinConstants.d.ts +2 -0
- package/dist/reducers/pinFlow/IPinConstants.js +1 -1
- package/dist/reducers/pinFlow/PinTypes.d.ts +156 -0
- package/dist/reducers/pinFlow/PinTypes.js +1 -1
- package/dist/reducers/pinFlow/index.d.ts +19 -0
- package/dist/reducers/pinFlow/index.js +1 -514
- package/dist/reducers/pinFlow/utils.d.ts +11 -0
- package/dist/reducers/pinFlow/utils.js +1 -494
- package/dist/reducers/strategy/IStategyActionContants.d.ts +2 -0
- package/dist/reducers/strategy/IStategyActionContants.js +1 -1
- package/dist/reducers/strategy/StrategyTypes.d.ts +248 -0
- package/dist/reducers/strategy/StrategyTypes.js +1 -1
- package/dist/reducers/strategy/index.d.ts +13 -0
- package/dist/reducers/strategy/index.js +1 -389
- package/dist/reducers/strategy/strategies/ask_mobile_number.d.ts +15 -0
- package/dist/reducers/strategy/strategies/ask_mobile_number.js +1 -403
- package/dist/reducers/strategy/strategies/ask_operator.d.ts +5 -0
- package/dist/reducers/strategy/strategies/ask_operator.js +1 -305
- package/dist/reducers/strategy/strategies/detect_operator_by_ip.d.ts +10 -0
- package/dist/reducers/strategy/strategies/detect_operator_by_ip.js +1 -459
- package/dist/reducers/strategy/strategies/header_enrichment.d.ts +7 -0
- package/dist/reducers/strategy/strategies/header_enrichment.js +1 -783
- package/dist/reducers/strategy/strategies/injectHeaderEnrichmentScript.d.ts +2 -0
- package/dist/reducers/strategy/strategies/injectHeaderEnrichmentScript.js +1 -0
- package/dist/reducers/strategy/utils.d.ts +30 -0
- package/dist/reducers/strategy/utils.js +1 -702
- package/dist/reducers/ussdFlow/IUssdConstants.d.ts +2 -0
- package/dist/reducers/ussdFlow/IUssdConstants.js +1 -1
- package/dist/reducers/ussdFlow/UssdTypes.d.ts +77 -0
- package/dist/reducers/ussdFlow/UssdTypes.js +1 -1
- package/dist/reducers/ussdFlow/index.d.ts +14 -0
- package/dist/reducers/ussdFlow/index.js +1 -251
- package/dist/reducers/ussdFlow/utils.d.ts +11 -0
- package/dist/reducers/ussdFlow/utils.js +1 -225
- package/dist/store/index.d.ts +14 -0
- package/dist/store/index.js +1 -177
- package/dist/store/reducers.d.ts +20 -0
- package/dist/store/reducers.js +1 -41
- package/dist/utilities/addEmpelloToken.d.ts +4 -0
- package/dist/utilities/addEmpelloToken.js +1 -0
- package/dist/utilities/handleSubmitNumber.d.ts +21 -0
- package/dist/utilities/handleSubmitNumber.js +1 -59
- package/dist/utilities/index.d.ts +14 -0
- package/dist/utilities/index.js +1 -0
- package/dist/utilities/loadScriptInnerHtml.d.ts +2 -0
- package/dist/utilities/loadScriptInnerHtml.js +1 -0
- package/dist/utilities/loadScriptSrc.d.ts +8 -0
- package/dist/utilities/loadScriptSrc.js +1 -0
- package/dist/utilities/replaceUrlParam.d.ts +1 -0
- package/dist/utilities/replaceUrlParam.js +1 -0
- package/dist/utilities/storeMsisdn.d.ts +3 -0
- package/dist/utilities/storeMsisdn.js +1 -0
- package/package.json +1 -1
- package/dist/app/store.js +0 -20
- package/dist/features/strategies/categories/askMobileNumber.js +0 -388
- package/dist/features/strategies/categories/askOperator.js +0 -313
- package/dist/features/strategies/categories/detectOperatorByIp.js +0 -599
- package/dist/features/strategies/categories/headerEnrichment.js +0 -665
- package/dist/features/strategies/categories/singleFlows/pin.js +0 -1
- package/dist/features/strategies/identifySlice.js +0 -355
- package/dist/features/strategies/pinFlowSlice.js +0 -338
- 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.js +0 -1
- package/dist/reducers/tpayHeFlow/TpayHeTypes.js +0 -1
- package/dist/reducers/tpayHeFlow/index.js +0 -331
- package/dist/reducers/tpayHeFlow/utils.js +0 -510
- package/dist/test/setup.js +0 -24
- package/dist/test/test-utils.js +0 -51
|
@@ -1,403 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
require("core-js/modules/es.symbol");
|
|
6
|
-
|
|
7
|
-
require("core-js/modules/es.symbol.description");
|
|
8
|
-
|
|
9
|
-
require("core-js/modules/es.symbol.iterator");
|
|
10
|
-
|
|
11
|
-
require("core-js/modules/es.array.filter");
|
|
12
|
-
|
|
13
|
-
require("core-js/modules/es.array.iterator");
|
|
14
|
-
|
|
15
|
-
require("core-js/modules/es.object.get-own-property-descriptor");
|
|
16
|
-
|
|
17
|
-
require("core-js/modules/es.object.get-own-property-descriptors");
|
|
18
|
-
|
|
19
|
-
require("core-js/modules/es.object.keys");
|
|
20
|
-
|
|
21
|
-
require("core-js/modules/es.object.to-string");
|
|
22
|
-
|
|
23
|
-
require("core-js/modules/es.promise");
|
|
24
|
-
|
|
25
|
-
require("core-js/modules/es.string.iterator");
|
|
26
|
-
|
|
27
|
-
require("core-js/modules/es.weak-map");
|
|
28
|
-
|
|
29
|
-
require("core-js/modules/web.dom-collections.for-each");
|
|
30
|
-
|
|
31
|
-
require("core-js/modules/web.dom-collections.iterator");
|
|
32
|
-
|
|
33
|
-
Object.defineProperty(exports, "__esModule", {
|
|
34
|
-
value: true
|
|
35
|
-
});
|
|
36
|
-
exports.default = ask_mobile_number;
|
|
37
|
-
exports.submitMSISDNAction = submitMSISDNAction;
|
|
38
|
-
exports.one_click_mo_pin_detect_operator_by_ip_or_msisdn = exports.pin_mo_redir_ask_mobile_number = exports.pin_mo_ask_mobile_number = void 0;
|
|
39
|
-
|
|
40
|
-
require("regenerator-runtime/runtime");
|
|
41
|
-
|
|
42
|
-
var _ = require("..");
|
|
43
|
-
|
|
44
|
-
var RDS = _interopRequireWildcard(require("../../../common-types/RemoteDataState"));
|
|
45
|
-
|
|
46
|
-
var _utils = require("../utils");
|
|
47
|
-
|
|
48
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
49
|
-
|
|
50
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
51
|
-
|
|
52
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
53
|
-
|
|
54
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
55
|
-
|
|
56
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
57
|
-
|
|
58
|
-
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); } }
|
|
59
|
-
|
|
60
|
-
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); }); }; }
|
|
61
|
-
|
|
62
|
-
function ask_mobile_number() {
|
|
63
|
-
return function (dispatch) {
|
|
64
|
-
try {
|
|
65
|
-
dispatch({
|
|
66
|
-
type: 'IDENTIFY_FLOW_BY_MSISDN',
|
|
67
|
-
payload: {
|
|
68
|
-
type: 'IDENTIFY_FLOW_BY_MSISDN',
|
|
69
|
-
result: RDS.NothingYet(),
|
|
70
|
-
nextData: {
|
|
71
|
-
nextAction: 'submitMSISDNAction'
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
} catch (err) {
|
|
76
|
-
dispatch({
|
|
77
|
-
type: 'IDENTIFY_FLOW_BY_MSISDN_ERROR',
|
|
78
|
-
payload: {
|
|
79
|
-
type: 'IDENTIFY_FLOW_BY_MSISDN',
|
|
80
|
-
result: RDS.Failure(err)
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
function submitMSISDNAction(internationalMSISDN) {
|
|
88
|
-
return /*#__PURE__*/function () {
|
|
89
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(dispatch) {
|
|
90
|
-
var _getConfig, strategy, flowObj, errorType;
|
|
91
|
-
|
|
92
|
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
93
|
-
while (1) {
|
|
94
|
-
switch (_context.prev = _context.next) {
|
|
95
|
-
case 0:
|
|
96
|
-
_context.prev = 0;
|
|
97
|
-
dispatch({
|
|
98
|
-
type: 'IDENTIFY_FLOW_BY_MSISDN_SUBMIT',
|
|
99
|
-
payload: {
|
|
100
|
-
type: 'IDENTIFY_FLOW_BY_MSISDN',
|
|
101
|
-
result: RDS.Loading(),
|
|
102
|
-
nextData: {
|
|
103
|
-
nextAction: 'submitMSISDNAction'
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
_getConfig = (0, _utils.getConfig)(), strategy = _getConfig.strategy;
|
|
108
|
-
_context.next = 5;
|
|
109
|
-
return (0, _utils.determineFlowByMsidn)(internationalMSISDN);
|
|
110
|
-
|
|
111
|
-
case 5:
|
|
112
|
-
flowObj = _context.sent;
|
|
113
|
-
dispatch({
|
|
114
|
-
type: 'IDENTIFY_FLOW_BY_MSISDN_SUBMIT',
|
|
115
|
-
payload: {
|
|
116
|
-
type: 'IDENTIFY_FLOW_BY_MSISDN',
|
|
117
|
-
result: RDS.Success(flowObj),
|
|
118
|
-
nextData: _objectSpread({
|
|
119
|
-
nextAction: 'submitMSISDNAction'
|
|
120
|
-
}, flowObj.operator && {
|
|
121
|
-
operator: flowObj.operator
|
|
122
|
-
})
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
_context.t0 = strategy;
|
|
126
|
-
_context.next = _context.t0 === 'pin-mo-redir-ask-mobile-number' ? 10 : _context.t0 === 'pin-mo-ask-mobile-number' ? 11 : 12;
|
|
127
|
-
break;
|
|
128
|
-
|
|
129
|
-
case 10:
|
|
130
|
-
return _context.abrupt("return", dispatch(pin_mo_redir_ask_mobile_number(flowObj, internationalMSISDN)));
|
|
131
|
-
|
|
132
|
-
case 11:
|
|
133
|
-
return _context.abrupt("return", dispatch(pin_mo_ask_mobile_number(flowObj, internationalMSISDN)));
|
|
134
|
-
|
|
135
|
-
case 12:
|
|
136
|
-
_context.next = 19;
|
|
137
|
-
break;
|
|
138
|
-
|
|
139
|
-
case 14:
|
|
140
|
-
_context.prev = 14;
|
|
141
|
-
_context.t1 = _context["catch"](0);
|
|
142
|
-
console.warn(_context.t1);
|
|
143
|
-
errorType = _context.t1.type === 'SEAlreadySubscribed' ? 'AlreadySubscribed' : _context.t1.type == 'SEInvalidMSISDN' ? 'InvalidMSISDN' : 'UnknownError';
|
|
144
|
-
dispatch({
|
|
145
|
-
type: 'IDENTIFY_FLOW_BY_MSISDN_SUBMIT_ERROR',
|
|
146
|
-
payload: {
|
|
147
|
-
type: 'IDENTIFY_FLOW_BY_MSISDN',
|
|
148
|
-
result: RDS.Failure({
|
|
149
|
-
errorType: errorType,
|
|
150
|
-
error: _context.t1
|
|
151
|
-
})
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
case 19:
|
|
156
|
-
case "end":
|
|
157
|
-
return _context.stop();
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}, _callee, null, [[0, 14]]);
|
|
161
|
-
}));
|
|
162
|
-
|
|
163
|
-
return function (_x) {
|
|
164
|
-
return _ref.apply(this, arguments);
|
|
165
|
-
};
|
|
166
|
-
}();
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
var pin_mo_ask_mobile_number = function pin_mo_ask_mobile_number(flowObj, msisdn) {
|
|
170
|
-
return function (dispatch) {
|
|
171
|
-
switch (flowObj.flow) {
|
|
172
|
-
case 'pin':
|
|
173
|
-
_.tracker.sendOptInFlowEvent('Pin');
|
|
174
|
-
|
|
175
|
-
dispatch({
|
|
176
|
-
type: 'IDENTIFY_FLOW_BY_MSISDN_SUBMIT',
|
|
177
|
-
payload: {
|
|
178
|
-
type: 'IDENTIFY_FLOW_BY_MSISDN',
|
|
179
|
-
result: RDS.Loading(),
|
|
180
|
-
nextData: _objectSpread({
|
|
181
|
-
nextAction: 'submitMSISDNAction'
|
|
182
|
-
}, flowObj.operator && {
|
|
183
|
-
operator: flowObj.operator
|
|
184
|
-
})
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
return dispatch({
|
|
188
|
-
type: 'IDENTIFY_FLOW_BY_MSISDN_SUBMIT',
|
|
189
|
-
payload: {
|
|
190
|
-
type: 'PIN',
|
|
191
|
-
result: _objectSpread({
|
|
192
|
-
nextAction: 'submitMSISDNAction',
|
|
193
|
-
config: flowObj.flowConfig,
|
|
194
|
-
msisdn: msisdn
|
|
195
|
-
}, flowObj.operator && {
|
|
196
|
-
operator: flowObj.operator
|
|
197
|
-
})
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
case 'mo':
|
|
202
|
-
_.tracker.sendOptInFlowEvent('Msisdn to sms');
|
|
203
|
-
|
|
204
|
-
return dispatch({
|
|
205
|
-
type: 'IDENTIFY_FLOW_BY_MSISDN_SUBMIT',
|
|
206
|
-
payload: {
|
|
207
|
-
type: 'MO',
|
|
208
|
-
result: _objectSpread({
|
|
209
|
-
nextAction: 'submitMSISDNAction',
|
|
210
|
-
config: flowObj.flowConfig,
|
|
211
|
-
msisdn: msisdn,
|
|
212
|
-
rockman_id: flowObj.rockman_id
|
|
213
|
-
}, flowObj.operator && {
|
|
214
|
-
operator: flowObj.operator
|
|
215
|
-
})
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
default:
|
|
220
|
-
_.tracker.sendOptInFlowEvent('Pin');
|
|
221
|
-
|
|
222
|
-
return dispatch({
|
|
223
|
-
type: 'IDENTIFY_FLOW_BY_MSISDN_SUBMIT',
|
|
224
|
-
payload: {
|
|
225
|
-
type: 'PIN',
|
|
226
|
-
result: _objectSpread({
|
|
227
|
-
nextAction: 'submitMSISDNAction',
|
|
228
|
-
config: flowObj.flowConfig,
|
|
229
|
-
rockman_id: flowObj.rockman_id
|
|
230
|
-
}, flowObj.operator && {
|
|
231
|
-
operator: flowObj.operator
|
|
232
|
-
})
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
};
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
exports.pin_mo_ask_mobile_number = pin_mo_ask_mobile_number;
|
|
240
|
-
|
|
241
|
-
var pin_mo_redir_ask_mobile_number = function pin_mo_redir_ask_mobile_number(flowObj, msisdn) {
|
|
242
|
-
return function (dispatch) {
|
|
243
|
-
switch (flowObj.flow) {
|
|
244
|
-
case 'pin':
|
|
245
|
-
_.tracker.sendOptInFlowEvent('Pin');
|
|
246
|
-
|
|
247
|
-
dispatch({
|
|
248
|
-
type: 'IDENTIFY_FLOW_BY_MSISDN_SUBMIT',
|
|
249
|
-
payload: {
|
|
250
|
-
type: 'IDENTIFY_FLOW_BY_MSISDN',
|
|
251
|
-
result: RDS.Loading(),
|
|
252
|
-
nextData: {
|
|
253
|
-
nextAction: 'submitMSISDNAction'
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
});
|
|
257
|
-
return dispatch({
|
|
258
|
-
type: 'IDENTIFY_FLOW_BY_MSISDN_SUBMIT',
|
|
259
|
-
payload: {
|
|
260
|
-
type: 'PIN',
|
|
261
|
-
result: {
|
|
262
|
-
nextAction: 'submitMSISDNAction',
|
|
263
|
-
config: flowObj.flowConfig,
|
|
264
|
-
msisdn: msisdn,
|
|
265
|
-
rockman_id: flowObj.rockman_id
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
});
|
|
269
|
-
|
|
270
|
-
case 'moRedir':
|
|
271
|
-
_.tracker.sendOptInFlowEvent('Redirect');
|
|
272
|
-
|
|
273
|
-
return dispatch({
|
|
274
|
-
type: 'IDENTIFY_FLOW_BY_MSISDN_SUBMIT',
|
|
275
|
-
payload: {
|
|
276
|
-
type: 'MO_REDIR',
|
|
277
|
-
result: {
|
|
278
|
-
nextAction: 'submitMSISDNAction',
|
|
279
|
-
config: flowObj.flowConfig,
|
|
280
|
-
msisdn: msisdn,
|
|
281
|
-
rockman_id: flowObj.rockman_id
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
});
|
|
285
|
-
|
|
286
|
-
default:
|
|
287
|
-
_.tracker.sendOptInFlowEvent('Pin');
|
|
288
|
-
|
|
289
|
-
return dispatch({
|
|
290
|
-
type: 'IDENTIFY_FLOW_BY_MSISDN_SUBMIT',
|
|
291
|
-
payload: {
|
|
292
|
-
type: 'PIN',
|
|
293
|
-
result: {
|
|
294
|
-
nextAction: 'submitMSISDNAction',
|
|
295
|
-
config: flowObj.flowConfig,
|
|
296
|
-
rockman_id: flowObj.rockman_id
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
});
|
|
300
|
-
}
|
|
301
|
-
};
|
|
302
|
-
};
|
|
303
|
-
|
|
304
|
-
exports.pin_mo_redir_ask_mobile_number = pin_mo_redir_ask_mobile_number;
|
|
305
|
-
|
|
306
|
-
var one_click_mo_pin_detect_operator_by_ip_or_msisdn = function one_click_mo_pin_detect_operator_by_ip_or_msisdn(flowObj, msisdn) {
|
|
307
|
-
return function (dispatch) {
|
|
308
|
-
switch (flowObj.flow) {
|
|
309
|
-
case 'oneClick':
|
|
310
|
-
_.tracker.sendOptInFlowEvent('3G click');
|
|
311
|
-
|
|
312
|
-
return dispatch({
|
|
313
|
-
type: 'IDENTIFY_FLOW_BY_MSISDN_SUBMIT',
|
|
314
|
-
payload: {
|
|
315
|
-
type: 'ONE_CLICK',
|
|
316
|
-
result: {
|
|
317
|
-
nextAction: 'submitMSISDNAction',
|
|
318
|
-
config: flowObj.flowConfig,
|
|
319
|
-
msisdn: msisdn,
|
|
320
|
-
rockman_id: flowObj.rockman_id
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
});
|
|
324
|
-
|
|
325
|
-
case 'mo':
|
|
326
|
-
_.tracker.sendOptInFlowEvent('Msisdn to sms');
|
|
327
|
-
|
|
328
|
-
return dispatch({
|
|
329
|
-
type: 'IDENTIFY_FLOW_BY_MSISDN_SUBMIT',
|
|
330
|
-
payload: {
|
|
331
|
-
type: 'MO',
|
|
332
|
-
result: {
|
|
333
|
-
nextAction: 'submitMSISDNAction',
|
|
334
|
-
config: flowObj.flowConfig,
|
|
335
|
-
msisdn: msisdn,
|
|
336
|
-
rockman_id: flowObj.rockman_id
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
});
|
|
340
|
-
|
|
341
|
-
default:
|
|
342
|
-
_.tracker.sendOptInFlowEvent('Pin');
|
|
343
|
-
|
|
344
|
-
return dispatch({
|
|
345
|
-
type: 'IDENTIFY_FLOW_BY_MSISDN_SUBMIT',
|
|
346
|
-
payload: {
|
|
347
|
-
type: 'PIN',
|
|
348
|
-
result: {
|
|
349
|
-
nextAction: 'submitMSISDNAction',
|
|
350
|
-
config: flowObj.flowConfig,
|
|
351
|
-
rockman_id: flowObj.rockman_id
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
});
|
|
355
|
-
}
|
|
356
|
-
};
|
|
357
|
-
}; // const pinMoRedirAskMobileNumber = (flowObj:IFlow)=>{
|
|
358
|
-
// switch (flowObj.flow) {
|
|
359
|
-
// case "pin":
|
|
360
|
-
// self.setState({
|
|
361
|
-
// currentState: {type: "PIN", result: pinFlow(tracker, flowObj, msisdn, extraParams) } as State,
|
|
362
|
-
// })
|
|
363
|
-
// tracker.advancedInFlow('tallyman/v1', 'pin-flow',{msisdn})
|
|
364
|
-
// break;
|
|
365
|
-
// case "moRedir":
|
|
366
|
-
// self.setState({
|
|
367
|
-
// currentState: {type: "MOREDIR", result: moRedirFlow(tracker, flowObj, msisdn, bupperNumber) } as State,
|
|
368
|
-
// })
|
|
369
|
-
// tracker.advancedInFlow('tallyman/v1', 'moRedir-flow',{msisdn})
|
|
370
|
-
// break;
|
|
371
|
-
// default:
|
|
372
|
-
// self.setState({
|
|
373
|
-
// currentState: {type: flowObj.default.flow.toUpperCase(), result: pinFlow(tracker, flowObj.default, msisdn, extraParams) } as State,
|
|
374
|
-
// })
|
|
375
|
-
// tracker.advancedInFlow('tallyman/v1', 'pin-flow',{msisdn})
|
|
376
|
-
// break;
|
|
377
|
-
// }
|
|
378
|
-
// }
|
|
379
|
-
// const pinClick2SmsAskMobileNumber = (flowObj:IFlow)=>{
|
|
380
|
-
// switch (flowObj.flow) {
|
|
381
|
-
// case "pin":
|
|
382
|
-
// self.setState({
|
|
383
|
-
// currentState: {type: "PIN", result: pinFlow(tracker, flowObj, msisdn, extraParams) } as State,
|
|
384
|
-
// })
|
|
385
|
-
// tracker.advancedInFlow('tallyman/v1', 'pin-flow',{msisdn})
|
|
386
|
-
// break;
|
|
387
|
-
// case "click2sms":
|
|
388
|
-
// self.setState({
|
|
389
|
-
// currentState: {type: "CLICK2SMS", result: click2smsFlow(tracker, flowObj) } as State,
|
|
390
|
-
// })
|
|
391
|
-
// tracker.advancedInFlow('tallyman/v1', 'click2sms-flow',{msisdn})
|
|
392
|
-
// break;
|
|
393
|
-
// default:
|
|
394
|
-
// self.setState({
|
|
395
|
-
// currentState: {type: flowObj.default.flow.toUpperCase(), result: pinFlow(tracker, flowObj.default, msisdn, extraParams) } as State,
|
|
396
|
-
// })
|
|
397
|
-
// tracker.advancedInFlow('tallyman/v1', 'pin-flow',{msisdn})
|
|
398
|
-
// break;
|
|
399
|
-
// }
|
|
400
|
-
// }
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
exports.one_click_mo_pin_detect_operator_by_ip_or_msisdn = one_click_mo_pin_detect_operator_by_ip_or_msisdn;
|
|
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.object.keys.js"),require("core-js/modules/es.symbol.js"),require("core-js/modules/es.array.filter.js"),require("core-js/modules/es.object.get-own-property-descriptor.js"),require("core-js/modules/web.dom-collections.for-each.js"),require("core-js/modules/es.object.get-own-property-descriptors.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/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.weak-map.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=ask_mobile_number,exports.pin_mo_redir_ask_mobile_number=exports.pin_mo_mo_redir_ask_mobile_number=exports.pin_mo_ask_mobile_number=exports.pin_combo_ask_mobile_number=exports.one_click_mo_pin_detect_operator_by_ip_or_msisdn=exports.mo_redir_mo_click2sms_one_click_detect_operator_by_ip_or_msisdn=exports.header_enrichment_script=void 0,exports.submitMSISDNAction=submitMSISDNAction,require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.promise.js");var _=require(".."),RDS=_interopRequireWildcard(require("../../../common-types/RemoteDataState")),_utils=require("../utils");function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!==_typeof(obj)&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!=key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}return newObj.default=obj,cache&&cache.set(obj,newObj),newObj}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 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 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)})}}function ask_mobile_number(payload){return function(dispatch){try{dispatch({type:"IDENTIFY_FLOW_BY_MSISDN",payload:{type:"IDENTIFY_FLOW_BY_MSISDN",result:RDS.NothingYet(),nextData:{nextAction:"submitMSISDNAction",msisdn:null===payload||void 0===payload?void 0:payload.msisdn,operator:null===payload||void 0===payload?void 0:payload.operator,isHeaderEnrichmentSuccess:(null===payload||void 0===payload?void 0:payload.isHeaderEnrichmentSuccess)||!1}}})}catch(err){dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_ERROR",payload:{type:"IDENTIFY_FLOW_BY_MSISDN",result:RDS.Failure(err)}})}}}function submitMSISDNAction(internationalMSISDN,isHeSuccess){return function(){var _ref=_asyncToGenerator(_regeneratorRuntime().mark(function _callee(dispatch,store){var _state$strategy,state,strategyState,nextData,_getConfig,strategy,flowObj,errorType;return _regeneratorRuntime().wrap(function _callee$(_context){for(;1;)switch(_context.prev=_context.next){case 0:return state=store(),strategyState=null===state||void 0===state||null===(_state$strategy=state.strategy)||void 0===_state$strategy?void 0:_state$strategy.currentState,nextData=null===strategyState||void 0===strategyState?void 0:strategyState.nextData,_context.prev=3,dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"IDENTIFY_FLOW_BY_MSISDN",result:RDS.Loading(),nextData:{nextAction:"submitMSISDNAction"}}}),_getConfig=(0,_utils.getConfig)(),strategy=_getConfig.strategy,_context.next=8,(0,_utils.determineFlowByMsidn)(internationalMSISDN);case 8:flowObj=_context.sent,dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"IDENTIFY_FLOW_BY_MSISDN",result:RDS.Success(flowObj),nextData:_objectSpread(_objectSpread({nextAction:"submitMSISDNAction"},flowObj.operator&&{operator:flowObj.operator}),nextData)}}),_context.t0=strategy,_context.next="pin-mo-redir-ask-mobile-number"===_context.t0?13:"pin-mo-ask-mobile-number"===_context.t0?14:"pin-combo-ask-mobile-number"===_context.t0?15:"header-enrichment-script"===_context.t0?16:"mo-redir-mo-click2sms-one-click-detect-operator-by-ip-or-msisdn"===_context.t0?17:"pin-mo-mo-redir-ask-mobile-number"===_context.t0?18:19;break;case 13:return _context.abrupt("return",dispatch(pin_mo_redir_ask_mobile_number(flowObj,internationalMSISDN)));case 14:return _context.abrupt("return",dispatch(pin_mo_ask_mobile_number(flowObj,internationalMSISDN)));case 15:return _context.abrupt("return",dispatch(pin_combo_ask_mobile_number(flowObj,internationalMSISDN)));case 16:return _context.abrupt("return",dispatch(header_enrichment_script(flowObj,internationalMSISDN,isHeSuccess)));case 17:return _context.abrupt("return",dispatch(mo_redir_mo_click2sms_one_click_detect_operator_by_ip_or_msisdn(flowObj,internationalMSISDN)));case 18:return _context.abrupt("return",dispatch(pin_mo_mo_redir_ask_mobile_number(flowObj,internationalMSISDN)));case 19:_context.next=26;break;case 21:_context.prev=21,_context.t1=_context["catch"](3),console.warn(_context.t1),errorType="SEAlreadySubscribed"===_context.t1.type?"AlreadySubscribed":"SEInvalidMSISDN"===_context.t1.type?"InvalidMSISDN":"UnknownError",dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT_ERROR",payload:{type:"IDENTIFY_FLOW_BY_MSISDN",result:RDS.Failure({errorType:errorType,error:_context.t1})}});case 26:case"end":return _context.stop();}},_callee,null,[[3,21]])}));return function(_x,_x2){return _ref.apply(this,arguments)}}()}var header_enrichment_script=function header_enrichment_script(flowObj,msisdn,isHeaderEnrichmentSuccess){return function(dispatch){switch(flowObj.flow){case"pin":return _.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"IDENTIFY_FLOW_BY_MSISDN",result:RDS.Loading(),nextData:_objectSpread({nextAction:"submitMSISDNAction",isHeaderEnrichmentSuccess:isHeaderEnrichmentSuccess},flowObj.operator&&{operator:flowObj.operator})}}),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"PIN",result:_objectSpread({nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,isHeaderEnrichmentSuccess:isHeaderEnrichmentSuccess},flowObj.operator&&{operator:flowObj.operator})}});case"mo":return _.tracker.sendOptInFlowEvent("Msisdn to sms"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"MO",result:_objectSpread({nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,isHeaderEnrichmentSuccess:isHeaderEnrichmentSuccess,rockman_id:flowObj.rockman_id},flowObj.operator&&{operator:flowObj.operator})}});case"moRedir":return _.tracker.sendOptInFlowEvent("Redirect"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"MO_REDIR",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,isHeaderEnrichmentSuccess:isHeaderEnrichmentSuccess,rockman_id:flowObj.rockman_id}}});default:return _.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"PIN",result:_objectSpread({nextAction:"submitMSISDNAction",config:flowObj.flowConfig,rockman_id:flowObj.rockman_id},flowObj.operator&&{operator:flowObj.operator})}});}}};exports.header_enrichment_script=header_enrichment_script;var pin_mo_ask_mobile_number=function pin_mo_ask_mobile_number(flowObj,msisdn){return function(dispatch){switch(flowObj.flow){case"pin":return _.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"IDENTIFY_FLOW_BY_MSISDN",result:RDS.Loading(),nextData:_objectSpread({nextAction:"submitMSISDNAction"},flowObj.operator&&{operator:flowObj.operator})}}),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"PIN",result:_objectSpread({nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn},flowObj.operator&&{operator:flowObj.operator})}});case"mo":return _.tracker.sendOptInFlowEvent("Msisdn to sms"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"MO",result:_objectSpread({nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,rockman_id:flowObj.rockman_id},flowObj.operator&&{operator:flowObj.operator})}});default:return _.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"PIN",result:_objectSpread({nextAction:"submitMSISDNAction",config:flowObj.flowConfig,rockman_id:flowObj.rockman_id},flowObj.operator&&{operator:flowObj.operator})}});}}};exports.pin_mo_ask_mobile_number=pin_mo_ask_mobile_number;var pin_combo_ask_mobile_number=function pin_combo_ask_mobile_number(flowObj,msisdn){return function(dispatch){switch(flowObj.flow){case"pin":return _.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"IDENTIFY_FLOW_BY_MSISDN",result:RDS.Loading(),nextData:_objectSpread({nextAction:"submitMSISDNAction"},flowObj.operator&&{operator:flowObj.operator})}}),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"PIN",result:_objectSpread({nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn},flowObj.operator&&{operator:flowObj.operator})}});default:return _.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"PIN",result:_objectSpread({nextAction:"submitMSISDNAction",config:flowObj.flowConfig,rockman_id:flowObj.rockman_id},flowObj.operator&&{operator:flowObj.operator})}});}}};exports.pin_combo_ask_mobile_number=pin_combo_ask_mobile_number;var pin_mo_redir_ask_mobile_number=function pin_mo_redir_ask_mobile_number(flowObj,msisdn){return function(dispatch){switch(flowObj.flow){case"pin":return _.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"IDENTIFY_FLOW_BY_MSISDN",result:RDS.Loading(),nextData:{nextAction:"submitMSISDNAction"}}}),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,rockman_id:flowObj.rockman_id}}});case"moRedir":return _.tracker.sendOptInFlowEvent("Redirect"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"MO_REDIR",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,rockman_id:flowObj.rockman_id}}});default:return _.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,rockman_id:flowObj.rockman_id}}});}}};exports.pin_mo_redir_ask_mobile_number=pin_mo_redir_ask_mobile_number;var pin_mo_mo_redir_ask_mobile_number=function pin_mo_mo_redir_ask_mobile_number(flowObj,msisdn){return function(dispatch){switch(flowObj.flow){case"pin":return _.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"IDENTIFY_FLOW_BY_MSISDN",result:RDS.Loading(),nextData:{nextAction:"submitMSISDNAction"}}}),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,rockman_id:flowObj.rockman_id}}});case"moRedir":return _.tracker.sendOptInFlowEvent("Redirect"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"MO_REDIR",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,rockman_id:flowObj.rockman_id}}});case"mo":return _.tracker.sendOptInFlowEvent("Msisdn to sms"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"MO",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,rockman_id:flowObj.rockman_id}}});default:return _.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,rockman_id:flowObj.rockman_id}}});}}};exports.pin_mo_mo_redir_ask_mobile_number=pin_mo_mo_redir_ask_mobile_number;var one_click_mo_pin_detect_operator_by_ip_or_msisdn=function one_click_mo_pin_detect_operator_by_ip_or_msisdn(flowObj,msisdn){return function(dispatch){switch(flowObj.flow){case"oneClick":return _.tracker.sendOptInFlowEvent("3G click"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"ONE_CLICK",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,rockman_id:flowObj.rockman_id}}});case"mo":return _.tracker.sendOptInFlowEvent("Msisdn to sms"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"MO",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,rockman_id:flowObj.rockman_id}}});default:return _.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,rockman_id:flowObj.rockman_id}}});}}};exports.one_click_mo_pin_detect_operator_by_ip_or_msisdn=one_click_mo_pin_detect_operator_by_ip_or_msisdn;var mo_redir_mo_click2sms_one_click_detect_operator_by_ip_or_msisdn=function mo_redir_mo_click2sms_one_click_detect_operator_by_ip_or_msisdn(flowObj,msisdn){return function(dispatch){switch(flowObj.flowOnWifi){case"moRedir":return _.tracker.sendOptInFlowEvent("Redirect"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"MO_REDIR",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,rockman_id:flowObj.rockman_id}}});case"mo":return _.tracker.sendOptInFlowEvent("Msisdn to sms"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"MO",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,rockman_id:flowObj.rockman_id}}});default:return _.tracker.sendOptInFlowEvent("Redirect"),dispatch({type:"IDENTIFY_FLOW_BY_MSISDN_SUBMIT",payload:{type:"MO_REDIR",result:{config:flowObj.flowConfig,rockman_id:flowObj.rockman_id}}});}}};exports.mo_redir_mo_click2sms_one_click_detect_operator_by_ip_or_msisdn=mo_redir_mo_click2sms_one_click_detect_operator_by_ip_or_msisdn;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AppThunk } from '../../../common-types/AppThunk';
|
|
2
|
+
import { IFlow } from '../StrategyTypes';
|
|
3
|
+
export default function ask_operator(): AppThunk;
|
|
4
|
+
export declare const he_pin_one_click_ask_operator: (flowObj: IFlow) => AppThunk;
|
|
5
|
+
export declare function selectOperator(operator: string): AppThunk;
|