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.4.1 to 0.4.2

11

index.js

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

/* windmill-module-api (0.4.1), build at 2019-01-22 16:14. */
/* windmill-module-api (0.4.2), build at 2019-01-22 17:47. */

@@ -1745,6 +1745,9 @@ (function (global, factory) {

for (var key in this._moduleAPIs) {
apis[key] = this._moduleAPIs[key];
if (typeof apis[key] === 'function') {
apis[key].bind(this._host);
var method = this._moduleAPIs[key];
if (typeof method === 'function') {
apis[key] = method.bind(this._host);
}
else {
apis[key] = this._moduleAPIs[key];
}
}

@@ -1751,0 +1754,0 @@ apis.canIUse = function (name) { return this$1.canIUse(name); };

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

/* windmill-module-api (0.4.1), build at 2019-01-22 16:14. */
!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 i(){return"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:new Function("return this")()}var r="__WINDMILL_MODULE_GETTER__";function s(t){var e=i();return e&&"function"==typeof e[r]?e[r](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 c(t,e){var n=t[a];return Array.isArray(n[e])||(n[e]=[]),n[e]}var u,f=function(){Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:{}})};function h(t){return Object.prototype.toString.call(t).slice(8,-1)}function d(t){return"Object"===h(t)}function l(t){return"Array"===h(t)}function p(){return"object"==typeof __windmill_environment__?__windmill_environment__:"object"==typeof wmlEnv?wmlEnv:"object"==typeof windmillEnv?windmillEnv:{}}function g(){if(!u){var t=i();u=t[e]}return u}function m(){return g().$getCurrentActivePageId()}f.prototype.on=function(t,e){return c(this,t).push({listener:e,once:!1,callCount:0}),this},f.prototype.once=function(t,e){return c(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 i=o.findIndex(function(t){return t.listener===e});-1!==i&&o.splice(i,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],i=o[t];return Array.isArray(i)&&(o[t]=i.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&&d(e)?n(e):e}var S,w=(S=1e5,function(){var t=String(S);return S+=1,t});function _(t,e){var n=m(),o="[[ModuleAPIEvent]]@"+n;g().$emit(o,{type:t,data:e},n)}var I=new f;var b=["success","fail","complete"];function P(t){var e={};for(var n in t)-1===b.indexOf(n)&&(e[n]=t[n]);return e}function T(r,t){var a=g();if(a){if(t&&"function"==typeof a.$callSync)return function(t,e,n){return void 0===n&&(n={}),a.$callSync(r,t,e,n)};if(!t&&"function"==typeof a.$call)return function(t,e,n,o,i){return void 0===i&&(i={}),a.$call(r,t,e,n,o,i)}}var e=r.split(/\s*\.\s*/i),n=e[0],o=e[1];if(n&&o){var i=s(n);if(i&&"function"==typeof i[o])return i[o]}return function(){}}function k(t,e){if("function"==typeof t)try{return t.apply(null,e)}catch(t){console.error("Failed to execute internal method: "+t.toString())}}var A=function(t,e){console.error('Failed to execute callback of "'+t+'": '+e.toString())};function B(e,t,n){if("function"==typeof t)try{return t.apply(null,n)}catch(t){A(e,t)}}function C(t,n,o,e,i,r){void 0===o&&(o={}),void 0===e&&(e=o),void 0===i&&(i=function(t){return t}),void 0===r&&(r=function(t){return t});var a=T(n),s=t&&"function"==typeof t.getContext?t.getContext():{},c=t&&"function"==typeof t.getModifier?t.getModifier():{},u=!1;return a(P(e),function(t){var e=k(i,[t]);B(n,o.success,[e]),u||(B(n,o.complete,[e]),u=!0)},function(t){var e=k(r,[t]);B(n,o.fail,[e]),u||(B(n,o.complete,[e]),u=!0)},s,c)}function x(t,e,n){void 0===n&&(n={});var o=T(e,!0),i=t&&"function"==typeof t.getContext?t.getContext():{},r=t&&"function"==typeof t.getModifier?t.getModifier():{};return o(P(n),i,r)}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"],N=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}})};N.prototype.step=function(t){return this.animations.push({config:Object.assign({},this.config,t),animation:this.currentAnimation}),this.currentAnimation=[],this},N.prototype.export=function(){var t=this.animations;return this.animations=[],t};var M=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}(N);var E=function(t,e){void 0===e&&(e={}),this._instanceId=w(),this._host=t,this._emitter=new f,this.src=e.src};E.prototype.play=function(t){var e=this;C(this._host,"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})},E.prototype.pause=function(t){var e=this;C(this._host,"audioPlayer.pauseVoice",t,{instanceId:this._instanceId},function(t){return e._emitter.emit("pause"),t},function(t){return e._emitter.emit("error",t),t})},E.prototype.stop=function(t){var e=this;C(this._host,"audioPlayer.stopVoice",t,{instanceId:this._instanceId},function(t){return e._emitter.emit("stop"),t},function(t){return e._emitter.emit("error",t),t})},E.prototype.onPlay=function(t){this._emitter.on("play",t)},E.prototype.onPause=function(t){this._emitter.on("pause",t)},E.prototype.onStop=function(t){this._emitter.on("stop",t)},E.prototype.onError=function(t){this._emitter.on("error",t)},E.prototype.offPlay=function(t){this._emitter.off("play",t)},E.prototype.offPause=function(t){this._emitter.off("pause",t)},E.prototype.offStop=function(t){this._emitter.off("stop",t)},E.prototype.offError=function(t){this._emitter.off("error",t)};var D,F=function(t){this._startEmitted=!1,this._host=t,this._emitter=new f};F.prototype.start=function(t){var e=this;void 0===t&&(t={}),this._startEmitted=!1,C(this._host,"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})},F.prototype.stop=function(t){var e=this;void 0===t&&(t={}),C(this._host,"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})},F.prototype.onStart=function(t){this._emitter.on("start",t)},F.prototype.onStop=function(t){this._emitter.on("stop",t)},F.prototype.onError=function(t){this._emitter.on("error",t)},F.prototype.offStart=function(t){this._emitter.off("start",t)},F.prototype.offStop=function(t){this._emitter.off("stop",t)},F.prototype.offError=function(t){this._emitter.off("error",t)};var L,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 d(t)?t.apFilePath||t.filePath:""}R.prototype.draw=function(){_("canvas",{canvasId:this._canvasId,actions:this._actions}),this._actions=[]};var U=["play","stop","pause","setSpeed","goToAndStop","goToAndPlay","getDuration","setDirection","playSegments","destroy"],j=["onAnimationEnd","onAnimationRepeat","onDataReady","onDataFailed","onAnimationStart","onAnimationCancel"],q=function(o){var i=this;U.forEach(function(n){i[n]=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];_("lottie",{lottieId:o,action:{method:n,args:t}})}}),j.forEach(function(t){i[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(i,e)})}})};function W(t){return"/"===t.charAt(0)}function H(t,e){for(var n=e,o=n+1,i=t.length;o<i;n+=1,o+=1)t[n]=t[o];t.pop()}function z(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=p();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=p().version||"";var X=["play","pause","stop","requestFullScreen","exitFullScreen","showControls","hideControls","enableLoop","disableLoop"],Y=function(r){var t=this;X.forEach(function(i){t[i]=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var n=m(),o="[[VideoContextAction]]@"+n;g().$emit(o,{action:i,id:r,args:t},n)}})};var Z=new f,Q=["onOpen","onError","onMessage","onClose"],tt=0,et=!1;var nt=Object.freeze({showActionSheet:function(t){C(this,"actionSheet.showActionSheet",t)},chooseAddress:function(t){C(this,"address.choose",t)},tradePay:function(t){void 0===t&&(t={}),C(this,"alipay.tradePay",t=y("tradePay",t))},createAnimation:function(t){return new M(t)},createInnerAudioContext:function(t){return new E(this,t)},getRecorderManager:function(t){return D||(D=new F(this)),D},createCanvasContext:function(t){return new R(t)},openChat:function(t){C(this,"chat.open",t)},getClipboard:function(t){C(this,"clipboard.readText",t)},setClipboard:function(t){void 0===t&&(t={}),C(this,"clipboard.writeText",t,{text:t.text})},getNetworkType:function(t){C(this,"connection.getType",t=y("getNetworkType",t),{},function(t){return{networkType:(t.type||"").toUpperCase()}})},onNetworkStatusChange:function(t){L||(L=new f,s("connection").onChange({},function(t){var e=t.type||"";L.emit("networkStatusChange",{networkType:e.toUpperCase()})})),L.on("networkStatusChange",t)},offNetworkStatusChange:function(){L.off("networkStatusChange")},choosePhoneContact:function(t){C(this,"contact.choosePhoneContact",t=y("choosePhoneContact",t),{},function(t){return{name:t.name,mobile:t.phone}})},watchShake:function(t){C(this,"device.onShake",t,{on:!0})},vibrate:function(t){C(this,"device.vibrate",t)},vibrateShort:function(t){C(this,"device.vibrateShort",t)},onUserCaptureScreen:function(t){C(this,"device.onUserCaptureScreen",{success:t})},offUserCaptureScreen:function(){C(this,"device.offUserCaptureScreen")},scan:function(t){C(this,"device.scan",t)},saveFile:function(t){return C(this,"file.saveFile",t,{filePath:V(t)},function(t){return{apFilePath:t.savedFilePath}})},getFileInfo:function(t){return C(this,"file.getFileInfo",t,{filePath:V(t)},function(t){return{size:t.size}})},getSavedFileInfo:function(t){return C(this,"file.getFileInfo",t,{filePath:V(t)})},getSavedFileList:function(t){return C(this,"file.getFileList",t,{},function(t){var e=[];return l(t.fileList)&&(e=t.fileList.map(function(t){return{size:t.size,createTime:t.createTime,apFilePath:t.filePath}})),{fileList:e}})},removeSavedFile:function(t){return C(this,"file.removeFile",t,{filePath:V(t)})},chooseImage:function(t){C(this,"image.chooseImage",t)},compressImage:function(t){C(this,"image.compressImage",t)},previewImage:function(t){C(this,"image.previewImage",t)},saveImage:function(t){C(this,"image.saveImage",t)},getImageInfo:function(t){C(this,"image.getImageInfo",t)},hideKeyboard:function(){C(this,"keyboard.hideKeyboard")},getLocation:function(t){var n=t.type;C(this,"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){C(this,"miniApp.setWebViewBackgroundImage",t)},removeBackgroundImage:function(t){C(this,"miniApp.setWebViewBackgroundImage",t,{color:"",imgUrl:""})},setViewTop:function(t){C(this,"miniApp.setWebViewTop",t)},setCanPullDown:function(t){C(this,"miniApp.setWebViewParams",t)},setShareAppMessage:function(t){void 0===t&&(t={}),C(this,"miniApp.setAppShareInfo",t,{title:t.title,description:t.desc,imageUrl:t.imageUrl,extraParams:t.extraParams})},startPullDownRefresh:function(t){C(this,"miniApp.startPullDownRefresh",t)},stopPullDownRefresh:function(t){C(this,"miniApp.stopPullDownRefresh",t)},setBackgroundTextStyle:function(t){C(this,"miniApp.setBackgroundTextStyle",t)},setBackgroundColor:function(t){C(this,"miniApp.setBackgroundColor",t)},reLaunch:function(t){C(this,"miniApp.reLaunch",t)},pageScrollTo:function(t){void 0===t&&(t={}),_("pageScrollTo",{scrollTop:t.scrollTop})},alert:function(t){void 0===t&&(t={}),C(this,"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";C(this,"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),C(this,"modal.toast",t,{message:t.content,duration:t.duration/1e3})},hideToast:function(t){C(this,"modal.hideToast",t)},prompt:function(t){C(this,"modal.prompt",t)},showLoading:function(t){C(this,"modal.showLoading",t)},hideLoading:function(t){C(this,"modal.hideLoading",t)},sendMtop:function(t){C(this,"sendMtop.request",y("sendMtop",t))},navigateTo:function(t,e){void 0===t&&(t={}),void 0===e&&(e=""),C(this,"navigator.push",t=y("navigateTo",t),{url:z(function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",n=t&&t.split("/")||[],o=e&&e.split("/")||[],i=t&&W(t),r=e&&W(e),a=i||r;if(t&&W(t)?o=n:n.length&&(o.pop(),o=o.concat(n)),!o.length)return"/";var s=void 0;if(o.length){var c=o[o.length-1];s="."===c||".."===c||""===c}else s=!1;for(var u=0,f=o.length;0<=f;f--){var h=o[f];"."===h?H(o,f):".."===h?(H(o,f),u++):u&&(H(o,f),u--)}if(!a)for(;u--;u)o.unshift("..");!a||""===o[0]||o[0]&&W(o[0])||o.unshift("");var d=o.join("/");return s&&"/"!==d.substr(-1)&&(d+="/"),d}(t.url,e)||"")})},navigateBack:function(t){C(this,"navigator.pop",y("navigateBack",t))},redirectTo:function(t){void 0===t&&(t={}),C(this,"navigator.redirectTo",t=y("redirectTo",t),{url:z(t.url)})},switchTab:function(t){void 0===t&&(t={}),C(this,"navigator.switchTab",t=y("switchTab",t),{url:z(t.url)})},navigateToMiniProgram:function(t){C(this,"navigator.navigateToMiniProgram",t)},navigateBackMiniProgram:function(t){C(this,"navigator.navigateBackMiniProgram",t)},onPageNotify:function(t){C(this,"navigator.pc_onPageNotify",{success:t})},offPageNotify:function(){C(this,"navigator.pc_offPageNotify")},setPageNotifyConfig:function(t){C(this,"navigator.pc_setPageNotifyConfig",t)},getBackStack:function(t){C(this,"navigator.getBackStack",t)},popToHome:function(t){C(this,"navigator.popToHome",t)},setNavigationBar:function(t){C(this,"navigatorBar.setNavigationBar",t)},getStatusBarHeight:function(t){C(this,"navigatorBar.getStatusBarHeight",t,t,function(t){return{height:parseInt(t.data)}})},getNavigationBarHeight:function(t){C(this,"navigatorBar.getHeight",t,t,function(t){return{height:parseInt(t.data)}})},showNavigationBarLoading:function(t){C(this,"navigatorBar.showNavigationBarLoading",t)},hideNavigationBarLoading:function(t){C(this,"navigatorBar.hideNavigationBarLoading",t)},setNavigationBarDrawer:function(t){C(this,"navigatorBar.setDrawer",t)},openNavigationBarDrawer:function(t){C(this,"navigatorBar.openDrawer",t)},closeNavigationBarDrawer:function(t){C(this,"navigatorBar.closeDrawer",t)},setNavigationBarSheet:function(t){C(this,"navigatorBar.setActionSheet",t)},httpRequest:function(o){void 0===o&&(o={});var t=(o=y("httpRequest",o)).method||"GET";if("GET"===t&&d(o.data)){var i=[];Object.keys(o.data).forEach(function(t){var e=o.data[t],n="object"==typeof e?JSON.stringify(e):e;i.push(t+"="+encodeURIComponent(n))});var e=i.join("&");0<=o.url.indexOf("?")?o.url+=e:o.url+="?"+e}C(this,"network.request",o,{method:t,url:o.url,headers:o.headers||{"Content-Type":"application/x-www-form-urlencoded"},dataType:o.dataType||"json",body:o.data},function(t){return{data:t.data,status:t.status,headers:t.headers}})},uploadFile:function(t){C(this,"network.uploadFile",t)},downloadFile:function(t){C(this,"network.downloadFile",t)},makePhoneCall:function(t){void 0===t&&(t={}),C(this,"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}})),C(this,"picker.chooseCity",t,t,function(t){return{city:t.cityName,adCode:t.cityCode}})},datePicker:function(t){void 0===t&&(t={}),C(this,"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={}),C(this,"screen.setBrightness",t,{brightness:t.brightness})},getScreenBrightness:function(t){C(this,"screen.getScreenBrightness",t,t,function(t){return{brightness:t.value}})},setKeepScreenOn:function(t){void 0===t&&(t={}),C(this,"screen.setAlwaysOn",t,{on:t.keepScreenOn})},shareTinyAppMsg:function(t){C(this,"share.doShare",t)},showSku:function(t){C(this,"sku.show",t)},hideSku:function(t){C(this,"sku.hide",t)},setStorage:function(t){void 0===t&&(t={}),C(this,"storage.setItem",t,{key:t.key,value:$(t)})},setStorageSync:function(t){return x(this,"storage.setItemSync",{key:t.key,value:$(t)})},getStorage:function(t){void 0===t&&(t={}),C(this,"storage.getItem",t,t,G)},getStorageSync:function(t){return G(x(this,"storage.getItemSync",t))},removeStorage:function(t){void 0===t&&(t={}),C(this,"storage.removeItem",t)},removeStorageSync:function(t){return void 0===t&&(t={}),x(this,"storage.removeItemSync",t)},clearStorage:function(t){C(this,"storage.clearStorage",t)},clearStorageSync:function(t){return x(this,"storage.clearStorageSync",t)},getStorageInfo:function(t){C(this,"storage.getStorageInfo",t)},getStorageInfoSync:function(t){return x(this,"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){C(this,"tabBar.show",t)},hideTabBar:function(t){C(this,"tabBar.hide",t)},setTabBarStyle:function(t){C(this,"tabBar.setTabBarStyle",t)},setTabBarItem:function(t){C(this,"tabBar.setTabBarItem",t)},setTabBarBadge:function(t){C(this,"tabBar.setTabBarBadge",t)},removeTabBarBadge:function(t){C(this,"tabBar.removeTabBarBadge",t)},showTabBarRedDot:function(t){C(this,"tabBar.showTabBarRedDot",t)},hideTabBarRedDot:function(t){C(this,"tabBar.hideTabBarRedDot",t)},uccBind:function(t){C(this,"ucc.uccBind",t)},uccTrustLogin:function(t){C(this,"ucc.uccTrustLogin",t)},uccUnbind:function(t){C(this,"ucc.uccUnbind",t)},reportAnalytics:function(t,e){void 0===e&&(e={}),"click"==t||"enter"==t||"expose"==t?C(this,"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}):C(this,"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){C(this,"video.chooseVideo",t,t,function(t){return t.apFilePath&&(t.tempFilePath=t.apFilePath,delete t.apFilePath),t})},saveVideoToPhotosAlbum:function(t){C(this,"video.saveVideoToPhotosAlbum",t)},getAuthUserInfo:function(t){C(this,"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){C(this,"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){C(this,"wopc.getSessionKey",t,t,function(t){return{data:t}})},setTBSessionInfo:function(t){void 0===t&&(t={}),C(this,"wopc.setSessionKey",t,t.sessionInfo,function(t){return{success:!0}})},getSetting:function(t){C(this,"wopc.getSetting",t)},openSetting:function(t){C(this,"wopc.openSetting",t)},authorize:function(t){C(this,"wopc.authorize",t)},connectSocket:function(t){var n=this;void 0===t&&(t={}),et&&(C(this,"webSocket.close",{instanceId:tt}),et=!1,tt++),C(this,"webSocket.webSocket",t,{instanceId:tt,url:t.url,protocol:""},function(t){return et=!0,t}),Q.forEach(function(e){C(n,"webSocket."+e,{instanceId:tt,success:function(t){Z.emit(e,t)}})})},sendSocketMessage:function(t){void 0===t&&(t={}),C(this,"webSocket.send",t,{instanceId:tt,data:t.data})},closeSocket:function(t){C(this,"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)}}),ot=function(t){var n=this;this._name="my",this._moduleAPIs={},this._modifier={},d(t)&&(this._options=t,this._name=t.defaultName||this._name,this._context=t.context||{},this._modifier.origin=t.label),this._host={getContext:function(){return n._context},getModifier:function(){return n._modifier}};var e=g();e&&e.$on("registerModuleAPI",function(t){var e=t.data;n.registerScopedAPIs(e)})};function it(t){var e;g().$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(d(t)&&d(e))for(var n in e)o=t,i=n,Object.prototype.hasOwnProperty.call(o,i)&&"function"==typeof e[n]&&(v[n]=e[n]);var o,i}(nt,t.preprocessor),t&&t.errorHandler&&"function"==typeof(e=t.errorHandler)&&(A=e);var n=new ot(t);return n.registerModuleAPIs(nt),n.getAPIs()}return ot.prototype.canIUse=function(t){return"string"==typeof t&&t in this._moduleAPIs},ot.prototype.getAPIs=function(){var t,e=this,n={};for(var o in this._moduleAPIs)n[o]=this._moduleAPIs[o],"function"==typeof n[o]&&n[o].bind(this._host);return n.canIUse=function(t){return e.canIUse(t)},(t={})[this._name]=n,t},ot.prototype.registerModuleAPIs=function(t){if(d(t))for(var e in t)this._moduleAPIs[e]=t[e]},ot.prototype.registerScopedAPIs=function(t){var n=this;void 0===t&&(t={});var o=t.scope,e=t.map;if(!o)return console.error('"data.scope" is undefined on "registerModuleAPI" event.');if(!l(e))return console.error('"data.map" is undefined or not a array on "registerModuleAPI" event.');if(this._moduleAPIs[o]&&!d(this._moduleAPIs[o]))return console.error('"'+this._name+"."+o+"\" is already exist and can't be overridden.");var i=this._moduleAPIs[o]=this._moduleAPIs[o]||{};e.forEach(function(e){i[e.apiName]&&console.warn(n._name+"."+o+"."+e.apiName+" is already exist and will be overridden!"),i[e.apiName]=e.isSync?function(t){return C(n._host,e.moduleMethod,t)}:function(t){return x(n._host,e.moduleMethod,t)}})},function(e,n,t){void 0===t&&(t=!0);var o=i();try{Object.defineProperty(o,e,{value:n,configurable:!0,enumerable:!0,writable:!t})}catch(t){o[e]=n}}("__WINDMILL_MODULE_API__",{getAPIs:it}),it});
/* windmill-module-api (0.4.2), build at 2019-01-22 17:47. */
!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 i(){return"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:new Function("return this")()}var r="__WINDMILL_MODULE_GETTER__";function s(t){var e=i();return e&&"function"==typeof e[r]?e[r](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 c(t,e){var n=t[a];return Array.isArray(n[e])||(n[e]=[]),n[e]}var u,f=function(){Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:{}})};function h(t){return Object.prototype.toString.call(t).slice(8,-1)}function d(t){return"Object"===h(t)}function l(t){return"Array"===h(t)}function p(){return"object"==typeof __windmill_environment__?__windmill_environment__:"object"==typeof wmlEnv?wmlEnv:"object"==typeof windmillEnv?windmillEnv:{}}function g(){if(!u){var t=i();u=t[e]}return u}function m(){return g().$getCurrentActivePageId()}f.prototype.on=function(t,e){return c(this,t).push({listener:e,once:!1,callCount:0}),this},f.prototype.once=function(t,e){return c(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 i=o.findIndex(function(t){return t.listener===e});-1!==i&&o.splice(i,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],i=o[t];return Array.isArray(i)&&(o[t]=i.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&&d(e)?n(e):e}var S,w=(S=1e5,function(){var t=String(S);return S+=1,t});function _(t,e){var n=m(),o="[[ModuleAPIEvent]]@"+n;g().$emit(o,{type:t,data:e},n)}var I=new f;var b=["success","fail","complete"];function P(t){var e={};for(var n in t)-1===b.indexOf(n)&&(e[n]=t[n]);return e}function T(r,t){var a=g();if(a){if(t&&"function"==typeof a.$callSync)return function(t,e,n){return void 0===n&&(n={}),a.$callSync(r,t,e,n)};if(!t&&"function"==typeof a.$call)return function(t,e,n,o,i){return void 0===i&&(i={}),a.$call(r,t,e,n,o,i)}}var e=r.split(/\s*\.\s*/i),n=e[0],o=e[1];if(n&&o){var i=s(n);if(i&&"function"==typeof i[o])return i[o]}return function(){}}function k(t,e){if("function"==typeof t)try{return t.apply(null,e)}catch(t){console.error("Failed to execute internal method: "+t.toString())}}var A=function(t,e){console.error('Failed to execute callback of "'+t+'": '+e.toString())};function B(e,t,n){if("function"==typeof t)try{return t.apply(null,n)}catch(t){A(e,t)}}function C(t,n,o,e,i,r){void 0===o&&(o={}),void 0===e&&(e=o),void 0===i&&(i=function(t){return t}),void 0===r&&(r=function(t){return t});var a=T(n),s=t&&"function"==typeof t.getContext?t.getContext():{},c=t&&"function"==typeof t.getModifier?t.getModifier():{},u=!1;return a(P(e),function(t){var e=k(i,[t]);B(n,o.success,[e]),u||(B(n,o.complete,[e]),u=!0)},function(t){var e=k(r,[t]);B(n,o.fail,[e]),u||(B(n,o.complete,[e]),u=!0)},s,c)}function x(t,e,n){void 0===n&&(n={});var o=T(e,!0),i=t&&"function"==typeof t.getContext?t.getContext():{},r=t&&"function"==typeof t.getModifier?t.getModifier():{};return o(P(n),i,r)}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"],N=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}})};N.prototype.step=function(t){return this.animations.push({config:Object.assign({},this.config,t),animation:this.currentAnimation}),this.currentAnimation=[],this},N.prototype.export=function(){var t=this.animations;return this.animations=[],t};var M=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}(N);var E=function(t,e){void 0===e&&(e={}),this._instanceId=w(),this._host=t,this._emitter=new f,this.src=e.src};E.prototype.play=function(t){var e=this;C(this._host,"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})},E.prototype.pause=function(t){var e=this;C(this._host,"audioPlayer.pauseVoice",t,{instanceId:this._instanceId},function(t){return e._emitter.emit("pause"),t},function(t){return e._emitter.emit("error",t),t})},E.prototype.stop=function(t){var e=this;C(this._host,"audioPlayer.stopVoice",t,{instanceId:this._instanceId},function(t){return e._emitter.emit("stop"),t},function(t){return e._emitter.emit("error",t),t})},E.prototype.onPlay=function(t){this._emitter.on("play",t)},E.prototype.onPause=function(t){this._emitter.on("pause",t)},E.prototype.onStop=function(t){this._emitter.on("stop",t)},E.prototype.onError=function(t){this._emitter.on("error",t)},E.prototype.offPlay=function(t){this._emitter.off("play",t)},E.prototype.offPause=function(t){this._emitter.off("pause",t)},E.prototype.offStop=function(t){this._emitter.off("stop",t)},E.prototype.offError=function(t){this._emitter.off("error",t)};var D,F=function(t){this._startEmitted=!1,this._host=t,this._emitter=new f};F.prototype.start=function(t){var e=this;void 0===t&&(t={}),this._startEmitted=!1,C(this._host,"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})},F.prototype.stop=function(t){var e=this;void 0===t&&(t={}),C(this._host,"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})},F.prototype.onStart=function(t){this._emitter.on("start",t)},F.prototype.onStop=function(t){this._emitter.on("stop",t)},F.prototype.onError=function(t){this._emitter.on("error",t)},F.prototype.offStart=function(t){this._emitter.off("start",t)},F.prototype.offStop=function(t){this._emitter.off("stop",t)},F.prototype.offError=function(t){this._emitter.off("error",t)};var L,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 d(t)?t.apFilePath||t.filePath:""}R.prototype.draw=function(){_("canvas",{canvasId:this._canvasId,actions:this._actions}),this._actions=[]};var U=["play","stop","pause","setSpeed","goToAndStop","goToAndPlay","getDuration","setDirection","playSegments","destroy"],j=["onAnimationEnd","onAnimationRepeat","onDataReady","onDataFailed","onAnimationStart","onAnimationCancel"],q=function(o){var i=this;U.forEach(function(n){i[n]=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];_("lottie",{lottieId:o,action:{method:n,args:t}})}}),j.forEach(function(t){i[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(i,e)})}})};function W(t){return"/"===t.charAt(0)}function H(t,e){for(var n=e,o=n+1,i=t.length;o<i;n+=1,o+=1)t[n]=t[o];t.pop()}function z(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=p();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=p().version||"";var X=["play","pause","stop","requestFullScreen","exitFullScreen","showControls","hideControls","enableLoop","disableLoop"],Y=function(r){var t=this;X.forEach(function(i){t[i]=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var n=m(),o="[[VideoContextAction]]@"+n;g().$emit(o,{action:i,id:r,args:t},n)}})};var Z=new f,Q=["onOpen","onError","onMessage","onClose"],tt=0,et=!1;var nt=Object.freeze({showActionSheet:function(t){C(this,"actionSheet.showActionSheet",t)},chooseAddress:function(t){C(this,"address.choose",t)},tradePay:function(t){void 0===t&&(t={}),C(this,"alipay.tradePay",t=y("tradePay",t))},createAnimation:function(t){return new M(t)},createInnerAudioContext:function(t){return new E(this,t)},getRecorderManager:function(t){return D||(D=new F(this)),D},createCanvasContext:function(t){return new R(t)},openChat:function(t){C(this,"chat.open",t)},getClipboard:function(t){C(this,"clipboard.readText",t)},setClipboard:function(t){void 0===t&&(t={}),C(this,"clipboard.writeText",t,{text:t.text})},getNetworkType:function(t){C(this,"connection.getType",t=y("getNetworkType",t),{},function(t){return{networkType:(t.type||"").toUpperCase()}})},onNetworkStatusChange:function(t){L||(L=new f,s("connection").onChange({},function(t){var e=t.type||"";L.emit("networkStatusChange",{networkType:e.toUpperCase()})})),L.on("networkStatusChange",t)},offNetworkStatusChange:function(){L.off("networkStatusChange")},choosePhoneContact:function(t){C(this,"contact.choosePhoneContact",t=y("choosePhoneContact",t),{},function(t){return{name:t.name,mobile:t.phone}})},watchShake:function(t){C(this,"device.onShake",t,{on:!0})},vibrate:function(t){C(this,"device.vibrate",t)},vibrateShort:function(t){C(this,"device.vibrateShort",t)},onUserCaptureScreen:function(t){C(this,"device.onUserCaptureScreen",{success:t})},offUserCaptureScreen:function(){C(this,"device.offUserCaptureScreen")},scan:function(t){C(this,"device.scan",t)},saveFile:function(t){return C(this,"file.saveFile",t,{filePath:V(t)},function(t){return{apFilePath:t.savedFilePath}})},getFileInfo:function(t){return C(this,"file.getFileInfo",t,{filePath:V(t)},function(t){return{size:t.size}})},getSavedFileInfo:function(t){return C(this,"file.getFileInfo",t,{filePath:V(t)})},getSavedFileList:function(t){return C(this,"file.getFileList",t,{},function(t){var e=[];return l(t.fileList)&&(e=t.fileList.map(function(t){return{size:t.size,createTime:t.createTime,apFilePath:t.filePath}})),{fileList:e}})},removeSavedFile:function(t){return C(this,"file.removeFile",t,{filePath:V(t)})},chooseImage:function(t){C(this,"image.chooseImage",t)},compressImage:function(t){C(this,"image.compressImage",t)},previewImage:function(t){C(this,"image.previewImage",t)},saveImage:function(t){C(this,"image.saveImage",t)},getImageInfo:function(t){C(this,"image.getImageInfo",t)},hideKeyboard:function(){C(this,"keyboard.hideKeyboard")},getLocation:function(t){var n=t.type;C(this,"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){C(this,"miniApp.setWebViewBackgroundImage",t)},removeBackgroundImage:function(t){C(this,"miniApp.setWebViewBackgroundImage",t,{color:"",imgUrl:""})},setViewTop:function(t){C(this,"miniApp.setWebViewTop",t)},setCanPullDown:function(t){C(this,"miniApp.setWebViewParams",t)},setShareAppMessage:function(t){void 0===t&&(t={}),C(this,"miniApp.setAppShareInfo",t,{title:t.title,description:t.desc,imageUrl:t.imageUrl,extraParams:t.extraParams})},startPullDownRefresh:function(t){C(this,"miniApp.startPullDownRefresh",t)},stopPullDownRefresh:function(t){C(this,"miniApp.stopPullDownRefresh",t)},setBackgroundTextStyle:function(t){C(this,"miniApp.setBackgroundTextStyle",t)},setBackgroundColor:function(t){C(this,"miniApp.setBackgroundColor",t)},reLaunch:function(t){C(this,"miniApp.reLaunch",t)},pageScrollTo:function(t){void 0===t&&(t={}),_("pageScrollTo",{scrollTop:t.scrollTop})},alert:function(t){void 0===t&&(t={}),C(this,"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";C(this,"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),C(this,"modal.toast",t,{message:t.content,duration:t.duration/1e3})},hideToast:function(t){C(this,"modal.hideToast",t)},prompt:function(t){C(this,"modal.prompt",t)},showLoading:function(t){C(this,"modal.showLoading",t)},hideLoading:function(t){C(this,"modal.hideLoading",t)},sendMtop:function(t){C(this,"sendMtop.request",y("sendMtop",t))},navigateTo:function(t,e){void 0===t&&(t={}),void 0===e&&(e=""),C(this,"navigator.push",t=y("navigateTo",t),{url:z(function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",n=t&&t.split("/")||[],o=e&&e.split("/")||[],i=t&&W(t),r=e&&W(e),a=i||r;if(t&&W(t)?o=n:n.length&&(o.pop(),o=o.concat(n)),!o.length)return"/";var s=void 0;if(o.length){var c=o[o.length-1];s="."===c||".."===c||""===c}else s=!1;for(var u=0,f=o.length;0<=f;f--){var h=o[f];"."===h?H(o,f):".."===h?(H(o,f),u++):u&&(H(o,f),u--)}if(!a)for(;u--;u)o.unshift("..");!a||""===o[0]||o[0]&&W(o[0])||o.unshift("");var d=o.join("/");return s&&"/"!==d.substr(-1)&&(d+="/"),d}(t.url,e)||"")})},navigateBack:function(t){C(this,"navigator.pop",y("navigateBack",t))},redirectTo:function(t){void 0===t&&(t={}),C(this,"navigator.redirectTo",t=y("redirectTo",t),{url:z(t.url)})},switchTab:function(t){void 0===t&&(t={}),C(this,"navigator.switchTab",t=y("switchTab",t),{url:z(t.url)})},navigateToMiniProgram:function(t){C(this,"navigator.navigateToMiniProgram",t)},navigateBackMiniProgram:function(t){C(this,"navigator.navigateBackMiniProgram",t)},onPageNotify:function(t){C(this,"navigator.pc_onPageNotify",{success:t})},offPageNotify:function(){C(this,"navigator.pc_offPageNotify")},setPageNotifyConfig:function(t){C(this,"navigator.pc_setPageNotifyConfig",t)},getBackStack:function(t){C(this,"navigator.getBackStack",t)},popToHome:function(t){C(this,"navigator.popToHome",t)},setNavigationBar:function(t){C(this,"navigatorBar.setNavigationBar",t)},getStatusBarHeight:function(t){C(this,"navigatorBar.getStatusBarHeight",t,t,function(t){return{height:parseInt(t.data)}})},getNavigationBarHeight:function(t){C(this,"navigatorBar.getHeight",t,t,function(t){return{height:parseInt(t.data)}})},showNavigationBarLoading:function(t){C(this,"navigatorBar.showNavigationBarLoading",t)},hideNavigationBarLoading:function(t){C(this,"navigatorBar.hideNavigationBarLoading",t)},setNavigationBarDrawer:function(t){C(this,"navigatorBar.setDrawer",t)},openNavigationBarDrawer:function(t){C(this,"navigatorBar.openDrawer",t)},closeNavigationBarDrawer:function(t){C(this,"navigatorBar.closeDrawer",t)},setNavigationBarSheet:function(t){C(this,"navigatorBar.setActionSheet",t)},httpRequest:function(o){void 0===o&&(o={});var t=(o=y("httpRequest",o)).method||"GET";if("GET"===t&&d(o.data)){var i=[];Object.keys(o.data).forEach(function(t){var e=o.data[t],n="object"==typeof e?JSON.stringify(e):e;i.push(t+"="+encodeURIComponent(n))});var e=i.join("&");0<=o.url.indexOf("?")?o.url+=e:o.url+="?"+e}C(this,"network.request",o,{method:t,url:o.url,headers:o.headers||{"Content-Type":"application/x-www-form-urlencoded"},dataType:o.dataType||"json",body:o.data},function(t){return{data:t.data,status:t.status,headers:t.headers}})},uploadFile:function(t){C(this,"network.uploadFile",t)},downloadFile:function(t){C(this,"network.downloadFile",t)},makePhoneCall:function(t){void 0===t&&(t={}),C(this,"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}})),C(this,"picker.chooseCity",t,t,function(t){return{city:t.cityName,adCode:t.cityCode}})},datePicker:function(t){void 0===t&&(t={}),C(this,"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={}),C(this,"screen.setBrightness",t,{brightness:t.brightness})},getScreenBrightness:function(t){C(this,"screen.getScreenBrightness",t,t,function(t){return{brightness:t.value}})},setKeepScreenOn:function(t){void 0===t&&(t={}),C(this,"screen.setAlwaysOn",t,{on:t.keepScreenOn})},shareTinyAppMsg:function(t){C(this,"share.doShare",t)},showSku:function(t){C(this,"sku.show",t)},hideSku:function(t){C(this,"sku.hide",t)},setStorage:function(t){void 0===t&&(t={}),C(this,"storage.setItem",t,{key:t.key,value:$(t)})},setStorageSync:function(t){return x(this,"storage.setItemSync",{key:t.key,value:$(t)})},getStorage:function(t){void 0===t&&(t={}),C(this,"storage.getItem",t,t,G)},getStorageSync:function(t){return G(x(this,"storage.getItemSync",t))},removeStorage:function(t){void 0===t&&(t={}),C(this,"storage.removeItem",t)},removeStorageSync:function(t){return void 0===t&&(t={}),x(this,"storage.removeItemSync",t)},clearStorage:function(t){C(this,"storage.clearStorage",t)},clearStorageSync:function(t){return x(this,"storage.clearStorageSync",t)},getStorageInfo:function(t){C(this,"storage.getStorageInfo",t)},getStorageInfoSync:function(t){return x(this,"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){C(this,"tabBar.show",t)},hideTabBar:function(t){C(this,"tabBar.hide",t)},setTabBarStyle:function(t){C(this,"tabBar.setTabBarStyle",t)},setTabBarItem:function(t){C(this,"tabBar.setTabBarItem",t)},setTabBarBadge:function(t){C(this,"tabBar.setTabBarBadge",t)},removeTabBarBadge:function(t){C(this,"tabBar.removeTabBarBadge",t)},showTabBarRedDot:function(t){C(this,"tabBar.showTabBarRedDot",t)},hideTabBarRedDot:function(t){C(this,"tabBar.hideTabBarRedDot",t)},uccBind:function(t){C(this,"ucc.uccBind",t)},uccTrustLogin:function(t){C(this,"ucc.uccTrustLogin",t)},uccUnbind:function(t){C(this,"ucc.uccUnbind",t)},reportAnalytics:function(t,e){void 0===e&&(e={}),"click"==t||"enter"==t||"expose"==t?C(this,"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}):C(this,"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){C(this,"video.chooseVideo",t,t,function(t){return t.apFilePath&&(t.tempFilePath=t.apFilePath,delete t.apFilePath),t})},saveVideoToPhotosAlbum:function(t){C(this,"video.saveVideoToPhotosAlbum",t)},getAuthUserInfo:function(t){C(this,"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){C(this,"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){C(this,"wopc.getSessionKey",t,t,function(t){return{data:t}})},setTBSessionInfo:function(t){void 0===t&&(t={}),C(this,"wopc.setSessionKey",t,t.sessionInfo,function(t){return{success:!0}})},getSetting:function(t){C(this,"wopc.getSetting",t)},openSetting:function(t){C(this,"wopc.openSetting",t)},authorize:function(t){C(this,"wopc.authorize",t)},connectSocket:function(t){var n=this;void 0===t&&(t={}),et&&(C(this,"webSocket.close",{instanceId:tt}),et=!1,tt++),C(this,"webSocket.webSocket",t,{instanceId:tt,url:t.url,protocol:""},function(t){return et=!0,t}),Q.forEach(function(e){C(n,"webSocket."+e,{instanceId:tt,success:function(t){Z.emit(e,t)}})})},sendSocketMessage:function(t){void 0===t&&(t={}),C(this,"webSocket.send",t,{instanceId:tt,data:t.data})},closeSocket:function(t){C(this,"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)}}),ot=function(t){var n=this;this._name="my",this._moduleAPIs={},this._modifier={},d(t)&&(this._options=t,this._name=t.defaultName||this._name,this._context=t.context||{},this._modifier.origin=t.label),this._host={getContext:function(){return n._context},getModifier:function(){return n._modifier}};var e=g();e&&e.$on("registerModuleAPI",function(t){var e=t.data;n.registerScopedAPIs(e)})};function it(t){var e;g().$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(d(t)&&d(e))for(var n in e)o=t,i=n,Object.prototype.hasOwnProperty.call(o,i)&&"function"==typeof e[n]&&(v[n]=e[n]);var o,i}(nt,t.preprocessor),t&&t.errorHandler&&"function"==typeof(e=t.errorHandler)&&(A=e);var n=new ot(t);return n.registerModuleAPIs(nt),n.getAPIs()}return ot.prototype.canIUse=function(t){return"string"==typeof t&&t in this._moduleAPIs},ot.prototype.getAPIs=function(){var t,e=this,n={};for(var o in this._moduleAPIs){var i=this._moduleAPIs[o];n[o]="function"==typeof i?i.bind(this._host):this._moduleAPIs[o]}return n.canIUse=function(t){return e.canIUse(t)},(t={})[this._name]=n,t},ot.prototype.registerModuleAPIs=function(t){if(d(t))for(var e in t)this._moduleAPIs[e]=t[e]},ot.prototype.registerScopedAPIs=function(t){var n=this;void 0===t&&(t={});var o=t.scope,e=t.map;if(!o)return console.error('"data.scope" is undefined on "registerModuleAPI" event.');if(!l(e))return console.error('"data.map" is undefined or not a array on "registerModuleAPI" event.');if(this._moduleAPIs[o]&&!d(this._moduleAPIs[o]))return console.error('"'+this._name+"."+o+"\" is already exist and can't be overridden.");var i=this._moduleAPIs[o]=this._moduleAPIs[o]||{};e.forEach(function(e){i[e.apiName]&&console.warn(n._name+"."+o+"."+e.apiName+" is already exist and will be overridden!"),i[e.apiName]=e.isSync?function(t){return C(n._host,e.moduleMethod,t)}:function(t){return x(n._host,e.moduleMethod,t)}})},function(e,n,t){void 0===t&&(t=!0);var o=i();try{Object.defineProperty(o,e,{value:n,configurable:!0,enumerable:!0,writable:!t})}catch(t){o[e]=n}}("__WINDMILL_MODULE_API__",{getAPIs:it}),it});
{
"name": "windmill-module-api",
"version": "0.4.1",
"version": "0.4.2",
"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