ouisys-engine 2.1.57 → 2.1.58
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/api/index.js
CHANGED
|
@@ -516,7 +516,7 @@ var RealTallyman = {
|
|
|
516
516
|
}(),
|
|
517
517
|
redirect: function () {
|
|
518
518
|
var _redirect2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee17(host, slug, country, msisdn, device, offer, rockmanId, ip_range_name, search, extraParamsQs) {
|
|
519
|
-
var isDMB, newHost;
|
|
519
|
+
var isDMB, newHost, evinaTi;
|
|
520
520
|
return regeneratorRuntime.wrap(function _callee17$(_context17) {
|
|
521
521
|
while (1) {
|
|
522
522
|
switch (_context17.prev = _context17.next) {
|
|
@@ -524,15 +524,16 @@ var RealTallyman = {
|
|
|
524
524
|
console.log("RealTallyman");
|
|
525
525
|
isDMB = window.pac_analytics.visitor.xaid != null && (window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb") != -1 || window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")) != -1 ? true : false;
|
|
526
526
|
newHost = isDMB ? "de.tallymans.com" : host;
|
|
527
|
-
|
|
528
|
-
|
|
527
|
+
evinaTi = country.toLowerCase() === "a2" ? "&evinaTi=".concat(rockmanId) : '';
|
|
528
|
+
_context17.next = 6;
|
|
529
|
+
return fetch("https://".concat(newHost, "/tallyman/v1/?action=redirect&slug=").concat(slug, "&country=").concat(country, "&msisdn=").concat(msisdn, "&device=").concat(device, "&offerId=").concat(offer, "&rockman_id=").concat(rockmanId, "&network_type=").concat(!ip_range_name ? "wifi" : "", "&").concat(search).concat(evinaTi).concat(extraParamsQs)).then(function (x) {
|
|
529
530
|
return x.json();
|
|
530
531
|
});
|
|
531
532
|
|
|
532
|
-
case
|
|
533
|
+
case 6:
|
|
533
534
|
return _context17.abrupt("return", _context17.sent);
|
|
534
535
|
|
|
535
|
-
case
|
|
536
|
+
case 7:
|
|
536
537
|
case "end":
|
|
537
538
|
return _context17.stop();
|
|
538
539
|
}
|
|
@@ -107,51 +107,46 @@ function submitMSISDNWithConfig(_x5, _x6, _x7, _x8) {
|
|
|
107
107
|
|
|
108
108
|
function _submitMSISDNWithConfig() {
|
|
109
109
|
_submitMSISDNWithConfig = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(window, config, internationalMSISDN, extraParams) {
|
|
110
|
-
var slug, country, device, offer, host,
|
|
110
|
+
var slug, country, device, offer, host, search, extraParamsQs, msisdn, visitor, rockmanId, ip_range_name, result, type, error;
|
|
111
111
|
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
112
112
|
while (1) {
|
|
113
113
|
switch (_context2.prev = _context2.next) {
|
|
114
114
|
case 0:
|
|
115
115
|
slug = config.slug, country = config.country, device = config.device, offer = config.offer, host = config.host;
|
|
116
|
-
visitor = window.pac_analytics.visitor;
|
|
117
|
-
rockmanId = visitor.rockmanId;
|
|
118
116
|
search = window.location.search.substr(1) || '';
|
|
119
|
-
|
|
120
|
-
if (country.toLowerCase() === "a2") {
|
|
121
|
-
extraParams.evinaTi = rockmanId;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
117
|
extraParamsQs = !extraParams ? '' : '&' + Object.keys(extraParams).map(function (k) {
|
|
125
118
|
return "".concat(k, "=").concat(extraParams[k]);
|
|
126
119
|
}).join('&');
|
|
127
120
|
msisdn = internationalMSISDN.match(/\d+/gi).join('');
|
|
121
|
+
visitor = window.pac_analytics.visitor;
|
|
122
|
+
rockmanId = visitor.rockmanId;
|
|
128
123
|
|
|
129
124
|
if (!(country == "ci")) {
|
|
130
|
-
_context2.next =
|
|
125
|
+
_context2.next = 12;
|
|
131
126
|
break;
|
|
132
127
|
}
|
|
133
128
|
|
|
134
|
-
_context2.next =
|
|
129
|
+
_context2.next = 9;
|
|
135
130
|
return (0, _tryGetIPRangeName.default)(visitor);
|
|
136
131
|
|
|
137
|
-
case
|
|
132
|
+
case 9:
|
|
138
133
|
_context2.t0 = _context2.sent;
|
|
139
|
-
_context2.next =
|
|
134
|
+
_context2.next = 13;
|
|
140
135
|
break;
|
|
141
136
|
|
|
142
|
-
case
|
|
137
|
+
case 12:
|
|
143
138
|
_context2.t0 = null;
|
|
144
139
|
|
|
145
|
-
case
|
|
140
|
+
case 13:
|
|
146
141
|
ip_range_name = _context2.t0;
|
|
147
|
-
_context2.next =
|
|
142
|
+
_context2.next = 16;
|
|
148
143
|
return window.tallymanApi.redirect(host, slug, country, msisdn, device, offer, rockmanId, ip_range_name, search, extraParamsQs);
|
|
149
144
|
|
|
150
|
-
case
|
|
145
|
+
case 16:
|
|
151
146
|
result = _context2.sent;
|
|
152
147
|
|
|
153
148
|
if (!(false === result.success)) {
|
|
154
|
-
_context2.next =
|
|
149
|
+
_context2.next = 25;
|
|
155
150
|
break;
|
|
156
151
|
}
|
|
157
152
|
|
|
@@ -161,10 +156,10 @@ function _submitMSISDNWithConfig() {
|
|
|
161
156
|
console.error(error);
|
|
162
157
|
throw error;
|
|
163
158
|
|
|
164
|
-
case
|
|
159
|
+
case 25:
|
|
165
160
|
return _context2.abrupt("return", result.redirect_url);
|
|
166
161
|
|
|
167
|
-
case
|
|
162
|
+
case 26:
|
|
168
163
|
case "end":
|
|
169
164
|
return _context2.stop();
|
|
170
165
|
}
|
package/package.json
CHANGED
package/src/api/index.ts
CHANGED
|
@@ -183,7 +183,9 @@ export const RealTallyman:ITallyman = {
|
|
|
183
183
|
console.log("RealTallyman")
|
|
184
184
|
const isDMB = (window.pac_analytics.visitor.xaid != null && (window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb") != -1 || window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")) != -1) ? true : false;
|
|
185
185
|
const newHost = isDMB ? "de.tallymans.com" : host;
|
|
186
|
-
|
|
186
|
+
const evinaTi = (country.toLowerCase() === "a2") ? `&evinaTi=${rockmanId}` : '';
|
|
187
|
+
|
|
188
|
+
return await fetch(`https://${newHost}/tallyman/v1/?action=redirect&slug=${slug}&country=${country}&msisdn=${msisdn}&device=${device}&offerId=${offer}&rockman_id=${rockmanId}&network_type=${!ip_range_name ? "wifi":""}&${search}${evinaTi}${extraParamsQs}`).then(x => x.json())
|
|
187
189
|
},
|
|
188
190
|
triggerMessage:async(host: string, slug: string, country: string, msisdn: string, device: string, offer: number, rockmanId: string, search: string, extraParamsQs: string): Promise<IMoMSISDNSubmissionResult> =>{
|
|
189
191
|
console.log("RealTallyman")
|
|
@@ -12,17 +12,12 @@ export default async function submitMSISDN(window: Window, maybeConfig: IConfig,
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export async function submitMSISDNWithConfig(window: Window, config: IConfig, internationalMSISDN: string, extraParams?: { [key: string]: string }): Promise<string> {
|
|
15
|
-
const { slug, country, device, offer, host } = config
|
|
16
|
-
const visitor = window.pac_analytics.visitor;
|
|
17
|
-
const rockmanId = visitor.rockmanId;
|
|
18
|
-
|
|
15
|
+
const { slug, country, device, offer, host } = config
|
|
19
16
|
const search = window.location.search.substr(1) || '';
|
|
20
|
-
if(country.toLowerCase() === "a2"){
|
|
21
|
-
extraParams.evinaTi = rockmanId;
|
|
22
|
-
}
|
|
23
17
|
const extraParamsQs = !extraParams ? '' : '&' + Object.keys(extraParams).map(k => `${k}=${extraParams[k]}`).join('&')
|
|
24
18
|
const msisdn = internationalMSISDN.match(/\d+/gi).join('')
|
|
25
|
-
|
|
19
|
+
const visitor = window.pac_analytics.visitor;
|
|
20
|
+
const rockmanId = visitor.rockmanId;
|
|
26
21
|
|
|
27
22
|
const ip_range_name = country == "ci" ? await tryGetIPRangeName(visitor) : null;
|
|
28
23
|
|