New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@extscreen/es-protocal-dialog

Package Overview
Dependencies
Maintainers
0
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@extscreen/es-protocal-dialog - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

2

dist/index.js

@@ -1,1 +0,1 @@

import{ESDevelopManager as e,ESDeviceManager as t,ESManager as a,ESLaunchManager as i}from"@extscreen/es-core";import{RuntimeDeviceManager as s,ESRuntimeUserPrivacy as n}from"@extscreen/es-runtime";const o="https://api.extscreen.com/extscreenapi",r={"content-type":"application/json"},c=e.getChannel().toUpperCase();const h=function(){let e=t.getDeviceEthMac(),a=t.getDeviceEthMac();e||(e=t.getDeviceWifiMac());let i=t.getDeviceWifiMac();return e=e.replace(/:/g,"").toLowerCase(),a&&(a=a.replace(/:/g,"").toLowerCase()),i&&(i=i.replace(/:/g,"").toLowerCase()),{brand:t.getBuildBrand(),clientType:s.getDeviceType(),dnum:s.getDeviceId(),mac:e,esMac:a,esWifiMac:i,manufacturer:t.getBuildManufacturer(),model:t.getBuildModel(),deviceVersion:t.getBuildVersionRelease()}}(),m={sdkVersion:a.getESSDKVersionName(),sdkCID:a.getESSDKCid(),sdkVersionCode:a.getESSDKVersionCode(),runtimeID:"",hostPackageName:e.getPackageName(),hostVersion:e.getVersionName(),hostChannel:c,snCode:""},g={apikey:e.getAppKey(),secretkey:e.getAppSecretKey(),packagename:"",vercode:e.getVersionCode(),vername:e.getVersionName(),bcCode:""};function l(e,t,a){return g.bcCode=a,fetch(e+"/api/v1/zero/user/agreementUpdate/getUpdate",{method:"POST",headers:r,body:JSON.stringify({developer:g,param:{packageName:t,channelCode:c},runtime:m})}).then((e=>e.json()))}function p(e,t,a,i){return g.packagename=t,fetch(e+"/api/v2/zero/event/track",{method:"POST",headers:r,body:JSON.stringify({developer:g,device:h,action:a,data:i})}).then((e=>e.json()))}var d=new class{launchNativePageIntent(e){i.launchNativePage(e)}finishActivity(){i.finishESPage()}},u={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return e.showDialog||e.showUpdate?a("dialog",{on:{requestClose:e.onClose}},[a("div",{staticClass:"protocol_dialog_root",attrs:{gradientBackground:{colors:["#0F1619","#2C2D2D"],orientation:0,cornerRadius:0}}},[a("div",{staticClass:"notice_block",attrs:{gradientBackground:{colors:["#252930","#2F3541"],orientation:0,cornerRadius:6}}},[a("span",{staticClass:"span_title",attrs:{focusable:!1}},[e._v(e._s(e.noticeTitle))]),e._v(" "),a("span",{staticClass:"span_content",style:{textAlign:e.showUpdate?"center":"left"},attrs:{focusable:!1}},[e._v(e._s(e.noticeContent))]),e._v(" "),a("span",{staticClass:"span_tip",attrs:{focusable:!1}},[e._v(e._s(e.noticeTip))]),e._v(" "),a("div",{staticClass:"notice_link",staticStyle:{"margin-bottom":"30px"}},e._l(e.noticeLink,(function(t,i){return a("div",{key:t.name,staticClass:"single_link",attrs:{focusable:!0,clipChildren:!1},on:{click:function(t){return e.read(i)}}},[a("span",{staticClass:"span_link_left"},[e._v("《")]),e._v(" "),a("span",{staticClass:"span_link",attrs:{duplicateParentState:!0}},[e._v(e._s(t.name))]),e._v(" "),a("span",{staticClass:"span_link_right"},[e._v("》")])])})),0),e._v(" "),a("span",{staticClass:"filing",attrs:{focusable:!1}},[e._v(e._s(e.filingNumber))])]),e._v(" "),a("div",{staticClass:"confirm_btn",attrs:{duplicateParentState:!0}},e._l(e.noticeConfirm,(function(t,i){return a("div",{key:t.name,staticClass:"span_confirm",attrs:{focusable:!0,clipChildren:!1},on:{click:function(t){return e.confirm(i)}}},[a("span",{staticClass:"txt",attrs:{duplicateParentState:!0,focusable:!1}},[e._v(e._s(t.name))])])})),0)])]):e._e()},staticRenderFns:[],name:"es-protocol-dialog",props:{packageName:{type:String,default:""},hidden:{type:Boolean,default:!1},domain:{type:String,default:o},appName:{type:String,default:""},bcCode:{type:String,default:""},initFinish:{type:Boolean,default:!1},webViewRouter:{type:String,default:"load_web_view"}},data:()=>({TAG:"ProtocolDialog",agreementConfig:{title:"",message:"",payMessage:"",privacyAgreement:{name:"",url:""},userAgreement:{name:"",url:""},bcMessage:""},agreementUpdate:{title:"",content:"",version:0,updateList:[]},showDialog:!1,showUpdate:!1,noticeConfirm:[{name:"同意",value:"1"},{name:"不同意并退出",value:"2"}]}),created(){},watch:{initFinish(e){e&&this.checkShowAgreement()}},computed:{keyIsShowAgreement(){return`${e.getPackageName()}_${this.packageName}_xieyi`},keyIsCheckDate(){return`${e.getPackageName()}_${this.packageName}_date`},keyIsShowUpdate(){return`${e.getPackageName()}_${this.packageName}_update`},noticeTitle(){return this.showDialog?this.agreementConfig.title||"温馨提示":this.showUpdate?this.agreementUpdate.title||"协议变更通知":""},noticeContent(){return this.showDialog?this.agreementConfig.message||`亲爱的用户, 在您使用${this.appName}前请阅读《${this.appName}隐私政策》和《${this.appName}用户协议》经过您同意后, 我们才能向您提供相关服务哦~`:this.showUpdate?this.agreementUpdate.content||"我们已更新协议,详细内容请参阅最新":""},noticeTip(){return this.showDialog?this.agreementConfig.payMessage:""},noticeLink(){if(this.showDialog){const e=`${o}/api/v1/zero/user/agreement/indexNew?name=${this.packageName}&bcCode=${this.bcCode}&default=privacy_agreement`,t=`${o}/api/v1/zero/user/agreement/indexNew?name=${this.packageName}&bcCode=${this.bcCode}&default=user_agreement`;return[{name:this.agreementConfig.privacyAgreement.name||`${this.appName}隐私政策`,value:"2",link:this.agreementConfig.privacyAgreement.url||e},{name:this.agreementConfig.userAgreement.name||`${this.appName}用户协议`,value:"1",link:this.agreementConfig.userAgreement.url||t}]}return this.showUpdate?this.agreementUpdate.updateList?.map((e=>({name:e.name,link:e.url}))):[]},filingNumber(){return this.agreementConfig.bcMessage||""},pageName(){return this.showUpdate?"协议更新弹窗":this.showDialog?"协议弹窗":""},realDomain(){return this.domain?this.domain:o}},methods:{checkShowAgreement(){this.removeShowAgreement(),this.packageName&&!this.hidden&&n.isShowPolicy(this.packageName).then((e=>{e&&e.data?this.checkShowUpdate():localStorage.getItem(this.keyIsShowAgreement).then((e=>{var t,a,i;e&&"1"===e?this.checkShowUpdate():(t=this.realDomain,a=this.packageName,i=this.bcCode,g.bcCode=i,fetch(t+"/api/v2/zero/user/agreement/getAppConfig",{method:"POST",headers:r,body:JSON.stringify({developer:g,data:{pkgName:a,channelCode:c},runtime:m})}).then((e=>e.json()))).then((e=>{0===e.code&&e.data&&(this.agreementConfig=e.data,this.showDialog=!0,this.saveShowAgreement(),l(this.realDomain,this.packageName,this.bcCode).then((e=>{0===e.code&&e.data&&(this.agreementUpdate=e.data,this.saveShowUpdate(this.agreementUpdate.version))})))}))}))}))},checkShowUpdate(){const e=(new Date).Format("yyyy-MM-dd");localStorage.getItem(this.keyIsCheckDate).then((t=>{t&&t===e||l(this.realDomain,this.packageName,this.bcCode).then((e=>{0===e.code&&e.data&&(this.agreementUpdate=e.data,localStorage.getItem(this.keyIsShowUpdate).then((e=>{e&&`${this.agreementUpdate.version}`===e||(this.showUpdate=!0,this.saveShowUpdate(this.agreementUpdate.version))})))}))}))},saveShowUpdate(e){const t=(new Date).Format("yyyy-MM-dd");localStorage.setItem(this.keyIsCheckDate,t),localStorage.setItem(this.keyIsShowUpdate,e)},removeShowUpdate(){localStorage.setItem(this.keyIsCheckDate,""),localStorage.setItem(this.keyIsShowUpdate,"")},saveShowAgreement(){localStorage.setItem(this.keyIsShowAgreement,"1")},removeShowAgreement(){localStorage.setItem(this.keyIsShowAgreement,"0")},onClose(e){e.stopPropagation()},dismiss(){this.showDialog=!1},read(e){let t;switch(e){case 0:t={html:this.noticeLink[0].link},p(this.realDomain,this.packageName,"common_click",{id:"PRIVACY_BUTTON",name:"隐私政策按钮",page_id:"AGREEMENT_DIALOG",page_name:this.pageName});break;case 1:t={html:this.noticeLink[1].link},p(this.realDomain,this.packageName,"common_click",{id:"USER_AGREEMENT_BUTTON",name:"用户协议按钮",page_id:"AGREEMENT_DIALOG",page_name:this.pageName})}d.launchNativePageIntent({packageName:this.packageName,url:this.webViewRouter,params:t,splash:-1})},confirm(e){switch(e){case 0:try{p(this.realDomain,this.packageName,"common_click",{id:"AGREE_BUTTON",name:"同意按钮",page_id:"AGREEMENT_DIALOG",page_name:this.pageName}),this.$emit("onAgreeClick"),this.dismiss()}catch(e){}break;case 1:try{p(this.realDomain,this.packageName,"common_click",{id:"DISAGREE_BUTTON",name:"不同意按钮",page_id:"AGREEMENT_DIALOG",page_name:this.pageName}),this.showDialog?this.removeShowAgreement():this.showUpdate&&this.removeShowUpdate(),this.dismiss(),setTimeout((()=>{d.finishActivity()}),500)}catch(e){}}}},beforeDestroy(){},mounted(){},install:e=>{e.component(u.name,u)}};export{u as EsProtocolDialog};
import{ESDevelopManager as e,ESDeviceManager as t,ESManager as a,ESLaunchManager as i}from"@extscreen/es-core";import{RuntimeDeviceManager as s,ESRuntimeUserPrivacy as n}from"@extscreen/es-runtime";const o="https://api.extscreen.com/extscreenapi",r={"content-type":"application/json"},c=e.getChannel().toUpperCase();const h=function(){let e=t.getDeviceEthMac(),a=t.getDeviceEthMac();e||(e=t.getDeviceWifiMac());let i=t.getDeviceWifiMac();return e=e.replace(/:/g,"").toLowerCase(),a&&(a=a.replace(/:/g,"").toLowerCase()),i&&(i=i.replace(/:/g,"").toLowerCase()),{brand:t.getBuildBrand(),clientType:s.getDeviceType(),dnum:s.getDeviceId(),mac:e,esMac:a,esWifiMac:i,manufacturer:t.getBuildManufacturer(),model:t.getBuildModel(),deviceVersion:t.getBuildVersionRelease()}}(),m={sdkVersion:a.getESSDKVersionName(),sdkCID:a.getESSDKCid(),sdkVersionCode:a.getESSDKVersionCode(),runtimeID:"",hostPackageName:e.getPackageName(),hostVersion:e.getVersionName(),hostChannel:c,snCode:""},g={apikey:e.getAppKey(),secretkey:e.getAppSecretKey(),packagename:"",vercode:e.getVersionCode(),vername:e.getVersionName(),bcCode:""};function l(e,t,a){return g.bcCode=a,fetch(e+"/api/v1/zero/user/agreementUpdate/getUpdate",{method:"POST",headers:r,body:JSON.stringify({developer:g,param:{packageName:t,channelCode:c},runtime:m})}).then((e=>e.json()))}function p(e,t,a,i){return g.packagename=t,fetch(e+"/api/v2/zero/event/track",{method:"POST",headers:r,body:JSON.stringify({developer:g,device:h,action:a,data:i})}).then((e=>e.json()))}var d=new class{launchNativePageIntent(e){i.launchNativePage(e)}finishActivity(){i.finishESPage()}},u={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return e.showDialog||e.showUpdate?a("dialog",{on:{requestClose:e.onClose}},[a("div",{staticClass:"protocol_dialog_root",attrs:{gradientBackground:{colors:["#0F1619","#2C2D2D"],orientation:0,cornerRadius:0}}},[a("div",{staticClass:"notice_block",attrs:{gradientBackground:{colors:["#252930","#2F3541"],orientation:0,cornerRadius:6}}},[a("span",{staticClass:"span_title",attrs:{focusable:!1}},[e._v(e._s(e.noticeTitle))]),e._v(" "),a("span",{staticClass:"span_content",style:{textAlign:e.showUpdate?"center":"left"},attrs:{focusable:!1}},[e._v(e._s(e.noticeContent))]),e._v(" "),a("span",{staticClass:"span_tip",attrs:{focusable:!1}},[e._v(e._s(e.noticeTip))]),e._v(" "),a("div",{staticClass:"notice_link",staticStyle:{"margin-bottom":"30px"}},e._l(e.noticeLink,(function(t,i){return a("div",{key:t.name,staticClass:"single_link",attrs:{focusable:!0,clipChildren:!1},on:{click:function(t){return e.read(i)}}},[a("span",{staticClass:"span_link_left"},[e._v("《")]),e._v(" "),a("span",{staticClass:"span_link",attrs:{duplicateParentState:!0}},[e._v(e._s(t.name))]),e._v(" "),a("span",{staticClass:"span_link_right"},[e._v("》")])])})),0),e._v(" "),a("span",{staticClass:"filing",attrs:{focusable:!1}},[e._v(e._s(e.filingNumber))])]),e._v(" "),a("div",{staticClass:"confirm_btn",attrs:{duplicateParentState:!0}},e._l(e.noticeConfirm,(function(t,i){return a("div",{key:t.name,staticClass:"span_confirm",attrs:{focusable:!0,clipChildren:!1},on:{click:function(t){return e.confirm(i)}}},[a("span",{staticClass:"txt",attrs:{duplicateParentState:!0,focusable:!1}},[e._v(e._s(t.name))])])})),0)])]):e._e()},staticRenderFns:[],name:"es-protocol-dialog",props:{packageName:{type:String,default:""},hidden:{type:Boolean,default:!1},domain:{type:String,default:o},appName:{type:String,default:""},bcCode:{type:String,default:""},initFinish:{type:Boolean,default:!1},webViewRouter:{type:String,default:"load_web_view"}},data:()=>({TAG:"ProtocolDialog",agreementConfig:{title:"",message:"",payMessage:"",privacyAgreement:{name:"",url:""},userAgreement:{name:"",url:""},bcMessage:""},agreementUpdate:{title:"",content:"",version:0,updateList:[]},showDialog:!1,showUpdate:!1,noticeConfirm:[{name:"同意",value:"1"},{name:"不同意并退出",value:"2"}]}),created(){},watch:{initFinish(e){e&&this.checkShowAgreement()}},computed:{keyIsShowAgreement(){return`${e.getPackageName()}_${this.packageName}_xieyi`},keyIsCheckDate(){return`${e.getPackageName()}_${this.packageName}_date`},keyIsShowUpdate(){return`${e.getPackageName()}_${this.packageName}_update`},noticeTitle(){return this.showDialog?this.agreementConfig.title||"温馨提示":this.showUpdate?this.agreementUpdate.title||"协议变更通知":""},noticeContent(){return this.showDialog?this.agreementConfig.message||`亲爱的用户, 在您使用${this.appName}前请阅读《${this.appName}隐私政策》和《${this.appName}用户协议》经过您同意后, 我们才能向您提供相关服务哦~`:this.showUpdate?this.agreementUpdate.content||"我们已更新协议,详细内容请参阅最新":""},noticeTip(){return this.showDialog?this.agreementConfig.payMessage:""},noticeLink(){if(this.showDialog){const e=`${o}/api/v1/zero/user/agreement/indexNew?name=${this.packageName}&bcCode=${this.bcCode}&default=privacy_agreement`,t=`${o}/api/v1/zero/user/agreement/indexNew?name=${this.packageName}&bcCode=${this.bcCode}&default=user_agreement`;return[{name:this.agreementConfig.privacyAgreement.name||`${this.appName}隐私政策`,value:"2",link:this.agreementConfig.privacyAgreement.url||e},{name:this.agreementConfig.userAgreement.name||`${this.appName}用户协议`,value:"1",link:this.agreementConfig.userAgreement.url||t}]}return this.showUpdate?this.agreementUpdate.updateList?.map((e=>({name:e.name,link:e.url}))):[]},filingNumber(){return this.agreementConfig.bcMessage||""},pageName(){return this.showUpdate?"协议更新弹窗":this.showDialog?"协议弹窗":""},realDomain(){return this.domain?this.domain:o}},methods:{checkShowAgreement(){this.packageName&&!this.hidden&&n.isShowPolicy(this.packageName).then((e=>{e&&e.data?this.checkShowUpdate():localStorage.getItem(this.keyIsShowAgreement).then((e=>{var t,a,i;e&&"1"===e?this.checkShowUpdate():(t=this.realDomain,a=this.packageName,i=this.bcCode,g.bcCode=i,fetch(t+"/api/v2/zero/user/agreement/getAppConfig",{method:"POST",headers:r,body:JSON.stringify({developer:g,data:{pkgName:a,channelCode:c},runtime:m})}).then((e=>e.json()))).then((e=>{0===e.code&&e.data&&(this.agreementConfig=e.data,this.showDialog=!0,this.saveShowAgreement(),l(this.realDomain,this.packageName,this.bcCode).then((e=>{0===e.code&&e.data&&(this.agreementUpdate=e.data,this.saveShowUpdate(this.agreementUpdate.version))})))}))}))}))},checkShowUpdate(){const e=(new Date).Format("yyyy-MM-dd");localStorage.getItem(this.keyIsCheckDate).then((t=>{t&&t===e||l(this.realDomain,this.packageName,this.bcCode).then((e=>{0===e.code&&e.data&&(this.agreementUpdate=e.data,localStorage.getItem(this.keyIsShowUpdate).then((e=>{e&&`${this.agreementUpdate.version}`===e||(this.showUpdate=!0,this.saveShowUpdate(this.agreementUpdate.version))})))}))}))},saveShowUpdate(e){const t=(new Date).Format("yyyy-MM-dd");localStorage.setItem(this.keyIsCheckDate,t),localStorage.setItem(this.keyIsShowUpdate,e)},removeShowUpdate(){localStorage.setItem(this.keyIsCheckDate,""),localStorage.setItem(this.keyIsShowUpdate,"")},saveShowAgreement(){localStorage.setItem(this.keyIsShowAgreement,"1")},removeShowAgreement(){localStorage.setItem(this.keyIsShowAgreement,"0")},onClose(e){e.stopPropagation()},dismiss(){this.showDialog=!1},read(e){let t;switch(e){case 0:t={html:this.noticeLink[0].link},p(this.realDomain,this.packageName,"common_click",{id:"PRIVACY_BUTTON",name:"隐私政策按钮",page_id:"AGREEMENT_DIALOG",page_name:this.pageName});break;case 1:t={html:this.noticeLink[1].link},p(this.realDomain,this.packageName,"common_click",{id:"USER_AGREEMENT_BUTTON",name:"用户协议按钮",page_id:"AGREEMENT_DIALOG",page_name:this.pageName})}d.launchNativePageIntent({packageName:this.packageName,url:this.webViewRouter,params:t,splash:-1})},confirm(e){switch(e){case 0:try{p(this.realDomain,this.packageName,"common_click",{id:"AGREE_BUTTON",name:"同意按钮",page_id:"AGREEMENT_DIALOG",page_name:this.pageName}),this.$emit("onAgreeClick"),this.dismiss()}catch(e){}break;case 1:try{p(this.realDomain,this.packageName,"common_click",{id:"DISAGREE_BUTTON",name:"不同意按钮",page_id:"AGREEMENT_DIALOG",page_name:this.pageName}),this.showDialog?this.removeShowAgreement():this.showUpdate&&this.removeShowUpdate(),this.dismiss(),setTimeout((()=>{d.finishActivity()}),500)}catch(e){}}}},beforeDestroy(){},mounted(){},install:e=>{e.component(u.name,u)}};export{u as EsProtocolDialog};
{
"name": "@extscreen/es-protocal-dialog",
"version": "1.0.4",
"version": "1.0.5",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc