ouisys-engine 2.1.45 → 2.1.46

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
@@ -359,7 +359,7 @@ var RealTallyman = {
359
359
  }(),
360
360
  triggerPin: function () {
361
361
  var _triggerPin2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee12(host, country, slug, device, offer, msisdn, rockmanId, extraParamsQs, search, uniqid) {
362
- var isDMB, newHost;
362
+ var isDMB, newHost, isCleanTraffic;
363
363
  return regeneratorRuntime.wrap(function _callee12$(_context12) {
364
364
  while (1) {
365
365
  switch (_context12.prev = _context12.next) {
@@ -367,15 +367,16 @@ var RealTallyman = {
367
367
  console.log("RealTallyman");
368
368
  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;
369
369
  newHost = isDMB ? "de.tallymans.com" : host;
370
- _context12.next = 5;
371
- return fetch("https://".concat(newHost, "/tallyman/v1/?action=trigger-pin&country=").concat(bupperizeCountry(country), "&slug=").concat(slug, "&device=").concat(device, "&offerId=").concat(offer, "&msisdn=").concat(msisdn, "&rockman_id=").concat(rockmanId).concat(uniqid).concat(extraParamsQs, "&").concat(search)).then(function (x) {
370
+ isCleanTraffic = country.toLowerCase() === "be" ? typeof window != "undefined" && window.shouldBlock === true ? '&is-clean-traffic=false' : '&is-clean-traffic=true' : '';
371
+ _context12.next = 6;
372
+ return fetch("https://".concat(newHost, "/tallyman/v1/?action=trigger-pin&country=").concat(bupperizeCountry(country), "&slug=").concat(slug, "&device=").concat(device, "&offerId=").concat(offer, "&msisdn=").concat(msisdn, "&rockman_id=").concat(rockmanId).concat(uniqid).concat(isCleanTraffic).concat(extraParamsQs, "&").concat(search)).then(function (x) {
372
373
  return x.json();
373
374
  });
374
375
 
375
- case 5:
376
+ case 6:
376
377
  return _context12.abrupt("return", _context12.sent);
377
378
 
378
- case 6:
379
+ case 7:
379
380
  case "end":
380
381
  return _context12.stop();
381
382
  }
@@ -391,7 +392,7 @@ var RealTallyman = {
391
392
  }(),
392
393
  verifyPin: function () {
393
394
  var _verifyPin2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee13(host, country, slug, device, offer, rockmanId, pin, extraParamsQs, uniqid, evinaTid) {
394
- var isDMB, newHost;
395
+ var isDMB, newHost, isCleanTraffic;
395
396
  return regeneratorRuntime.wrap(function _callee13$(_context13) {
396
397
  while (1) {
397
398
  switch (_context13.prev = _context13.next) {
@@ -399,15 +400,16 @@ var RealTallyman = {
399
400
  console.log("RealTallyman");
400
401
  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;
401
402
  newHost = isDMB ? "de.tallymans.com" : host;
402
- _context13.next = 5;
403
- return fetch("https://".concat(newHost, "/tallyman/v1/?action=verify-pin&country=").concat(bupperizeCountry(country), "&slug=").concat(slug, "&device=").concat(device, "&offerId=").concat(offer, "&rockman_id=").concat(rockmanId, "&pin=").concat(pin).concat(uniqid, "&sam_evina_tid=").concat(evinaTid).concat(extraParamsQs)).then(function (x) {
403
+ isCleanTraffic = country.toLowerCase() === "be" ? typeof window != "undefined" && window.shouldBlock === true ? '&is-clean-traffic=false' : '&is-clean-traffic=true' : '';
404
+ _context13.next = 6;
405
+ return fetch("https://".concat(newHost, "/tallyman/v1/?action=verify-pin&country=").concat(bupperizeCountry(country), "&slug=").concat(slug, "&device=").concat(device, "&offerId=").concat(offer, "&rockman_id=").concat(rockmanId, "&pin=").concat(pin).concat(uniqid, "&sam_evina_tid=").concat(evinaTid).concat(isCleanTraffic).concat(extraParamsQs)).then(function (x) {
404
406
  return x.json();
405
407
  });
406
408
 
407
- case 5:
409
+ case 6:
408
410
  return _context13.abrupt("return", _context13.sent);
409
411
 
410
- case 6:
412
+ case 7:
411
413
  case "end":
412
414
  return _context13.stop();
413
415
  }
@@ -278,7 +278,7 @@ exports.getRedirectUrl = getRedirectUrl;
278
278
 
279
279
  var subscribe = /*#__PURE__*/function () {
280
280
  var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(url, extraParams) {
281
- var evinaTid, extraParamsQs, result, subscribeError;
281
+ var evinaTid, extraParamsQs, isCleanTraffic, result, subscribeError;
282
282
  return regeneratorRuntime.wrap(function _callee2$(_context2) {
283
283
  while (1) {
284
284
  switch (_context2.prev = _context2.next) {
@@ -287,16 +287,17 @@ var subscribe = /*#__PURE__*/function () {
287
287
  extraParamsQs = !extraParams ? '' : '&' + Object.keys(extraParams).map(function (k) {
288
288
  return "".concat(k, "=").concat(extraParams[k]);
289
289
  }).join('&');
290
- _context2.next = 4;
291
- return fetch("".concat(url, "&sam_evina_tid=").concat(evinaTid).concat(extraParamsQs)).then(function (x) {
290
+ isCleanTraffic = typeof window != "undefined" && window.shouldBlock === true ? '&is-clean-traffic=false' : '&is-clean-traffic=true';
291
+ _context2.next = 5;
292
+ return fetch("".concat(url, "&sam_evina_tid=").concat(evinaTid).concat(isCleanTraffic).concat(extraParamsQs)).then(function (x) {
292
293
  return x.json();
293
294
  });
294
295
 
295
- case 4:
296
+ case 5:
296
297
  result = _context2.sent;
297
298
 
298
299
  if (!(false === result.success)) {
299
- _context2.next = 12;
300
+ _context2.next = 13;
300
301
  break;
301
302
  }
302
303
 
@@ -305,10 +306,10 @@ var subscribe = /*#__PURE__*/function () {
305
306
  subscribeError['productUrl'] = result.product_url ? result.product_url : "";
306
307
  throw subscribeError;
307
308
 
308
- case 12:
309
+ case 13:
309
310
  return _context2.abrupt("return", result.product_url || result.redirect_url);
310
311
 
311
- case 13:
312
+ case 14:
312
313
  case "end":
313
314
  return _context2.stop();
314
315
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ouisys-engine",
3
- "version": "2.1.45",
3
+ "version": "2.1.46",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "directories": "dist dev-tools",
@@ -59,6 +59,7 @@ export type ITpay = {
59
59
  tid:string;
60
60
  isAutoFraudScreener: boolean;
61
61
  isEvinaSessionChecked: boolean;
62
+ shouldBlock: boolean;
62
63
  }
63
64
 
64
65
  namespace NodeJS {
package/src/api/index.ts CHANGED
@@ -147,13 +147,17 @@ export const RealTallyman:ITallyman = {
147
147
  console.log("RealTallyman")
148
148
  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;
149
149
  const newHost = isDMB ? "de.tallymans.com" : host;
150
- return await fetch(`https://${newHost}/tallyman/v1/?action=trigger-pin&country=${bupperizeCountry(country)}&slug=${slug}&device=${device}&offerId=${offer}&msisdn=${msisdn}&rockman_id=${rockmanId}${uniqid}${extraParamsQs}&${search}`).then(x => x.json());
150
+ const isCleanTraffic = country.toLowerCase() === "be" ? (typeof window != "undefined" && window.shouldBlock === true) ? '&is-clean-traffic=false' : '&is-clean-traffic=true' : '';
151
+
152
+ return await fetch(`https://${newHost}/tallyman/v1/?action=trigger-pin&country=${bupperizeCountry(country)}&slug=${slug}&device=${device}&offerId=${offer}&msisdn=${msisdn}&rockman_id=${rockmanId}${uniqid}${isCleanTraffic}${extraParamsQs}&${search}`).then(x => x.json());
151
153
  },
152
154
  verifyPin:async(host:string, country:string, slug:string, device:string, offer:number, rockmanId:string, pin:string, extraParamsQs:string, uniqid:string, evinaTid:string): Promise<IPINSubmissionResult> =>{
153
- console.log("RealTallyman")
155
+ console.log("RealTallyman");
154
156
  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;
155
157
  const newHost = isDMB ? "de.tallymans.com" : host;
156
- return await fetch(`https://${newHost}/tallyman/v1/?action=verify-pin&country=${bupperizeCountry(country)}&slug=${slug}&device=${device}&offerId=${offer}&rockman_id=${rockmanId}&pin=${pin}${uniqid}&sam_evina_tid=${evinaTid}${extraParamsQs}`).then(x => x.json())
158
+ const isCleanTraffic = country.toLowerCase() === "be" ? (typeof window != "undefined" && window.shouldBlock === true) ? '&is-clean-traffic=false' : '&is-clean-traffic=true' : '';
159
+
160
+ return await fetch(`https://${newHost}/tallyman/v1/?action=verify-pin&country=${bupperizeCountry(country)}&slug=${slug}&device=${device}&offerId=${offer}&rockman_id=${rockmanId}&pin=${pin}${uniqid}&sam_evina_tid=${evinaTid}${isCleanTraffic}${extraParamsQs}`).then(x => x.json())
157
161
  },
158
162
  checkSubscription:async(host:string, country:string, slug:string, device:string, offer:number, rockmanId:string, pin:string, extraParamsQs:string): Promise<ICheckSubscriptionResult> =>{
159
163
  console.log("RealTallyman")
@@ -164,8 +164,9 @@ export const subscribe:(url:string, extraParams?:IHash)=>Promise<string> = async
164
164
  const evinaTid = (typeof window != "undefined" && window.tid) ? window.tid : "";
165
165
  const extraParamsQs = !extraParams ? '' : '&' + Object.keys(extraParams).map(k => `${k}=${extraParams[k]}`).join('&')
166
166
 
167
+ const isCleanTraffic = (typeof window != "undefined" && window.shouldBlock === true) ? '&is-clean-traffic=false' : '&is-clean-traffic=true';
167
168
 
168
- const result:ISubscribeResult = await fetch(`${url}&sam_evina_tid=${evinaTid}${extraParamsQs}`).then((x)=>x.json())
169
+ const result:ISubscribeResult = await fetch(`${url}&sam_evina_tid=${evinaTid}${isCleanTraffic}${extraParamsQs}`).then((x)=>x.json())
169
170
 
170
171
  if(false === result.success){
171
172
  const subscribeError = new Error(`Error in subscribe() one-click-subscribe action:\n${result.message}`) as {productUrl:string} & IError;
@@ -157,7 +157,8 @@ export async function submitPIN(window:Window, pin: string, config:IConfig, extr
157
157
  const { slug, country, device, host } = config;
158
158
  const offer = window.pac_analytics.visitor.offer;
159
159
  const extraParamsQs = !extraParams ? '' : '&' + Object.keys(extraParams).map(k => `${k}=${extraParams[k]}`).join('&')
160
- const rockmanId = window.pac_analytics.visitor.rockmanId
160
+ const rockmanId = window.pac_analytics.visitor.rockmanId;
161
+
161
162
  if(!pin){
162
163
  const emptyPinError = new Error(`Error in submitMSISDN() verify-pin action:\n Pin Cannot Be Empty`) as IError & {type:string}
163
164
  emptyPinError['type'] = "InvalidPIN";