ouisys-engine 3.0.3 → 3.0.5
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/.husky/pre-commit +4 -0
- package/.nvmrc +1 -1
- package/.prettierignore +2 -1
- package/.vscode/settings.json +1 -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 +38 -38
- 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 +2 -2
- package/dist/reducers/strategy/strategies/ask_mobile_number.js +78 -78
- 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/mockData/config.json +1 -1
- package/package.json +23 -15
- package/setupJest.js +1 -1
- package/tsconfig.json +2 -2
- 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/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 -219
- 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 -376
- package/src/reducers/strategy/index.ts +0 -322
- package/src/reducers/strategy/strategies/ask_mobile_number.ts +0 -366
- 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
package/dist/api/mo.js
DELETED
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
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); }
|
|
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.concat");
|
|
12
|
-
|
|
13
|
-
require("core-js/modules/es.array.filter");
|
|
14
|
-
|
|
15
|
-
require("core-js/modules/es.array.iterator");
|
|
16
|
-
|
|
17
|
-
require("core-js/modules/es.array.join");
|
|
18
|
-
|
|
19
|
-
require("core-js/modules/es.array.map");
|
|
20
|
-
|
|
21
|
-
require("core-js/modules/es.object.get-own-property-descriptor");
|
|
22
|
-
|
|
23
|
-
require("core-js/modules/es.object.get-own-property-descriptors");
|
|
24
|
-
|
|
25
|
-
require("core-js/modules/es.object.keys");
|
|
26
|
-
|
|
27
|
-
require("core-js/modules/es.object.to-string");
|
|
28
|
-
|
|
29
|
-
require("core-js/modules/es.promise");
|
|
30
|
-
|
|
31
|
-
require("core-js/modules/es.regexp.exec");
|
|
32
|
-
|
|
33
|
-
require("core-js/modules/es.string.iterator");
|
|
34
|
-
|
|
35
|
-
require("core-js/modules/es.string.match");
|
|
36
|
-
|
|
37
|
-
require("core-js/modules/es.string.search");
|
|
38
|
-
|
|
39
|
-
require("core-js/modules/es.weak-map");
|
|
40
|
-
|
|
41
|
-
require("core-js/modules/web.dom-collections.for-each");
|
|
42
|
-
|
|
43
|
-
require("core-js/modules/web.dom-collections.iterator");
|
|
44
|
-
|
|
45
|
-
Object.defineProperty(exports, "__esModule", {
|
|
46
|
-
value: true
|
|
47
|
-
});
|
|
48
|
-
exports.checkSubscription = checkSubscription;
|
|
49
|
-
exports.default = submitMSISDN;
|
|
50
|
-
exports.mockedMSISDNEntrySuccess = exports.mockedMSISDNEntryFailure = exports.formatSMSLink = void 0;
|
|
51
|
-
exports.submitMSISDNWithConfig = submitMSISDNWithConfig;
|
|
52
|
-
|
|
53
|
-
require("regenerator-runtime/runtime");
|
|
54
|
-
|
|
55
|
-
var RDS = _interopRequireWildcard(require("../common-types/RemoteDataState"));
|
|
56
|
-
|
|
57
|
-
var _moFlowSliceTypes = require("../features/strategies/categories/typings/moFlowSliceTypes");
|
|
58
|
-
|
|
59
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
60
|
-
|
|
61
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
|
|
62
|
-
|
|
63
|
-
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; }
|
|
64
|
-
|
|
65
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var 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; }
|
|
66
|
-
|
|
67
|
-
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; }
|
|
68
|
-
|
|
69
|
-
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); } }
|
|
70
|
-
|
|
71
|
-
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); }); }; }
|
|
72
|
-
|
|
73
|
-
var wait = function wait(ms) {
|
|
74
|
-
return (// @ts-ignore
|
|
75
|
-
new Promise(function (resolve) {
|
|
76
|
-
return setTimeout(function () {
|
|
77
|
-
return resolve();
|
|
78
|
-
}, ms);
|
|
79
|
-
})
|
|
80
|
-
);
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
var loop = /*#__PURE__*/function () {
|
|
84
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(f, max, stop, i) {
|
|
85
|
-
var r;
|
|
86
|
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
87
|
-
while (1) {
|
|
88
|
-
switch (_context.prev = _context.next) {
|
|
89
|
-
case 0:
|
|
90
|
-
_context.next = 2;
|
|
91
|
-
return f();
|
|
92
|
-
|
|
93
|
-
case 2:
|
|
94
|
-
r = _context.sent;
|
|
95
|
-
|
|
96
|
-
if (!(stop(r) || i >= max)) {
|
|
97
|
-
_context.next = 5;
|
|
98
|
-
break;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return _context.abrupt("return", r);
|
|
102
|
-
|
|
103
|
-
case 5:
|
|
104
|
-
_context.next = 7;
|
|
105
|
-
return wait(1000);
|
|
106
|
-
|
|
107
|
-
case 7:
|
|
108
|
-
return _context.abrupt("return", loop(f, max, stop, i + 1));
|
|
109
|
-
|
|
110
|
-
case 8:
|
|
111
|
-
case "end":
|
|
112
|
-
return _context.stop();
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}, _callee);
|
|
116
|
-
}));
|
|
117
|
-
|
|
118
|
-
return function loop(_x, _x2, _x3, _x4) {
|
|
119
|
-
return _ref.apply(this, arguments);
|
|
120
|
-
};
|
|
121
|
-
}();
|
|
122
|
-
|
|
123
|
-
function submitMSISDN(_x5, _x6, _x7, _x8) {
|
|
124
|
-
return _submitMSISDN.apply(this, arguments);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
function _submitMSISDN() {
|
|
128
|
-
_submitMSISDN = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(window, maybeConfig, internationalMSISDN, extraParams) {
|
|
129
|
-
var config;
|
|
130
|
-
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
131
|
-
while (1) {
|
|
132
|
-
switch (_context2.prev = _context2.next) {
|
|
133
|
-
case 0:
|
|
134
|
-
config = _objectSpread({
|
|
135
|
-
offer: window.pac_analytics.visitor.offer
|
|
136
|
-
}, maybeConfig || {});
|
|
137
|
-
return _context2.abrupt("return", submitMSISDNWithConfig(window, config, internationalMSISDN, extraParams));
|
|
138
|
-
|
|
139
|
-
case 2:
|
|
140
|
-
case "end":
|
|
141
|
-
return _context2.stop();
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}, _callee2);
|
|
145
|
-
}));
|
|
146
|
-
return _submitMSISDN.apply(this, arguments);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
function submitMSISDNWithConfig(_x9, _x10, _x11, _x12) {
|
|
150
|
-
return _submitMSISDNWithConfig.apply(this, arguments);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
function _submitMSISDNWithConfig() {
|
|
154
|
-
_submitMSISDNWithConfig = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(window, config, internationalMSISDN, extraParams) {
|
|
155
|
-
var slug, country, device, offer, host, search, extraParamsQs, msisdn, rockmanId, result, type, error;
|
|
156
|
-
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
157
|
-
while (1) {
|
|
158
|
-
switch (_context3.prev = _context3.next) {
|
|
159
|
-
case 0:
|
|
160
|
-
slug = config.slug, country = config.country, device = config.device, offer = config.offer, host = config.host;
|
|
161
|
-
search = window.location.search.substr(1) || '';
|
|
162
|
-
extraParamsQs = !extraParams ? '' : "&".concat(Object.keys(extraParams).map(function (k) {
|
|
163
|
-
return "".concat(k, "=").concat(extraParams[k]);
|
|
164
|
-
}).join('&'));
|
|
165
|
-
msisdn = internationalMSISDN.match(/\d+/gi).join('');
|
|
166
|
-
rockmanId = window.pac_analytics.visitor.rockmanId;
|
|
167
|
-
_context3.next = 7;
|
|
168
|
-
return window.tallymanApi.triggerMessage(host, slug, country, msisdn, device, offer, rockmanId, search, extraParamsQs);
|
|
169
|
-
|
|
170
|
-
case 7:
|
|
171
|
-
result = _context3.sent;
|
|
172
|
-
|
|
173
|
-
if (!(result.success === false)) {
|
|
174
|
-
_context3.next = 17;
|
|
175
|
-
break;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
type = result.message == 'ALREADY SUBSCRIBED' ? 'AlreadySubscribed' : 'InvalidMSISDN';
|
|
179
|
-
error = new Error("".concat(type, ":\n").concat(result.message));
|
|
180
|
-
error.type = type;
|
|
181
|
-
error.productUrl = result.product_url ? result.product_url : '';
|
|
182
|
-
console.error(error);
|
|
183
|
-
throw error;
|
|
184
|
-
|
|
185
|
-
case 17:
|
|
186
|
-
return _context3.abrupt("return", result);
|
|
187
|
-
|
|
188
|
-
case 18:
|
|
189
|
-
case "end":
|
|
190
|
-
return _context3.stop();
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}, _callee3);
|
|
194
|
-
}));
|
|
195
|
-
return _submitMSISDNWithConfig.apply(this, arguments);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
function checkSubscription(_x13, _x14) {
|
|
199
|
-
return _checkSubscription.apply(this, arguments);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
function _checkSubscription() {
|
|
203
|
-
_checkSubscription = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(window, maybeConfig) {
|
|
204
|
-
var config, host, rockmanId, check, checkResult, error;
|
|
205
|
-
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
206
|
-
while (1) {
|
|
207
|
-
switch (_context4.prev = _context4.next) {
|
|
208
|
-
case 0:
|
|
209
|
-
config = _objectSpread({
|
|
210
|
-
offer: window.pac_analytics.visitor.offer
|
|
211
|
-
}, maybeConfig || {});
|
|
212
|
-
host = config.host;
|
|
213
|
-
rockmanId = window.pac_analytics.visitor.rockmanId;
|
|
214
|
-
|
|
215
|
-
check = function check() {
|
|
216
|
-
return window.tallymanApi.checkSubscriptionByRockmanIdOnly(host, rockmanId);
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
_context4.next = 6;
|
|
220
|
-
return loop(check, 60, function (r) {
|
|
221
|
-
return r.success;
|
|
222
|
-
}, 0);
|
|
223
|
-
|
|
224
|
-
case 6:
|
|
225
|
-
checkResult = _context4.sent;
|
|
226
|
-
|
|
227
|
-
if (!(checkResult.success === true)) {
|
|
228
|
-
_context4.next = 10;
|
|
229
|
-
break;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
window.location.href = checkResult.product_url;
|
|
233
|
-
return _context4.abrupt("return", checkResult.product_url || null);
|
|
234
|
-
|
|
235
|
-
case 10:
|
|
236
|
-
error = new Error('SubscriptionFailed'.concat(":\n", checkResult.message));
|
|
237
|
-
error.type = 'SubscriptionFailed';
|
|
238
|
-
throw error;
|
|
239
|
-
|
|
240
|
-
case 13:
|
|
241
|
-
case "end":
|
|
242
|
-
return _context4.stop();
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}, _callee4);
|
|
246
|
-
}));
|
|
247
|
-
return _checkSubscription.apply(this, arguments);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
var formatSMSLink = function formatSMSLink(keywordAndShortcode) {
|
|
251
|
-
return !!window.pac_analytics.visitor['x-requested-with'] && window.pac_analytics.visitor['x-requested-with'] !== null && window.pac_analytics.visitor['x-requested-with'].indexOf('com.facebook') !== -1 ? "sms://".concat(keywordAndShortcode.shortcode, "?body=").concat(keywordAndShortcode.keyword) : typeof navigator !== 'undefined' && (/iPhone/i.test(navigator.userAgent) || /Mac OS/i.test(navigator.userAgent)) ? "sms:".concat(keywordAndShortcode.shortcode, "&body=").concat(keywordAndShortcode.keyword) : "sms:".concat(keywordAndShortcode.shortcode, "?body=").concat(keywordAndShortcode.keyword);
|
|
252
|
-
};
|
|
253
|
-
|
|
254
|
-
exports.formatSMSLink = formatSMSLink;
|
|
255
|
-
var mockedMSISDNEntrySuccess = {
|
|
256
|
-
currentState: {
|
|
257
|
-
type: _moFlowSliceTypes.MoStates.MSISDNEntry,
|
|
258
|
-
result: RDS.Success({
|
|
259
|
-
keyword: 'TEST OK',
|
|
260
|
-
shortcode: '666'
|
|
261
|
-
})
|
|
262
|
-
}
|
|
263
|
-
};
|
|
264
|
-
exports.mockedMSISDNEntrySuccess = mockedMSISDNEntrySuccess;
|
|
265
|
-
var mockedMSISDNEntryFailure = {
|
|
266
|
-
currentState: {
|
|
267
|
-
type: _moFlowSliceTypes.MoStates.MSISDNEntry,
|
|
268
|
-
result: RDS.Failure({
|
|
269
|
-
errorType: _moFlowSliceTypes.MSISDNEntryErrorTypes.InvalidMSISDN,
|
|
270
|
-
error: 'Invalid Mobile Number'
|
|
271
|
-
})
|
|
272
|
-
}
|
|
273
|
-
};
|
|
274
|
-
exports.mockedMSISDNEntryFailure = mockedMSISDNEntryFailure;
|
package/dist/api/moRedir.js
DELETED
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
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); }
|
|
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.concat");
|
|
12
|
-
|
|
13
|
-
require("core-js/modules/es.array.filter");
|
|
14
|
-
|
|
15
|
-
require("core-js/modules/es.array.iterator");
|
|
16
|
-
|
|
17
|
-
require("core-js/modules/es.array.join");
|
|
18
|
-
|
|
19
|
-
require("core-js/modules/es.array.map");
|
|
20
|
-
|
|
21
|
-
require("core-js/modules/es.object.get-own-property-descriptor");
|
|
22
|
-
|
|
23
|
-
require("core-js/modules/es.object.get-own-property-descriptors");
|
|
24
|
-
|
|
25
|
-
require("core-js/modules/es.object.keys");
|
|
26
|
-
|
|
27
|
-
require("core-js/modules/es.object.to-string");
|
|
28
|
-
|
|
29
|
-
require("core-js/modules/es.promise");
|
|
30
|
-
|
|
31
|
-
require("core-js/modules/es.regexp.exec");
|
|
32
|
-
|
|
33
|
-
require("core-js/modules/es.string.iterator");
|
|
34
|
-
|
|
35
|
-
require("core-js/modules/es.string.match");
|
|
36
|
-
|
|
37
|
-
require("core-js/modules/es.string.search");
|
|
38
|
-
|
|
39
|
-
require("core-js/modules/es.weak-map");
|
|
40
|
-
|
|
41
|
-
require("core-js/modules/web.dom-collections.for-each");
|
|
42
|
-
|
|
43
|
-
require("core-js/modules/web.dom-collections.iterator");
|
|
44
|
-
|
|
45
|
-
Object.defineProperty(exports, "__esModule", {
|
|
46
|
-
value: true
|
|
47
|
-
});
|
|
48
|
-
exports.default = submitMSISDN;
|
|
49
|
-
exports.mockedMSISDNEntrySuccess = exports.mockedMSISDNEntryFailure = void 0;
|
|
50
|
-
exports.submitMSISDNWithConfig = submitMSISDNWithConfig;
|
|
51
|
-
|
|
52
|
-
require("regenerator-runtime/runtime");
|
|
53
|
-
|
|
54
|
-
var RDS = _interopRequireWildcard(require("../common-types/RemoteDataState"));
|
|
55
|
-
|
|
56
|
-
var _tryGetIPRangeName = _interopRequireDefault(require("../ips/tryGetIPRangeName"));
|
|
57
|
-
|
|
58
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
59
|
-
|
|
60
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
61
|
-
|
|
62
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
|
|
63
|
-
|
|
64
|
-
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; }
|
|
65
|
-
|
|
66
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var 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; }
|
|
67
|
-
|
|
68
|
-
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; }
|
|
69
|
-
|
|
70
|
-
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); } }
|
|
71
|
-
|
|
72
|
-
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); }); }; }
|
|
73
|
-
|
|
74
|
-
function submitMSISDN(_x, _x2, _x3, _x4) {
|
|
75
|
-
return _submitMSISDN.apply(this, arguments);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function _submitMSISDN() {
|
|
79
|
-
_submitMSISDN = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(window, maybeConfig, internationalMSISDN, extraParams) {
|
|
80
|
-
var config;
|
|
81
|
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
82
|
-
while (1) {
|
|
83
|
-
switch (_context.prev = _context.next) {
|
|
84
|
-
case 0:
|
|
85
|
-
config = _objectSpread({
|
|
86
|
-
offer: window.pac_analytics.visitor.offer
|
|
87
|
-
}, maybeConfig || {});
|
|
88
|
-
return _context.abrupt("return", submitMSISDNWithConfig(window, config, internationalMSISDN, extraParams));
|
|
89
|
-
|
|
90
|
-
case 2:
|
|
91
|
-
case "end":
|
|
92
|
-
return _context.stop();
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}, _callee);
|
|
96
|
-
}));
|
|
97
|
-
return _submitMSISDN.apply(this, arguments);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
function submitMSISDNWithConfig(_x5, _x6, _x7, _x8) {
|
|
101
|
-
return _submitMSISDNWithConfig.apply(this, arguments);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function _submitMSISDNWithConfig() {
|
|
105
|
-
_submitMSISDNWithConfig = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(window, config, internationalMSISDN, extraParams) {
|
|
106
|
-
var slug, country, device, offer, host, search, extraParamsQs, msisdn, visitor, rockmanId, ip_range_name, result, type, error;
|
|
107
|
-
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
108
|
-
while (1) {
|
|
109
|
-
switch (_context2.prev = _context2.next) {
|
|
110
|
-
case 0:
|
|
111
|
-
slug = config.slug, country = config.country, device = config.device, offer = config.offer, host = config.host;
|
|
112
|
-
search = window.location.search.substr(1) || '';
|
|
113
|
-
extraParamsQs = !extraParams ? '' : "&".concat(Object.keys(extraParams).map(function (k) {
|
|
114
|
-
return "".concat(k, "=").concat(extraParams[k]);
|
|
115
|
-
}).join('&'));
|
|
116
|
-
msisdn = internationalMSISDN.match(/\d+/gi).join('');
|
|
117
|
-
visitor = window.pac_analytics.visitor;
|
|
118
|
-
rockmanId = visitor.rockmanId;
|
|
119
|
-
|
|
120
|
-
if (!(country == 'ci')) {
|
|
121
|
-
_context2.next = 12;
|
|
122
|
-
break;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
_context2.next = 9;
|
|
126
|
-
return (0, _tryGetIPRangeName.default)(visitor);
|
|
127
|
-
|
|
128
|
-
case 9:
|
|
129
|
-
_context2.t0 = _context2.sent;
|
|
130
|
-
_context2.next = 13;
|
|
131
|
-
break;
|
|
132
|
-
|
|
133
|
-
case 12:
|
|
134
|
-
_context2.t0 = null;
|
|
135
|
-
|
|
136
|
-
case 13:
|
|
137
|
-
ip_range_name = _context2.t0;
|
|
138
|
-
_context2.next = 16;
|
|
139
|
-
return window.tallymanApi.redirect(host, slug, country, msisdn, device, offer, rockmanId, ip_range_name, search, extraParamsQs);
|
|
140
|
-
|
|
141
|
-
case 16:
|
|
142
|
-
result = _context2.sent;
|
|
143
|
-
|
|
144
|
-
if (!(result.success === false)) {
|
|
145
|
-
_context2.next = 25;
|
|
146
|
-
break;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
type = result.message == 'ALREADY SUBSCRIBED' ? 'AlreadySubscribed' : 'InvalidMSISDN';
|
|
150
|
-
error = new Error("".concat(type, ":\n").concat(result.message));
|
|
151
|
-
error.type = type;
|
|
152
|
-
console.error(error);
|
|
153
|
-
throw error;
|
|
154
|
-
|
|
155
|
-
case 25:
|
|
156
|
-
return _context2.abrupt("return", result.redirect_url);
|
|
157
|
-
|
|
158
|
-
case 26:
|
|
159
|
-
case "end":
|
|
160
|
-
return _context2.stop();
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}, _callee2);
|
|
164
|
-
}));
|
|
165
|
-
return _submitMSISDNWithConfig.apply(this, arguments);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
var mockedMSISDNEntrySuccess = {
|
|
169
|
-
currentState: {
|
|
170
|
-
type: 'MSISDNEntry',
|
|
171
|
-
result: RDS.Success({
|
|
172
|
-
href: 'https://www.yahoo.com/'
|
|
173
|
-
})
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
exports.mockedMSISDNEntrySuccess = mockedMSISDNEntrySuccess;
|
|
177
|
-
var mockedMSISDNEntryFailure = {
|
|
178
|
-
currentState: {
|
|
179
|
-
type: 'MSISDNEntry',
|
|
180
|
-
result: RDS.Failure({
|
|
181
|
-
errorType: 'InvalidMSISDN',
|
|
182
|
-
error: 'Invalid Mobile Number'
|
|
183
|
-
})
|
|
184
|
-
}
|
|
185
|
-
};
|
|
186
|
-
exports.mockedMSISDNEntryFailure = mockedMSISDNEntryFailure;
|