@moengage/web-sdk 2.61.2 → 2.62.0

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 (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- const Moe={initialize:e=>{var o=e.app_id,d=e.debug_logs||0,n=e.cluster||"DC_1",a=e.project_id||null,i=e.disable_onsite||!1,s=e.enableSPA||!1,t=e.cards||null,r=e.disable_web_push||!1,g=e.swPath||"/serviceworker.js",l=e.swScope||null,M=e.disableCookies||!1,w=e.useLatest||!1,_=e.sdkVersion||"2.61.02",u=e.disableSdk||!1,c=e.proxyDomains||null,m=e.bots_list||[];try{t&&(t=JSON.stringify(t))}catch(e){console.log("Failed to parse cards config",e)}try{m=JSON.stringify(m)}catch(e){console.log("Failed to parse bots list config",e)}try{c&&(c=JSON.stringify(c))}catch(e){console.log("Failed to parse proxy domains config",e)}if("undefined"!=typeof window&&document&&!window.Moengage){var b=n.toLowerCase(),f=document.createElement("script"),p=_&&!w?`https://cdn.moengage.com/release/${b}/versions/${_}/moe_webSdk.min.latest.js`:`https://cdn.moengage.com/release/${b}/moe_webSdk.min.latest.js`;f.type="text/javascript",f.text=`!function(e,n,i,t,a,r,o,d){if(!"${b}"||"{DC}"==="${b}")return console.error("Data center has not been passed correctly. Please follow the SDK installation instruction carefully.");var s=e[a]=e[a]||[];if(s.invoked=0,s&&s.initialised>0||s.invoked>0)return console.error("MoEngage Web SDK initialised multiple times. Please integrate the Web SDK only once!"),!1;e.moengage_object=a;var l={},g=function n(i){return function(){for(var n=arguments.length,t=Array(n),a=0;a<n;a++)t[a]=arguments[a];(e.moengage_q=e.moengage_q||[]).push({f:i,a:t})}},u=["track_event","add_user_attribute","add_first_name","add_last_name","add_email","add_mobile","add_user_name","add_gender","add_birthday","destroy_session","add_unique_user_id","update_unique_user_id","moe_events","call_web_push","track","location_type_attribute","track_page_view","getSdkVersion","setDebugLevel","handle_page_change","identifyUser","getUserIdentities"],m={onsite:["getData","registerCallback","getSelfHandledOSM"]};for(var c in u)l[u[c]]=g(u[c]);for(var v in m)for(var f in m[v])null==l[v]&&(l[v]={}),l[v][m[v][f]]=g(v+"."+m[v][f]);r=n.createElement(i),o=n.getElementsByTagName("head")[0],r.async=1,r.src=t,o.appendChild(r),e.moe=e.moe||function(){return(s.invoked=s.invoked+1,s.invoked>1)?(console.error("MoEngage Web SDK initialised multiple times. Please integrate the Web SDK only once!"),!1):(d=arguments.length<=0?void 0:arguments[0],l)},r.addEventListener("load",function(){if(d)return e[a]=e.moe(d),(e[a]&&(e[a].initialised=e[a].initialised+1||1)),!0}),r.addEventListener("error",function(){return console.error("Moengage Web SDK loading failed."),!1})}(window,document,"script","${p}","Moengage");\n Moengage = moe({\n app_id: "${o}",\n debug_logs: ${d},\n swPath: "${g}",\n swScope: "${l}",\n cluster: "${n.toUpperCase()}",\n ${a?`project_id: "${a}",`:""}\n disableOnsite: ${i},\n disableCookies: ${M},\n disable_web_push: ${r},\n enableSPA: ${s},\n cards: ${t},\n disableSdk: ${u},\n proxyDomains: ${c},\n bots_list: ${m}\n });\n `,document.head.appendChild(f)}},isMoeLoaded:()=>{try{if("undefined"!=typeof window&&document&&window.Moengage)return!0}catch(e){return!1}return!1},track_event:(e,o)=>Moe.isMoeLoaded()&&window.Moengage.track_event(e,o),getSdkVersion:()=>Moe.isMoeLoaded()&&window.Moengage.getSdkVersion(),setDebugLevel:e=>Moe.isMoeLoaded()&&window.Moengage.setDebugLevel(e),add_unique_user_id:e=>Moe.isMoeLoaded()&&window.Moengage.add_unique_user_id(e),update_unique_user_id:e=>Moe.isMoeLoaded()&&window.Moengage.update_unique_user_id(e),identifyUser:e=>Moe.isMoeLoaded()&&window.Moengage.identifyUser(e),getUserIdentities:()=>Moe.isMoeLoaded()&&window.Moengage.getUserIdentities(),enableSdk:()=>Moe.isMoeLoaded()&&window.Moengage.enableSdk(),disableSdk:()=>Moe.isMoeLoaded()&&window.Moengage.disableSdk(),isSdkEnabled:()=>Moe.isMoeLoaded()&&window.Moengage.isSdkEnabled(),getUserId:()=>Moe.isMoeLoaded()&&window.Moengage.getUserId(),getUserAttribute:(e,o)=>Moe.isMoeLoaded()?o&&"string"==typeof o?window.Moengage.getUserAttribute(e,o):window.Moengage.getUserAttribute(e):null,add_user_attribute:(e,o,d)=>!!Moe.isMoeLoaded()&&(d&&"string"==typeof d?window.Moengage.add_user_attribute(e,o,d):window.Moengage.add_user_attribute(e,o)),add_first_name:e=>Moe.isMoeLoaded()&&window.Moengage.add_first_name(e),add_last_name:e=>Moe.isMoeLoaded()&&window.Moengage.add_last_name(e),add_email:e=>Moe.isMoeLoaded()&&window.Moengage.add_email(e),add_mobile:e=>Moe.isMoeLoaded()&&window.Moengage.add_mobile(e),add_user_name:e=>Moe.isMoeLoaded()&&window.Moengage.add_user_name(e),add_gender:e=>Moe.isMoeLoaded()&&window.Moengage.add_gender(e),add_birthday:e=>Moe.isMoeLoaded()&&window.Moengage.add_birthday(e),destroy_session:()=>Moe.isMoeLoaded()&&window.Moengage.destroy_session(),call_web_push:e=>Moe.isMoeLoaded()&&window.Moengage.call_web_push(e),track_page_view:()=>Moe.isMoeLoaded()&&window.Moengage.track_page_view(),handle_page_change:()=>Moe.isMoeLoaded()&&window.Moengage.handle_page_change(),on_cards_loaded:()=>new Promise((e,o)=>{"undefined"!=typeof window?window.Moengage.cards?(Moe.cards=window.Moengage.cards,e()):window.addEventListener("MOE_LIFECYCLE",o=>{"CARDS_INITIALIZED"===o.detail.name&&(Moe.cards=window.Moengage.cards,e())}):o()}),cards:"undefined"!=typeof window&&window.Moengage&&window.Moengage.cards||{},onsite:{getData:()=>Moe.isMoeLoaded()&&window.Moengage.onsite.getData(),registerCallback:e=>Moe.isMoeLoaded()&&window.Moengage.onsite.registerCallback(e),getSelfHandledOSM:e=>Moe.isMoeLoaded()&&window.Moengage.onsite.getSelfHandledOSM(e),selfHandledShown:e=>Moe.isMoeLoaded()&&window.Moengage.onsite.selfHandledShown(e),selfHandledClicked:e=>Moe.isMoeLoaded()&&window.Moengage.onsite.selfHandledClicked(e),selfHandledDismissed:e=>Moe.isMoeLoaded()&&window.Moengage.onsite.selfHandledDismissed(e)},Attribute:{USER_ATTRIBUTE_LEVEL:{PROJECT:"PROJECT",PORTFOLIO:"PORTFOLIO"}}};module.exports=Moe;
1
+ const Moe={initialize:e=>{var o=e.app_id,d=e.debug_logs||0,n=e.cluster||"DC_1",a=e.project_id||null,i=e.disable_onsite||!1,s=e.enableSPA||!1,t=e.cards||null,r=e.disable_web_push||!1,g=e.swPath||"/serviceworker.js",l=e.swScope||null,M=e.disableCookies||!1,w=e.useLatest||!1,_=e.sdkVersion||"2.62.00",u=e.disableSdk||!1,c=e.proxyDomains||null,m=e.bots_list||[];try{t&&(t=JSON.stringify(t))}catch(e){console.log("Failed to parse cards config",e)}try{m=JSON.stringify(m)}catch(e){console.log("Failed to parse bots list config",e)}try{c&&(c=JSON.stringify(c))}catch(e){console.log("Failed to parse proxy domains config",e)}if("undefined"!=typeof window&&document&&!window.Moengage){var b=n.toLowerCase(),f=document.createElement("script"),p=_&&!w?`https://cdn.moengage.com/release/${b}/versions/${_}/moe_webSdk.min.latest.js`:`https://cdn.moengage.com/release/${b}/moe_webSdk.min.latest.js`;f.type="text/javascript",f.text=`!function(e,n,i,t,a,r,o,d){if(!"${b}"||"{DC}"==="${b}")return console.error("Data center has not been passed correctly. Please follow the SDK installation instruction carefully.");var s=e[a]=e[a]||[];if(s.invoked=0,s&&s.initialised>0||s.invoked>0)return console.error("MoEngage Web SDK initialised multiple times. Please integrate the Web SDK only once!"),!1;e.moengage_object=a;var l={},g=function n(i){return function(){for(var n=arguments.length,t=Array(n),a=0;a<n;a++)t[a]=arguments[a];(e.moengage_q=e.moengage_q||[]).push({f:i,a:t})}},u=["track_event","add_user_attribute","add_first_name","add_last_name","add_email","add_mobile","add_user_name","add_gender","add_birthday","destroy_session","add_unique_user_id","update_unique_user_id","moe_events","call_web_push","track","location_type_attribute","track_page_view","getSdkVersion","setDebugLevel","handle_page_change","identifyUser","getUserIdentities"],m={onsite:["getData","registerCallback","getSelfHandledOSM"]};for(var c in u)l[u[c]]=g(u[c]);for(var v in m)for(var f in m[v])null==l[v]&&(l[v]={}),l[v][m[v][f]]=g(v+"."+m[v][f]);r=n.createElement(i),o=n.getElementsByTagName("head")[0],r.async=1,r.src=t,o.appendChild(r),e.moe=e.moe||function(){return(s.invoked=s.invoked+1,s.invoked>1)?(console.error("MoEngage Web SDK initialised multiple times. Please integrate the Web SDK only once!"),!1):(d=arguments.length<=0?void 0:arguments[0],l)},r.addEventListener("load",function(){if(d)return e[a]=e.moe(d),(e[a]&&(e[a].initialised=e[a].initialised+1||1)),!0}),r.addEventListener("error",function(){return console.error("Moengage Web SDK loading failed."),!1})}(window,document,"script","${p}","Moengage");\n Moengage = moe({\n app_id: "${o}",\n debug_logs: ${d},\n swPath: "${g}",\n swScope: "${l}",\n cluster: "${n.toUpperCase()}",\n ${a?`project_id: "${a}",`:""}\n disableOnsite: ${i},\n disableCookies: ${M},\n disable_web_push: ${r},\n enableSPA: ${s},\n cards: ${t},\n disableSdk: ${u},\n proxyDomains: ${c},\n bots_list: ${m}\n });\n `,document.head.appendChild(f)}},isMoeLoaded:()=>{try{if("undefined"!=typeof window&&document&&window.Moengage)return!0}catch(e){return!1}return!1},track_event:(e,o)=>Moe.isMoeLoaded()&&window.Moengage.track_event(e,o),getSdkVersion:()=>Moe.isMoeLoaded()&&window.Moengage.getSdkVersion(),setDebugLevel:e=>Moe.isMoeLoaded()&&window.Moengage.setDebugLevel(e),add_unique_user_id:e=>Moe.isMoeLoaded()&&window.Moengage.add_unique_user_id(e),update_unique_user_id:e=>Moe.isMoeLoaded()&&window.Moengage.update_unique_user_id(e),identifyUser:e=>Moe.isMoeLoaded()&&window.Moengage.identifyUser(e),getUserIdentities:()=>Moe.isMoeLoaded()&&window.Moengage.getUserIdentities(),enableSdk:()=>Moe.isMoeLoaded()&&window.Moengage.enableSdk(),disableSdk:()=>Moe.isMoeLoaded()&&window.Moengage.disableSdk(),isSdkEnabled:()=>Moe.isMoeLoaded()&&window.Moengage.isSdkEnabled(),getUserId:()=>Moe.isMoeLoaded()&&window.Moengage.getUserId(),getUserAttribute:(e,o)=>Moe.isMoeLoaded()?o&&"string"==typeof o?window.Moengage.getUserAttribute(e,o):window.Moengage.getUserAttribute(e):null,add_user_attribute:(e,o,d)=>!!Moe.isMoeLoaded()&&(d&&"string"==typeof d?window.Moengage.add_user_attribute(e,o,d):window.Moengage.add_user_attribute(e,o)),add_first_name:e=>Moe.isMoeLoaded()&&window.Moengage.add_first_name(e),add_last_name:e=>Moe.isMoeLoaded()&&window.Moengage.add_last_name(e),add_email:e=>Moe.isMoeLoaded()&&window.Moengage.add_email(e),add_mobile:e=>Moe.isMoeLoaded()&&window.Moengage.add_mobile(e),add_user_name:e=>Moe.isMoeLoaded()&&window.Moengage.add_user_name(e),add_gender:e=>Moe.isMoeLoaded()&&window.Moengage.add_gender(e),add_birthday:e=>Moe.isMoeLoaded()&&window.Moengage.add_birthday(e),destroy_session:()=>Moe.isMoeLoaded()&&window.Moengage.destroy_session(),call_web_push:e=>Moe.isMoeLoaded()&&window.Moengage.call_web_push(e),track_page_view:()=>Moe.isMoeLoaded()&&window.Moengage.track_page_view(),handle_page_change:()=>Moe.isMoeLoaded()&&window.Moengage.handle_page_change(),on_cards_loaded:()=>new Promise((e,o)=>{"undefined"!=typeof window?window.Moengage.cards?(Moe.cards=window.Moengage.cards,e()):window.addEventListener("MOE_LIFECYCLE",o=>{"CARDS_INITIALIZED"===o.detail.name&&(Moe.cards=window.Moengage.cards,e())}):o()}),cards:"undefined"!=typeof window&&window.Moengage&&window.Moengage.cards||{},onsite:{getData:()=>Moe.isMoeLoaded()&&window.Moengage.onsite.getData(),registerCallback:e=>Moe.isMoeLoaded()&&window.Moengage.onsite.registerCallback(e),getSelfHandledOSM:e=>Moe.isMoeLoaded()&&window.Moengage.onsite.getSelfHandledOSM(e),selfHandledShown:e=>Moe.isMoeLoaded()&&window.Moengage.onsite.selfHandledShown(e),selfHandledClicked:e=>Moe.isMoeLoaded()&&window.Moengage.onsite.selfHandledClicked(e),selfHandledDismissed:e=>Moe.isMoeLoaded()&&window.Moengage.onsite.selfHandledDismissed(e)},Attribute:{USER_ATTRIBUTE_LEVEL:{PROJECT:"PROJECT",PORTFOLIO:"PORTFOLIO"}}};module.exports=Moe;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moengage/web-sdk",
3
- "version": "2.61.02",
3
+ "version": "2.62.00",
4
4
  "description": "Moengage Web SDK package",
5
5
  "main": "dist/index.js",
6
6
  "keywords": [