ouisys-engine 2.1.68 → 2.1.71

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/.eslintrc.js ADDED
@@ -0,0 +1,5 @@
1
+ module.exports = {
2
+
3
+ extends: ['eslint-config-ouisys'],
4
+
5
+ };
@@ -0,0 +1,3 @@
1
+ build/
2
+ storybook-static/
3
+ stats.json
@@ -0,0 +1,6 @@
1
+ {
2
+ "eslint.format.enable": true,
3
+ "editor.codeActionsOnSave": {
4
+ "source.fixAll.eslint": true
5
+ }
6
+ }
@@ -59,6 +59,8 @@ var _utilities = require("../../utilities");
59
59
 
60
60
  var _loadScriptInnerHtml = _interopRequireDefault(require("../../utilities/loadScriptInnerHtml"));
61
61
 
62
+ var _utils = require("../strategy/utils");
63
+
62
64
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
63
65
 
64
66
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }
@@ -171,7 +173,12 @@ function _submitMSISDNWithConfig() {
171
173
 
172
174
  var startEvinaAgency = function startEvinaAgency(config) {
173
175
  try {
174
- var host = config.host;
176
+ var configs = (0, _utils.getConfig)();
177
+ var defaultFlowConfig = configs.strategyConfigs.default;
178
+
179
+ var _ref = !!config ? config : defaultFlowConfig.flowConfig,
180
+ host = _ref.host;
181
+
175
182
  var newHost = (0, _utilities.getHost)({
176
183
  host: host
177
184
  });
@@ -116,7 +116,6 @@ var bupperizeCountry = function bupperizeCountry(c) {
116
116
  };
117
117
 
118
118
  var uniqidResult = "";
119
- var uniqidOnLoadResult = "";
120
119
 
121
120
  function loadMcpShield(_x5, _x6) {
122
121
  return _loadMcpShield.apply(this, arguments);
@@ -150,7 +149,7 @@ function _loadMcpShield() {
150
149
 
151
150
  case 11:
152
151
  (0, _loadScriptInnerHtml.default)(mcpShieldResult.source);
153
- uniqidOnLoadResult = mcpShieldResult.uniqid;
152
+ uniqidResult = mcpShieldResult.uniqid;
154
153
  return _context2.abrupt("return", mcpShieldResult);
155
154
 
156
155
  case 14:
@@ -227,7 +226,7 @@ function _submitMSISDNOnce() {
227
226
  extraParamsQs = !extraParams ? '' : '&' + Object.keys(extraParams).map(function (k) {
228
227
  return "".concat(k, "=").concat(extraParams[k]);
229
228
  }).join('&');
230
- uniqid = uniqidOnLoadResult != "" && country.toLowerCase() == "iq" ? "&mcpUniqid=".concat(uniqidOnLoadResult) : '';
229
+ uniqid = !!uniqidResult && uniqidResult != "" ? "&mcpUniqid=".concat(uniqidResult) : '';
231
230
  _context3.next = 18;
232
231
  return window.tallymanApi.triggerPin(host, country, slug, device, offer, msisdn, rockmanId, extraParamsQs, search, uniqid);
233
232
 
@@ -9,6 +9,8 @@ var _utils = require("../reducers/moFlow/utils");
9
9
 
10
10
  var _utils2 = require("../reducers/moRedirFlow/utils");
11
11
 
12
+ var _utils3 = require("../reducers/pinFlow/utils");
13
+
12
14
  var isDMBCheck = function isDMBCheck() {
13
15
  return 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;
14
16
  };
@@ -31,6 +33,10 @@ var setOnLoadUtilities = function setOnLoadUtilities(config) {
31
33
  if (process.env.country.toLowerCase() === "a2" && process.env.NODE_ENV === "production") {
32
34
  (0, _utils2.startEvinaAgency)(config);
33
35
  }
36
+
37
+ if (process.env.country.toLowerCase() === "sa" || process.env.country.toLowerCase() === "iq") {
38
+ (0, _utils3.loadMcpShield)(window, config);
39
+ }
34
40
  };
35
41
 
36
42
  exports.setOnLoadUtilities = setOnLoadUtilities;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ouisys-engine",
3
- "version": "2.1.68",
3
+ "version": "2.1.71",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "directories": "dist dev-tools",
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ "semi": true,
3
+ "trailingComma": "none",
4
+ "singleQuote": true,
5
+ "printWidth": 120,
6
+ "tabWidth": 2
7
+ };
@@ -61,6 +61,7 @@ export type ITpay = {
61
61
  isEvinaSessionChecked: boolean;
62
62
  shouldBlock: boolean;
63
63
  reCaptchaToken: string;
64
+ uniqidOnLoadResult: string;
64
65
  }
65
66
 
66
67
  namespace NodeJS {
@@ -5,6 +5,7 @@ import * as RDS from "../../common-types/RemoteDataState";
5
5
  import loadScriptSrc from "../../utilities/loadScriptSrc";
6
6
  import { getHost, isDMBCheck } from "../../utilities";
7
7
  import loadScriptInnerHtml from "../../utilities/loadScriptInnerHtml";
8
+ import { getConfig } from "../strategy/utils";
8
9
 
9
10
 
10
11
  export default async function submitMSISDN(window: Window, maybeConfig: IConfig, internationalMSISDN: string, extraParams?: {[key: string]: string}): Promise<string> {
@@ -38,7 +39,10 @@ export async function submitMSISDNWithConfig(window: Window, config: IConfig, in
38
39
 
39
40
  export const startEvinaAgency = (config: IConfig)=>{
40
41
  try{
41
- const { host } = config
42
+ const configs = getConfig();
43
+ const defaultFlowConfig = configs.strategyConfigs.default;
44
+
45
+ const { host } = !!config ? config : defaultFlowConfig.flowConfig;
42
46
  const newHost = getHost({host});
43
47
  const rockmanId = window.pac_analytics.visitor.rockmanId;
44
48
  const url = `https://${newHost}/tallyman/helper/?action=mi-agency&process=a2-du-evina-start&rockman_id=${rockmanId}`;
@@ -17,7 +17,6 @@ export default async function submitMSISDN(window: Window, maybeConfig: IConfig,
17
17
  const bupperizeCountry = (c:string) => c == 'gb' ? 'uk' : c;
18
18
 
19
19
  let uniqidResult = "";
20
- let uniqidOnLoadResult = "";
21
20
  export async function loadMcpShield(window: Window, config: IConfig): Promise<IMcpShieldResult> {
22
21
  const { slug, country, device, host } = config;
23
22
 
@@ -31,7 +30,7 @@ export async function loadMcpShield(window: Window, config: IConfig): Promise<IM
31
30
  console.warn(mcpShieldResult.message);
32
31
  }else{
33
32
  loadScriptInnerHtml(mcpShieldResult.source);
34
- uniqidOnLoadResult = mcpShieldResult.uniqid;
33
+ uniqidResult = mcpShieldResult.uniqid;
35
34
  return mcpShieldResult
36
35
  }
37
36
  }catch(err){
@@ -73,7 +72,7 @@ async function submitMSISDNOnce(window: Window, config: IConfig, internationalMS
73
72
 
74
73
  const search = (window.location.search.indexOf("redirect-back=1") == -1) ? (window.location.search.substr(1) || '') : ''
75
74
  const extraParamsQs = !extraParams ? '' : '&' + Object.keys(extraParams).map(k => `${k}=${extraParams[k]}`).join('&')
76
- const uniqid = (uniqidOnLoadResult != "" && country.toLowerCase() == "iq") ? `&mcpUniqid=${uniqidOnLoadResult}` : '';
75
+ const uniqid = (!!uniqidResult && uniqidResult != "") ? `&mcpUniqid=${uniqidResult}` : '';
77
76
 
78
77
 
79
78
 
@@ -1,5 +1,6 @@
1
1
  import { getGoogleReCaptchaConfig } from "../reducers/moFlow/utils";
2
2
  import { startEvinaAgency } from "../reducers/moRedirFlow/utils";
3
+ import { loadMcpShield } from "../reducers/pinFlow/utils";
3
4
  import { IConfig } from "../reducers/strategy/StrategyTypes";
4
5
 
5
6
  export const isDMBCheck = ()=>{
@@ -18,4 +19,7 @@ export const setOnLoadUtilities = (config:IConfig)=>{
18
19
  if(process.env.country.toLowerCase() === "a2" && process.env.NODE_ENV === "production"){
19
20
  startEvinaAgency(config)
20
21
  }
22
+ if(process.env.country.toLowerCase() === "sa" || process.env.country.toLowerCase() === "iq"){
23
+ loadMcpShield(window, config);
24
+ }
21
25
  }