yach.open.jssdk 4.2.4-beta2 → 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/sdk/index.d.ts +1 -0
- package/es/lib/sdk/index.js +27 -25
- package/es/utils/compareVersions.d.ts +58 -0
- package/es/utils/compareVersions.js +192 -0
- 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 +13 -0
- package/libs/lib/sdk/index.d.ts +1 -0
- package/libs/lib/sdk/index.js +28 -25
- package/libs/utils/compareVersions.d.ts +58 -0
- package/libs/utils/compareVersions.js +218 -0
- package/package.json +1 -1
- package/dist/yach_jssdk_4.2.4-beta2.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/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
|
@@ -3,6 +3,7 @@ import _Promise from "@babel/runtime-corejs3/core-js/promise";
|
|
|
3
3
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
4
4
|
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
5
5
|
import { bpitLog } from '../../utils';
|
|
6
|
+
import { compareVersions } from '../../utils/compareVersions';
|
|
6
7
|
import { version } from '../../../package.json';
|
|
7
8
|
|
|
8
9
|
var Sdk = /*#__PURE__*/function () {
|
|
@@ -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
|
+
};
|
|
@@ -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,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
|
|
6
|
+
|
|
7
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
exports.writeLog = writeLog;
|
|
12
|
+
|
|
13
|
+
var _initAPI = _interopRequireDefault(require("../../initAPI"));
|
|
14
|
+
|
|
15
|
+
var apiName = 'util.tool.writeLog';
|
|
16
|
+
var pc = {
|
|
17
|
+
vs: '1.7.0'
|
|
18
|
+
};
|
|
19
|
+
var platform = {
|
|
20
|
+
pc: pc
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
function writeLog(params) {
|
|
24
|
+
(0, _initAPI["default"])(apiName, {
|
|
25
|
+
params: params,
|
|
26
|
+
platform: platform
|
|
27
|
+
});
|
|
28
|
+
}
|
package/libs/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/libs/index.js
CHANGED
|
@@ -734,6 +734,13 @@ _Object$defineProperty(exports, "removeItem", {
|
|
|
734
734
|
}
|
|
735
735
|
});
|
|
736
736
|
|
|
737
|
+
_Object$defineProperty(exports, "writeLog", {
|
|
738
|
+
enumerable: true,
|
|
739
|
+
get: function get() {
|
|
740
|
+
return _log.writeLog;
|
|
741
|
+
}
|
|
742
|
+
});
|
|
743
|
+
|
|
737
744
|
_Object$defineProperty(exports, "webViewMessageSend", {
|
|
738
745
|
enumerable: true,
|
|
739
746
|
get: function get() {
|
|
@@ -960,6 +967,8 @@ var _setItem = require("./api/util/domainStorage/setItem");
|
|
|
960
967
|
|
|
961
968
|
var _removeItem = require("./api/util/domainStorage/removeItem");
|
|
962
969
|
|
|
970
|
+
var _log = require("./api/util/tool/log");
|
|
971
|
+
|
|
963
972
|
var _send = require("./api/biz/webViewMessage/send");
|
|
964
973
|
|
|
965
974
|
var _talYoungFilesUpload = require("./api/app/custom/talYoungFilesUpload");
|
|
@@ -986,6 +995,7 @@ var _talYoungFilesUpload = require("./api/app/custom/talYoungFilesUpload");
|
|
|
986
995
|
|
|
987
996
|
/** ui */
|
|
988
997
|
// demainStorage
|
|
998
|
+
// log
|
|
989
999
|
console.log('add rouseApp ------------>', _rouseApp.rouseApp);
|
|
990
1000
|
var _yachSdk$exportSdk = _lib.yachSdk.exportSdk,
|
|
991
1001
|
version = _yachSdk$exportSdk.version,
|
|
@@ -1170,6 +1180,9 @@ var _default = {
|
|
|
1170
1180
|
getItem: _getItem.getItem,
|
|
1171
1181
|
setItem: _setItem.setItem,
|
|
1172
1182
|
removeItem: _removeItem.removeItem
|
|
1183
|
+
},
|
|
1184
|
+
tool: {
|
|
1185
|
+
writeLog: _log.writeLog
|
|
1173
1186
|
}
|
|
1174
1187
|
},
|
|
1175
1188
|
app: {
|
package/libs/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/libs/lib/sdk/index.js
CHANGED
|
@@ -20,6 +20,8 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpe
|
|
|
20
20
|
|
|
21
21
|
var _utils = require("../../utils");
|
|
22
22
|
|
|
23
|
+
var _compareVersions = require("../../utils/compareVersions");
|
|
24
|
+
|
|
23
25
|
var _package = require("../../../package.json");
|
|
24
26
|
|
|
25
27
|
var Sdk = /*#__PURE__*/function () {
|
|
@@ -124,31 +126,45 @@ var Sdk = /*#__PURE__*/function () {
|
|
|
124
126
|
|
|
125
127
|
return this.bridgeInitFnPromise;
|
|
126
128
|
}
|
|
129
|
+
}, {
|
|
130
|
+
key: "_onFail",
|
|
131
|
+
value: function _onFail(method, errorcode, message, onFail) {
|
|
132
|
+
(0, _utils.bpitLog)({
|
|
133
|
+
method: method,
|
|
134
|
+
errorcode: errorcode,
|
|
135
|
+
message: message
|
|
136
|
+
});
|
|
137
|
+
onFail && typeof onFail == 'function' && onFail({
|
|
138
|
+
code: errorcode,
|
|
139
|
+
message: message
|
|
140
|
+
});
|
|
141
|
+
}
|
|
127
142
|
}, {
|
|
128
143
|
key: "invokeAPI",
|
|
129
144
|
value: function invokeAPI(method, params) {
|
|
145
|
+
var _context2;
|
|
146
|
+
|
|
130
147
|
if (!params) params = {};
|
|
131
148
|
if (!method) return; // 验证方法是否可用
|
|
132
149
|
|
|
133
150
|
var apiConfigs = this.invokeAPIConfigMapByMethod[method];
|
|
134
151
|
|
|
135
152
|
if (!apiConfigs) {
|
|
136
|
-
(
|
|
137
|
-
method: method,
|
|
138
|
-
errorcode: '-1',
|
|
139
|
-
message: "".concat(method, " do not exist")
|
|
140
|
-
});
|
|
141
|
-
params.onFail({
|
|
142
|
-
code: '-1',
|
|
143
|
-
message: "".concat(method, " do not exist")
|
|
144
|
-
});
|
|
145
|
-
return;
|
|
153
|
+
return this._onFail(method, '-1', "[".concat(method, "] method is not exist"), params.onFail);
|
|
146
154
|
}
|
|
147
155
|
|
|
148
156
|
var apiConfig = apiConfigs[this.env.platform];
|
|
149
157
|
|
|
150
158
|
if (apiConfig) {
|
|
151
|
-
|
|
159
|
+
var supportVersion = apiConfig.vs || '0.0.0';
|
|
160
|
+
|
|
161
|
+
if ((0, _compareVersions.compareVersions)(this.env.version, supportVersion) < 0) {
|
|
162
|
+
var _context;
|
|
163
|
+
|
|
164
|
+
return this._onFail(method, '-1', (0, _concat["default"])(_context = "The current application version is ".concat(this.env.version, ". This method does not support versions less than ")).call(_context, supportVersion), params.onFail);
|
|
165
|
+
} // 确定参数
|
|
166
|
+
|
|
167
|
+
|
|
152
168
|
var p = apiConfig.paramsDeal ? apiConfig.paramsDeal(params) : params; // 确定回调
|
|
153
169
|
|
|
154
170
|
if ('function' == typeof p.onSuccess) {
|
|
@@ -170,20 +186,7 @@ var Sdk = /*#__PURE__*/function () {
|
|
|
170
186
|
return;
|
|
171
187
|
}
|
|
172
188
|
|
|
173
|
-
|
|
174
|
-
var _context, _context2;
|
|
175
|
-
|
|
176
|
-
(0, _utils.bpitLog)({
|
|
177
|
-
method: method,
|
|
178
|
-
errorcode: '-1',
|
|
179
|
-
message: (0, _concat["default"])(_context = "".concat(method, " do not support the current platform (")).call(_context, this.env.platform, ")")
|
|
180
|
-
});
|
|
181
|
-
params.onFail({
|
|
182
|
-
code: '-1',
|
|
183
|
-
message: (0, _concat["default"])(_context2 = "".concat(method, " do not support the current platform (")).call(_context2, this.env.platform, ")")
|
|
184
|
-
});
|
|
185
|
-
} // console.log(`${method} do not support the current platform (${this.env.platform})`);
|
|
186
|
-
|
|
189
|
+
this._onFail(method, '-1', (0, _concat["default"])(_context2 = "[".concat(method, "] method do not support the current platform (")).call(_context2, this.env.platform, ")"), params.onFail);
|
|
187
190
|
}
|
|
188
191
|
}]);
|
|
189
192
|
return Sdk;
|
|
@@ -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,218 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
|
|
6
|
+
|
|
7
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
exports.satisfies = exports.compare = exports.validate = exports.compareVersions = void 0;
|
|
12
|
+
|
|
13
|
+
var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/index-of"));
|
|
14
|
+
|
|
15
|
+
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/object/keys"));
|
|
16
|
+
|
|
17
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/typeof"));
|
|
18
|
+
|
|
19
|
+
var _parseInt2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/parse-int"));
|
|
20
|
+
|
|
21
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
|
22
|
+
|
|
23
|
+
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/includes"));
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Compare [semver](https://semver.org/) version strings to find greater, equal or lesser.
|
|
27
|
+
* 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`.
|
|
28
|
+
* @param v1 - First version to compare
|
|
29
|
+
* @param v2 - Second version to compare
|
|
30
|
+
* @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).
|
|
31
|
+
*/
|
|
32
|
+
var compareVersions = function compareVersions(v1, v2) {
|
|
33
|
+
// validate input and split into segments
|
|
34
|
+
var n1 = validateAndParse(v1);
|
|
35
|
+
var n2 = validateAndParse(v2); // pop off the patch
|
|
36
|
+
|
|
37
|
+
var p1 = n1.pop();
|
|
38
|
+
var p2 = n2.pop(); // validate numbers
|
|
39
|
+
|
|
40
|
+
var r = compareSegments(n1, n2);
|
|
41
|
+
if (r !== 0) return r; // validate pre-release
|
|
42
|
+
|
|
43
|
+
if (p1 && p2) {
|
|
44
|
+
return compareSegments(p1.split('.'), p2.split('.'));
|
|
45
|
+
} else if (p1 || p2) {
|
|
46
|
+
return p1 ? -1 : 1;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return 0;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Validate [semver](https://semver.org/) version strings.
|
|
53
|
+
*
|
|
54
|
+
* @param version Version number to validate
|
|
55
|
+
* @returns `true` if the version number is a valid semver version number, `false` otherwise.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```
|
|
59
|
+
* validate('1.0.0-rc.1'); // return true
|
|
60
|
+
* validate('1.0-rc.1'); // return false
|
|
61
|
+
* validate('foo'); // return false
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
exports.compareVersions = compareVersions;
|
|
67
|
+
|
|
68
|
+
var validate = function validate(version) {
|
|
69
|
+
return typeof version === 'string' && /^[v\d]/.test(version) && semver.test(version);
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Compare [semver](https://semver.org/) version strings using the specified operator.
|
|
73
|
+
*
|
|
74
|
+
* @param v1 First version to compare
|
|
75
|
+
* @param v2 Second version to compare
|
|
76
|
+
* @param operator Allowed arithmetic operator to use
|
|
77
|
+
* @returns `true` if the comparison between the firstVersion and the secondVersion satisfies the operator, `false` otherwise.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```
|
|
81
|
+
* compare('10.1.8', '10.0.4', '>'); // return true
|
|
82
|
+
* compare('10.0.1', '10.0.1', '='); // return true
|
|
83
|
+
* compare('10.1.1', '10.2.2', '<'); // return true
|
|
84
|
+
* compare('10.1.1', '10.2.2', '<='); // return true
|
|
85
|
+
* compare('10.1.1', '10.2.2', '>='); // return false
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
exports.validate = validate;
|
|
91
|
+
|
|
92
|
+
var compare = function compare(v1, v2, operator) {
|
|
93
|
+
var _context;
|
|
94
|
+
|
|
95
|
+
// validate input operator
|
|
96
|
+
assertValidOperator(operator); // since result of compareVersions can only be -1 or 0 or 1
|
|
97
|
+
// a simple map can be used to replace switch
|
|
98
|
+
|
|
99
|
+
var res = compareVersions(v1, v2);
|
|
100
|
+
return (0, _includes["default"])(_context = operatorResMap[operator]).call(_context, res);
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Match [npm semver](https://docs.npmjs.com/cli/v6/using-npm/semver) version range.
|
|
104
|
+
*
|
|
105
|
+
* @param version Version number to match
|
|
106
|
+
* @param range Range pattern for version
|
|
107
|
+
* @returns `true` if the version number is within the range, `false` otherwise.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```
|
|
111
|
+
* satisfies('1.1.0', '^1.0.0'); // return true
|
|
112
|
+
* satisfies('1.1.0', '~1.0.0'); // return false
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
exports.compare = compare;
|
|
118
|
+
|
|
119
|
+
var satisfies = function satisfies(version, range) {
|
|
120
|
+
// if no range operator then "="
|
|
121
|
+
var m = range.match(/^([<>=~^]+)/);
|
|
122
|
+
var op = m ? m[1] : '='; // if gt/lt/eq then operator compare
|
|
123
|
+
|
|
124
|
+
if (op !== '^' && op !== '~') return compare(version, range, op); // else range of either "~" or "^" is assumed
|
|
125
|
+
|
|
126
|
+
var _validateAndParse = validateAndParse(version),
|
|
127
|
+
_validateAndParse2 = (0, _slicedToArray2["default"])(_validateAndParse, 3),
|
|
128
|
+
v1 = _validateAndParse2[0],
|
|
129
|
+
v2 = _validateAndParse2[1],
|
|
130
|
+
v3 = _validateAndParse2[2];
|
|
131
|
+
|
|
132
|
+
var _validateAndParse3 = validateAndParse(range),
|
|
133
|
+
_validateAndParse4 = (0, _slicedToArray2["default"])(_validateAndParse3, 3),
|
|
134
|
+
r1 = _validateAndParse4[0],
|
|
135
|
+
r2 = _validateAndParse4[1],
|
|
136
|
+
r3 = _validateAndParse4[2];
|
|
137
|
+
|
|
138
|
+
if (compareStrings(v1, r1) !== 0) return false;
|
|
139
|
+
|
|
140
|
+
if (op === '^') {
|
|
141
|
+
return compareSegments([v2, v3], [r2, r3]) >= 0;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if (compareStrings(v2, r2) !== 0) return false;
|
|
145
|
+
return compareStrings(v3, r3) >= 0;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
exports.satisfies = satisfies;
|
|
149
|
+
var semver = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;
|
|
150
|
+
|
|
151
|
+
var validateAndParse = function validateAndParse(version) {
|
|
152
|
+
if (typeof version !== 'string') {
|
|
153
|
+
throw new TypeError('Invalid argument expected string');
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
var match = version.match(semver);
|
|
157
|
+
|
|
158
|
+
if (!match) {
|
|
159
|
+
throw new Error("Invalid argument not valid semver ('".concat(version, "' received)"));
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
match.shift();
|
|
163
|
+
return match;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
var isWildcard = function isWildcard(s) {
|
|
167
|
+
return s === '*' || s === 'x' || s === 'X';
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
var tryParse = function tryParse(v) {
|
|
171
|
+
var n = (0, _parseInt2["default"])(v, 10);
|
|
172
|
+
return isNaN(n) ? v : n;
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
var forceType = function forceType(a, b) {
|
|
176
|
+
return (0, _typeof2["default"])(a) !== (0, _typeof2["default"])(b) ? [String(a), String(b)] : [a, b];
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
var compareStrings = function compareStrings(a, b) {
|
|
180
|
+
if (isWildcard(a) || isWildcard(b)) return 0;
|
|
181
|
+
|
|
182
|
+
var _forceType = forceType(tryParse(a), tryParse(b)),
|
|
183
|
+
_forceType2 = (0, _slicedToArray2["default"])(_forceType, 2),
|
|
184
|
+
ap = _forceType2[0],
|
|
185
|
+
bp = _forceType2[1];
|
|
186
|
+
|
|
187
|
+
if (ap > bp) return 1;
|
|
188
|
+
if (ap < bp) return -1;
|
|
189
|
+
return 0;
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
var compareSegments = function compareSegments(a, b) {
|
|
193
|
+
for (var i = 0; i < Math.max(a.length, b.length); i++) {
|
|
194
|
+
var r = compareStrings(a[i] || '0', b[i] || '0');
|
|
195
|
+
if (r !== 0) return r;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return 0;
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
var operatorResMap = {
|
|
202
|
+
'>': [1],
|
|
203
|
+
'>=': [0, 1],
|
|
204
|
+
'=': [0],
|
|
205
|
+
'<=': [-1, 0],
|
|
206
|
+
'<': [-1]
|
|
207
|
+
};
|
|
208
|
+
var allowedOperators = (0, _keys["default"])(operatorResMap);
|
|
209
|
+
|
|
210
|
+
var assertValidOperator = function assertValidOperator(op) {
|
|
211
|
+
if (typeof op !== 'string') {
|
|
212
|
+
throw new TypeError("Invalid operator type, expected string but got ".concat((0, _typeof2["default"])(op)));
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
if ((0, _indexOf["default"])(allowedOperators).call(allowedOperators, op) === -1) {
|
|
216
|
+
throw new Error("Invalid operator, expected one of ".concat(allowedOperators.join('|')));
|
|
217
|
+
}
|
|
218
|
+
};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
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-beta2"}')},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 Zt})),t.d(e,"sdkVersion",(function(){return Qt})),t.d(e,"env",(function(){return Xt})),t.d(e,"platform",(function(){return no})),t.d(e,"platformV2",(function(){return eo})),t.d(e,"config",(function(){return to})),t.d(e,"ready",(function(){return oo})),t.d(e,"error",(function(){return io})),t.d(e,"on",(function(){return ro})),t.d(e,"off",(function(){return ao})),t.d(e,"openLink",(function(){return F})),t.d(e,"feedback",(function(){return D})),t.d(e,"open",(function(){return V})),t.d(e,"openSlidePanel",(function(){return W})),t.d(e,"share",(function(){return j})),t.d(e,"previewFile",(function(){return B})),t.d(e,"previewImage",(function(){return _})),t.d(e,"downloadFile",(function(){return O})),t.d(e,"uploadAttachment",(function(){return H})),t.d(e,"clipboardFileUpload",(function(){return L})),t.d(e,"proxy",(function(){return N})),t.d(e,"datepicker",(function(){return Y})),t.d(e,"scan",(function(){return G})),t.d(e,"chosen",(function(){return en})),t.d(e,"openSingleWebview",(function(){return on})),t.d(e,"getSingleWebviewData",(function(){return rn})),t.d(e,"injectScript",(function(){return an})),t.d(e,"closeWindow",(function(){return cn})),t.d(e,"showCallMenu",(function(){return xt})),t.d(e,"call",(function(){return Dt})),t.d(e,"setIcon",(function(){return Nn})),t.d(e,"setTitle",(function(){return Un})),t.d(e,"setMenu",(function(){return qn})),t.d(e,"close",(function(){return Kn})),t.d(e,"replacePage",(function(){return Gn})),t.d(e,"quit",(function(){return Zn})),t.d(e,"setRight",(function(){return ne})),t.d(e,"setTitleExpandIcon",(function(){return oe})),t.d(e,"updateExpandTitle",(function(){return ie})),t.d(e,"setLeft",(function(){return se})),t.d(e,"goBack",(function(){return ue})),t.d(e,"complexPicker",(function(){return ve})),t.d(e,"departmentsPicker",(function(){return me})),t.d(e,"groupComplexPicker",(function(){return ge})),t.d(e,"chooseConversationByCorpId",(function(){return he})),t.d(e,"pickConversation",(function(){return we})),t.d(e,"openSingleChat",(function(){return ye})),t.d(e,"openTeamChat",(function(){return Pe})),t.d(e,"openSquad",(function(){return ke})),t.d(e,"sendP2PMsg",(function(){return ze})),t.d(e,"mapView",(function(){return Z})),t.d(e,"multipointView",(function(){return X})),t.d(e,"requestAuthCode",(function(){return Ce})),t.d(e,"createTab",(function(){return Ie})),t.d(e,"weeklyShare",(function(){return Me})),t.d(e,"showPreloader",(function(){return xe})),t.d(e,"hidePreloader",(function(){return De})),t.d(e,"vibrate",(function(){return Ee})),t.d(e,"toast",(function(){return We})),t.d(e,"alert",(function(){return He})),t.d(e,"confirm",(function(){return Ne})),t.d(e,"getPhoneInfo",(function(){return _e})),t.d(e,"getUUID",(function(){return bt})),t.d(e,"checkStepPermission",(function(){return yt})),t.d(e,"getGeolocation",(function(){return Ye})),t.d(e,"getGeolocationSwitch",(function(){return qe})),t.d(e,"getLang",(function(){return Ke})),t.d(e,"startRecord",(function(){return $e})),t.d(e,"stopRecord",(function(){return Qe})),t.d(e,"onRecordEnd",(function(){return nt})),t.d(e,"downloadAudio",(function(){return tt})),t.d(e,"playAudio",(function(){return it})),t.d(e,"pauseAudio",(function(){return at})),t.d(e,"stopAudio",(function(){return ct})),t.d(e,"onPlayEnd",(function(){return dt})),t.d(e,"resumeAudio",(function(){return pt})),t.d(e,"getNetworkType",(function(){return vt})),t.d(e,"isAtTal",(function(){return gt})),t.d(e,"webViewBounceDisable",(function(){return Et})),t.d(e,"pullToRefreshEnable",(function(){return Rt})),t.d(e,"pullToRefreshStop",(function(){return Bt})),t.d(e,"pullToRefreshDisable",(function(){return Ot})),t.d(e,"getItem",(function(){return Lt})),t.d(e,"setItem",(function(){return Ut})),t.d(e,"removeItem",(function(){return Jt})),t.d(e,"remind",(function(){return dn})),t.d(e,"takePicture",(function(){return fn})),t.d(e,"datetimepicker",(function(){return q})),t.d(e,"actionSheet",(function(){return je})),t.d(e,"webViewMessageSend",(function(){return Kt})),t.d(e,"talYoungFilesUpload",(function(){return Gt})),t.d(e,"openVideoPlayer",(function(){return ln})),t.d(e,"openMediaFileDialog",(function(){return vn})),t.d(e,"mediaFileUpload",(function(){return mn})),t.d(e,"invoice",(function(){return gn})),t.d(e,"pushWorkMsg",(function(){return hn})),t.d(e,"openTalYoungToTopic",(function(){return bn})),t.d(e,"getToken",(function(){return yn})),t.d(e,"authStart",(function(){return kn})),t.d(e,"authFinish",(function(){return Sn})),t.d(e,"openTogetherEyeWebview",(function(){return Tn})),t.d(e,"getTogetherConfig",(function(){return Cn})),t.d(e,"rouseApp",(function(){return An})),t.d(e,"externalLinkPreviewFile",(function(){return xn})),t.d(e,"savePic",(function(){return En})),t.d(e,"zfbAuth",(function(){return Dn})),t.d(e,"complain",(function(){return Wn})),t.d(e,"onRecordEnd_v2",(function(){return kt})),t.d(e,"startRecord_v2",(function(){return St})),t.d(e,"stopRecord_v2",(function(){return Tt})),t.d(e,"selectDepartment",(function(){return Rn})),t.d(e,"setWindowBig",(function(){return fe})),t.d(e,"tencentMeeting",(function(){return pe})),t.d(e,"tencentMeetingBegin",(function(){return le})),t.d(e,"createModifySchedule",(function(){return Bn})),t.d(e,"setLight",(function(){return Ct})),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=t(0),u=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:c.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.invokeAPI=function(n,e){if(e||(e={}),n){var t=this.invokeAPIConfigMapByMethod[n];if(!t)return s({method:n,errorcode:"-1",message:n+" do not exist"}),void e.onFail({code:"-1",message:n+" do not exist"});var o=t[this.env.platform];if(o){var i=o.paramsDeal?o.paramsDeal(e):e;if("function"==typeof i.onSuccess){var r=i.onSuccess;i.onSuccess=function(n){r(n)}}this.bridgeInitFn().then((function(e){e(n,i).then((function(){})).catch((function(n){}))})).catch((function(n){console.log("wenai err",n)}))}else"function"==typeof e.onFail&&(s({method:n,errorcode:"-1",message:n+" do not support the current platform ("+this.env.platform+")"}),e.onFail({code:"-1",message:n+" do not support the current platform ("+this.env.platform+")"}))}},n}(),d={log:function(){},warn:function(){},error:function(){}};if(window&&window.console&&(d=window.console),document&&document.body){var f=document.createElement("iframe");f&&f.contentWindow&&f.contentWindow.console&&(f.style.display="none",document.body.appendChild(f),d=f.contentWindow.console)}var p=d.log.bind(d),l=(d.warn.bind(d),d.error.bind(d),"color:#fff;font-weight:bold;border-radius:5px;background:#67c23a;");function v(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return p("%c Yach-jssdk log: ",l,n)}var m=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={}},g=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},h=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 g(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":m.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){v("electron res: ",e),n.handleCallback(e.data||{})})),window.receiveBrowserViewData&&window.receiveBrowserViewData((function(e,t){return n.handleCallback(t)}))},this.pendingMsgs={}},b=new Map([[0,"onSuccess"],[-1,"onCancel"],[-2,"onFail"],[-3,"onProgress"],[-4,"onSubmit"]]);function w(n){return b.get(n)||"onFail"}var y=function(n,e){return new Promise((function(t){return h.invokeAPI(n,e,(function(o){var i=o.data,r=o.code,a=o.message,c=parseInt(r),u=w(c);-2===c&&s({method:n,errorcode:c,message:a||"SDK执行失败回调,相关参数"});var d=e[u];v("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})}))}))},P=function(){return(P=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 k(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 z=function(n,e){return new Promise((function(t,o){var i=P({},e);k((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=w(d);-2!==d&&7!==d||(s({method:n,errorcode:d,message:c||"SDK执行失败回调,相关参数"}),v("SDK执行后回调,相关参数 ",{method:n,param:e,data:u,_code:d,message:c}),o({_code:d,message:c}));var p=i[f];v("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})}))}))}))},S=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())}))},I=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])}}},T=i(),M=T.platform,C=new u(T);!function(){var n=this,e={platform:M,authMethod:"config",bridgeInit:"pc"===M?function(){return S(n,void 0,void 0,(function(){return I(this,(function(n){return h.init(),[2,y]}))}))}:function(){return new Promise((function(n,e){k((function(e){v("注册resume事件 "),e.registerHandler("resume",(function(n){v("resume监听到回调,相关参数 ",{resData:n}),m.execEvent("resume",n)})),v("注册unreadMsgAction事件 "),e.registerHandler("unreadMsgAction",(function(n){v("unreadMsgAction监听到回调,相关参数 ",{resData:n}),m.execEvent("unreadMsgAction",n)})),v("注册webViewMsgReceive事件 "),e.registerHandler("webViewMsgReceive",(function(n){v("webViewMsgReceive监听到回调,相关参数 ",{resData:n}),m.execEvent("webViewMsgReceive",n)})),e.registerHandler("pushWorkMsg",(function(n){v("pushWorkMsg监听到回调,相关参数 ",{resData:n}),m.execEvent("pushWorkMsg",n)})),e.registerHandler("getTogetherCallback",(function(n){v("getTogetherCallback监听到回调,相关参数 ",{resData:n}),m.execEvent("getTogetherCallback",n)})),e.registerHandler("sendMsgCommon",(function(n){v("sendMsgCommon ",{resData:n}),m.execEvent("sendMsgCommon",n)})),n()}))})).then((function(){return z}))},event:{on:function(n,e){m.on(n,e)},off:function(n,e){m.off(n,e)}}};C.setPlatform(e)}();var A={ios:{vs:"0.0.0"},android:{vs:"0.0.0"},pc:{vs:"0.0.0"}};var x=function(n,e){var t=e.params,o=void 0===t?{}:t,i=e.platform,r=void 0===i?A:i;C.setAPI(n,r),C.invokeAPI(n,o)};function F(n){x("biz.util.openLink",{params:n})}function D(n){x("biz.util.feedback",{params:n})}function V(n){x("biz.util.open",{params:n})}var E={pc:{vs:"0.0.0"}};function W(n){x("biz.util.openSlidePanel",{params:n,platform:E})}var R={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function j(n){x("biz.util.share",{params:n,platform:R})}function B(n){x("biz.util.previewFile",{params:n})}function _(n){x("biz.util.previewImage",{params:n})}function O(n){x("biz.util.downloadFile",{params:n})}function H(n){x("biz.util.uploadAttachment",{params:n})}function L(n){x("biz.util.clipboardFileUpload",{params:n})}function N(n){x("biz.util.proxy",{params:n})}var U={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Y(n){x("biz.util.datepicker",{params:n,platform:U})}var J={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function q(n){x("biz.util.datetimepicker",{params:n,platform:J})}var K={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function G(n){x("biz.util.scan",{params:n,platform:K})}var $={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Z(n){x("biz.map.view",{params:n,platform:$})}var Q={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function X(n){x("biz.map.multipointView",{params:n,platform:Q})}var nn={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function en(n){x("biz.util.chosen",{params:n,platform:nn})}var tn={pc:{vs:"0.0.0"}};function on(n){x("biz.util.openSingleWebview",{params:n,platform:tn})}function rn(n){x("biz.util.getSingleWebviewData",{params:n})}function an(n){x("biz.util.injectScript",{params:n})}var sn={pc:{vs:"0.0.0"}};function cn(n){x("biz.util.closeWindow",{params:n,platform:sn})}var un={ios:{vs:"0.0.0"},android:{vs:"0.0.0"},pc:{vs:"0.0.0"}};function dn(n){x("biz.util.remind",{params:n,platform:un})}function fn(n){x("biz.util.takePicture",{params:n})}var pn={pc:{vs:"0.0.0"},ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function ln(n){x("biz.util.openVideoPlayer",{params:n,platform:pn})}function vn(n){x("biz.util.openMediaFileDialog",{params:n})}function mn(n){x("biz.util.mediaFileUpload",{params:n})}function gn(n){x("biz.util.invoice",{params:n})}function hn(n){x("biz.util.pushWorkMsg",{params:n})}function bn(n){x("biz.util.openTalYoungToTopic",{params:n})}var wn={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function yn(n){x("biz.util.getToken",{params:n,platform:wn})}var Pn={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function kn(n){x("biz.util.authStart",{params:n,platform:Pn})}var zn={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Sn(n){x("biz.util.authFinish",{params:n,platform:zn})}var In={ios:{vs:"0.0.0"},android:{vs:"0.0.0"},pc:{vs:"0.0.0"}};function Tn(n){x("biz.util.openTogetherEyeWebview",{params:n,platform:In})}var Mn={ios:{vs:"0.0.0"},android:{vs:"0.0.0"},pc:{vs:"0.0.0"}};function Cn(n){x("biz.util.getTogetherConfig",{params:n,platform:Mn})}function An(n){x("biz.util.rouseApp",{params:n})}function xn(n){x("biz.util.externalLinkPreviewFile",{params:n})}var Fn={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Dn(n){x("biz.util.zfbAuth",{params:n,platform:Fn})}var Vn={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function En(n){x("biz.util.savePic",{params:n,platform:Vn})}function Wn(n){x("biz.util.complain",{params:n})}function Rn(n){x("biz.util.selectDepartment",{params:n})}var jn={pc:{vs:"0.0.0"}};function Bn(n){x("biz.util.createModifySchedule",{params:n,platform:jn})}var _n=function(){return(_n=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 On(n){return function(e){return _n(_n({},n),e)}}var Hn=On({control:!0,showIcon:!0,iconIndex:1}),Ln={ios:{vs:"0.0.0",paramsDeal:Hn},android:{vs:"0.0.0",paramsDeal:Hn}};function Nn(n){x("biz.navigation.setIcon",{params:n,platform:Ln})}function Un(n){x("biz.navigation.setTitle",{params:n})}var Yn=On({control:!0}),Jn={ios:{vs:"0.0.0",paramsDeal:Yn},android:{vs:"0.0.0",paramsDeal:Yn}};function qn(n){x("biz.navigation.setMenu",{params:n,platform:Jn})}function Kn(n){x("biz.navigation.close",{params:n})}function Gn(n){x("biz.navigation.replace",{params:n})}var $n={pc:{vs:"0.0.0"}};function Zn(n){x("biz.navigation.quit",{params:n,platform:$n})}var Qn=On({show:!0,control:!1,text:""}),Xn={ios:{vs:"0.0.0",paramsDeal:Qn},android:{vs:"0.0.0",paramsDeal:Qn},pc:{vs:"0.0.0"}};function ne(n){x("biz.navigation.setRight",{params:n,platform:Xn})}var ee=On({control:!0}),te={ios:{vs:"0.0.0",paramsDeal:ee},android:{vs:"0.0.0",paramsDeal:ee}};function oe(n){x("biz.navigation.setTitleExpandIcon",{params:n,platform:te})}function ie(n){x("biz.navigation.updateExpandTitle",{params:n})}var re=On({show:!0,control:!1,text:""}),ae={ios:{vs:"0.0.0",paramsDeal:re},android:{vs:"0.0.0",paramsDeal:re},pc:{vs:"0.0.0"}};function se(n){x("biz.navigation.setLeft",{params:n,platform:ae})}var ce={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function ue(n){x("biz.navigation.goBack",{params:n,platform:ce})}var de={pc:{vs:"0.0.0"}};function fe(n){x("biz.navigation.setWindowBig",{params:n,platform:de})}function pe(n){x("biz.navigation.tencentMeeting",{params:n})}function le(n){x("biz.navigation.tencentMeetingBegin",{params:n})}function ve(n){x("biz.contact.complexPicker",{params:n})}function me(n){x("biz.contact.departmentsPicker",{params:n})}function ge(n){x("biz.group.groupComplexPicker",{params:n})}function he(n){x("biz.chat.chooseConversationByCorpId",{params:n})}var be={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function we(n){x("biz.chat.pickConversation",{params:n,platform:be})}function ye(n){x("biz.chat.openSingleChat",{params:n})}function Pe(n){x("biz.chat.openTeamChat",{params:n})}function ke(n){x("biz.chat.openSquad",{params:n})}function ze(n){x("biz.chat.sendP2PMsg",{params:n})}var Se={pc:{vs:"0.0.0"}};function Ie(n){x("primary.createTab",{params:n,platform:Se})}var Te={pc:{vs:"0.0.0"}};function Me(n){x("primary.weeklyShare",{params:n,platform:Te})}function Ce(n){x("runtime.permission.requestAuthCode",{params:n})}var Ae={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function xe(n){x("device.notification.showPreloader",{params:n,platform:Ae})}var Fe={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function De(n){x("device.notification.hidePreloader",{params:n,platform:Fe})}var Ve={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Ee(n){x("device.notification.vibrate",{params:n,platform:Ve})}function We(n){x("device.notification.toast",{params:n})}var Re={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function je(n){x("device.notification.actionSheet",{params:n,platform:Re})}var Be={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function _e(n){x("device.base.getPhoneInfo",{params:n,platform:Be})}var Oe={ios:{vs:"0.0.0"},android:{vs:"0.0.0"},pc:{vs:"0.0.0"}};function He(n){x("device.notification.alert",{params:n,platform:Oe})}var Le={ios:{vs:"0.0.0"},android:{vs:"0.0.0"},pc:{vs:"0.0.0"}};function Ne(n){x("device.notification.confirm",{params:n,platform:Le})}var Ue={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Ye(n){x("device.geolocation.get",{params:n,platform:Ue})}var Je={android:{vs:"0.0.0"}};function qe(n){x("device.geolocation.getSwitch",{params:n,platform:Je})}function Ke(n){x("device.system.getLang",{params:n})}var Ge={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function $e(n){x("device.audio.startRecord",{params:n,platform:Ge})}var Ze={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Qe(n){x("device.audio.stopRecord",{params:n,platform:Ze})}var Xe={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function nt(n){x("device.audio.onRecordEnd",{params:n,platform:Xe})}var et={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function tt(n){x("device.audio.download",{params:n,platform:et})}var ot={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function it(n){x("device.audio.play",{params:n,platform:ot})}var rt={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function at(n){x("device.audio.pause",{params:n,platform:rt})}var st={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function ct(n){x("device.audio.stop",{params:n,platform:st})}var ut={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function dt(n){x("device.audio.onPlayEnd",{params:n,platform:ut})}var ft={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function pt(n){x("device.audio.resume",{params:n,platform:ft})}var lt={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function vt(n){x("device.connection.getNetworkType",{params:n,platform:lt})}var mt={pc:{vs:"0.0.0"}};function gt(n){x("device.connection.isAtTal",{params:n,platform:mt})}var ht={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function bt(n){x("device.base.getUUID",{params:n,platform:ht})}var wt={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function yt(n){x("device.base.checkStepPermission",{params:n,platform:wt})}var Pt={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function kt(n){x("device.audio.onRecordEnd_v2",{params:n,platform:Pt})}var zt={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function St(n){x("device.audio.startRecord_v2",{params:n,platform:zt})}var It={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Tt(n){x("device.audio.stopRecord_v2",{params:n,platform:It})}var Mt={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Ct(n){x("device.system.setLight",{params:n,platform:Mt})}var At={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function xt(n){x("biz.telephone.showCallMenu",{params:n,platform:At})}var Ft={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Dt(n){x("biz.telephone.call",{params:n,platform:Ft})}var Vt={ios:{vs:"0.0.0"}};function Et(n){x("ui.webViewBounce.disable",{params:n,platform:Vt})}var Wt={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Rt(n){x("ui.pullToRefresh.enable",{params:n,platform:Wt})}var jt={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Bt(n){x("ui.pullToRefresh.stop",{params:n,platform:jt})}var _t={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Ot(n){x("ui.pullToRefresh.disable",{params:n,platform:_t})}var Ht={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Lt(n){x("util.domainStorage.getItem",{params:n,platform:Ht})}var Nt={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Ut(n){x("util.domainStorage.setItem",{params:n,platform:Nt})}var Yt={ios:{vs:"0.0.0"},android:{vs:"0.0.0"}};function Jt(n){x("util.domainStorage.removeItem",{params:n,platform:Yt})}var qt={ios:{vs:"0.0.0"}};function Kt(n){x("biz.webViewMessage.send",{params:n,platform:qt})}function Gt(n){x("app.custom.talYoungFilesUpload",{params:n})}console.log("add rouseApp ------------\x3e",An);var $t=C.exportSdk,Zt=$t.version,Qt=$t.sdkVersion,Xt=$t.env,no=$t.platform,eo=$t.platformV2,to=$t.config,oo=$t.ready,io=$t.error,ro=$t.on,ao=$t.off;e.default={version:Zt,sdkVersion:Qt,env:Xt,platform:no,platformV2:eo,config:to,ready:oo,error:io,on:ro,off:ao,biz:{util:{openLink:F,feedback:D,open:V,openSlidePanel:W,share:j,previewFile:B,previewImage:_,downloadFile:O,uploadAttachment:H,clipboardFileUpload:L,proxy:N,datepicker:Y,datetimepicker:q,scan:G,chosen:en,openSingleWebview:on,getSingleWebviewData:rn,injectScript:an,closeWindow:cn,remind:dn,takePicture:fn,openVideoPlayer:ln,openMediaFileDialog:vn,mediaFileUpload:mn,invoice:gn,pushWorkMsg:hn,openTalYoungToTopic:bn,getToken:yn,authStart:kn,authFinish:Sn,openTogetherEyeWebview:Tn,getTogetherConfig:Cn,rouseApp:An,externalLinkPreviewFile:xn,savePic:En,zfbAuth:Dn,complain:Wn,selectDepartment:Rn,createModifySchedule:Bn},telephone:{showCallMenu:xt,call:Dt},navigation:{setIcon:Nn,setTitle:Un,setMenu:qn,close:Kn,replace:Gn,quit:Zn,setRight:ne,setTitleExpandIcon:oe,updateExpandTitle:ie,setLeft:se,goBack:ue,setWindowBig:fe,tencentMeeting:pe,tencentMeetingBegin:le},contact:{complexPicker:ve,departmentsPicker:me},group:{groupComplexPicker:ge},chat:{chooseConversationByCorpId:he,pickConversation:we,openSingleChat:ye,openTeamChat:Pe,openSquad:ke,sendP2PMsg:ze},map:{view:Z,multipointView:X},webViewMessage:{send:Kt}},runtime:{permission:{requestAuthCode:Ce}},primary:{createTab:Ie,weeklyShare:Me},device:{notification:{showPreloader:xe,hidePreloader:De,vibrate:Ee,toast:We,alert:He,confirm:Ne,actionSheet:je},base:{getPhoneInfo:_e,getUUID:bt,checkStepPermission:yt},geolocation:{get:Ye,getSwitch:qe},system:{getLang:Ke,setLight:Ct},audio:{startRecord:$e,stopRecord:Qe,onRecordEnd:nt,download:tt,play:it,pause:at,stop:ct,onPlayEnd:dt,resume:pt,onRecordEnd_v2:kt,startRecord_v2:St,stopRecord_v2:Tt},connection:{getNetworkType:vt,isAtTal:gt}},ui:{webViewBounce:{disable:Et},pullToRefresh:{enable:Rt,stop:Bt,disable:Ot}},util:{domainStorage:{getItem:Lt,setItem:Ut,removeItem:Jt}},app:{custom:{talYoungFilesUpload:Gt}}}}]).default;
|