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.
- package/dist/api/click2sms.js +357 -0
- package/dist/api/index.js +3 -3
- package/dist/api/mo.js +274 -0
- package/dist/api/moRedir.js +186 -0
- package/dist/api/oneClick.js +366 -0
- package/dist/api/pin.js +493 -0
- package/dist/api/strategies.js +704 -0
- package/dist/api/ussd.js +1 -0
- package/dist/app/store.js +35 -0
- package/dist/features/strategies/categories/askMobileNumber.js +395 -0
- package/dist/features/strategies/categories/askOperator.js +311 -0
- package/dist/features/strategies/categories/detectOperatorByIp.js +606 -0
- package/dist/features/strategies/categories/headerEnrichment.js +670 -0
- package/dist/features/strategies/categories/typings/click2smsSliceTypes.js +12 -0
- package/dist/features/strategies/categories/typings/identifySliceTypes.js +22 -0
- package/dist/features/strategies/categories/typings/moFlowSliceTypes.js +22 -0
- package/dist/features/strategies/categories/typings/moRedirFlowSliceTypes.js +21 -0
- package/dist/features/strategies/categories/typings/oneClickSliceTypes.js +13 -0
- package/dist/features/strategies/categories/typings/pinFlowSliceTypes.js +13 -0
- package/dist/features/strategies/click2smsFlowSlice.js +172 -0
- package/dist/features/strategies/identifySlice.js +455 -0
- package/dist/features/strategies/moFlowSlice.js +196 -0
- package/dist/features/strategies/moRedirFlowSlice.js +190 -0
- package/dist/features/strategies/oneClickFlowSlice.js +277 -0
- package/dist/features/strategies/pinFlowSlice.js +313 -0
- package/dist/features/strategies/ussdFlowSlice.js +1 -0
- package/dist/ips/tryGetIPRangeName.js +14 -13
- package/dist/mockServer/browser.js +48 -0
- package/dist/mockServer/handlers.js +22 -0
- package/dist/mockServer/server.js +48 -0
- package/dist/pacman/index.js +0 -1
- package/dist/reducers/click2smsFlow/utils.js +1 -3
- package/dist/reducers/strategy/utils.js +11 -12
- package/dist/reducers/tpayHeFlow/utils.js +1 -1
- package/dist/test/setup.js +24 -0
- package/dist/test/test-utils.js +51 -0
- package/package.json +1 -1
- package/src/api/index.ts +3 -3
- package/src/ips/tryGetIPRangeName.ts +3 -2
- package/src/pacman/index.ts +1 -1
- package/src/reducers/click2smsFlow/utils.ts +0 -3
- package/src/reducers/strategy/utils.ts +1 -2
- 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
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:\/\/
|
|
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:\/\/
|
|
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:\/\/
|
|
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
|
|
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
|
package/src/pacman/index.ts
CHANGED
|
@@ -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,
|
|
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
|
|
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
|
|
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
|
}
|