ouisys-engine 5.0.139 → 5.0.140

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/initTPay.js CHANGED
@@ -1,2 +1,2 @@
1
- import{__awaiter as o,__generator as i}from"tslib";import{i as n}from"./api-geirVksI.js";import{getConfig as d}from"./getConfig.js";var r=function(r){return o(void 0,void 0,void 0,(function(){var o,e,l,t,a,v,u,w,c,s,p,f,m,g,y,_,C,h,x,S,b,k;return i(this,(function(i){switch(i.label){case 0:if(o=null===(w=null===(u=null===window||void 0===window?void 0:window.pac_analytics)||void 0===u?void 0:u.visitor)||void 0===w?void 0:w.genericJsLinkResult,"undefined"==typeof window||"tpay"!==(null==o?void 0:o.gateway))return[3,5];e=d(),l=e.strategyConfigs,t=null===(c=null==l?void 0:l.default)||void 0===c?void 0:c.flowConfig,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n({window:window,slug:null==t?void 0:t.slug,country:null==t?void 0:t.country,msisdn:r,device:"smart",offer:null===(p=null===(s=null===window||void 0===window?void 0:window.pac_analytics)||void 0===s?void 0:s.visitor)||void 0===p?void 0:p.offer,rockmanId:null===(m=null===(f=null===window||void 0===window?void 0:window.pac_analytics)||void 0===f?void 0:f.visitor)||void 0===m?void 0:m.rockmanId})];case 2:return(a=i.sent()).operator&&(window.operatorCode=null===(C=null===(_=null===(y=null===(g=null==o?void 0:o.extra_data)||void 0===g?void 0:g.operator_mccmnc_mapping)||void 0===y?void 0:y[a.operator])||void 0===_?void 0:_.code)||void 0===C?void 0:C.toString(),window.operatorSuffix=null===(S=null===(x=null===(h=null==o?void 0:o.extra_data)||void 0===h?void 0:h.operator_mccmnc_mapping)||void 0===x?void 0:x[a.operator])||void 0===S?void 0:S.operator_suffix),console.log("operatorCode",window.operatorCode),console.log("operatorSuffix",window.operatorSuffix),(null===(b=window.TPay.HeaderEnrichment)||void 0===b?void 0:b.enriched())?null===(k=window.TPay.HeaderEnrichment)||void 0===k||k.operatorCode():window.TPay.HeaderEnrichment.init({operatorCode:window.operatorCode}),[2,!0];case 3:return v=i.sent(),console.warn(v),[2,!1];case 4:return[3,6];case 5:return console.log("Not tpay"),[2,!1];case 6:return[2]}}))}))};export{r as initTPay};
1
+ import{__awaiter as o,__generator as i}from"tslib";import{i as n}from"./api-geirVksI.js";import{getConfig as d}from"./getConfig.js";var r=function(r){return o(void 0,void 0,void 0,(function(){var o,e,l,t,a,v,u,w,c,s,p,f,m,g,y,_,C,h,x,S,b,j,k,E;return i(this,(function(i){switch(i.label){case 0:if(o=null===(c=null===(w=null===window||void 0===window?void 0:window.pac_analytics)||void 0===w?void 0:w.visitor)||void 0===c?void 0:c.genericJsLinkResult,"undefined"==typeof window||"tpay"!==(null==o?void 0:o.gateway))return[3,5];e=d(),l=e.strategyConfigs,t=null===(s=null==l?void 0:l.default)||void 0===s?void 0:s.flowConfig,i.label=1;case 1:return i.trys.push([1,3,,4]),a=null===(p=null==r?void 0:r.match(/\d+/gi))||void 0===p?void 0:p.join(""),[4,n({window:window,slug:null==t?void 0:t.slug,country:null==t?void 0:t.country,msisdn:a,device:"smart",offer:null===(m=null===(f=null===window||void 0===window?void 0:window.pac_analytics)||void 0===f?void 0:f.visitor)||void 0===m?void 0:m.offer,rockmanId:null===(y=null===(g=null===window||void 0===window?void 0:window.pac_analytics)||void 0===g?void 0:g.visitor)||void 0===y?void 0:y.rockmanId})];case 2:return(v=i.sent()).operator&&(window.operatorCode=null===(x=null===(h=null===(C=null===(_=null==o?void 0:o.extra_data)||void 0===_?void 0:_.operator_mccmnc_mapping)||void 0===C?void 0:C[v.operator])||void 0===h?void 0:h.code)||void 0===x?void 0:x.toString(),window.operatorSuffix=null===(j=null===(b=null===(S=null==o?void 0:o.extra_data)||void 0===S?void 0:S.operator_mccmnc_mapping)||void 0===b?void 0:b[v.operator])||void 0===j?void 0:j.operator_suffix),console.log("operatorCode",window.operatorCode),console.log("operatorSuffix",window.operatorSuffix),(null===(k=window.TPay.HeaderEnrichment)||void 0===k?void 0:k.enriched())?null===(E=window.TPay.HeaderEnrichment)||void 0===E||E.operatorCode():window.TPay.HeaderEnrichment.init({operatorCode:window.operatorCode}),[2,!0];case 3:return u=i.sent(),console.warn(u),[2,!1];case 4:return[3,6];case 5:return console.log("Not tpay"),[2,!1];case 6:return[2]}}))}))};export{r as initTPay};
2
2
  //# sourceMappingURL=initTPay.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"initTPay.js","sources":["../src/utilities/initTpay.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport { identify } from '../flows/strategy/api';\nimport { getConfig } from './getConfig';\n\nexport const initTPay = async (msisdn: string): Promise<boolean> => {\n const jsLinkResult = window?.pac_analytics?.visitor?.genericJsLinkResult;\n\n if (typeof window !== 'undefined' && jsLinkResult?.gateway === 'tpay') {\n const configs = getConfig();\n const { strategyConfigs } = configs;\n const config = strategyConfigs?.default?.flowConfig;\n\n try {\n const identifyResult = await identify({\n window,\n slug: config?.slug,\n country: config?.country,\n msisdn,\n device: 'smart',\n offer: window?.pac_analytics?.visitor?.offer,\n rockmanId: window?.pac_analytics?.visitor?.rockmanId\n });\n\n if (identifyResult.operator) {\n window.operatorCode = jsLinkResult?.extra_data?.operator_mccmnc_mapping?.[\n identifyResult.operator\n ]?.code?.toString();\n window.operatorSuffix =\n jsLinkResult?.extra_data?.operator_mccmnc_mapping?.[identifyResult.operator]?.operator_suffix;\n }\n console.log('operatorCode', window.operatorCode);\n console.log('operatorSuffix', window.operatorSuffix);\n\n if (!window.TPay.HeaderEnrichment?.enriched()) {\n window.TPay.HeaderEnrichment.init({ operatorCode: window.operatorCode });\n } else {\n window.TPay.HeaderEnrichment?.operatorCode();\n }\n return true;\n } catch (err) {\n console.warn(err);\n return false;\n }\n } else {\n console.log('Not tpay');\n return false;\n }\n};\n"],"names":["initTPay","msisdn","__awaiter","jsLinkResult","_b","_a","window","pac_analytics","visitor","genericJsLinkResult","gateway","configs","getConfig","strategyConfigs","config","_c","default","flowConfig","identify","slug","country","device","offer","_e","_d","rockmanId","_g","_f","identifyResult","_s","sent","operator","operatorCode","_l","_k","_j","_h","extra_data","operator_mccmnc_mapping","code","toString","operatorSuffix","_p","_m","operator_suffix","console","log","_q","TPay","HeaderEnrichment","enriched","_r","init","warn","err_1"],"mappings":"oIAIO,IAAMA,EAAW,SAAOC,GAAc,OAAAC,OAAA,OAAA,OAAA,GAAA,6GAGvC,GAFEC,EAA6C,QAA9BC,EAAqB,QAArBC,SAAAC,aAAM,IAANA,YAAM,EAANA,OAAQC,qBAAa,IAAAF,OAAA,EAAAA,EAAEG,eAAO,IAAAJ,OAAA,EAAAA,EAAEK,oBAE/B,oBAAXH,QAAoD,UAA1BH,aAAY,EAAZA,EAAcO,SAA/C,MAAiE,CAAA,EAAA,GAC7DC,EAAUC,IACRC,EAAoBF,EAAOE,gBAC7BC,EAAmC,QAA1BC,EAAAF,aAAA,EAAAA,EAAiBG,eAAS,IAAAD,OAAA,EAAAA,EAAAE,4BAGhB,6BAAA,CAAA,EAAMC,EAAS,CACpCZ,OAAMA,OACNa,KAAML,aAAA,EAAAA,EAAQK,KACdC,QAASN,aAAA,EAAAA,EAAQM,QACjBnB,OAAMA,EACNoB,OAAQ,QACRC,cAAOC,EAAuB,QAAvBC,EAAA,OAAAlB,aAAA,IAAAA,YAAA,EAAAA,OAAQC,qBAAe,IAAAiB,OAAA,EAAAA,EAAAhB,8BAASc,MACvCG,kBAAWC,EAAuB,QAAvBC,EAAA,OAAArB,aAAA,IAAAA,YAAA,EAAAA,OAAQC,qBAAe,IAAAoB,OAAA,EAAAA,EAAAnB,8BAASiB,oBAkB7C,OAzBMG,EAAiBC,EAQrBC,QAEiBC,WACjBzB,OAAO0B,aAEA,QAFeC,EAErB,QAFqBC,EACpB,QADoBC,EAA0B,QAA1BC,EAAAjC,aAAY,EAAZA,EAAckC,kBAAY,IAAAD,OAAA,EAAAA,EAAAE,+BAC9C,IAAAH,OAAA,EAAAA,EAAAP,EAAeG,iBAChB,IAAAG,OAAA,EAAAA,EAAEK,YAAI,IAAAN,OAAA,EAAAA,EAAEO,WACTlC,OAAOmC,eACuE,QAA5EC,YAA0B,QAA1BC,EAAAxC,aAAY,EAAZA,EAAckC,kBAAY,IAAAM,OAAA,EAAAA,EAAAL,8CAA0BV,EAAeG,iBAAS,IAAAW,OAAA,EAAAA,EAAEE,iBAElFC,QAAQC,IAAI,eAAgBxC,OAAO0B,cACnCa,QAAQC,IAAI,iBAAkBxC,OAAOmC,iBAEF,QAA9BM,EAAAzC,OAAO0C,KAAKC,wBAAkB,IAAAF,OAAA,EAAAA,EAAAG,YAGH,QAA9BC,EAAA7C,OAAO0C,KAAKC,wBAAkB,IAAAE,GAAAA,EAAAnB,eAF9B1B,OAAO0C,KAAKC,iBAAiBG,KAAK,CAAEpB,aAAc1B,OAAO0B,eAI3D,CAAA,GAAO,UAGP,kBADAa,QAAQQ,KAAKC,GACb,CAAA,GAAO,6BAIT,OADAT,QAAQC,IAAI,YACZ,CAAA,GAAO"}
1
+ {"version":3,"file":"initTPay.js","sources":["../src/utilities/initTpay.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport { identify } from '../flows/strategy/api';\nimport { getConfig } from './getConfig';\n\nexport const initTPay = async (internationalNumber: string): Promise<boolean> => {\n const jsLinkResult = window?.pac_analytics?.visitor?.genericJsLinkResult;\n\n if (typeof window !== 'undefined' && jsLinkResult?.gateway === 'tpay') {\n const configs = getConfig();\n const { strategyConfigs } = configs;\n const config = strategyConfigs?.default?.flowConfig;\n\n try {\n const intlPhone = internationalNumber?.match(/\\d+/gi)?.join('');\n const identifyResult = await identify({\n window,\n slug: config?.slug,\n country: config?.country,\n msisdn: intlPhone,\n device: 'smart',\n offer: window?.pac_analytics?.visitor?.offer,\n rockmanId: window?.pac_analytics?.visitor?.rockmanId\n });\n\n if (identifyResult.operator) {\n window.operatorCode = jsLinkResult?.extra_data?.operator_mccmnc_mapping?.[\n identifyResult.operator\n ]?.code?.toString();\n window.operatorSuffix =\n jsLinkResult?.extra_data?.operator_mccmnc_mapping?.[identifyResult.operator]?.operator_suffix;\n }\n console.log('operatorCode', window.operatorCode);\n console.log('operatorSuffix', window.operatorSuffix);\n\n if (!window.TPay.HeaderEnrichment?.enriched()) {\n window.TPay.HeaderEnrichment.init({ operatorCode: window.operatorCode });\n } else {\n window.TPay.HeaderEnrichment?.operatorCode();\n }\n return true;\n } catch (err) {\n console.warn(err);\n return false;\n }\n } else {\n console.log('Not tpay');\n return false;\n }\n};\n"],"names":["initTPay","internationalNumber","__awaiter","jsLinkResult","_b","_a","window","pac_analytics","visitor","genericJsLinkResult","gateway","configs","getConfig","strategyConfigs","config","_c","default","flowConfig","intlPhone","_d","match","join","identify","slug","country","msisdn","device","offer","_f","_e","rockmanId","_h","_g","identifyResult","_t","sent","operator","operatorCode","_m","_l","_k","_j","extra_data","operator_mccmnc_mapping","code","toString","operatorSuffix","_q","_o","operator_suffix","console","log","_r","TPay","HeaderEnrichment","enriched","_s","init","warn","err_1"],"mappings":"oIAIO,IAAMA,EAAW,SAAOC,GAA2B,OAAAC,OAAA,OAAA,OAAA,GAAA,iHAGpD,GAFEC,EAA6C,QAA9BC,EAAqB,QAArBC,SAAAC,aAAM,IAANA,YAAM,EAANA,OAAQC,qBAAa,IAAAF,OAAA,EAAAA,EAAEG,eAAO,IAAAJ,OAAA,EAAAA,EAAEK,oBAE/B,oBAAXH,QAAoD,UAA1BH,aAAY,EAAZA,EAAcO,SAA/C,MAAiE,CAAA,EAAA,GAC7DC,EAAUC,IACRC,EAAoBF,EAAOE,gBAC7BC,EAAmC,QAA1BC,EAAAF,aAAA,EAAAA,EAAiBG,eAAS,IAAAD,OAAA,EAAAA,EAAAE,4BAIhB,6BADjBC,EAA+C,QAAnCC,EAAAlB,eAAAA,EAAqBmB,MAAM,gBAAQ,IAAAD,OAAA,EAAAA,EAAEE,KAAK,IACrC,CAAA,EAAMC,EAAS,CACpChB,OAAMA,OACNiB,KAAMT,aAAA,EAAAA,EAAQS,KACdC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(internationalNumber: string) => Promise<boolean>;
2
2
 
3
3
  export { initTPay };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ouisys-engine",
3
- "version": "5.0.139",
3
+ "version": "5.0.140",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "directories": "dist dev-tools",