ouisys-engine 2.1.21 → 2.1.22

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.
Files changed (43) hide show
  1. package/dist/api/click2sms.js +357 -0
  2. package/dist/api/index.js +3 -3
  3. package/dist/api/mo.js +274 -0
  4. package/dist/api/moRedir.js +186 -0
  5. package/dist/api/oneClick.js +366 -0
  6. package/dist/api/pin.js +493 -0
  7. package/dist/api/strategies.js +704 -0
  8. package/dist/api/ussd.js +1 -0
  9. package/dist/app/store.js +35 -0
  10. package/dist/features/strategies/categories/askMobileNumber.js +395 -0
  11. package/dist/features/strategies/categories/askOperator.js +311 -0
  12. package/dist/features/strategies/categories/detectOperatorByIp.js +606 -0
  13. package/dist/features/strategies/categories/headerEnrichment.js +670 -0
  14. package/dist/features/strategies/categories/typings/click2smsSliceTypes.js +12 -0
  15. package/dist/features/strategies/categories/typings/identifySliceTypes.js +22 -0
  16. package/dist/features/strategies/categories/typings/moFlowSliceTypes.js +22 -0
  17. package/dist/features/strategies/categories/typings/moRedirFlowSliceTypes.js +21 -0
  18. package/dist/features/strategies/categories/typings/oneClickSliceTypes.js +13 -0
  19. package/dist/features/strategies/categories/typings/pinFlowSliceTypes.js +13 -0
  20. package/dist/features/strategies/click2smsFlowSlice.js +172 -0
  21. package/dist/features/strategies/identifySlice.js +455 -0
  22. package/dist/features/strategies/moFlowSlice.js +196 -0
  23. package/dist/features/strategies/moRedirFlowSlice.js +190 -0
  24. package/dist/features/strategies/oneClickFlowSlice.js +277 -0
  25. package/dist/features/strategies/pinFlowSlice.js +313 -0
  26. package/dist/features/strategies/ussdFlowSlice.js +1 -0
  27. package/dist/ips/tryGetIPRangeName.js +14 -13
  28. package/dist/mockServer/browser.js +48 -0
  29. package/dist/mockServer/handlers.js +22 -0
  30. package/dist/mockServer/server.js +48 -0
  31. package/dist/pacman/index.js +0 -1
  32. package/dist/reducers/click2smsFlow/utils.js +1 -3
  33. package/dist/reducers/strategy/utils.js +11 -12
  34. package/dist/reducers/tpayHeFlow/utils.js +1 -1
  35. package/dist/test/setup.js +24 -0
  36. package/dist/test/test-utils.js +51 -0
  37. package/package.json +1 -1
  38. package/src/api/index.ts +3 -3
  39. package/src/ips/tryGetIPRangeName.ts +3 -2
  40. package/src/pacman/index.ts +1 -1
  41. package/src/reducers/click2smsFlow/utils.ts +0 -3
  42. package/src/reducers/strategy/utils.ts +1 -2
  43. package/src/reducers/tpayHeFlow/utils.ts +1 -1
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.object.keys");
4
+
5
+ require("core-js/modules/web.dom-collections.for-each");
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ var _exportNames = {
11
+ server: true
12
+ };
13
+ Object.defineProperty(exports, "server", {
14
+ enumerable: true,
15
+ get: function get() {
16
+ return _server.server;
17
+ }
18
+ });
19
+
20
+ require("whatwg-fetch");
21
+
22
+ var _server = require("../mockServer/server");
23
+
24
+ var _msw = require("msw");
25
+
26
+ Object.keys(_msw).forEach(function (key) {
27
+ if (key === "default" || key === "__esModule") return;
28
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
29
+ if (key in exports && exports[key] === _msw[key]) return;
30
+ Object.defineProperty(exports, key, {
31
+ enumerable: true,
32
+ get: function get() {
33
+ return _msw[key];
34
+ }
35
+ });
36
+ });
37
+
38
+ /**
39
+ * Generic functions for the tests.
40
+ */
41
+ beforeAll(function () {
42
+ _server.server.listen();
43
+ });
44
+ afterEach(function () {
45
+ _server.server.resetHandlers();
46
+
47
+ _server.server.restoreHandlers();
48
+ });
49
+ afterAll(function () {
50
+ _server.server.close();
51
+ }); // re-export everything
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ouisys-engine",
3
- "version": "2.1.21",
3
+ "version": "2.1.22",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "directories": "dist dev-tools",
package/src/api/index.ts CHANGED
@@ -132,9 +132,9 @@ export const MockTallyman:ITallyman = {
132
132
  "prodSku": "gamelords",
133
133
  "lang": "ar",
134
134
  "country": "eg",
135
- "subscription_url": "http:\/\/n.vidflixz.com\/tallyman\/v1\/?action=one-click-subscribe&device=smart&slug=tpay-he-vidflixz&country=eg&offerId=1&rockman_id=13643b4780fb40bb8adf2feb2a400d7f&",
135
+ "subscription_url": "http:\/\/de.tallymans.com\/tallyman\/v1\/?action=one-click-subscribe&device=smart&slug=tpay-he-vidflixz&country=eg&offerId=1&rockman_id=13643b4780fb40bb8adf2feb2a400d7f&",
136
136
  "config": {
137
- "product_url": "http:\/\/eg.game-lords.com\/#\/?uid=fdf098fcc6",
137
+ "product_url": "http:\/\/de.tallymans.com\/#\/?uid=fdf098fcc6",
138
138
  "subscription_plan_id": 829,
139
139
  "public": "HFyenUyCJCxl1QTgtVCA",
140
140
  "private": "vazlmVhGFyxKLOav6DvW",
@@ -145,7 +145,7 @@ export const MockTallyman:ITallyman = {
145
145
  "60203": "gamelords_etst"
146
146
  }
147
147
  },
148
- "redirectUrl": "http:\/\/n.game-lords.com\/eg\/animal-game?country=eg&handle=animal-game&offer=1&device=smart&_extracted=957ad26679cd47a09d4efe28d4a4af72&operator=#operator#&msisdnSubmitted=Y&network_type=mobile_data&atmobirun=true&force_mcb_page=true&skipTrigger=true",
148
+ "redirectUrl": "http:\/\/de.tallymans.com\/eg\/animal-game?country=eg&handle=animal-game&offer=1&device=smart&_extracted=957ad26679cd47a09d4efe28d4a4af72&operator=#operator#&msisdnSubmitted=Y&network_type=mobile_data&atmobirun=true&force_mcb_page=true&skipTrigger=true",
149
149
  "rid": "957ad26679cd47a09d4efe28d4a4af72",
150
150
  "success": true
151
151
  }
