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.63 to 0.2.64

19

index.js

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

/* windmill-module-api (0.2.63), build at 2019-01-03 14:31. */
/* windmill-module-api (0.2.64), build at 2019-01-03 15:43. */

@@ -1119,2 +1119,16 @@ (function (global, factory) {

}
// only for PC
function onPageNotify(callback) {
this[PRIVATE_PROP_KEY]._callModule('navigator.pc_onPageNotify', {
success: callback
});
}
// only for PC
function offPageNotify() {
this[PRIVATE_PROP_KEY]._callModule('navigator.pc_offPageNotify');
}
// only for PC
function setPageNotifyConfig(options) {
this[PRIVATE_PROP_KEY]._callModule('navigator.pc_setPageNotifyConfig', options);
}

@@ -1678,2 +1692,5 @@ function setNavigationBar(options) {

navigateBackMiniProgram: navigateBackMiniProgram,
onPageNotify: onPageNotify,
offPageNotify: offPageNotify,
setPageNotifyConfig: setPageNotifyConfig,
setNavigationBar: setNavigationBar,

@@ -1680,0 +1697,0 @@ getStatusBarHeight: getStatusBarHeight,

4

index.min.js

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

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