yach.open.jssdk 4.2.4-beta3 → 4.2.4-beta4
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/yach_jssdk_4.2.4-beta4.js +1 -0
- package/es/api/util/tool/log.d.ts +9 -0
- package/es/api/util/tool/log.js +17 -0
- package/es/index.d.ts +5 -1
- package/es/index.js +7 -2
- package/es/lib/bridge/mobile.js +3 -3
- package/es/lib/bridge/pc.js +1 -1
- package/es/lib/helper/event.js +6 -7
- package/es/lib/helper/pcIframe.js +6 -7
- package/es/lib/sdk/index.d.ts +1 -0
- package/es/lib/sdk/index.js +31 -29
- package/es/utils/compareVersions.d.ts +58 -0
- package/es/utils/compareVersions.js +192 -0
- package/es/utils/console.js +2 -1
- package/es/utils/index.js +1 -1
- package/libs/api/app/custom/talYoungFilesUpload.js +2 -2
- package/libs/api/biz/chat/chooseConversationByCorpId.js +2 -2
- package/libs/api/biz/chat/openSingleChat.js +2 -2
- package/libs/api/biz/chat/openSquad.js +2 -2
- package/libs/api/biz/chat/openTeamChat.js +2 -2
- package/libs/api/biz/chat/pickConversation.js +2 -2
- package/libs/api/biz/chat/sendP2PMsg.js +2 -2
- package/libs/api/biz/contact/complexPicker.js +2 -2
- package/libs/api/biz/contact/departmentsPicker.js +2 -2
- package/libs/api/biz/group/groupComplexPicker.js +2 -2
- package/libs/api/biz/map/multipointView.js +2 -2
- package/libs/api/biz/map/view.js +2 -2
- package/libs/api/biz/navigation/close.js +2 -2
- package/libs/api/biz/navigation/goBack.js +2 -2
- package/libs/api/biz/navigation/quit.js +2 -2
- package/libs/api/biz/navigation/replace.js +2 -2
- package/libs/api/biz/navigation/setIcon.js +2 -2
- package/libs/api/biz/navigation/setLeft.js +2 -2
- package/libs/api/biz/navigation/setMenu.js +2 -2
- package/libs/api/biz/navigation/setRight.js +2 -2
- package/libs/api/biz/navigation/setTitle.js +2 -2
- package/libs/api/biz/navigation/setTitleExpandIcon.js +2 -2
- package/libs/api/biz/navigation/setWindowBig.js +2 -2
- package/libs/api/biz/navigation/tencentMeeting.js +2 -2
- package/libs/api/biz/navigation/tencentMeetingBegin.js +2 -2
- package/libs/api/biz/navigation/updateExpandTitle.js +2 -2
- package/libs/api/biz/telephone/call.js +2 -2
- package/libs/api/biz/telephone/showCallMenu.js +2 -2
- package/libs/api/biz/util/authFinish.js +2 -2
- package/libs/api/biz/util/authStart.js +2 -2
- package/libs/api/biz/util/chosen.js +2 -2
- package/libs/api/biz/util/clipboardFileUpload.js +2 -2
- package/libs/api/biz/util/closeWindow.js +2 -2
- package/libs/api/biz/util/complain.js +2 -2
- package/libs/api/biz/util/createModifySchedule.js +2 -2
- package/libs/api/biz/util/datepicker.js +2 -2
- package/libs/api/biz/util/datetimepicker.js +2 -2
- package/libs/api/biz/util/downloadFile.js +2 -2
- package/libs/api/biz/util/externalLinkPreviewFile.js +2 -2
- package/libs/api/biz/util/feedback.js +2 -2
- package/libs/api/biz/util/getSingleWebviewData.js +2 -2
- package/libs/api/biz/util/getTogetherConfig.js +2 -2
- package/libs/api/biz/util/getToken.js +2 -2
- package/libs/api/biz/util/injectScript.js +2 -2
- package/libs/api/biz/util/invoice.js +2 -2
- package/libs/api/biz/util/mediaFileUpload.js +2 -2
- package/libs/api/biz/util/open.js +2 -2
- package/libs/api/biz/util/openLink.js +2 -2
- package/libs/api/biz/util/openMediaFileDialog.js +2 -2
- package/libs/api/biz/util/openSingleWebview.js +2 -2
- package/libs/api/biz/util/openSlidePanel.js +2 -2
- package/libs/api/biz/util/openTalYoungToTopic.js +2 -2
- package/libs/api/biz/util/openTogetherEyeWebview.js +2 -2
- package/libs/api/biz/util/openVideoPlayer.js +2 -2
- package/libs/api/biz/util/previewFile.js +2 -2
- package/libs/api/biz/util/previewImage.js +2 -2
- package/libs/api/biz/util/proxy.js +2 -2
- package/libs/api/biz/util/pushWorkMsg.js +2 -2
- package/libs/api/biz/util/remind.js +2 -2
- package/libs/api/biz/util/rouseApp.js +2 -2
- package/libs/api/biz/util/savePic.js +2 -2
- package/libs/api/biz/util/scan.js +2 -2
- package/libs/api/biz/util/selectDepartment.js +2 -2
- package/libs/api/biz/util/share.js +2 -2
- package/libs/api/biz/util/takePicture.js +2 -2
- package/libs/api/biz/util/uploadAttachment.js +2 -2
- package/libs/api/biz/util/zfbAuth.js +2 -2
- package/libs/api/biz/webViewMessage/send.js +2 -2
- package/libs/api/device/audio/download.js +2 -2
- package/libs/api/device/audio/onPlayEnd.js +2 -2
- package/libs/api/device/audio/onRecordEnd.js +2 -2
- package/libs/api/device/audio/onRecordEnd_v2.js +2 -2
- package/libs/api/device/audio/pause.js +2 -2
- package/libs/api/device/audio/play.js +2 -2
- package/libs/api/device/audio/resume.js +2 -2
- package/libs/api/device/audio/startRecord.js +2 -2
- package/libs/api/device/audio/startRecord_v2.js +2 -2
- package/libs/api/device/audio/stop.js +2 -2
- package/libs/api/device/audio/stopRecord.js +2 -2
- package/libs/api/device/audio/stopRecord_v2.js +2 -2
- package/libs/api/device/base/checkStepPermission.js +2 -2
- package/libs/api/device/base/getPhoneInfo.js +2 -2
- package/libs/api/device/base/getUUID.js +2 -2
- package/libs/api/device/connection/getNetworkType.js +2 -2
- package/libs/api/device/connection/isAtTal.js +2 -2
- package/libs/api/device/geolocation/get.js +2 -2
- package/libs/api/device/geolocation/getSwitch.js +2 -2
- package/libs/api/device/notification/actionSheet.js +2 -2
- package/libs/api/device/notification/alert.js +2 -2
- package/libs/api/device/notification/confirm.js +2 -2
- package/libs/api/device/notification/hidePreloader.js +2 -2
- package/libs/api/device/notification/showPreloader.js +2 -2
- package/libs/api/device/notification/toast.js +2 -2
- package/libs/api/device/notification/vibrate.js +2 -2
- package/libs/api/device/system/getLang.js +2 -2
- package/libs/api/device/system/setLight.js +2 -2
- package/libs/api/primary/createTab.js +2 -2
- package/libs/api/primary/weeklyShare.js +2 -2
- package/libs/api/runtime/permission/requestAuthCode.js +2 -2
- package/libs/api/ui/pullToRefresh/disable.js +2 -2
- package/libs/api/ui/pullToRefresh/enable.js +2 -2
- package/libs/api/ui/pullToRefresh/stop.js +2 -2
- package/libs/api/ui/webViewBounce/disable.js +2 -2
- package/libs/api/util/domainStorage/getItem.js +2 -2
- package/libs/api/util/domainStorage/removeItem.js +2 -2
- package/libs/api/util/domainStorage/setItem.js +2 -2
- package/libs/api/util/tool/log.d.ts +9 -0
- package/libs/api/util/tool/log.js +28 -0
- package/libs/index.d.ts +5 -1
- package/libs/index.js +222 -223
- package/libs/lib/bridge/index.js +7 -7
- package/libs/lib/bridge/mobile.js +6 -6
- package/libs/lib/bridge/pc.js +5 -5
- package/libs/lib/helper/apiHelper.js +2 -2
- package/libs/lib/helper/codeMap.js +2 -2
- package/libs/lib/helper/event.js +8 -9
- package/libs/lib/helper/pcIframe.js +9 -9
- package/libs/lib/index.js +2 -2
- package/libs/lib/sdk/index.d.ts +1 -0
- package/libs/lib/sdk/index.js +34 -31
- package/libs/utils/compareVersions.d.ts +58 -0
- package/libs/utils/compareVersions.js +218 -0
- package/libs/utils/console.js +3 -3
- package/libs/utils/index.js +10 -10
- package/package.json +1 -1
- package/dist/yach_jssdk_4.2.4-beta3.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
window.yy=function(n){var e={};function t(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return n[o].call(i.exports,i,i.exports,t),i.l=!0,i.exports}return t.m=n,t.c=e,t.d=function(n,e,o){t.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:o})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,e){if(1&e&&(n=t(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var o=Object.create(null);if(t.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var i in n)t.d(o,i,function(e){return n[e]}.bind(null,i));return o},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},t.p="",t(t.s=1)}([function(n){n.exports=JSON.parse('{"a":"4.2.4-beta4"}')},function(n,e,t){"use strict";var o;function i(){var n="undefined"!=typeof navigator?navigator.userAgent:"",e=/Yach/i.test(n),t=/iPhone|iPad|iPod|iOS/i.test(n)&&e,i=/Android/i.test(n)&&e,r=/YachPc/i.test(n),a=/iPad/i.test(n)&&e,s=/iPhone/i.test(n)&&e,c=o.notInYach;return t&&(c=o.ios),i&&(c=o.android),r&&(c=o.pc),{platform:c,platformV2:{inYach:e,inIOS:t,inAndroid:i,inPC:r,inIpad:a,inIPhone:s},version:((n.match(/Yach\/[a-zA-Z0-9.-]+/)||[])[0]||"").split("/")[1]||"",language:"undefined"!=typeof navigator?navigator.language:"*"}}function r(n){if(n)if(n.group)if(n.project)if(n.hasOwnProperty("env"))if(n.hasOwnProperty("version")){var e=["https://es.zhiyinlou.com/log.js?"];e.push("group="+n.group),e.push("&project="+n.project),e.push("&env="+n.env),e.push("&version="+n.version),e.push("&method="+n.method),n.yachid&&e.push("&yachid="+n.yachid),n.workcode&&e.push("&workcode="+n.workcode),n.timestamp&&e.push("×tamp="+n.timestamp),n.errorcode&&e.push("&errorcode="+n.errorcode),n.message&&e.push("&message="+n.message),n.api&&n.time&&(e.push("&api="+n.api),e.push("&load_time="+n.time));var t,o,i=e.join("");t=i,(o=document.createElement("script")).type="text/javascript",o.readyState?o.onreadystatechange=function(){"loaded"!=o.readyState&&"complete"!=o.readyState||(o.onreadystatechange=null,document.getElementsByTagName("head")[0].removeChild(o))}:o.onload=function(){document.getElementsByTagName("head")[0].removeChild(o)},o.src=t,document.getElementsByTagName("head")[0].appendChild(o),"online"!=n.env&&console.log(i)}else console.log("bpit error: need options.version");else console.log("bpit error: need options.env");else console.log("bpit error: need options.project");else console.log("bpit error: need options.group");else console.log("bpit error: need options")}t.r(e),t.d(e,"version",(function(){return so})),t.d(e,"sdkVersion",(function(){return co})),t.d(e,"env",(function(){return uo})),t.d(e,"platform",(function(){return fo})),t.d(e,"platformV2",(function(){return po})),t.d(e,"config",(function(){return lo})),t.d(e,"ready",(function(){return vo})),t.d(e,"error",(function(){return mo})),t.d(e,"on",(function(){return go})),t.d(e,"off",(function(){return ho})),t.d(e,"openLink",(function(){return B})),t.d(e,"feedback",(function(){return O})),t.d(e,"open",(function(){return L})),t.d(e,"openSlidePanel",(function(){return H})),t.d(e,"share",(function(){return Y})),t.d(e,"previewFile",(function(){return J})),t.d(e,"previewImage",(function(){return q})),t.d(e,"downloadFile",(function(){return K})),t.d(e,"uploadAttachment",(function(){return G})),t.d(e,"clipboardFileUpload",(function(){return $})),t.d(e,"proxy",(function(){return X})),t.d(e,"datepicker",(function(){return Q})),t.d(e,"scan",(function(){return on})),t.d(e,"chosen",(function(){return dn})),t.d(e,"openSingleWebview",(function(){return pn})),t.d(e,"getSingleWebviewData",(function(){return ln})),t.d(e,"injectScript",(function(){return vn})),t.d(e,"closeWindow",(function(){return gn})),t.d(e,"showCallMenu",(function(){return _t})),t.d(e,"call",(function(){return Ot})),t.d(e,"setIcon",(function(){return Xn})),t.d(e,"setTitle",(function(){return Zn})),t.d(e,"setMenu",(function(){return ee})),t.d(e,"close",(function(){return te})),t.d(e,"replacePage",(function(){return oe})),t.d(e,"quit",(function(){return re})),t.d(e,"setRight",(function(){return ce})),t.d(e,"setTitleExpandIcon",(function(){return fe})),t.d(e,"updateExpandTitle",(function(){return pe})),t.d(e,"setLeft",(function(){return me})),t.d(e,"goBack",(function(){return he})),t.d(e,"complexPicker",(function(){return Pe})),t.d(e,"departmentsPicker",(function(){return ze})),t.d(e,"groupComplexPicker",(function(){return Se})),t.d(e,"chooseConversationByCorpId",(function(){return Ie})),t.d(e,"pickConversation",(function(){return Me})),t.d(e,"openSingleChat",(function(){return Ce})),t.d(e,"openTeamChat",(function(){return xe})),t.d(e,"openSquad",(function(){return Ae})),t.d(e,"sendP2PMsg",(function(){return Fe})),t.d(e,"mapView",(function(){return an})),t.d(e,"multipointView",(function(){return cn})),t.d(e,"requestAuthCode",(function(){return je})),t.d(e,"createTab",(function(){return Ee})),t.d(e,"weeklyShare",(function(){return We})),t.d(e,"showPreloader",(function(){return _e})),t.d(e,"hidePreloader",(function(){return Oe})),t.d(e,"vibrate",(function(){return Ne})),t.d(e,"toast",(function(){return He})),t.d(e,"alert",(function(){return Ge})),t.d(e,"confirm",(function(){return Xe})),t.d(e,"getPhoneInfo",(function(){return qe})),t.d(e,"getUUID",(function(){return Tt})),t.d(e,"checkStepPermission",(function(){return Ct})),t.d(e,"getGeolocation",(function(){return Qe})),t.d(e,"getGeolocationSwitch",(function(){return et})),t.d(e,"getLang",(function(){return tt})),t.d(e,"startRecord",(function(){return it})),t.d(e,"stopRecord",(function(){return at})),t.d(e,"onRecordEnd",(function(){return ct})),t.d(e,"downloadAudio",(function(){return dt})),t.d(e,"playAudio",(function(){return pt})),t.d(e,"pauseAudio",(function(){return vt})),t.d(e,"stopAudio",(function(){return gt})),t.d(e,"onPlayEnd",(function(){return bt})),t.d(e,"resumeAudio",(function(){return yt})),t.d(e,"getNetworkType",(function(){return Pt})),t.d(e,"isAtTal",(function(){return St})),t.d(e,"webViewBounceDisable",(function(){return Nt})),t.d(e,"pullToRefreshEnable",(function(){return Ut})),t.d(e,"pullToRefreshStop",(function(){return Jt})),t.d(e,"pullToRefreshDisable",(function(){return Kt})),t.d(e,"getItem",(function(){return $t})),t.d(e,"setItem",(function(){return Zt})),t.d(e,"removeItem",(function(){return no})),t.d(e,"writeLog",(function(){return to})),t.d(e,"remind",(function(){return bn})),t.d(e,"takePicture",(function(){return wn})),t.d(e,"datetimepicker",(function(){return en})),t.d(e,"actionSheet",(function(){return Ye})),t.d(e,"webViewMessageSend",(function(){return io})),t.d(e,"talYoungFilesUpload",(function(){return ro})),t.d(e,"openVideoPlayer",(function(){return kn})),t.d(e,"openMediaFileDialog",(function(){return Pn})),t.d(e,"mediaFileUpload",(function(){return zn})),t.d(e,"invoice",(function(){return Sn})),t.d(e,"pushWorkMsg",(function(){return In})),t.d(e,"openTalYoungToTopic",(function(){return Tn})),t.d(e,"getToken",(function(){return Cn})),t.d(e,"authStart",(function(){return An})),t.d(e,"authFinish",(function(){return Dn})),t.d(e,"openTogetherEyeWebview",(function(){return Vn})),t.d(e,"getTogetherConfig",(function(){return jn})),t.d(e,"rouseApp",(function(){return Rn})),t.d(e,"externalLinkPreviewFile",(function(){return _n})),t.d(e,"savePic",(function(){return Nn})),t.d(e,"zfbAuth",(function(){return On})),t.d(e,"complain",(function(){return Hn})),t.d(e,"onRecordEnd_v2",(function(){return At})),t.d(e,"startRecord_v2",(function(){return Dt})),t.d(e,"stopRecord_v2",(function(){return Vt})),t.d(e,"selectDepartment",(function(){return Un})),t.d(e,"setWindowBig",(function(){return we})),t.d(e,"tencentMeeting",(function(){return ye})),t.d(e,"tencentMeetingBegin",(function(){return ke})),t.d(e,"createModifySchedule",(function(){return Jn})),t.d(e,"setLight",(function(){return jt})),function(n){n.pc="pc",n.android="android",n.ios="ios",n.notInYach="notInYach"}(o||(o={}));var a=function(){return(a=Object.assign||function(n){for(var e,t=1,o=arguments.length;t<o;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}).apply(this,arguments)};function s(n){var e=i().version,t=Date.now(),o=a({group:"yach",project:"yach_31_jssdk",env:"test",version:e,timestamp:t},n);console.log("jssdk 项目 bpit 上报数据:",o),r(o)}var c=function(n,e){var t=d(n),o=d(e),i=t.pop(),r=o.pop(),a=v(t,o);return 0!==a?a:i&&r?v(i.split("."),r.split(".")):i||r?i?-1:1:0},u=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,d=function(n){if("string"!=typeof n)throw new TypeError("Invalid argument expected string");var e=n.match(u);if(!e)throw new Error("Invalid argument not valid semver ('"+n+"' received)");return e.shift(),e},f=function(n){return"*"===n||"x"===n||"X"===n},p=function(n){var e=parseInt(n,10);return isNaN(e)?n:e},l=function(n,e){if(f(n)||f(e))return 0;var t=function(n,e){return typeof n!=typeof e?[String(n),String(e)]:[n,e]}(p(n),p(e)),o=t[0],i=t[1];return o>i?1:o<i?-1:0},v=function(n,e){for(var t=0;t<Math.max(n.length,e.length);t++){var o=l(n[t]||"0",e[t]||"0");if(0!==o)return o}return 0},m={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1]},g=(Object.keys(m),t(0)),h=function(){function n(n){var e=this;this.invokeAPIConfigMapByMethod={},this.configJsApiList=[],this.platformConfigMap={},this.hadConfig=!1,this.bridgeInitFnPromise=null,this.cacheP={},this.config$=new Promise((function(n,t){e.cacheP.resolve=n,e.cacheP.reject=t})),this.env=n,this.exportSdk={version:n.version,sdkVersion:g.a,env:n,platform:n.platform,platformV2:n.platformV2,config:function(n){void 0===n&&(n={});var t=n.jsApiList,o=void 0===t?[]:t;e.hadConfig?console.log("Config has been executed"):e.bridgeInitFn().then((function(t){t("config",n).then((function(n){e.cacheP.resolve(n),e.hadConfig=!0,e.configJsApiList=o})).catch((function(n){e.cacheP.reject(n)}))}))},ready:function(n){e.bridgeInitFn().then((function(){n()}))},error:function(n){e.config$.catch((function(e){n(e)}))},on:function(t,o){e.bridgeInitFn().then((function(){e.platformConfigMap[n.platform].event.on(t,o)}))},off:function(t,o){e.bridgeInitFn().then((function(){e.platformConfigMap[n.platform].event.off(t,o)}))}}}return n.prototype.setAPI=function(n,e){this.invokeAPIConfigMapByMethod[n]=e},n.prototype.setPlatform=function(n){var e=n.platform;n.bridgeInit;this.platformConfigMap[e]=n},n.prototype.bridgeInitFn=function(){if(this.bridgeInitFnPromise)return this.bridgeInitFnPromise;var n=this.platformConfigMap[this.env.platform];if(n)this.bridgeInitFnPromise=n.bridgeInit();else{var e="Do not support the current environment�"+this.env.platform;this.bridgeInitFnPromise=Promise.reject(new Error(e))}return this.bridgeInitFnPromise},n.prototype._onFail=function(n,e,t,o){s({method:n,errorcode:e,message:t}),o&&"function"==typeof o&&o({code:e,message:t})},n.prototype.invokeAPI=function(n,e){if(e||(e={}),n){var t=this.invokeAPIConfigMapByMethod[n];if(!t)return this._onFail(n,"-1","["+n+"] method is not exist",e.onFail);var o=t[this.env.platform];if(o){var i=o.vs||"0.0.0";if(c(this.env.version,i)<0)return this._onFail(n,"-1","The current application version is "+this.env.version+". This method does not support versions less than "+i,e.onFail);var r=o.paramsDeal?o.paramsDeal(e):e;if("function"==typeof r.onSuccess){var a=r.onSuccess;r.onSuccess=function(n){a(n)}}this.bridgeInitFn().then((function(e){e(n,r).then((function(){})).catch((function(n){}))})).catch((function(n){console.log("wenai err",n)}))}else this._onFail(n,"-1","["+n+"] method do not support the current platform ("+this.env.platform+")",e.onFail)}},n}(),b={log:function(){},warn:function(){},error:function(){}};if(window&&window.console&&(b=window.console),document&&document.body){var w=document.createElement("iframe");w&&w.contentWindow&&w.contentWindow.console&&(w.style.display="none",document.body.appendChild(w),b=w.contentWindow.console)}var y=b.log.bind(b),k=(b.warn.bind(b),b.error.bind(b),"color:#fff;font-weight:bold;border-radius:5px;background:#67c23a;");function P(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return y("%c Yach-jssdk log: ",k,n)}var z=new function(){var n=this;this.on=function(e,t){if(!e||"function"!=typeof t)throw"eventName is null or handle is not a function, on fail";Array.isArray(n.eventsHandle[e])||(n.eventsHandle[e]=[]),n.eventsHandle[e].push(t)},this.off=function(e,t){if(!e)throw"eventName is null, invoke off fail";if(t){if(Array.isArray(n.eventsHandle[e])){var o=n.eventsHandle[e].indexOf(t);-1!==o&&n.eventsHandle[e].splice(o,1)}}else n.eventsHandle[e]=[]},this.execEvent=function(n,e){Array.isArray(this.eventsHandle[n])&&this.eventsHandle[n].forEach((function(n){try{n(e)}catch(n){console.error(e)}}))},this.eventsHandle={}},S=function(n,e,t){var o=this;this.genid=function(){var n=Date.now().toString(36);return n+=Math.random().toString(36).substr(3)},this.receiveResponse=function(n){o.callback(n)},this.getPayload=function(){return{msgId:o.id,methodName:o.methodName,body:o.plainMsg,type:"request",invokeType:o.invokeType}},this.id=this.genid(),this.PromiseObj={resolve:null,reject:null},this.methodName=n,this.plainMsg=e,this.invokeType=null==e?void 0:e.invokeType,this.callback=t},I=new function(){var n=this;this.addPending=function(e){n.pendingMsgs[e.id]=e},this.deletePending=function(e){delete n.pendingMsgs[e.id]},this.getPending=function(n){return this.pendingMsgs[n]},this.invokeAPIInBrowserView=function(n){window.sendTo(n)},this.invokeAPIInWebview=function(n){window.sendToHost(n)},this.invokeAPI=function(e,t,o){var i=new S(e,t,o),r=JSON.stringify(i.getPayload()),a=t.invokeType;return"browserView"===(void 0===a?"":a)?n.invokeAPIInBrowserView(r):n.invokeAPIInWebview(r),n.addPending(i),i},this.handleCallback=function(e,t){var o=e.type,i=e.methodName,r=e.eventName,a=e.msgId,s=e.data,c=e.code,u=e.message;if("request"===o)switch(i){case"refresh":window.location.reload();break;case"back":window.history.back();break;case"forward":window.history.forward();break;case"event":z.execEvent(r,s);break;case"zoomInClick":var d=document.documentElement.scrollTop||document.body.scrollTop,f=window.location.href;"browserView"===t?window.sendTo(JSON.stringify({type:o,methodName:i,body:{scrollTopVal:d,url:f,title:s&&s.title}})):window.sendToHost(JSON.stringify({type:o,methodName:i,body:{scrollTopVal:d,url:f,title:s&&s.title}}))}else if("response"===o){var p=n.getPending(a);p&&p.receiveResponse({data:s,code:c,message:u}),-3!=c&&n.deletePending(a)}},this.init=function(){window.addEventListener("message",(function(e){P("electron res: ",e),n.handleCallback(e.data||{})})),window.receiveBrowserViewData&&window.receiveBrowserViewData((function(e,t){return n.handleCallback(t)}))},this.pendingMsgs={}},T=new Map([[0,"onSuccess"],[-1,"onCancel"],[-2,"onFail"],[-3,"onProgress"],[-4,"onSubmit"]]);function M(n){return T.get(n)||"onFail"}var C=function(n,e){return new Promise((function(t){return I.invokeAPI(n,e,(function(o){var i=o.data,r=o.code,a=o.message,c=parseInt(r),u=M(c);-2===c&&s({method:n,errorcode:c,message:a||"SDK执行失败回调,相关参数"});var d=e[u];P("SDK执行后回调,相关参数 ",{method:n,param:e,data:i,_code:c,message:a,callbackFun:d}),"function"==typeof d&&d(i||a),t({_code:c,message:a,data:i})}))}))},x=function(){return(x=Object.assign||function(n){for(var e,t=1,o=arguments.length;t<o;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}).apply(this,arguments)};function A(n){if(window.WebViewJavascriptBridge)return n(WebViewJavascriptBridge);if(window.WKWebViewJavascriptBridge)return n(WKWebViewJavascriptBridge);if(window.WVJBCallbacks)return window.WVJBCallbacks.push(n);window.WVJBCallbacks=[n];var e=document.createElement("iframe");e.style.display="none",e.src="https://__bridge_loaded__",document.documentElement.appendChild(e),setTimeout((function(){document.documentElement.removeChild(e)}),0)}var F=function(n,e){return new Promise((function(t,o){var i=x({},e);A((function(r){e.control&&r.registerHandler(n,(function(n){var o=e.onSuccess;delete i.onSuccess,"function"==typeof o&&(o(n),t({code:"0",message:"success"}))})),r.callHandler(n,e,(function(r){var a=r.code,c=r.message,u=r.data,d=parseInt(a),f=M(d);-2!==d&&7!==d||(s({method:n,errorcode:d,message:c||"SDK执行失败回调,相关参数"}),P("SDK执行后回调,相关参数 ",{method:n,param:e,data:u,_code:d,message:c}),o({_code:d,message:c}));var p=i[f];P("SDK执行后回调,相关参数 ",{method:n,param:e,data:u,_code:d,message:c,callbackFun:p}),"function"==typeof p&&p(u||c),t({_code:d,message:c,data:u})}))}))}))},D=function(n,e,t,o){return new(t||(t=Promise))((function(i,r){function a(n){try{c(o.next(n))}catch(n){r(n)}}function s(n){try{c(o.throw(n))}catch(n){r(n)}}function c(n){var e;n.done?i(n.value):(e=n.value,e instanceof t?e:new t((function(n){n(e)}))).then(a,s)}c((o=o.apply(n,e||[])).next())}))},E=function(n,e){var t,o,i,r,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,o&&(i=2&r[0]?o.return:r[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;switch(o=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,o=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){a.label=r[1];break}if(6===r[0]&&a.label<i[1]){a.label=i[1],i=r;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(r);break}i[2]&&a.ops.pop(),a.trys.pop();continue}r=e.call(n,a)}catch(n){r=[6,n],o=0}finally{t=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}},V=i(),W=V.platform,j=new h(V);!function(){var n=this,e={platform:W,authMethod:"config",bridgeInit:"pc"===W?function(){return D(n,void 0,void 0,(function(){return E(this,(function(n){return I.init(),[2,C]}))}))}:function(){return new Promise((function(n,e){A((function(e){P("注册resume事件 "),e.registerHandler("resume",(function(n){P("resume监听到回调,相关参数 ",{resData:n}),z.execEvent("resume",n)})),P("注册unreadMsgAction事件 "),e.registerHandler("unreadMsgAction",(function(n){P("unreadMsgAction监听到回调,相关参数 ",{resData:n}),z.execEvent("unreadMsgAction",n)})),P("注册webViewMsgReceive事件 "),e.registerHandler("webViewMsgReceive",(function(n){P("webViewMsgReceive监听到回调,相关参数 ",{resData:n}),z.execEvent("webViewMsgReceive",n)})),e.registerHandler("pushWorkMsg",(function(n){P("pushWorkMsg监听到回调,相关参数 ",{resData:n}),z.execEvent("pushWorkMsg",n)})),e.registerHandler("getTogetherCallback",(function(n){P("getTogetherCallback监听到回调,相关参数 ",{resData:n}),z.execEvent("getTogetherCallback",n)})),e.registerHandler("sendMsgCommon",(function(n){P("sendMsgCommon ",{resData:n}),z.execEvent("sendMsgCommon",n)})),n()}))})).then((function(){return F}))},event:{on:function(n,e){z.on(n,e)},off:function(n,e){z.off(n,e)}}};j.setPlatform(e)}();var R={ios:{vs:"0.0.0"},android:{vs:"0.0.0"},pc:{vs:"0.0.0"}};var _=function(n,e){var t=e.params,o=void 0===t?{}:t,i=e.platform,r=void 0===i?R:i;j.setAPI(n,r),j.invokeAPI(n,o)};function B(n){_("biz.util.openLink",{params:n})}function O(n){_("biz.util.feedback",{params:n})}function L(n){_("biz.util.open",{params:n})}var N={pc:{vs:"0.0.0"}};function H(n){_("biz.util.openSlidePanel",{params:n,platform:N})}var U={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Y(n){_("biz.util.share",{params:n,platform:U})}function J(n){_("biz.util.previewFile",{params:n})}function q(n){_("biz.util.previewImage",{params:n})}function K(n){_("biz.util.downloadFile",{params:n})}function G(n){_("biz.util.uploadAttachment",{params:n})}function $(n){_("biz.util.clipboardFileUpload",{params:n})}function X(n){_("biz.util.proxy",{params:n})}var Z={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Q(n){_("biz.util.datepicker",{params:n,platform:Z})}var nn={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function en(n){_("biz.util.datetimepicker",{params:n,platform:nn})}var tn={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function on(n){_("biz.util.scan",{params:n,platform:tn})}var rn={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function an(n){_("biz.map.view",{params:n,platform:rn})}var sn={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function cn(n){_("biz.map.multipointView",{params:n,platform:sn})}var un={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function dn(n){_("biz.util.chosen",{params:n,platform:un})}var fn={pc:{vs:"0.0.0"}};function pn(n){_("biz.util.openSingleWebview",{params:n,platform:fn})}function ln(n){_("biz.util.getSingleWebviewData",{params:n})}function vn(n){_("biz.util.injectScript",{params:n})}var mn={pc:{vs:"0.0.0"}};function gn(n){_("biz.util.closeWindow",{params:n,platform:mn})}var hn={ios:{vs:"0.0.0"},android:{vs:"0.0.0"},pc:{vs:"0.0.0"}};function bn(n){_("biz.util.remind",{params:n,platform:hn})}function wn(n){_("biz.util.takePicture",{params:n})}var yn={pc:{vs:"0.0.0"},ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function kn(n){_("biz.util.openVideoPlayer",{params:n,platform:yn})}function Pn(n){_("biz.util.openMediaFileDialog",{params:n})}function zn(n){_("biz.util.mediaFileUpload",{params:n})}function Sn(n){_("biz.util.invoice",{params:n})}function In(n){_("biz.util.pushWorkMsg",{params:n})}function Tn(n){_("biz.util.openTalYoungToTopic",{params:n})}var Mn={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Cn(n){_("biz.util.getToken",{params:n,platform:Mn})}var xn={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function An(n){_("biz.util.authStart",{params:n,platform:xn})}var Fn={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Dn(n){_("biz.util.authFinish",{params:n,platform:Fn})}var En={ios:{vs:"0.0.0"},android:{vs:"0.0.0"},pc:{vs:"0.0.0"}};function Vn(n){_("biz.util.openTogetherEyeWebview",{params:n,platform:En})}var Wn={ios:{vs:"0.0.0"},android:{vs:"0.0.0"},pc:{vs:"0.0.0"}};function jn(n){_("biz.util.getTogetherConfig",{params:n,platform:Wn})}function Rn(n){_("biz.util.rouseApp",{params:n})}function _n(n){_("biz.util.externalLinkPreviewFile",{params:n})}var Bn={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function On(n){_("biz.util.zfbAuth",{params:n,platform:Bn})}var Ln={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Nn(n){_("biz.util.savePic",{params:n,platform:Ln})}function Hn(n){_("biz.util.complain",{params:n})}function Un(n){_("biz.util.selectDepartment",{params:n})}var Yn={pc:{vs:"0.0.0"}};function Jn(n){_("biz.util.createModifySchedule",{params:n,platform:Yn})}var qn=function(){return(qn=Object.assign||function(n){for(var e,t=1,o=arguments.length;t<o;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}).apply(this,arguments)};function Kn(n){return function(e){return qn(qn({},n),e)}}var Gn=Kn({control:!0,showIcon:!0,iconIndex:1}),$n={ios:{vs:"0.0.0",paramsDeal:Gn},android:{vs:"0.0.0",paramsDeal:Gn}};function Xn(n){_("biz.navigation.setIcon",{params:n,platform:$n})}function Zn(n){_("biz.navigation.setTitle",{params:n})}var Qn=Kn({control:!0}),ne={ios:{vs:"0.0.0",paramsDeal:Qn},android:{vs:"0.0.0",paramsDeal:Qn}};function ee(n){_("biz.navigation.setMenu",{params:n,platform:ne})}function te(n){_("biz.navigation.close",{params:n})}function oe(n){_("biz.navigation.replace",{params:n})}var ie={pc:{vs:"0.0.0"}};function re(n){_("biz.navigation.quit",{params:n,platform:ie})}var ae=Kn({show:!0,control:!1,text:""}),se={ios:{vs:"0.0.0",paramsDeal:ae},android:{vs:"0.0.0",paramsDeal:ae},pc:{vs:"0.0.0"}};function ce(n){_("biz.navigation.setRight",{params:n,platform:se})}var ue=Kn({control:!0}),de={ios:{vs:"0.0.0",paramsDeal:ue},android:{vs:"0.0.0",paramsDeal:ue}};function fe(n){_("biz.navigation.setTitleExpandIcon",{params:n,platform:de})}function pe(n){_("biz.navigation.updateExpandTitle",{params:n})}var le=Kn({show:!0,control:!1,text:""}),ve={ios:{vs:"0.0.0",paramsDeal:le},android:{vs:"0.0.0",paramsDeal:le},pc:{vs:"0.0.0"}};function me(n){_("biz.navigation.setLeft",{params:n,platform:ve})}var ge={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function he(n){_("biz.navigation.goBack",{params:n,platform:ge})}var be={pc:{vs:"0.0.0"}};function we(n){_("biz.navigation.setWindowBig",{params:n,platform:be})}function ye(n){_("biz.navigation.tencentMeeting",{params:n})}function ke(n){_("biz.navigation.tencentMeetingBegin",{params:n})}function Pe(n){_("biz.contact.complexPicker",{params:n})}function ze(n){_("biz.contact.departmentsPicker",{params:n})}function Se(n){_("biz.group.groupComplexPicker",{params:n})}function Ie(n){_("biz.chat.chooseConversationByCorpId",{params:n})}var Te={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Me(n){_("biz.chat.pickConversation",{params:n,platform:Te})}function Ce(n){_("biz.chat.openSingleChat",{params:n})}function xe(n){_("biz.chat.openTeamChat",{params:n})}function Ae(n){_("biz.chat.openSquad",{params:n})}function Fe(n){_("biz.chat.sendP2PMsg",{params:n})}var De={pc:{vs:"0.0.0"}};function Ee(n){_("primary.createTab",{params:n,platform:De})}var Ve={pc:{vs:"0.0.0"}};function We(n){_("primary.weeklyShare",{params:n,platform:Ve})}function je(n){_("runtime.permission.requestAuthCode",{params:n})}var Re={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function _e(n){_("device.notification.showPreloader",{params:n,platform:Re})}var Be={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Oe(n){_("device.notification.hidePreloader",{params:n,platform:Be})}var Le={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Ne(n){_("device.notification.vibrate",{params:n,platform:Le})}function He(n){_("device.notification.toast",{params:n})}var Ue={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Ye(n){_("device.notification.actionSheet",{params:n,platform:Ue})}var Je={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function qe(n){_("device.base.getPhoneInfo",{params:n,platform:Je})}var Ke={ios:{vs:"0.0.0"},android:{vs:"0.0.0"},pc:{vs:"0.0.0"}};function Ge(n){_("device.notification.alert",{params:n,platform:Ke})}var $e={ios:{vs:"0.0.0"},android:{vs:"0.0.0"},pc:{vs:"0.0.0"}};function Xe(n){_("device.notification.confirm",{params:n,platform:$e})}var Ze={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Qe(n){_("device.geolocation.get",{params:n,platform:Ze})}var nt={android:{vs:"0.0.0"}};function et(n){_("device.geolocation.getSwitch",{params:n,platform:nt})}function tt(n){_("device.system.getLang",{params:n})}var ot={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function it(n){_("device.audio.startRecord",{params:n,platform:ot})}var rt={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function at(n){_("device.audio.stopRecord",{params:n,platform:rt})}var st={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function ct(n){_("device.audio.onRecordEnd",{params:n,platform:st})}var ut={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function dt(n){_("device.audio.download",{params:n,platform:ut})}var ft={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function pt(n){_("device.audio.play",{params:n,platform:ft})}var lt={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function vt(n){_("device.audio.pause",{params:n,platform:lt})}var mt={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function gt(n){_("device.audio.stop",{params:n,platform:mt})}var ht={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function bt(n){_("device.audio.onPlayEnd",{params:n,platform:ht})}var wt={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function yt(n){_("device.audio.resume",{params:n,platform:wt})}var kt={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Pt(n){_("device.connection.getNetworkType",{params:n,platform:kt})}var zt={pc:{vs:"0.0.0"}};function St(n){_("device.connection.isAtTal",{params:n,platform:zt})}var It={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Tt(n){_("device.base.getUUID",{params:n,platform:It})}var Mt={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Ct(n){_("device.base.checkStepPermission",{params:n,platform:Mt})}var xt={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function At(n){_("device.audio.onRecordEnd_v2",{params:n,platform:xt})}var Ft={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Dt(n){_("device.audio.startRecord_v2",{params:n,platform:Ft})}var Et={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Vt(n){_("device.audio.stopRecord_v2",{params:n,platform:Et})}var Wt={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function jt(n){_("device.system.setLight",{params:n,platform:Wt})}var Rt={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function _t(n){_("biz.telephone.showCallMenu",{params:n,platform:Rt})}var Bt={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Ot(n){_("biz.telephone.call",{params:n,platform:Bt})}var Lt={ios:{vs:"0.0.0"}};function Nt(n){_("ui.webViewBounce.disable",{params:n,platform:Lt})}var Ht={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Ut(n){_("ui.pullToRefresh.enable",{params:n,platform:Ht})}var Yt={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Jt(n){_("ui.pullToRefresh.stop",{params:n,platform:Yt})}var qt={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Kt(n){_("ui.pullToRefresh.disable",{params:n,platform:qt})}var Gt={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function $t(n){_("util.domainStorage.getItem",{params:n,platform:Gt})}var Xt={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Zt(n){_("util.domainStorage.setItem",{params:n,platform:Xt})}var Qt={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function no(n){_("util.domainStorage.removeItem",{params:n,platform:Qt})}var eo={pc:{vs:"1.7.0"}};function to(n){_("util.tool.writeLog",{params:n,platform:eo})}var oo={ios:{vs:"0.0.0"}};function io(n){_("biz.webViewMessage.send",{params:n,platform:oo})}function ro(n){_("app.custom.talYoungFilesUpload",{params:n})}console.log("add rouseApp ------------\x3e",Rn);var ao=j.exportSdk,so=ao.version,co=ao.sdkVersion,uo=ao.env,fo=ao.platform,po=ao.platformV2,lo=ao.config,vo=ao.ready,mo=ao.error,go=ao.on,ho=ao.off;e.default={version:so,sdkVersion:co,env:uo,platform:fo,platformV2:po,config:lo,ready:vo,error:mo,on:go,off:ho,biz:{util:{openLink:B,feedback:O,open:L,openSlidePanel:H,share:Y,previewFile:J,previewImage:q,downloadFile:K,uploadAttachment:G,clipboardFileUpload:$,proxy:X,datepicker:Q,datetimepicker:en,scan:on,chosen:dn,openSingleWebview:pn,getSingleWebviewData:ln,injectScript:vn,closeWindow:gn,remind:bn,takePicture:wn,openVideoPlayer:kn,openMediaFileDialog:Pn,mediaFileUpload:zn,invoice:Sn,pushWorkMsg:In,openTalYoungToTopic:Tn,getToken:Cn,authStart:An,authFinish:Dn,openTogetherEyeWebview:Vn,getTogetherConfig:jn,rouseApp:Rn,externalLinkPreviewFile:_n,savePic:Nn,zfbAuth:On,complain:Hn,selectDepartment:Un,createModifySchedule:Jn},telephone:{showCallMenu:_t,call:Ot},navigation:{setIcon:Xn,setTitle:Zn,setMenu:ee,close:te,replace:oe,quit:re,setRight:ce,setTitleExpandIcon:fe,updateExpandTitle:pe,setLeft:me,goBack:he,setWindowBig:we,tencentMeeting:ye,tencentMeetingBegin:ke},contact:{complexPicker:Pe,departmentsPicker:ze},group:{groupComplexPicker:Se},chat:{chooseConversationByCorpId:Ie,pickConversation:Me,openSingleChat:Ce,openTeamChat:xe,openSquad:Ae,sendP2PMsg:Fe},map:{view:an,multipointView:cn},webViewMessage:{send:io}},runtime:{permission:{requestAuthCode:je}},primary:{createTab:Ee,weeklyShare:We},device:{notification:{showPreloader:_e,hidePreloader:Oe,vibrate:Ne,toast:He,alert:Ge,confirm:Xe,actionSheet:Ye},base:{getPhoneInfo:qe,getUUID:Tt,checkStepPermission:Ct},geolocation:{get:Qe,getSwitch:et},system:{getLang:tt,setLight:jt},audio:{startRecord:it,stopRecord:at,onRecordEnd:ct,download:dt,play:pt,pause:vt,stop:gt,onPlayEnd:bt,resume:yt,onRecordEnd_v2:At,startRecord_v2:Dt,stopRecord_v2:Vt},connection:{getNetworkType:Pt,isAtTal:St}},ui:{webViewBounce:{disable:Nt},pullToRefresh:{enable:Ut,stop:Jt,disable:Kt}},util:{domainStorage:{getItem:$t,setItem:Zt,removeItem:no},tool:{writeLog:to}},app:{custom:{talYoungFilesUpload:ro}}}}]).default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IError } from '../../common.typings';
|
|
2
|
+
export interface IUtilToolLogParams {
|
|
3
|
+
module: string;
|
|
4
|
+
logStr: string;
|
|
5
|
+
onSuccess?: () => void;
|
|
6
|
+
onFail?: (err: IError) => void;
|
|
7
|
+
}
|
|
8
|
+
declare function writeLog(params: IUtilToolLogParams): void;
|
|
9
|
+
export { writeLog };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import initAPI from '../../initAPI';
|
|
2
|
+
var apiName = 'util.tool.writeLog';
|
|
3
|
+
var pc = {
|
|
4
|
+
vs: '1.7.0'
|
|
5
|
+
};
|
|
6
|
+
var platform = {
|
|
7
|
+
pc: pc
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
function writeLog(params) {
|
|
11
|
+
initAPI(apiName, {
|
|
12
|
+
params: params,
|
|
13
|
+
platform: platform
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { writeLog };
|
package/es/index.d.ts
CHANGED
|
@@ -110,10 +110,11 @@ import { disable as pullToRefreshDisable } from './api/ui/pullToRefresh/disable'
|
|
|
110
110
|
import { getItem } from './api/util/domainStorage/getItem';
|
|
111
111
|
import { setItem } from './api/util/domainStorage/setItem';
|
|
112
112
|
import { removeItem } from './api/util/domainStorage/removeItem';
|
|
113
|
+
import { writeLog } from './api/util/tool/log';
|
|
113
114
|
import { send as webViewMessageSend } from './api/biz/webViewMessage/send';
|
|
114
115
|
import { talYoungFilesUpload } from './api/app/custom/talYoungFilesUpload';
|
|
115
116
|
declare const version: string, sdkVersion: string, env: import("./lib/sdk/sdk.typings").IENV, platform: import("./lib/sdk/sdk.typings").ENV_ENUM, platformV2: import("./lib/sdk/sdk.typings").PlatformV2Props, config: (configParams: import("./lib/sdk/sdk.typings").IConfigParams) => void, ready: (readyCallback: () => void) => void, error: (callback: (err: any) => void) => void, on: (methodName: string, listener: (e: any) => void) => void, off: (methodName: string, listener: (e: any) => void) => void;
|
|
116
|
-
export { version, sdkVersion, env, platform, platformV2, config, ready, error, on, off, openLink, feedback, open, openSlidePanel, share, previewFile, previewImage, downloadFile, uploadAttachment, clipboardFileUpload, proxy, datepicker, scan, chosen, openSingleWebview, getSingleWebviewData, injectScript, closeWindow, showCallMenu, call, setIcon, setTitle, setMenu, close, replacePage, quit, setRight, setTitleExpandIcon, updateExpandTitle, setLeft, goBack, complexPicker, departmentsPicker, groupComplexPicker, chooseConversationByCorpId, pickConversation, openSingleChat, openTeamChat, openSquad, sendP2PMsg, mapView, multipointView, requestAuthCode, createTab, weeklyShare, showPreloader, hidePreloader, vibrate, toast, alert, confirm, getPhoneInfo, getUUID, checkStepPermission, getGeolocation, getGeolocationSwitch, getLang, startRecord, stopRecord, onRecordEnd, downloadAudio, playAudio, pauseAudio, stopAudio, onPlayEnd, resumeAudio, getNetworkType, isAtTal, webViewBounceDisable, pullToRefreshEnable, pullToRefreshStop, pullToRefreshDisable, getItem, setItem, removeItem, remind, takePicture, datetimepicker, actionSheet, webViewMessageSend, talYoungFilesUpload, openVideoPlayer, openMediaFileDialog, mediaFileUpload, invoice, pushWorkMsg, openTalYoungToTopic, getToken, authStart, authFinish, openTogetherEyeWebview, getTogetherConfig, rouseApp, externalLinkPreviewFile, savePic, zfbAuth, complain, onRecordEnd_v2, startRecord_v2, stopRecord_v2, selectDepartment, setWindowBig, tencentMeeting, tencentMeetingBegin, createModifySchedule, setLight, };
|
|
117
|
+
export { version, sdkVersion, env, platform, platformV2, config, ready, error, on, off, openLink, feedback, open, openSlidePanel, share, previewFile, previewImage, downloadFile, uploadAttachment, clipboardFileUpload, proxy, datepicker, scan, chosen, openSingleWebview, getSingleWebviewData, injectScript, closeWindow, showCallMenu, call, setIcon, setTitle, setMenu, close, replacePage, quit, setRight, setTitleExpandIcon, updateExpandTitle, setLeft, goBack, complexPicker, departmentsPicker, groupComplexPicker, chooseConversationByCorpId, pickConversation, openSingleChat, openTeamChat, openSquad, sendP2PMsg, mapView, multipointView, requestAuthCode, createTab, weeklyShare, showPreloader, hidePreloader, vibrate, toast, alert, confirm, getPhoneInfo, getUUID, checkStepPermission, getGeolocation, getGeolocationSwitch, getLang, startRecord, stopRecord, onRecordEnd, downloadAudio, playAudio, pauseAudio, stopAudio, onPlayEnd, resumeAudio, getNetworkType, isAtTal, webViewBounceDisable, pullToRefreshEnable, pullToRefreshStop, pullToRefreshDisable, getItem, setItem, removeItem, writeLog, remind, takePicture, datetimepicker, actionSheet, webViewMessageSend, talYoungFilesUpload, openVideoPlayer, openMediaFileDialog, mediaFileUpload, invoice, pushWorkMsg, openTalYoungToTopic, getToken, authStart, authFinish, openTogetherEyeWebview, getTogetherConfig, rouseApp, externalLinkPreviewFile, savePic, zfbAuth, complain, onRecordEnd_v2, startRecord_v2, stopRecord_v2, selectDepartment, setWindowBig, tencentMeeting, tencentMeetingBegin, createModifySchedule, setLight, };
|
|
117
118
|
declare const _default: {
|
|
118
119
|
version: string;
|
|
119
120
|
sdkVersion: string;
|
|
@@ -277,6 +278,9 @@ declare const _default: {
|
|
|
277
278
|
setItem: typeof setItem;
|
|
278
279
|
removeItem: typeof removeItem;
|
|
279
280
|
};
|
|
281
|
+
tool: {
|
|
282
|
+
writeLog: typeof writeLog;
|
|
283
|
+
};
|
|
280
284
|
};
|
|
281
285
|
app: {
|
|
282
286
|
custom: {
|
package/es/index.js
CHANGED
|
@@ -125,7 +125,9 @@ import { disable as pullToRefreshDisable } from './api/ui/pullToRefresh/disable'
|
|
|
125
125
|
|
|
126
126
|
import { getItem } from './api/util/domainStorage/getItem';
|
|
127
127
|
import { setItem } from './api/util/domainStorage/setItem';
|
|
128
|
-
import { removeItem } from './api/util/domainStorage/removeItem';
|
|
128
|
+
import { removeItem } from './api/util/domainStorage/removeItem'; // log
|
|
129
|
+
|
|
130
|
+
import { writeLog } from './api/util/tool/log';
|
|
129
131
|
import { send as webViewMessageSend } from './api/biz/webViewMessage/send';
|
|
130
132
|
import { talYoungFilesUpload } from './api/app/custom/talYoungFilesUpload';
|
|
131
133
|
console.log('add rouseApp ------------>', rouseApp);
|
|
@@ -140,7 +142,7 @@ var _yachSdk$exportSdk = yachSdk.exportSdk,
|
|
|
140
142
|
error = _yachSdk$exportSdk.error,
|
|
141
143
|
on = _yachSdk$exportSdk.on,
|
|
142
144
|
off = _yachSdk$exportSdk.off;
|
|
143
|
-
export { version, sdkVersion, env, platform, platformV2, config, ready, error, on, off, openLink, feedback, open, openSlidePanel, share, previewFile, previewImage, downloadFile, uploadAttachment, clipboardFileUpload, proxy, datepicker, scan, chosen, openSingleWebview, getSingleWebviewData, injectScript, closeWindow, showCallMenu, call, setIcon, setTitle, setMenu, close, replacePage, quit, setRight, setTitleExpandIcon, updateExpandTitle, setLeft, goBack, complexPicker, departmentsPicker, groupComplexPicker, chooseConversationByCorpId, pickConversation, openSingleChat, openTeamChat, openSquad, sendP2PMsg, mapView, multipointView, requestAuthCode, createTab, weeklyShare, showPreloader, hidePreloader, vibrate, toast, alert, confirm, getPhoneInfo, getUUID, checkStepPermission, getGeolocation, getGeolocationSwitch, getLang, startRecord, stopRecord, onRecordEnd, downloadAudio, playAudio, pauseAudio, stopAudio, onPlayEnd, resumeAudio, getNetworkType, isAtTal, webViewBounceDisable, pullToRefreshEnable, pullToRefreshStop, pullToRefreshDisable, getItem, setItem, removeItem, remind, takePicture, datetimepicker, actionSheet, webViewMessageSend, talYoungFilesUpload, openVideoPlayer, openMediaFileDialog, mediaFileUpload, invoice, pushWorkMsg, openTalYoungToTopic, getToken, authStart, authFinish, openTogetherEyeWebview, getTogetherConfig, rouseApp, externalLinkPreviewFile, savePic, zfbAuth, complain, onRecordEnd_v2, startRecord_v2, stopRecord_v2, selectDepartment, setWindowBig, tencentMeeting, tencentMeetingBegin, createModifySchedule, setLight };
|
|
145
|
+
export { version, sdkVersion, env, platform, platformV2, config, ready, error, on, off, openLink, feedback, open, openSlidePanel, share, previewFile, previewImage, downloadFile, uploadAttachment, clipboardFileUpload, proxy, datepicker, scan, chosen, openSingleWebview, getSingleWebviewData, injectScript, closeWindow, showCallMenu, call, setIcon, setTitle, setMenu, close, replacePage, quit, setRight, setTitleExpandIcon, updateExpandTitle, setLeft, goBack, complexPicker, departmentsPicker, groupComplexPicker, chooseConversationByCorpId, pickConversation, openSingleChat, openTeamChat, openSquad, sendP2PMsg, mapView, multipointView, requestAuthCode, createTab, weeklyShare, showPreloader, hidePreloader, vibrate, toast, alert, confirm, getPhoneInfo, getUUID, checkStepPermission, getGeolocation, getGeolocationSwitch, getLang, startRecord, stopRecord, onRecordEnd, downloadAudio, playAudio, pauseAudio, stopAudio, onPlayEnd, resumeAudio, getNetworkType, isAtTal, webViewBounceDisable, pullToRefreshEnable, pullToRefreshStop, pullToRefreshDisable, getItem, setItem, removeItem, writeLog, remind, takePicture, datetimepicker, actionSheet, webViewMessageSend, talYoungFilesUpload, openVideoPlayer, openMediaFileDialog, mediaFileUpload, invoice, pushWorkMsg, openTalYoungToTopic, getToken, authStart, authFinish, openTogetherEyeWebview, getTogetherConfig, rouseApp, externalLinkPreviewFile, savePic, zfbAuth, complain, onRecordEnd_v2, startRecord_v2, stopRecord_v2, selectDepartment, setWindowBig, tencentMeeting, tencentMeetingBegin, createModifySchedule, setLight };
|
|
144
146
|
export default {
|
|
145
147
|
version: version,
|
|
146
148
|
sdkVersion: sdkVersion,
|
|
@@ -303,6 +305,9 @@ export default {
|
|
|
303
305
|
getItem: getItem,
|
|
304
306
|
setItem: setItem,
|
|
305
307
|
removeItem: removeItem
|
|
308
|
+
},
|
|
309
|
+
tool: {
|
|
310
|
+
writeLog: writeLog
|
|
306
311
|
}
|
|
307
312
|
},
|
|
308
313
|
app: {
|
package/es/lib/bridge/mobile.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import _setTimeout from "@babel/runtime-corejs3/core-js/set-timeout";
|
|
2
|
-
import _Promise from "@babel/runtime-corejs3/core-js/promise";
|
|
3
|
-
import _Object$assign from "@babel/runtime-corejs3/core-js/object/assign";
|
|
4
1
|
import _parseInt from "@babel/runtime-corejs3/core-js/parse-int";
|
|
2
|
+
import _Object$assign from "@babel/runtime-corejs3/core-js/object/assign";
|
|
3
|
+
import _Promise from "@babel/runtime-corejs3/core-js/promise";
|
|
4
|
+
import _setTimeout from "@babel/runtime-corejs3/core-js/set-timeout";
|
|
5
5
|
import Event from '../helper/event';
|
|
6
6
|
import { electronResCodeMap } from '../helper/codeMap';
|
|
7
7
|
import { log, bpitLog } from '../../utils';
|
package/es/lib/bridge/pc.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _Promise from "@babel/runtime-corejs3/core-js/promise";
|
|
2
1
|
import _parseInt from "@babel/runtime-corejs3/core-js/parse-int";
|
|
2
|
+
import _Promise from "@babel/runtime-corejs3/core-js/promise";
|
|
3
3
|
import PcIframe from '../helper/pcIframe';
|
|
4
4
|
import { electronResCodeMap } from '../helper/codeMap';
|
|
5
5
|
import { log, bpitLog } from '../../utils';
|
package/es/lib/helper/event.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
2
|
-
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
3
|
-
import _Array$isArray from "@babel/runtime-corejs3/core-js/array/is-array";
|
|
4
|
-
import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js/instance/index-of";
|
|
5
|
-
import _spliceInstanceProperty from "@babel/runtime-corejs3/core-js/instance/splice";
|
|
6
1
|
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js/instance/for-each";
|
|
2
|
+
import _spliceInstanceProperty from "@babel/runtime-corejs3/core-js/instance/splice";
|
|
3
|
+
import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js/instance/index-of";
|
|
4
|
+
import _Array$isArray from "@babel/runtime-corejs3/core-js/array/is-array";
|
|
5
|
+
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
7
6
|
|
|
8
|
-
var Event =
|
|
7
|
+
var Event = function Event() {
|
|
9
8
|
var _this = this;
|
|
10
9
|
|
|
11
10
|
_classCallCheck(this, Event);
|
|
@@ -47,7 +46,7 @@ var Event = /*#__PURE__*/_createClass(function Event() {
|
|
|
47
46
|
};
|
|
48
47
|
|
|
49
48
|
this.eventsHandle = {};
|
|
50
|
-
}
|
|
49
|
+
};
|
|
51
50
|
|
|
52
51
|
var event = new Event();
|
|
53
52
|
export default event;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
2
|
-
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
3
|
-
import _Date$now from "@babel/runtime-corejs3/core-js/date/now";
|
|
4
1
|
import _JSON$stringify from "@babel/runtime-corejs3/core-js/json/stringify";
|
|
2
|
+
import _Date$now from "@babel/runtime-corejs3/core-js/date/now";
|
|
3
|
+
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
5
4
|
import { log } from '../../utils';
|
|
6
5
|
import Event from './event'; // 处理posmessage参数
|
|
7
6
|
|
|
8
|
-
var GenPostMsg =
|
|
7
|
+
var GenPostMsg = function GenPostMsg(method, param, callback) {
|
|
9
8
|
var _this = this;
|
|
10
9
|
|
|
11
10
|
_classCallCheck(this, GenPostMsg);
|
|
@@ -48,9 +47,9 @@ var GenPostMsg = /*#__PURE__*/_createClass(function GenPostMsg(method, param, ca
|
|
|
48
47
|
// };
|
|
49
48
|
// }.bind(this)
|
|
50
49
|
// );
|
|
51
|
-
}
|
|
50
|
+
};
|
|
52
51
|
|
|
53
|
-
var Frame =
|
|
52
|
+
var Frame = function Frame() {
|
|
54
53
|
var _this2 = this;
|
|
55
54
|
|
|
56
55
|
_classCallCheck(this, Frame);
|
|
@@ -173,7 +172,7 @@ var Frame = /*#__PURE__*/_createClass(function Frame() {
|
|
|
173
172
|
};
|
|
174
173
|
|
|
175
174
|
this.pendingMsgs = {};
|
|
176
|
-
}
|
|
175
|
+
};
|
|
177
176
|
|
|
178
177
|
var frame = new Frame();
|
|
179
178
|
export default frame;
|
package/es/lib/sdk/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ declare class Sdk {
|
|
|
13
13
|
setAPI(method: string, config: IInvokeAPIConfigMap): void;
|
|
14
14
|
setPlatform(value: IPlatformConfig): void;
|
|
15
15
|
bridgeInitFn(): any;
|
|
16
|
+
_onFail(method: any, errorcode: any, message: any, onFail: any): void;
|
|
16
17
|
invokeAPI(method: string, params?: any): void;
|
|
17
18
|
}
|
|
18
19
|
export default Sdk;
|
package/es/lib/sdk/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
2
|
+
import _Promise from "@babel/runtime-corejs3/core-js/promise";
|
|
1
3
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
2
4
|
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
3
|
-
import _Promise from "@babel/runtime-corejs3/core-js/promise";
|
|
4
|
-
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
5
5
|
import { bpitLog } from '../../utils';
|
|
6
|
-
import
|
|
6
|
+
import { compareVersions } from '../../utils/compareVersions';
|
|
7
|
+
import { version } from '../../../package.json';
|
|
7
8
|
|
|
8
9
|
var Sdk = /*#__PURE__*/function () {
|
|
9
10
|
function Sdk(env) {
|
|
@@ -24,7 +25,7 @@ var Sdk = /*#__PURE__*/function () {
|
|
|
24
25
|
this.env = env;
|
|
25
26
|
this.exportSdk = {
|
|
26
27
|
version: env.version,
|
|
27
|
-
sdkVersion:
|
|
28
|
+
sdkVersion: version,
|
|
28
29
|
// sdkVersion: '0.0.0',
|
|
29
30
|
env: env,
|
|
30
31
|
platform: env.platform,
|
|
@@ -108,31 +109,45 @@ var Sdk = /*#__PURE__*/function () {
|
|
|
108
109
|
|
|
109
110
|
return this.bridgeInitFnPromise;
|
|
110
111
|
}
|
|
112
|
+
}, {
|
|
113
|
+
key: "_onFail",
|
|
114
|
+
value: function _onFail(method, errorcode, message, onFail) {
|
|
115
|
+
bpitLog({
|
|
116
|
+
method: method,
|
|
117
|
+
errorcode: errorcode,
|
|
118
|
+
message: message
|
|
119
|
+
});
|
|
120
|
+
onFail && typeof onFail == 'function' && onFail({
|
|
121
|
+
code: errorcode,
|
|
122
|
+
message: message
|
|
123
|
+
});
|
|
124
|
+
}
|
|
111
125
|
}, {
|
|
112
126
|
key: "invokeAPI",
|
|
113
127
|
value: function invokeAPI(method, params) {
|
|
128
|
+
var _context2;
|
|
129
|
+
|
|
114
130
|
if (!params) params = {};
|
|
115
131
|
if (!method) return; // 验证方法是否可用
|
|
116
132
|
|
|
117
133
|
var apiConfigs = this.invokeAPIConfigMapByMethod[method];
|
|
118
134
|
|
|
119
135
|
if (!apiConfigs) {
|
|
120
|
-
|
|
121
|
-
method: method,
|
|
122
|
-
errorcode: '-1',
|
|
123
|
-
message: "".concat(method, " do not exist")
|
|
124
|
-
});
|
|
125
|
-
params.onFail({
|
|
126
|
-
code: '-1',
|
|
127
|
-
message: "".concat(method, " do not exist")
|
|
128
|
-
});
|
|
129
|
-
return;
|
|
136
|
+
return this._onFail(method, '-1', "[".concat(method, "] method is not exist"), params.onFail);
|
|
130
137
|
}
|
|
131
138
|
|
|
132
139
|
var apiConfig = apiConfigs[this.env.platform];
|
|
133
140
|
|
|
134
141
|
if (apiConfig) {
|
|
135
|
-
|
|
142
|
+
var supportVersion = apiConfig.vs || '0.0.0';
|
|
143
|
+
|
|
144
|
+
if (compareVersions(this.env.version, supportVersion) < 0) {
|
|
145
|
+
var _context;
|
|
146
|
+
|
|
147
|
+
return this._onFail(method, '-1', _concatInstanceProperty(_context = "The current application version is ".concat(this.env.version, ". This method does not support versions less than ")).call(_context, supportVersion), params.onFail);
|
|
148
|
+
} // 确定参数
|
|
149
|
+
|
|
150
|
+
|
|
136
151
|
var p = apiConfig.paramsDeal ? apiConfig.paramsDeal(params) : params; // 确定回调
|
|
137
152
|
|
|
138
153
|
if ('function' == typeof p.onSuccess) {
|
|
@@ -154,20 +169,7 @@ var Sdk = /*#__PURE__*/function () {
|
|
|
154
169
|
return;
|
|
155
170
|
}
|
|
156
171
|
|
|
157
|
-
|
|
158
|
-
var _context, _context2;
|
|
159
|
-
|
|
160
|
-
bpitLog({
|
|
161
|
-
method: method,
|
|
162
|
-
errorcode: '-1',
|
|
163
|
-
message: _concatInstanceProperty(_context = "".concat(method, " do not support the current platform (")).call(_context, this.env.platform, ")")
|
|
164
|
-
});
|
|
165
|
-
params.onFail({
|
|
166
|
-
code: '-1',
|
|
167
|
-
message: _concatInstanceProperty(_context2 = "".concat(method, " do not support the current platform (")).call(_context2, this.env.platform, ")")
|
|
168
|
-
});
|
|
169
|
-
} // console.log(`${method} do not support the current platform (${this.env.platform})`);
|
|
170
|
-
|
|
172
|
+
this._onFail(method, '-1', _concatInstanceProperty(_context2 = "[".concat(method, "] method do not support the current platform (")).call(_context2, this.env.platform, ")"), params.onFail);
|
|
171
173
|
}
|
|
172
174
|
}]);
|
|
173
175
|
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compare [semver](https://semver.org/) version strings to find greater, equal or lesser.
|
|
3
|
+
* This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`.
|
|
4
|
+
* @param v1 - First version to compare
|
|
5
|
+
* @param v2 - Second version to compare
|
|
6
|
+
* @returns Numeric value compatible with the [Array.sort(fn) interface](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Parameters).
|
|
7
|
+
*/
|
|
8
|
+
export declare const compareVersions: (v1: string, v2: string) => 0 | 1 | -1;
|
|
9
|
+
/**
|
|
10
|
+
* Validate [semver](https://semver.org/) version strings.
|
|
11
|
+
*
|
|
12
|
+
* @param version Version number to validate
|
|
13
|
+
* @returns `true` if the version number is a valid semver version number, `false` otherwise.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```
|
|
17
|
+
* validate('1.0.0-rc.1'); // return true
|
|
18
|
+
* validate('1.0-rc.1'); // return false
|
|
19
|
+
* validate('foo'); // return false
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare const validate: (version: string) => boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Allowed arithmetic operators
|
|
25
|
+
*/
|
|
26
|
+
export declare type CompareOperator = '>' | '>=' | '=' | '<' | '<=';
|
|
27
|
+
/**
|
|
28
|
+
* Compare [semver](https://semver.org/) version strings using the specified operator.
|
|
29
|
+
*
|
|
30
|
+
* @param v1 First version to compare
|
|
31
|
+
* @param v2 Second version to compare
|
|
32
|
+
* @param operator Allowed arithmetic operator to use
|
|
33
|
+
* @returns `true` if the comparison between the firstVersion and the secondVersion satisfies the operator, `false` otherwise.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```
|
|
37
|
+
* compare('10.1.8', '10.0.4', '>'); // return true
|
|
38
|
+
* compare('10.0.1', '10.0.1', '='); // return true
|
|
39
|
+
* compare('10.1.1', '10.2.2', '<'); // return true
|
|
40
|
+
* compare('10.1.1', '10.2.2', '<='); // return true
|
|
41
|
+
* compare('10.1.1', '10.2.2', '>='); // return false
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare const compare: (v1: string, v2: string, operator: CompareOperator) => boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Match [npm semver](https://docs.npmjs.com/cli/v6/using-npm/semver) version range.
|
|
47
|
+
*
|
|
48
|
+
* @param version Version number to match
|
|
49
|
+
* @param range Range pattern for version
|
|
50
|
+
* @returns `true` if the version number is within the range, `false` otherwise.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```
|
|
54
|
+
* satisfies('1.1.0', '^1.0.0'); // return true
|
|
55
|
+
* satisfies('1.1.0', '~1.0.0'); // return false
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export declare const satisfies: (version: string, range: string) => boolean;
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js/instance/index-of";
|
|
2
|
+
import _Object$keys from "@babel/runtime-corejs3/core-js/object/keys";
|
|
3
|
+
import _typeof from "@babel/runtime-corejs3/helpers/typeof";
|
|
4
|
+
import _parseInt from "@babel/runtime-corejs3/core-js/parse-int";
|
|
5
|
+
import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
|
|
6
|
+
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js/instance/includes";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Compare [semver](https://semver.org/) version strings to find greater, equal or lesser.
|
|
10
|
+
* This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`.
|
|
11
|
+
* @param v1 - First version to compare
|
|
12
|
+
* @param v2 - Second version to compare
|
|
13
|
+
* @returns Numeric value compatible with the [Array.sort(fn) interface](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Parameters).
|
|
14
|
+
*/
|
|
15
|
+
export var compareVersions = function compareVersions(v1, v2) {
|
|
16
|
+
// validate input and split into segments
|
|
17
|
+
var n1 = validateAndParse(v1);
|
|
18
|
+
var n2 = validateAndParse(v2); // pop off the patch
|
|
19
|
+
|
|
20
|
+
var p1 = n1.pop();
|
|
21
|
+
var p2 = n2.pop(); // validate numbers
|
|
22
|
+
|
|
23
|
+
var r = compareSegments(n1, n2);
|
|
24
|
+
if (r !== 0) return r; // validate pre-release
|
|
25
|
+
|
|
26
|
+
if (p1 && p2) {
|
|
27
|
+
return compareSegments(p1.split('.'), p2.split('.'));
|
|
28
|
+
} else if (p1 || p2) {
|
|
29
|
+
return p1 ? -1 : 1;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return 0;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Validate [semver](https://semver.org/) version strings.
|
|
36
|
+
*
|
|
37
|
+
* @param version Version number to validate
|
|
38
|
+
* @returns `true` if the version number is a valid semver version number, `false` otherwise.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```
|
|
42
|
+
* validate('1.0.0-rc.1'); // return true
|
|
43
|
+
* validate('1.0-rc.1'); // return false
|
|
44
|
+
* validate('foo'); // return false
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
export var validate = function validate(version) {
|
|
49
|
+
return typeof version === 'string' && /^[v\d]/.test(version) && semver.test(version);
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Compare [semver](https://semver.org/) version strings using the specified operator.
|
|
53
|
+
*
|
|
54
|
+
* @param v1 First version to compare
|
|
55
|
+
* @param v2 Second version to compare
|
|
56
|
+
* @param operator Allowed arithmetic operator to use
|
|
57
|
+
* @returns `true` if the comparison between the firstVersion and the secondVersion satisfies the operator, `false` otherwise.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```
|
|
61
|
+
* compare('10.1.8', '10.0.4', '>'); // return true
|
|
62
|
+
* compare('10.0.1', '10.0.1', '='); // return true
|
|
63
|
+
* compare('10.1.1', '10.2.2', '<'); // return true
|
|
64
|
+
* compare('10.1.1', '10.2.2', '<='); // return true
|
|
65
|
+
* compare('10.1.1', '10.2.2', '>='); // return false
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
export var compare = function compare(v1, v2, operator) {
|
|
70
|
+
var _context;
|
|
71
|
+
|
|
72
|
+
// validate input operator
|
|
73
|
+
assertValidOperator(operator); // since result of compareVersions can only be -1 or 0 or 1
|
|
74
|
+
// a simple map can be used to replace switch
|
|
75
|
+
|
|
76
|
+
var res = compareVersions(v1, v2);
|
|
77
|
+
return _includesInstanceProperty(_context = operatorResMap[operator]).call(_context, res);
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Match [npm semver](https://docs.npmjs.com/cli/v6/using-npm/semver) version range.
|
|
81
|
+
*
|
|
82
|
+
* @param version Version number to match
|
|
83
|
+
* @param range Range pattern for version
|
|
84
|
+
* @returns `true` if the version number is within the range, `false` otherwise.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```
|
|
88
|
+
* satisfies('1.1.0', '^1.0.0'); // return true
|
|
89
|
+
* satisfies('1.1.0', '~1.0.0'); // return false
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
|
|
93
|
+
export var satisfies = function satisfies(version, range) {
|
|
94
|
+
// if no range operator then "="
|
|
95
|
+
var m = range.match(/^([<>=~^]+)/);
|
|
96
|
+
var op = m ? m[1] : '='; // if gt/lt/eq then operator compare
|
|
97
|
+
|
|
98
|
+
if (op !== '^' && op !== '~') return compare(version, range, op); // else range of either "~" or "^" is assumed
|
|
99
|
+
|
|
100
|
+
var _validateAndParse = validateAndParse(version),
|
|
101
|
+
_validateAndParse2 = _slicedToArray(_validateAndParse, 3),
|
|
102
|
+
v1 = _validateAndParse2[0],
|
|
103
|
+
v2 = _validateAndParse2[1],
|
|
104
|
+
v3 = _validateAndParse2[2];
|
|
105
|
+
|
|
106
|
+
var _validateAndParse3 = validateAndParse(range),
|
|
107
|
+
_validateAndParse4 = _slicedToArray(_validateAndParse3, 3),
|
|
108
|
+
r1 = _validateAndParse4[0],
|
|
109
|
+
r2 = _validateAndParse4[1],
|
|
110
|
+
r3 = _validateAndParse4[2];
|
|
111
|
+
|
|
112
|
+
if (compareStrings(v1, r1) !== 0) return false;
|
|
113
|
+
|
|
114
|
+
if (op === '^') {
|
|
115
|
+
return compareSegments([v2, v3], [r2, r3]) >= 0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (compareStrings(v2, r2) !== 0) return false;
|
|
119
|
+
return compareStrings(v3, r3) >= 0;
|
|
120
|
+
};
|
|
121
|
+
var semver = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;
|
|
122
|
+
|
|
123
|
+
var validateAndParse = function validateAndParse(version) {
|
|
124
|
+
if (typeof version !== 'string') {
|
|
125
|
+
throw new TypeError('Invalid argument expected string');
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
var match = version.match(semver);
|
|
129
|
+
|
|
130
|
+
if (!match) {
|
|
131
|
+
throw new Error("Invalid argument not valid semver ('".concat(version, "' received)"));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
match.shift();
|
|
135
|
+
return match;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
var isWildcard = function isWildcard(s) {
|
|
139
|
+
return s === '*' || s === 'x' || s === 'X';
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
var tryParse = function tryParse(v) {
|
|
143
|
+
var n = _parseInt(v, 10);
|
|
144
|
+
|
|
145
|
+
return isNaN(n) ? v : n;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
var forceType = function forceType(a, b) {
|
|
149
|
+
return _typeof(a) !== _typeof(b) ? [String(a), String(b)] : [a, b];
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
var compareStrings = function compareStrings(a, b) {
|
|
153
|
+
if (isWildcard(a) || isWildcard(b)) return 0;
|
|
154
|
+
|
|
155
|
+
var _forceType = forceType(tryParse(a), tryParse(b)),
|
|
156
|
+
_forceType2 = _slicedToArray(_forceType, 2),
|
|
157
|
+
ap = _forceType2[0],
|
|
158
|
+
bp = _forceType2[1];
|
|
159
|
+
|
|
160
|
+
if (ap > bp) return 1;
|
|
161
|
+
if (ap < bp) return -1;
|
|
162
|
+
return 0;
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
var compareSegments = function compareSegments(a, b) {
|
|
166
|
+
for (var i = 0; i < Math.max(a.length, b.length); i++) {
|
|
167
|
+
var r = compareStrings(a[i] || '0', b[i] || '0');
|
|
168
|
+
if (r !== 0) return r;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return 0;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
var operatorResMap = {
|
|
175
|
+
'>': [1],
|
|
176
|
+
'>=': [0, 1],
|
|
177
|
+
'=': [0],
|
|
178
|
+
'<=': [-1, 0],
|
|
179
|
+
'<': [-1]
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
var allowedOperators = _Object$keys(operatorResMap);
|
|
183
|
+
|
|
184
|
+
var assertValidOperator = function assertValidOperator(op) {
|
|
185
|
+
if (typeof op !== 'string') {
|
|
186
|
+
throw new TypeError("Invalid operator type, expected string but got ".concat(_typeof(op)));
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
if (_indexOfInstanceProperty(allowedOperators).call(allowedOperators, op) === -1) {
|
|
190
|
+
throw new Error("Invalid operator, expected one of ".concat(allowedOperators.join('|')));
|
|
191
|
+
}
|
|
192
|
+
};
|
package/es/utils/console.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import _bindInstanceProperty from "@babel/runtime-corejs3/core-js/instance/bind";
|
|
2
|
+
|
|
1
3
|
var _context, _context2, _context3;
|
|
2
4
|
|
|
3
|
-
import _bindInstanceProperty from "@babel/runtime-corejs3/core-js/instance/bind";
|
|
4
5
|
// 防止被应用复写console
|
|
5
6
|
var myconsole = {
|
|
6
7
|
log: function log() {},
|
package/es/utils/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _Date$now from "@babel/runtime-corejs3/core-js/date/now";
|
|
2
1
|
import _Object$assign from "@babel/runtime-corejs3/core-js/object/assign";
|
|
2
|
+
import _Date$now from "@babel/runtime-corejs3/core-js/date/now";
|
|
3
3
|
import { getENV } from './env';
|
|
4
4
|
import bpitLog from './bpitLog';
|
|
5
5
|
import { log, error, warn } from './console';
|