@@ -5,9 +5,10 @@ export default async function tryGetIPRangeName(visitor: IVisitor): Promise<stri
5
5
 
6
6
  const mockip = queryString(window.location.href, "mock-ip") || process.env.mock_ip;
7
7
  console.log("mockip", mockip)
8
- if (!visitor.ip) {
8
+ if (!visitor.ip && typeof window != "undefined") {
9
9
  try {
10
- const res = await fetch('https://c1.ouisys.com/api/v1/ip' + (!!mockip ? `?mock-ip=${mockip}` : "")).then(x => x.json())
10
+ const host = window.location.host
11
+ const res = await fetch(`https://${host}/api/v1/ip` + (!!mockip ? `?mock-ip=${mockip}` : "")).then(x => x.json())
11
12
  // return isIPInRange('37.200.146.28')
12
13
  visitor.ip = res.ip
13
14
  visitor.ip_range_name = res.ip_range_name
@@ -56,7 +56,7 @@ export default (window: Window, country?: string, page?: string): ITrackerFlowEv
56
56
 
57
57
  const pacmanClient = mkPacmanClient({
58
58
  rockmanId: window.pac_analytics.visitor.rockmanId,
59
- serverUrl: process.env.pacman_server, // check webpack.config.common.js //"https://de-pacman.sam-media.com/api/v2/mstore",
59
+ serverUrl: process.env.pacman_server,
60
60
  impressionNumber: 1,
61
61
  signalInterval: 1000 // in milliseconds
62
62
  });
@@ -124,6 +124,3 @@ export async function checkSubscription(window: Window, maybeConfig: IConfig): P
124
124
  throw error
125
125
  }
126
126
  }
127
-
128
- // {"success":true,"uid":"*5QADM","shortcode":"1901","keyword":"TIPS"}%
129
- // curl "http://w1.mozzi.com/spa-api/?country=gh&device=smart&slug=18plus-oc2sms&action=oc2sms"
@@ -225,7 +225,6 @@ export const identifyUser = async(extraParams?:ILinkExtraParams):
225
225
  return {redirect_url, msisdn:msisdn, operator:operator}
226
226
  }
227
227
  }else{
228
- console.log("newUrl",window.location.href)
229
228
  const newUrl = new URL(window.location.href);
230
229
  const queryString = newUrl.search;
231
230
  const urlParams = new URLSearchParams(queryString);
@@ -237,7 +236,7 @@ export const identifyUser = async(extraParams?:ILinkExtraParams):
237
236
 
238
237
  }
239
238
  }else{
240
- const url = `https://${newHost}/tallyman/v1/?action=identify-user&country=${bupperizeCountry(country)}&slug=${slug}&device=${device}&offerId=${offer}&page=${window.location.href}&pixel_url=${encodeURIComponent(`http://c1.ouisys.com/pixels?xcid=${window.location.pathname.replace("/", "")}&xaid=${window.pac_analytics.visitor.xaid}&country=${bupperizeCountry(country)}`)}&rockman_id=${rockmanId}${extraParamsQs}&${search}`
239
+ const url = `https://${newHost}/tallyman/v1/?action=identify-user&country=${bupperizeCountry(country)}&slug=${slug}&device=${device}&offerId=${offer}&page=${window.location.href}&pixel_url=${encodeURIComponent(`http://${window.location.host}/pixels?xcid=${window.location.pathname.replace("/", "")}&xaid=${window.pac_analytics.visitor.xaid}&country=${bupperizeCountry(country)}`)}&rockman_id=${rockmanId}${extraParamsQs}&${search}`
241
240
 
242
241
  const result = await fetchJsonp<IStrategyIDentifyUserResult>(url);
243
242
  if(false === result.success){
@@ -224,7 +224,7 @@ export const confirmTPay = (window:Window, tpayConfig:ITpayConsentResult, locale
224
224
  if (config["replace_uid"] != undefined && config['replace_uid'] == true) {
225
225
  console.log('sub id ' + subId);
226
226
  productUrl = config['product_full_access'];
227
- fetch(`http://de-mcb-api.sam-media.com/api/v2/validate-access/?domain=${config.domain}&sub_id=${subId}&country=${tpayConfig.country}&gateway=tpay`).then((response:any)=>{
227
+ fetch(`http://de.tallymans.com/api/v2/validate-access/?domain=${config.domain}&sub_id=${subId}&country=${tpayConfig.country}&gateway=tpay`).then((response:any)=>{
228
228
  if (response.payload.token) {
229
229
  productUrl = config['product_url'].replace('<%UID%>', response.payload.token);
230
230
  }