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

windmill-module-api

Package Overview
Dependencies
Maintainers
1
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

windmill-module-api - npm Package Compare versions

Comparing version 0.2.56 to 0.2.57

16

index.js

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

/* windmill-module-api (0.2.56), build at 2018-12-05 15:49. */
/* windmill-module-api (0.2.57), build at 2018-12-12 14:48. */

@@ -361,3 +361,3 @@ (function (global, factory) {

function chooseAddress(options) {
callModule('address.chooseAddress', options);
callModule('address.choose', options);
}

@@ -1446,2 +1446,11 @@

}
function getSetting(options) {
callModule('wopc.getSetting', options);
}
function openSetting(options) {
callModule('wopc.openSetting', options);
}
function authorize(options) {
callModule('wopc.authorize', options);
}

@@ -1630,2 +1639,5 @@ var bus$1 = new EventEmitter();

setTBSessionInfo: setTBSessionInfo,
getSetting: getSetting,
openSetting: openSetting,
authorize: authorize,
connectSocket: connectSocket,

@@ -1632,0 +1644,0 @@ sendSocketMessage: sendSocketMessage,

4

index.min.js

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

/* windmill-module-api (0.2.56), build at 2018-12-05 15:49. */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t["windmill-module-api"]=e()}(this,function(){"use strict";var e="__WINDMILL_WORKER_RUNTIME_APIS__",n="[[JSON]]",o=/^\[\[JSON\]\].*/;function r(){return"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:new Function("return this")()}var i="__WINDMILL_MODULE_GETTER__";function c(t){var e=r();return e&&"function"==typeof e[i]?e[i](t):e&&"function"==typeof e.require?e.require("@core/"+t):(console.error('Can\'t find available "require" function.'),e&&e&&"function"==typeof e.requireModule?e.requireModule(t):e&&e.weex&&"function"==typeof e.weex.requireModule?e.weex.requireModule("@windmill/"+t):void 0)}var a="[[EVENT_MAP]]";function u(t,e){var n=t[a];return Array.isArray(n[e])||(n[e]=[]),n[e]}var s,f=function(){Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:{}})};function d(t){return Object.prototype.toString.call(t).slice(8,-1)}function l(t){return"Object"===d(t)}function p(t){return"Array"===d(t)}function g(){return"object"==typeof __windmill_environment__?__windmill_environment__:"object"==typeof wmlEnv?wmlEnv:"object"==typeof windmillEnv?windmillEnv:{}}function h(){if(!s){var t=r();s=t[e]}return s}function m(){return h().$getCurrentActivePageId()}f.prototype.on=function(t,e){return u(this,t).push({listener:e,once:!1,callCount:0}),this},f.prototype.once=function(t,e){return u(this,t).push({listener:e,once:!0,callCount:0}),this},f.prototype.off=function(t,e){var n=this[a];if(e){var o=n[t];if(Array.isArray(o)){var r=o.findIndex(function(t){return t.listener===e});-1!==r&&o.splice(r,1)}}else delete n[t];return this},f.prototype.emit=function(t){for(var e=[],n=arguments.length-1;0<n--;)e[n]=arguments[n+1];var o=this[a],r=o[t];return Array.isArray(r)&&(o[t]=r.filter(function(t){try{t.listener.apply(null,e),t.callCount+=1}catch(t){return!0}return!t.once})),this};var v={};function y(t,e){var n=v[t];return"function"==typeof n&&l(e)?n(e):e}var S,w=(S=1e5,function(){var t=String(S);return S+=1,t});function b(t,e){var n=m(),o="[[ModuleAPIEvent]]@"+n;h().$emit(o,{type:t,data:e},n)}var I=new f;var T=["success","fail","complete"];function k(t){var e={};for(var n in t)-1===T.indexOf(n)&&(e[n]=t[n]);return e}function _(n,t){var o=h();if(o){if(t&&"function"==typeof o.$callSync)return function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return o.$callSync.apply(o,[n].concat(t))};if(!t&&"function"==typeof o.$call)return function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return o.$call.apply(o,[n].concat(t))}}var e=n.split(/\s*\.\s*/i),r=e[0],i=e[1];if(r&&i){var a=c(r);if(a&&"function"==typeof a[i])return a[i]}return function(){}}function B(t,e){if("function"==typeof t)try{return t.apply(null,e)}catch(t){console.error("Failed to execute internal method: "+t.toString())}}var C=function(t,e){console.error('Failed to execute callback of "'+t+'": '+e.toString())};function A(e,t,n){if("function"==typeof t)try{return t.apply(null,n)}catch(t){C(e,t)}}function P(n,o,t,r,i){void 0===o&&(o={}),void 0===t&&(t=o),void 0===r&&(r=function(t){return t}),void 0===i&&(i=function(t){return t});var e=_(n),a=!1;return e(k(t),function(t){var e=B(r,[t]);A(n,o.success,[e]),a||(A(n,o.complete,[e]),a=!0)},function(t){var e=B(i,[t]);A(n,o.fail,[e]),a||(A(n,o.complete,[e]),a=!0)})}function N(t,e){return void 0===e&&(e={}),_(t,!0)(k(e))}var t=["opacity","backgroundColor","width","height","top","left","bottom","right","rotate","rotateX","rotateY","rotateZ","rotate3d","skew","skewX","skewY","scale","scaleX","scaleY","scaleZ","scale3d","translate","translateX","translateY","translateZ","translate3d","matrix","matrix3d"],E=function(){var o=this;this.animations=[],this.currentAnimation=[],this.config={},t.forEach(function(n){o[n]=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return o.currentAnimation.push([n,t]),o}})};E.prototype.step=function(t){return this.animations.push({config:Object.assign({},this.config,t),animation:this.currentAnimation}),this.currentAnimation=[],this},E.prototype.export=function(){var t=this.animations;return this.animations=[],t};var x=function(e){function t(t){e.call(this),this.config=Object.assign({transformOrigin:"50% 50% 0",duration:400,timeFunction:"linear",delay:0},t)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t}(E);var M=function(t){void 0===t&&(t={}),this._instanceId=w(),this._emitter=new f,this.src=t.src};M.prototype.play=function(t){var e=this;P("audioPlayer.playVoice",t,{src:this.src,instanceId:this._instanceId},function(t){return 1===t.isComplete?e._emitter.emit("stop"):(e.duration=t.duration,e._emitter.emit("play")),t},function(t){return e._emitter.emit("error",t),t})},M.prototype.pause=function(t){var e=this;P("audioPlayer.pauseVoice",t,{instanceId:this._instanceId},function(t){return e._emitter.emit("pause"),t},function(t){return e._emitter.emit("error",t),t})},M.prototype.stop=function(t){var e=this;P("audioPlayer.stopVoice",t,{instanceId:this._instanceId},function(t){return e._emitter.emit("stop"),t},function(t){return e._emitter.emit("error",t),t})},M.prototype.onPlay=function(t){this._emitter.on("play",t)},M.prototype.onPause=function(t){this._emitter.on("pause",t)},M.prototype.onStop=function(t){this._emitter.on("stop",t)},M.prototype.onError=function(t){this._emitter.on("error",t)},M.prototype.offPlay=function(t){this._emitter.off("play",t)},M.prototype.offPause=function(t){this._emitter.off("pause",t)},M.prototype.offStop=function(t){this._emitter.off("stop",t)},M.prototype.offError=function(t){this._emitter.off("error",t)};var F,L=function(){this._startEmitted=!1,this._emitter=new f};L.prototype.start=function(t){var e=this;void 0===t&&(t={}),this._startEmitted=!1,P("audioRecord.startRecord",t,{maxDuration:t.duration/1e3,minDuration:1},function(t){return t.averagePower&&!e._startEmitted&&(e._emitter.emit("start",{}),e._startEmitted=!0),t.apFilePath&&e._emitter.emit("stop",{tempFilePath:t.apFilePath,duration:t.duration}),t},function(t){return e._emitter.emit("error",t),t})},L.prototype.stop=function(t){var e=this;void 0===t&&(t={}),P("audioRecord.stopRecord",t,t,function(t){return e._emitter.emit("stop",{tempFilePath:t.apFilePath,duration:t.duration}),t},function(t){return e._emitter.emit("error",t),t})},L.prototype.onStart=function(t){this._emitter.on("start",t)},L.prototype.onStop=function(t){this._emitter.on("stop",t)},L.prototype.onError=function(t){this._emitter.on("error",t)},L.prototype.offStart=function(t){this._emitter.off("start",t)},L.prototype.offStop=function(t){this._emitter.off("stop",t)},L.prototype.offError=function(t){this._emitter.off("error",t)};var D,O=["setTextAlign","setTextBaseline","setFillStyle","setStrokeStyle","setShadow","createLinearGradient","createCircularGradient","addColorStop","setLineWidth","setLineCap","setLineJoin","setMiterLimit","rect","fillRect","strokeRect","clearRect","fill","stroke","beginPath","closePath","moveTo","lineTo","arc","bezierCurveTo","clip","quadraticCurveTo","scale","rotate","translate","setFontSize","fillText","drawImage","setGlobalAlpha","setLineDash","transform","setTransform","getImageData","p\u200butImageData","save","restore","measureText"],R=function(t){var o=this;this._canvasId=t,this._actions=[],O.forEach(function(n){o[n]=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];o._actions.push({method:n,args:t})}})};function V(t){return l(t)?t.apFilePath||t.filePath:""}R.prototype.draw=function(){b("canvas",{canvasId:this._canvasId,actions:this._actions}),this._actions=[]};var j=["play","stop","pause","setSpeed","goToAndStop","goToAndPlay","getDuration","setDirection","playSegments","destroy"],U=["onAnimationEnd","onAnimationRepeat","onDataReady","onDataFailed","onAnimationStart","onAnimationCancel"],q=function(o){var r=this;j.forEach(function(n){r[n]=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];b("lottie",{lottieId:o,action:{method:n,args:t}})}}),U.forEach(function(t){r[t]=function(n){I.on("lottie."+t,function(t){var e=[];t.event&&t.event.args&&(e=t.event.args),t.lottieId===o&&n.apply(r,e)})}})};function W(t){return"/"===t.charAt(0)}function H(t,e){for(var n=e,o=n+1,r=t.length;o<r;n+=1,o+=1)t[n]=t[o];t.pop()}function $(t){return void 0===t&&(t=""),"/"===t[0]?t.slice(1):t}function z(t){return n+JSON.stringify(t.data)}function G(t){return{data:o.test(t.value)?JSON.parse(t.value.substr(n.length)):t.value}}function K(){var t=g();return{model:t.model,pixelRatio:t.pixelRatio,windowWidth:t.screenWidth,windowHeight:t.screenHeight,language:t.language,version:t.appVersion,storage:null,currentBattery:null,system:t.systemVersion,platform:t.platform,screenWidth:t.screenWidth,screenHeight:t.screenHeight,brand:t.brand,fontSizeSetting:14,app:t.appName,SDKVersion:t.version,frameworkType:t.frameworkType,frameworkVersion:t.frameworkVersion,userAgent:t.userAgent,screenDensity:t.screenDensity}}var J=g().version||"";var X=["play","pause","stop","requestFullScreen","exitFullScreen","showControls","hideControls","enableLoop","disableLoop"],Y=function(i){var t=this;X.forEach(function(r){t[r]=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var n=m(),o="[[VideoContextAction]]@"+n;h().$emit(o,{action:r,id:i,args:t},n)}})};var Z=new f,Q=["onOpen","onError","onMessage","onClose"],tt=0,et=!1;var nt=Object.freeze({showActionSheet:function(t){P("actionSheet.showActionSheet",t)},chooseAddress:function(t){P("address.chooseAddress",t)},tradePay:function(t){void 0===t&&(t={}),P("alipay.tradePay",t=y("tradePay",t))},createAnimation:function(t){return new x(t)},createInnerAudioContext:function(t){return new M(t)},getRecorderManager:function(t){return F||(F=new L),F},createCanvasContext:function(t){return new R(t)},openChat:function(t){P("chat.open",t)},getClipboard:function(t){P("clipboard.readText",t)},setClipboard:function(t){void 0===t&&(t={}),P("clipboard.writeText",t,{text:t.text})},getNetworkType:function(t){P("connection.getType",t=y("getNetworkType",t),{},function(t){return{networkType:(t.type||"").toUpperCase()}})},onNetworkStatusChange:function(t){D||(D=new f,c("connection").onChange({},function(t){var e=t.type||"";D.emit("networkStatusChange",{networkType:e.toUpperCase()})})),D.on("networkStatusChange",t)},offNetworkStatusChange:function(){D.off("networkStatusChange")},choosePhoneContact:function(t){P("contact.choosePhoneContact",t=y("choosePhoneContact",t),{},function(t){return{name:t.name,mobile:t.phone}})},watchShake:function(t){P("device.onShake",t,{on:!0})},vibrate:function(t){P("device.vibrate",t)},vibrateShort:function(t){P("device.vibrateShort",t)},onUserCaptureScreen:function(t){P("device.onUserCaptureScreen",{success:t})},offUserCaptureScreen:function(){P("device.offUserCaptureScreen")},scan:function(t){P("device.scan",t)},saveFile:function(t){return P("file.saveFile",t,{filePath:V(t)},function(t){return{apFilePath:t.savedFilePath}})},getFileInfo:function(t){return P("file.getFileInfo",t,{filePath:V(t)},function(t){return{size:t.size}})},getSavedFileInfo:function(t){return P("file.getFileInfo",t,{filePath:V(t)})},getSavedFileList:function(t){return P("file.getFileList",t,{},function(t){var e=[];return p(t.fileList)&&(e=t.fileList.map(function(t){return{size:t.size,createTime:t.createTime,apFilePath:t.filePath}})),{fileList:e}})},removeSavedFile:function(t){return P("file.removeFile",t,{filePath:V(t)})},chooseImage:function(t){P("image.chooseImage",t)},compressImage:function(t){P("image.compressImage",t)},previewImage:function(t){P("image.previewImage",t)},saveImage:function(t){P("image.saveImage",t)},getImageInfo:function(t){P("image.getImageInfo",t)},hideKeyboard:function(){P("keyboard.hideKeyboard")},getLocation:function(t){var n=t.type;P("location.getLocation",t,t,function(t){var e={longitude:t.coords.longitude,latitude:t.coords.latitude,accuracy:t.coords.accuracy};return 0<n&&t.address&&(e.country=t.address.country,e.province=t.address.province,e.city=t.address.city,e.cityAdcode=t.address.cityCode,e.district=t.address.area,e.districtAdcode=t.address.areaCode),e})},createLottieContext:function(t){return new q(t)},setBackgroundImage:function(t){P("miniApp.setWebViewBackgroundImage",t)},removeBackgroundImage:function(t){P("miniApp.setWebViewBackgroundImage",t,{color:"",imgUrl:""})},setViewTop:function(t){P("miniApp.setWebViewTop",t)},setCanPullDown:function(t){P("miniApp.setWebViewParams",t)},setShareAppMessage:function(t){void 0===t&&(t={}),P("miniApp.setAppShareInfo",t,{title:t.title,description:t.desc,imageUrl:t.imageUrl})},pageScrollTo:function(t){void 0===t&&(t={}),b("pageScrollTo",{scrollTop:t.scrollTop})},alert:function(t){void 0===t&&(t={}),P("modal.alert",t,{title:t.title,message:t.content,okTitle:t.buttonText})},confirm:function(t){void 0===t&&(t={});var e=t.confirmButtonText||"\u786e\u5b9a",n=t.cancelButtonText||"\u53d6\u6d88";P("modal.confirm",t,{title:t.title,message:t.content,okTitle:e,cancelTitle:n},function(t){return{confirm:t.data===e}})},showToast:function(t){void 0===t&&(t={}),t.duration||(t.duration=2e3),P("modal.toast",t,{message:t.content,duration:t.duration/1e3})},hideToast:function(t){P("modal.hideToast",t)},prompt:function(t){P("modal.prompt",t)},showLoading:function(t){P("modal.showLoading",t)},hideLoading:function(t){P("modal.hideLoading",t)},sendMtop:function(t){P("sendMtop.request",y("sendMtop",t))},navigateTo:function(t,e){void 0===t&&(t={}),void 0===e&&(e=""),P("navigator.push",t=y("navigateTo",t),{url:$(function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",n=t&&t.split("/")||[],o=e&&e.split("/")||[],r=t&&W(t),i=e&&W(e),a=r||i;if(t&&W(t)?o=n:n.length&&(o.pop(),o=o.concat(n)),!o.length)return"/";var c=void 0;if(o.length){var u=o[o.length-1];c="."===u||".."===u||""===u}else c=!1;for(var s=0,f=o.length;0<=f;f--){var d=o[f];"."===d?H(o,f):".."===d?(H(o,f),s++):s&&(H(o,f),s--)}if(!a)for(;s--;s)o.unshift("..");!a||""===o[0]||o[0]&&W(o[0])||o.unshift("");var l=o.join("/");return c&&"/"!==l.substr(-1)&&(l+="/"),l}(t.url,e)||"")})},navigateBack:function(t){P("navigator.pop",y("navigateBack",t))},redirectTo:function(t){void 0===t&&(t={}),P("navigator.redirectTo",t=y("redirectTo",t),{url:$(t.url)})},switchTab:function(t){void 0===t&&(t={}),P("navigator.switchTab",t=y("switchTab",t),{url:$(t.url)})},navigateToMiniProgram:function(t){P("navigator.navigateToMiniProgram",t)},navigateBackMiniProgram:function(t){P("navigator.navigateBackMiniProgram",t)},setNavigationBar:function(t){P("navigatorBar.setNavigationBar",t)},getStatusBarHeight:function(t){P("navigatorBar.getStatusBarHeight",t,t,function(t){return{height:parseInt(t.data)}})},getNavigationBarHeight:function(t){P("navigatorBar.getHeight",t,t,function(t){return{height:parseInt(t.data)}})},showNavigationBarLoading:function(t){P("navigatorBar.showNavigationBarLoading",t)},hideNavigationBarLoading:function(t){P("navigatorBar.hideNavigationBarLoading",t)},setNavigationBarDrawer:function(t){P("navigatorBar.setDrawer",t)},openNavigationBarDrawer:function(t){P("navigatorBar.openDrawer",t)},closeNavigationBarDrawer:function(t){P("navigatorBar.closeDrawer",t)},setNavigationBarSheet:function(t){P("navigatorBar.setActionSheet",t)},httpRequest:function(n){void 0===n&&(n={});var t=(n=y("httpRequest",n)).method||"GET";if("GET"===t&&l(n.data)){var o=[];Object.keys(n.data).forEach(function(t){var e=n.data[t];o.push(t+"="+JSON.stringify(e))});var e=o.join("&");0<=n.url.indexOf("?")?n.url+=e:n.url+="?"+e}P("network.request",n,{method:t,url:n.url,headers:n.headers||{"Content-Type":"application/x-www-form-urlencoded"},dataType:n.dataType||"json",body:n.data},function(t){return{data:t.data,status:t.status,headers:t.headers}})},uploadFile:function(t){P("network.uploadFile",t)},downloadFile:function(t){P("network.downloadFile",t)},makePhoneCall:function(t){void 0===t&&(t={}),P("phone.makePhoneCall",t,{phoneNumber:t.number})},chooseCity:function(t){void 0===t&&(t={}),t.cities&&Array.isArray(t.cities)&&(t.cities=t.cities.map(function(t){return{cityName:t.city,cityCode:t.adCode,spell:t.spell}})),t.hotCities&&Array.isArray(t.hotCities)&&(t.hotCities=t.hotCities.map(function(t){return{cityName:t.city,cityCode:t.adCode,spell:t.spell}})),P("picker.chooseCity",t,t,function(t){return{city:t.cityName,adCode:t.cityCode}})},datePicker:function(t){void 0===t&&(t={}),P("picker.pickDate",t,{format:t.format,value:t.currentDate,min:t.startDate,max:t.endDate},function(t){return{date:t.data}})},setScreenBrightness:function(t){void 0===t&&(t={}),P("screen.setBrightness",t,{brightness:t.brightness})},getScreenBrightness:function(t){P("screen.getScreenBrightness",t,t,function(t){return{brightness:t.value}})},setKeepScreenOn:function(t){void 0===t&&(t={}),P("screen.setAlwaysOn",t,{on:t.keepScreenOn})},shareTinyAppMsg:function(t){P("share.doShare",t)},showSku:function(t){P("sku.show",t)},hideSku:function(t){P("sku.hide",t)},setStorage:function(t){void 0===t&&(t={}),P("storage.setItem",t,{key:t.key,value:z(t)})},setStorageSync:function(t){return N("storage.setItemSync",{key:t.key,value:z(t)})},getStorage:function(t){void 0===t&&(t={}),P("storage.getItem",t,t,G)},getStorageSync:function(t){return G(N("storage.getItemSync",t))},removeStorage:function(t){void 0===t&&(t={}),P("storage.removeItem",t)},removeStorageSync:function(t){return void 0===t&&(t={}),N("storage.removeItemSync",t)},clearStorage:function(t){P("storage.clearStorage",t)},clearStorageSync:function(t){return N("storage.clearStorageSync",t)},getStorageInfo:function(t){P("storage.getStorageInfo",t)},getStorageInfoSync:function(t){return N("storage.getStorageInfoSync",t)},getSystemInfoSync:K,getSystemInfo:function(e){void 0===e&&(e={});try{"function"==typeof e.success&&e.success.call(this,K())}catch(t){"function"==typeof e.fail&&e.fail.call(this,t)}finally{"function"==typeof e.complete&&e.complete.call(this)}},SDKVersion:J,showTabBar:function(t){P("tabBar.show",t)},hideTabBar:function(t){P("tabBar.hide",t)},setTabBarStyle:function(t){P("tabBar.setTabBarStyle",t)},setTabBarItem:function(t){P("tabBar.setTabBarItem",t)},setTabBarBadge:function(t){P("tabBar.setTabBarBadge",t)},removeTabBarBadge:function(t){P("tabBar.removeTabBarBadge",t)},showTabBarRedDot:function(t){P("tabBar.showTabBarRedDot",t)},hideTabBarRedDot:function(t){P("tabBar.hideTabBarRedDot",t)},uccBind:function(t){P("ucc.uccBind",t)},uccTrustLogin:function(t){P("ucc.uccTrustLogin",t)},uccUnbind:function(t){P("ucc.uccUnbind",t)},reportAnalytics:function(t,e){void 0===e&&(e={}),"click"==t||"enter"==t||"expose"==t?_("userTrack.commitut")({type:t,eventId:e.eventId,name:e.name,comName:e.comName,arg1:e.arg1,arg2:e.arg2,arg3:e.arg3,param:e.param}):_("userTrack.customAdvance")({eventId:e.eventId,name:e.name,comName:e.comName,arg1:e.arg1,arg2:e.arg2,arg3:e.arg3,param:e.param})},createVideoContext:function(t){return new Y(t)},chooseVideo:function(t){P("video.chooseVideo",t,t,function(t){return t.apFilePath&&(t.tempFilePath=t.apFilePath,delete t.apFilePath),t})},saveVideoToPhotosAlbum:function(t){P("video.saveVideoToPhotosAlbum",t)},getAuthUserInfo:function(t){P("sendMtop.request",t,{api:"mtop.taobao.openlink.openinfo.user.get",v:"1.0",type:"GET"},function(t){var e={nickName:t.data.mixNick,userId:t.data.openId};return t.data.avatar&&(e.avatar=t.data.avatar),t.data.unionId&&(e.unionId=t.data.unionId),e})},getTBCode:function(t){P("sendMtop.request",t,{api:"mtop.taobao.openlink.basic.login.auth.code",v:"1.0",type:"GET"},function(t){return{code:t.data.result}})},getTBSessionInfo:function(t){P("wopc.getSessionKey",t,t,function(t){return{data:t}})},setTBSessionInfo:function(t){void 0===t&&(t={}),P("wopc.setSessionKey",t,t.sessionInfo,function(t){return{success:!0}})},connectSocket:function(t){void 0===t&&(t={}),et&&(P("webSocket.close",{instanceId:tt}),et=!1,tt++),P("webSocket.webSocket",t,{instanceId:tt,url:t.url,protocol:""},function(t){return et=!0,t}),Q.forEach(function(e){P("webSocket."+e,{instanceId:tt,success:function(t){Z.emit(e,t)}})})},sendSocketMessage:function(t){void 0===t&&(t={}),P("webSocket.send",t,{instanceId:tt,data:t.data})},closeSocket:function(t){P("webSocket.close",t,{instanceId:tt},function(t){return et=!1,tt++,t})},onSocketOpen:function(t){Z.on("onOpen",t)},offSocketOpen:function(t){Z.off("onOpen",t)},onSocketError:function(t){Z.on("onError",t)},offSocketError:function(t){Z.off("onError",t)},onSocketMessage:function(e){Z.on("onMessage",function(t){e&&e({data:t,isBuffer:!1})})},offSocketMessage:function(t){Z.off("onMessage",t)},onSocketClose:function(t){Z.on("onClose",t)},offSocketClose:function(t){Z.off("onClose",t)}});function ot(t){var e,n="my";t&&t.defaultName&&(n=t.defaultName);var r,o,i,a=Object.assign({},nt,{canIUse:function(t){return t in nt}});return r=a,(o=h())&&o.$on("registerModuleAPI",function(t){var e=t.data,n=e.scope;if(n)if(p(e.map))if(!r[n]||l(r[n])){var o=r[n]=r[n]||{};e.map.forEach(function(e){o[e.apiName]&&console.warn("my."+n+"."+e.apiName+" is already existed and will be overridded."),o[e.apiName]=function(t){return e.isSync?N(e.moduleMethod,t):P(e.moduleMethod,t)}})}else console.error('"my.'+n+"\" is already existed and can't be overridded.");else console.error('"data.map" is undefined or not a array on "registerModuleAPI" event.');else console.error('"data.scope" is undefined on "registerModuleAPI" event.')}),h().$on("[[ModuleAPIEvent]]",function(t){var e=t.type;void 0===e&&(e="");var n=t.data;void 0===n&&(n={});var o=e;n.event&&n.event.name&&(o+="."+n.event.name),I.emit(o,n)}),t&&t.preprocessor&&function(t,e){if(l(t)&&l(e))for(var n in e)o=t,r=n,Object.prototype.hasOwnProperty.call(o,r)&&"function"==typeof e[n]&&(v[n]=e[n]);var o,r}(a,t.preprocessor),t&&t.errorHandler&&"function"==typeof(i=t.errorHandler)&&(C=i),(e={})[n]=a,e}return function(e,n,t){void 0===t&&(t=!0);var o=r();try{Object.defineProperty(o,e,{value:n,configurable:!0,enumerable:!0,writable:!t})}catch(t){o[e]=n}}("__WINDMILL_MODULE_API__",{getAPIs:ot}),ot});
/* windmill-module-api (0.2.57), build at 2018-12-12 14:48. */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t["windmill-module-api"]=e()}(this,function(){"use strict";var e="__WINDMILL_WORKER_RUNTIME_APIS__",n="[[JSON]]",o=/^\[\[JSON\]\].*/;function r(){return"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:new Function("return this")()}var i="__WINDMILL_MODULE_GETTER__";function c(t){var e=r();return e&&"function"==typeof e[i]?e[i](t):e&&"function"==typeof e.require?e.require("@core/"+t):(console.error('Can\'t find available "require" function.'),e&&e&&"function"==typeof e.requireModule?e.requireModule(t):e&&e.weex&&"function"==typeof e.weex.requireModule?e.weex.requireModule("@windmill/"+t):void 0)}var a="[[EVENT_MAP]]";function u(t,e){var n=t[a];return Array.isArray(n[e])||(n[e]=[]),n[e]}var s,f=function(){Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:{}})};function d(t){return Object.prototype.toString.call(t).slice(8,-1)}function l(t){return"Object"===d(t)}function p(t){return"Array"===d(t)}function g(){return"object"==typeof __windmill_environment__?__windmill_environment__:"object"==typeof wmlEnv?wmlEnv:"object"==typeof windmillEnv?windmillEnv:{}}function h(){if(!s){var t=r();s=t[e]}return s}function m(){return h().$getCurrentActivePageId()}f.prototype.on=function(t,e){return u(this,t).push({listener:e,once:!1,callCount:0}),this},f.prototype.once=function(t,e){return u(this,t).push({listener:e,once:!0,callCount:0}),this},f.prototype.off=function(t,e){var n=this[a];if(e){var o=n[t];if(Array.isArray(o)){var r=o.findIndex(function(t){return t.listener===e});-1!==r&&o.splice(r,1)}}else delete n[t];return this},f.prototype.emit=function(t){for(var e=[],n=arguments.length-1;0<n--;)e[n]=arguments[n+1];var o=this[a],r=o[t];return Array.isArray(r)&&(o[t]=r.filter(function(t){try{t.listener.apply(null,e),t.callCount+=1}catch(t){return!0}return!t.once})),this};var v={};function y(t,e){var n=v[t];return"function"==typeof n&&l(e)?n(e):e}var S,w=(S=1e5,function(){var t=String(S);return S+=1,t});function b(t,e){var n=m(),o="[[ModuleAPIEvent]]@"+n;h().$emit(o,{type:t,data:e},n)}var I=new f;var T=["success","fail","complete"];function k(t){var e={};for(var n in t)-1===T.indexOf(n)&&(e[n]=t[n]);return e}function _(n,t){var o=h();if(o){if(t&&"function"==typeof o.$callSync)return function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return o.$callSync.apply(o,[n].concat(t))};if(!t&&"function"==typeof o.$call)return function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return o.$call.apply(o,[n].concat(t))}}var e=n.split(/\s*\.\s*/i),r=e[0],i=e[1];if(r&&i){var a=c(r);if(a&&"function"==typeof a[i])return a[i]}return function(){}}function B(t,e){if("function"==typeof t)try{return t.apply(null,e)}catch(t){console.error("Failed to execute internal method: "+t.toString())}}var C=function(t,e){console.error('Failed to execute callback of "'+t+'": '+e.toString())};function P(e,t,n){if("function"==typeof t)try{return t.apply(null,n)}catch(t){C(e,t)}}function A(n,o,t,r,i){void 0===o&&(o={}),void 0===t&&(t=o),void 0===r&&(r=function(t){return t}),void 0===i&&(i=function(t){return t});var e=_(n),a=!1;return e(k(t),function(t){var e=B(r,[t]);P(n,o.success,[e]),a||(P(n,o.complete,[e]),a=!0)},function(t){var e=B(i,[t]);P(n,o.fail,[e]),a||(P(n,o.complete,[e]),a=!0)})}function N(t,e){return void 0===e&&(e={}),_(t,!0)(k(e))}var t=["opacity","backgroundColor","width","height","top","left","bottom","right","rotate","rotateX","rotateY","rotateZ","rotate3d","skew","skewX","skewY","scale","scaleX","scaleY","scaleZ","scale3d","translate","translateX","translateY","translateZ","translate3d","matrix","matrix3d"],E=function(){var o=this;this.animations=[],this.currentAnimation=[],this.config={},t.forEach(function(n){o[n]=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return o.currentAnimation.push([n,t]),o}})};E.prototype.step=function(t){return this.animations.push({config:Object.assign({},this.config,t),animation:this.currentAnimation}),this.currentAnimation=[],this},E.prototype.export=function(){var t=this.animations;return this.animations=[],t};var x=function(e){function t(t){e.call(this),this.config=Object.assign({transformOrigin:"50% 50% 0",duration:400,timeFunction:"linear",delay:0},t)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t}(E);var M=function(t){void 0===t&&(t={}),this._instanceId=w(),this._emitter=new f,this.src=t.src};M.prototype.play=function(t){var e=this;A("audioPlayer.playVoice",t,{src:this.src,instanceId:this._instanceId},function(t){return 1===t.isComplete?e._emitter.emit("stop"):(e.duration=t.duration,e._emitter.emit("play")),t},function(t){return e._emitter.emit("error",t),t})},M.prototype.pause=function(t){var e=this;A("audioPlayer.pauseVoice",t,{instanceId:this._instanceId},function(t){return e._emitter.emit("pause"),t},function(t){return e._emitter.emit("error",t),t})},M.prototype.stop=function(t){var e=this;A("audioPlayer.stopVoice",t,{instanceId:this._instanceId},function(t){return e._emitter.emit("stop"),t},function(t){return e._emitter.emit("error",t),t})},M.prototype.onPlay=function(t){this._emitter.on("play",t)},M.prototype.onPause=function(t){this._emitter.on("pause",t)},M.prototype.onStop=function(t){this._emitter.on("stop",t)},M.prototype.onError=function(t){this._emitter.on("error",t)},M.prototype.offPlay=function(t){this._emitter.off("play",t)},M.prototype.offPause=function(t){this._emitter.off("pause",t)},M.prototype.offStop=function(t){this._emitter.off("stop",t)},M.prototype.offError=function(t){this._emitter.off("error",t)};var F,L=function(){this._startEmitted=!1,this._emitter=new f};L.prototype.start=function(t){var e=this;void 0===t&&(t={}),this._startEmitted=!1,A("audioRecord.startRecord",t,{maxDuration:t.duration/1e3,minDuration:1},function(t){return t.averagePower&&!e._startEmitted&&(e._emitter.emit("start",{}),e._startEmitted=!0),t.apFilePath&&e._emitter.emit("stop",{tempFilePath:t.apFilePath,duration:t.duration}),t},function(t){return e._emitter.emit("error",t),t})},L.prototype.stop=function(t){var e=this;void 0===t&&(t={}),A("audioRecord.stopRecord",t,t,function(t){return e._emitter.emit("stop",{tempFilePath:t.apFilePath,duration:t.duration}),t},function(t){return e._emitter.emit("error",t),t})},L.prototype.onStart=function(t){this._emitter.on("start",t)},L.prototype.onStop=function(t){this._emitter.on("stop",t)},L.prototype.onError=function(t){this._emitter.on("error",t)},L.prototype.offStart=function(t){this._emitter.off("start",t)},L.prototype.offStop=function(t){this._emitter.off("stop",t)},L.prototype.offError=function(t){this._emitter.off("error",t)};var D,O=["setTextAlign","setTextBaseline","setFillStyle","setStrokeStyle","setShadow","createLinearGradient","createCircularGradient","addColorStop","setLineWidth","setLineCap","setLineJoin","setMiterLimit","rect","fillRect","strokeRect","clearRect","fill","stroke","beginPath","closePath","moveTo","lineTo","arc","bezierCurveTo","clip","quadraticCurveTo","scale","rotate","translate","setFontSize","fillText","drawImage","setGlobalAlpha","setLineDash","transform","setTransform","getImageData","p\u200butImageData","save","restore","measureText"],R=function(t){var o=this;this._canvasId=t,this._actions=[],O.forEach(function(n){o[n]=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];o._actions.push({method:n,args:t})}})};function V(t){return l(t)?t.apFilePath||t.filePath:""}R.prototype.draw=function(){b("canvas",{canvasId:this._canvasId,actions:this._actions}),this._actions=[]};var j=["play","stop","pause","setSpeed","goToAndStop","goToAndPlay","getDuration","setDirection","playSegments","destroy"],U=["onAnimationEnd","onAnimationRepeat","onDataReady","onDataFailed","onAnimationStart","onAnimationCancel"],q=function(o){var r=this;j.forEach(function(n){r[n]=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];b("lottie",{lottieId:o,action:{method:n,args:t}})}}),U.forEach(function(t){r[t]=function(n){I.on("lottie."+t,function(t){var e=[];t.event&&t.event.args&&(e=t.event.args),t.lottieId===o&&n.apply(r,e)})}})};function W(t){return"/"===t.charAt(0)}function z(t,e){for(var n=e,o=n+1,r=t.length;o<r;n+=1,o+=1)t[n]=t[o];t.pop()}function H(t){return void 0===t&&(t=""),"/"===t[0]?t.slice(1):t}function $(t){return n+JSON.stringify(t.data)}function G(t){return{data:o.test(t.value)?JSON.parse(t.value.substr(n.length)):t.value}}function K(){var t=g();return{model:t.model,pixelRatio:t.pixelRatio,windowWidth:t.screenWidth,windowHeight:t.screenHeight,language:t.language,version:t.appVersion,storage:null,currentBattery:null,system:t.systemVersion,platform:t.platform,screenWidth:t.screenWidth,screenHeight:t.screenHeight,brand:t.brand,fontSizeSetting:14,app:t.appName,SDKVersion:t.version,frameworkType:t.frameworkType,frameworkVersion:t.frameworkVersion,userAgent:t.userAgent,screenDensity:t.screenDensity}}var J=g().version||"";var X=["play","pause","stop","requestFullScreen","exitFullScreen","showControls","hideControls","enableLoop","disableLoop"],Y=function(i){var t=this;X.forEach(function(r){t[r]=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var n=m(),o="[[VideoContextAction]]@"+n;h().$emit(o,{action:r,id:i,args:t},n)}})};var Z=new f,Q=["onOpen","onError","onMessage","onClose"],tt=0,et=!1;var nt=Object.freeze({showActionSheet:function(t){A("actionSheet.showActionSheet",t)},chooseAddress:function(t){A("address.choose",t)},tradePay:function(t){void 0===t&&(t={}),A("alipay.tradePay",t=y("tradePay",t))},createAnimation:function(t){return new x(t)},createInnerAudioContext:function(t){return new M(t)},getRecorderManager:function(t){return F||(F=new L),F},createCanvasContext:function(t){return new R(t)},openChat:function(t){A("chat.open",t)},getClipboard:function(t){A("clipboard.readText",t)},setClipboard:function(t){void 0===t&&(t={}),A("clipboard.writeText",t,{text:t.text})},getNetworkType:function(t){A("connection.getType",t=y("getNetworkType",t),{},function(t){return{networkType:(t.type||"").toUpperCase()}})},onNetworkStatusChange:function(t){D||(D=new f,c("connection").onChange({},function(t){var e=t.type||"";D.emit("networkStatusChange",{networkType:e.toUpperCase()})})),D.on("networkStatusChange",t)},offNetworkStatusChange:function(){D.off("networkStatusChange")},choosePhoneContact:function(t){A("contact.choosePhoneContact",t=y("choosePhoneContact",t),{},function(t){return{name:t.name,mobile:t.phone}})},watchShake:function(t){A("device.onShake",t,{on:!0})},vibrate:function(t){A("device.vibrate",t)},vibrateShort:function(t){A("device.vibrateShort",t)},onUserCaptureScreen:function(t){A("device.onUserCaptureScreen",{success:t})},offUserCaptureScreen:function(){A("device.offUserCaptureScreen")},scan:function(t){A("device.scan",t)},saveFile:function(t){return A("file.saveFile",t,{filePath:V(t)},function(t){return{apFilePath:t.savedFilePath}})},getFileInfo:function(t){return A("file.getFileInfo",t,{filePath:V(t)},function(t){return{size:t.size}})},getSavedFileInfo:function(t){return A("file.getFileInfo",t,{filePath:V(t)})},getSavedFileList:function(t){return A("file.getFileList",t,{},function(t){var e=[];return p(t.fileList)&&(e=t.fileList.map(function(t){return{size:t.size,createTime:t.createTime,apFilePath:t.filePath}})),{fileList:e}})},removeSavedFile:function(t){return A("file.removeFile",t,{filePath:V(t)})},chooseImage:function(t){A("image.chooseImage",t)},compressImage:function(t){A("image.compressImage",t)},previewImage:function(t){A("image.previewImage",t)},saveImage:function(t){A("image.saveImage",t)},getImageInfo:function(t){A("image.getImageInfo",t)},hideKeyboard:function(){A("keyboard.hideKeyboard")},getLocation:function(t){var n=t.type;A("location.getLocation",t,t,function(t){var e={longitude:t.coords.longitude,latitude:t.coords.latitude,accuracy:t.coords.accuracy};return 0<n&&t.address&&(e.country=t.address.country,e.province=t.address.province,e.city=t.address.city,e.cityAdcode=t.address.cityCode,e.district=t.address.area,e.districtAdcode=t.address.areaCode),e})},createLottieContext:function(t){return new q(t)},setBackgroundImage:function(t){A("miniApp.setWebViewBackgroundImage",t)},removeBackgroundImage:function(t){A("miniApp.setWebViewBackgroundImage",t,{color:"",imgUrl:""})},setViewTop:function(t){A("miniApp.setWebViewTop",t)},setCanPullDown:function(t){A("miniApp.setWebViewParams",t)},setShareAppMessage:function(t){void 0===t&&(t={}),A("miniApp.setAppShareInfo",t,{title:t.title,description:t.desc,imageUrl:t.imageUrl})},pageScrollTo:function(t){void 0===t&&(t={}),b("pageScrollTo",{scrollTop:t.scrollTop})},alert:function(t){void 0===t&&(t={}),A("modal.alert",t,{title:t.title,message:t.content,okTitle:t.buttonText})},confirm:function(t){void 0===t&&(t={});var e=t.confirmButtonText||"\u786e\u5b9a",n=t.cancelButtonText||"\u53d6\u6d88";A("modal.confirm",t,{title:t.title,message:t.content,okTitle:e,cancelTitle:n},function(t){return{confirm:t.data===e}})},showToast:function(t){void 0===t&&(t={}),t.duration||(t.duration=2e3),A("modal.toast",t,{message:t.content,duration:t.duration/1e3})},hideToast:function(t){A("modal.hideToast",t)},prompt:function(t){A("modal.prompt",t)},showLoading:function(t){A("modal.showLoading",t)},hideLoading:function(t){A("modal.hideLoading",t)},sendMtop:function(t){A("sendMtop.request",y("sendMtop",t))},navigateTo:function(t,e){void 0===t&&(t={}),void 0===e&&(e=""),A("navigator.push",t=y("navigateTo",t),{url:H(function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",n=t&&t.split("/")||[],o=e&&e.split("/")||[],r=t&&W(t),i=e&&W(e),a=r||i;if(t&&W(t)?o=n:n.length&&(o.pop(),o=o.concat(n)),!o.length)return"/";var c=void 0;if(o.length){var u=o[o.length-1];c="."===u||".."===u||""===u}else c=!1;for(var s=0,f=o.length;0<=f;f--){var d=o[f];"."===d?z(o,f):".."===d?(z(o,f),s++):s&&(z(o,f),s--)}if(!a)for(;s--;s)o.unshift("..");!a||""===o[0]||o[0]&&W(o[0])||o.unshift("");var l=o.join("/");return c&&"/"!==l.substr(-1)&&(l+="/"),l}(t.url,e)||"")})},navigateBack:function(t){A("navigator.pop",y("navigateBack",t))},redirectTo:function(t){void 0===t&&(t={}),A("navigator.redirectTo",t=y("redirectTo",t),{url:H(t.url)})},switchTab:function(t){void 0===t&&(t={}),A("navigator.switchTab",t=y("switchTab",t),{url:H(t.url)})},navigateToMiniProgram:function(t){A("navigator.navigateToMiniProgram",t)},navigateBackMiniProgram:function(t){A("navigator.navigateBackMiniProgram",t)},setNavigationBar:function(t){A("navigatorBar.setNavigationBar",t)},getStatusBarHeight:function(t){A("navigatorBar.getStatusBarHeight",t,t,function(t){return{height:parseInt(t.data)}})},getNavigationBarHeight:function(t){A("navigatorBar.getHeight",t,t,function(t){return{height:parseInt(t.data)}})},showNavigationBarLoading:function(t){A("navigatorBar.showNavigationBarLoading",t)},hideNavigationBarLoading:function(t){A("navigatorBar.hideNavigationBarLoading",t)},setNavigationBarDrawer:function(t){A("navigatorBar.setDrawer",t)},openNavigationBarDrawer:function(t){A("navigatorBar.openDrawer",t)},closeNavigationBarDrawer:function(t){A("navigatorBar.closeDrawer",t)},setNavigationBarSheet:function(t){A("navigatorBar.setActionSheet",t)},httpRequest:function(n){void 0===n&&(n={});var t=(n=y("httpRequest",n)).method||"GET";if("GET"===t&&l(n.data)){var o=[];Object.keys(n.data).forEach(function(t){var e=n.data[t];o.push(t+"="+JSON.stringify(e))});var e=o.join("&");0<=n.url.indexOf("?")?n.url+=e:n.url+="?"+e}A("network.request",n,{method:t,url:n.url,headers:n.headers||{"Content-Type":"application/x-www-form-urlencoded"},dataType:n.dataType||"json",body:n.data},function(t){return{data:t.data,status:t.status,headers:t.headers}})},uploadFile:function(t){A("network.uploadFile",t)},downloadFile:function(t){A("network.downloadFile",t)},makePhoneCall:function(t){void 0===t&&(t={}),A("phone.makePhoneCall",t,{phoneNumber:t.number})},chooseCity:function(t){void 0===t&&(t={}),t.cities&&Array.isArray(t.cities)&&(t.cities=t.cities.map(function(t){return{cityName:t.city,cityCode:t.adCode,spell:t.spell}})),t.hotCities&&Array.isArray(t.hotCities)&&(t.hotCities=t.hotCities.map(function(t){return{cityName:t.city,cityCode:t.adCode,spell:t.spell}})),A("picker.chooseCity",t,t,function(t){return{city:t.cityName,adCode:t.cityCode}})},datePicker:function(t){void 0===t&&(t={}),A("picker.pickDate",t,{format:t.format,value:t.currentDate,min:t.startDate,max:t.endDate},function(t){return{date:t.data}})},setScreenBrightness:function(t){void 0===t&&(t={}),A("screen.setBrightness",t,{brightness:t.brightness})},getScreenBrightness:function(t){A("screen.getScreenBrightness",t,t,function(t){return{brightness:t.value}})},setKeepScreenOn:function(t){void 0===t&&(t={}),A("screen.setAlwaysOn",t,{on:t.keepScreenOn})},shareTinyAppMsg:function(t){A("share.doShare",t)},showSku:function(t){A("sku.show",t)},hideSku:function(t){A("sku.hide",t)},setStorage:function(t){void 0===t&&(t={}),A("storage.setItem",t,{key:t.key,value:$(t)})},setStorageSync:function(t){return N("storage.setItemSync",{key:t.key,value:$(t)})},getStorage:function(t){void 0===t&&(t={}),A("storage.getItem",t,t,G)},getStorageSync:function(t){return G(N("storage.getItemSync",t))},removeStorage:function(t){void 0===t&&(t={}),A("storage.removeItem",t)},removeStorageSync:function(t){return void 0===t&&(t={}),N("storage.removeItemSync",t)},clearStorage:function(t){A("storage.clearStorage",t)},clearStorageSync:function(t){return N("storage.clearStorageSync",t)},getStorageInfo:function(t){A("storage.getStorageInfo",t)},getStorageInfoSync:function(t){return N("storage.getStorageInfoSync",t)},getSystemInfoSync:K,getSystemInfo:function(e){void 0===e&&(e={});try{"function"==typeof e.success&&e.success.call(this,K())}catch(t){"function"==typeof e.fail&&e.fail.call(this,t)}finally{"function"==typeof e.complete&&e.complete.call(this)}},SDKVersion:J,showTabBar:function(t){A("tabBar.show",t)},hideTabBar:function(t){A("tabBar.hide",t)},setTabBarStyle:function(t){A("tabBar.setTabBarStyle",t)},setTabBarItem:function(t){A("tabBar.setTabBarItem",t)},setTabBarBadge:function(t){A("tabBar.setTabBarBadge",t)},removeTabBarBadge:function(t){A("tabBar.removeTabBarBadge",t)},showTabBarRedDot:function(t){A("tabBar.showTabBarRedDot",t)},hideTabBarRedDot:function(t){A("tabBar.hideTabBarRedDot",t)},uccBind:function(t){A("ucc.uccBind",t)},uccTrustLogin:function(t){A("ucc.uccTrustLogin",t)},uccUnbind:function(t){A("ucc.uccUnbind",t)},reportAnalytics:function(t,e){void 0===e&&(e={}),"click"==t||"enter"==t||"expose"==t?_("userTrack.commitut")({type:t,eventId:e.eventId,name:e.name,comName:e.comName,arg1:e.arg1,arg2:e.arg2,arg3:e.arg3,param:e.param}):_("userTrack.customAdvance")({eventId:e.eventId,name:e.name,comName:e.comName,arg1:e.arg1,arg2:e.arg2,arg3:e.arg3,param:e.param})},createVideoContext:function(t){return new Y(t)},chooseVideo:function(t){A("video.chooseVideo",t,t,function(t){return t.apFilePath&&(t.tempFilePath=t.apFilePath,delete t.apFilePath),t})},saveVideoToPhotosAlbum:function(t){A("video.saveVideoToPhotosAlbum",t)},getAuthUserInfo:function(t){A("sendMtop.request",t,{api:"mtop.taobao.openlink.openinfo.user.get",v:"1.0",type:"GET"},function(t){var e={nickName:t.data.mixNick,userId:t.data.openId};return t.data.avatar&&(e.avatar=t.data.avatar),t.data.unionId&&(e.unionId=t.data.unionId),e})},getTBCode:function(t){A("sendMtop.request",t,{api:"mtop.taobao.openlink.basic.login.auth.code",v:"1.0",type:"GET"},function(t){return{code:t.data.result}})},getTBSessionInfo:function(t){A("wopc.getSessionKey",t,t,function(t){return{data:t}})},setTBSessionInfo:function(t){void 0===t&&(t={}),A("wopc.setSessionKey",t,t.sessionInfo,function(t){return{success:!0}})},getSetting:function(t){A("wopc.getSetting",t)},openSetting:function(t){A("wopc.openSetting",t)},authorize:function(t){A("wopc.authorize",t)},connectSocket:function(t){void 0===t&&(t={}),et&&(A("webSocket.close",{instanceId:tt}),et=!1,tt++),A("webSocket.webSocket",t,{instanceId:tt,url:t.url,protocol:""},function(t){return et=!0,t}),Q.forEach(function(e){A("webSocket."+e,{instanceId:tt,success:function(t){Z.emit(e,t)}})})},sendSocketMessage:function(t){void 0===t&&(t={}),A("webSocket.send",t,{instanceId:tt,data:t.data})},closeSocket:function(t){A("webSocket.close",t,{instanceId:tt},function(t){return et=!1,tt++,t})},onSocketOpen:function(t){Z.on("onOpen",t)},offSocketOpen:function(t){Z.off("onOpen",t)},onSocketError:function(t){Z.on("onError",t)},offSocketError:function(t){Z.off("onError",t)},onSocketMessage:function(e){Z.on("onMessage",function(t){e&&e({data:t,isBuffer:!1})})},offSocketMessage:function(t){Z.off("onMessage",t)},onSocketClose:function(t){Z.on("onClose",t)},offSocketClose:function(t){Z.off("onClose",t)}});function ot(t){var e,n="my";t&&t.defaultName&&(n=t.defaultName);var r,o,i,a=Object.assign({},nt,{canIUse:function(t){return t in nt}});return r=a,(o=h())&&o.$on("registerModuleAPI",function(t){var e=t.data,n=e.scope;if(n)if(p(e.map))if(!r[n]||l(r[n])){var o=r[n]=r[n]||{};e.map.forEach(function(e){o[e.apiName]&&console.warn("my."+n+"."+e.apiName+" is already existed and will be overridded."),o[e.apiName]=function(t){return e.isSync?N(e.moduleMethod,t):A(e.moduleMethod,t)}})}else console.error('"my.'+n+"\" is already existed and can't be overridded.");else console.error('"data.map" is undefined or not a array on "registerModuleAPI" event.');else console.error('"data.scope" is undefined on "registerModuleAPI" event.')}),h().$on("[[ModuleAPIEvent]]",function(t){var e=t.type;void 0===e&&(e="");var n=t.data;void 0===n&&(n={});var o=e;n.event&&n.event.name&&(o+="."+n.event.name),I.emit(o,n)}),t&&t.preprocessor&&function(t,e){if(l(t)&&l(e))for(var n in e)o=t,r=n,Object.prototype.hasOwnProperty.call(o,r)&&"function"==typeof e[n]&&(v[n]=e[n]);var o,r}(a,t.preprocessor),t&&t.errorHandler&&"function"==typeof(i=t.errorHandler)&&(C=i),(e={})[n]=a,e}return function(e,n,t){void 0===t&&(t=!0);var o=r();try{Object.defineProperty(o,e,{value:n,configurable:!0,enumerable:!0,writable:!t})}catch(t){o[e]=n}}("__WINDMILL_MODULE_API__",{getAPIs:ot}),ot});
{
"name": "windmill-module-api",
"version": "0.2.56",
"version": "0.2.57",
"description": "Standard module APIs of windmill.",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc