@vetc-miniapp/apis 0.0.17 → 0.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vetc-miniapp/apis",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
4
4
  "description": "MiniApp Platform JS SDK",
5
5
  "main": "src/apis/index.js",
6
6
  "type": "module",
package/src/apis/index.js CHANGED
@@ -75,7 +75,7 @@ export const MiniApp = {
75
75
  return callHost("getBase64ByPath", { path });
76
76
  },
77
77
  addWatermarkImage({ originalPath, watermarkUrl, opacity, fileName, watermarkWidth, watermarkHeight, positionWatermarkX, positionWatermarkY } = {}) {
78
- return callHost("addWatermarkImage", { path, originalPath, watermarkUrl, opacity, fileName, watermarkWidth, watermarkHeight, positionWatermarkX, positionWatermarkY });
78
+ return callHost("addWatermarkImage", { originalPath, watermarkUrl, opacity, fileName, watermarkWidth, watermarkHeight, positionWatermarkX, positionWatermarkY });
79
79
  },
80
80
  uploadFile({ path, url, headers, extraData, fieldName, method } = {}) {
81
81
  return callHost("uploadFile", { path, url, headers, extraData, fieldName, method });
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.MiniApp=t():e.MiniApp=t()}(this,()=>(()=>{"use strict";var e={d:(t,o)=>{for(var r in o)e.o(o,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:o[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{MiniApp:()=>a,callHost:()=>r,default:()=>i});const o="undefined"!=typeof window,r=async(e,t={})=>{const r=o&&window.flutter_inappwebview&&window.flutter_inappwebview.callHandler&&"function"==typeof window.flutter_inappwebview.callHandler?window.flutter_inappwebview:null;if(!r)return{ok:!1,error:"BRIDGE_CALL_FAILED"};try{const o=await r.callHandler("MiniAppBridge",{action:e,payload:t});return console.log("Bridge response:",o),o}catch(e){return console.error("Bridge error:",e),{ok:!1,error:"BRIDGE_CALL_FAILED"}}},a={confirmBeforeExit:(e,t,o,a,i)=>r("confirmBeforeExit",{title:e,message:t,success:o,fail:a,complete:i}),exitMiniApp:(e,t,o)=>r("exitMiniApp",{success:e,fail:t,complete:o}),openAppSetting:(e,t,o)=>r("openAppSetting",{success:e,fail:t,complete:o}),openNativeAppStore:(e,t,o,a,i)=>r("openNativeAppStore",{appleStoreId:e,googlePlayId:t,success:o,fail:a,complete:i}),shareApp:(e,t,o,a,i,s,n)=>r("shareApp",{title:e,description:t,path:o,url:a,success:i,fail:s,complete:n}),getAuthCode:(e,t,o,a)=>r("getAuthCode",{scopes:e,success:t,fail:o,complete:a}),getUserInfo:(e,t,o)=>r("getUserInfo",{success:e,fail:t,complete:o}),scanQr:(e=[])=>r("scanQr",{patterns:e}),closeScanQr:()=>r("closeScanQr",{}),navigate:(e,t={})=>r("navigate",{type:"native",screen:e,params:t}),close:(e={})=>r("close",{result:e}),openTel:e=>r("openTel",{phone:e}),chooseImage:({count:e,includeBase64:t,sourceType:o,success:a,fail:i,complete:s}={})=>r("chooseImage",{count:e,includeBase64:t,sourceType:o,success:a,fail:i,complete:s}),getBase64ByPath:({path:e}={})=>r("getBase64ByPath",{path:e}),addWatermarkImage:({originalPath:e,watermarkUrl:t,opacity:o,fileName:a,watermarkWidth:i,watermarkHeight:s,positionWatermarkX:n,positionWatermarkY:p}={})=>r("addWatermarkImage",{path,originalPath:e,watermarkUrl:t,opacity:o,fileName:a,watermarkWidth:i,watermarkHeight:s,positionWatermarkX:n,positionWatermarkY:p}),uploadFile:({path:e,url:t,headers:o,extraData:a,fieldName:i,method:s}={})=>r("uploadFile",{path:e,url:t,headers:o,extraData:a,fieldName:i,method:s}),requestPermission:(e,t)=>r("requestPermission",{permission:e,reason:t}),requestLocation:e=>a.requestPermission("location",e),requestCamera:e=>a.requestPermission("camera",e),requestMicrophone:e=>a.requestPermission("microphone",e),requestPhotos:e=>a.requestPermission("photos",e),requestContacts:e=>a.requestPermission("contacts",e),requestBluetooth:e=>a.requestPermission("bluetooth",e),requestNFC:e=>a.requestPermission("nfc",e),_listeners:{},on(e,t){a._listeners[e]||(a._listeners[e]=[]),a._listeners[e].push(t)},_emit(e,t){(a._listeners[e]||[]).forEach(e=>e(t))}};o&&window.addEventListener("miniapp_event",e=>{const{type:t,data:o}=e.detail||{};a._emit(t,o)});const i=a;return t})());
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.MiniApp=t():e.MiniApp=t()}(this,()=>(()=>{"use strict";var e={d:(t,o)=>{for(var r in o)e.o(o,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:o[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{MiniApp:()=>i,callHost:()=>r,default:()=>a});const o="undefined"!=typeof window,r=async(e,t={})=>{const r=o&&window.flutter_inappwebview&&window.flutter_inappwebview.callHandler&&"function"==typeof window.flutter_inappwebview.callHandler?window.flutter_inappwebview:null;if(!r)return{ok:!1,error:"BRIDGE_CALL_FAILED"};try{const o=await r.callHandler("MiniAppBridge",{action:e,payload:t});return console.log("Bridge response:",o),o}catch(e){return console.error("Bridge error:",e),{ok:!1,error:"BRIDGE_CALL_FAILED"}}},i={confirmBeforeExit:(e,t,o,i,a)=>r("confirmBeforeExit",{title:e,message:t,success:o,fail:i,complete:a}),exitMiniApp:(e,t,o)=>r("exitMiniApp",{success:e,fail:t,complete:o}),openAppSetting:(e,t,o)=>r("openAppSetting",{success:e,fail:t,complete:o}),openNativeAppStore:(e,t,o,i,a)=>r("openNativeAppStore",{appleStoreId:e,googlePlayId:t,success:o,fail:i,complete:a}),shareApp:(e,t,o,i,a,s,n)=>r("shareApp",{title:e,description:t,path:o,url:i,success:a,fail:s,complete:n}),getAuthCode:(e,t,o,i)=>r("getAuthCode",{scopes:e,success:t,fail:o,complete:i}),getUserInfo:(e,t,o)=>r("getUserInfo",{success:e,fail:t,complete:o}),scanQr:(e=[])=>r("scanQr",{patterns:e}),closeScanQr:()=>r("closeScanQr",{}),navigate:(e,t={})=>r("navigate",{type:"native",screen:e,params:t}),close:(e={})=>r("close",{result:e}),openTel:e=>r("openTel",{phone:e}),chooseImage:({count:e,includeBase64:t,sourceType:o,success:i,fail:a,complete:s}={})=>r("chooseImage",{count:e,includeBase64:t,sourceType:o,success:i,fail:a,complete:s}),getBase64ByPath:({path:e}={})=>r("getBase64ByPath",{path:e}),addWatermarkImage:({originalPath:e,watermarkUrl:t,opacity:o,fileName:i,watermarkWidth:a,watermarkHeight:s,positionWatermarkX:n,positionWatermarkY:p}={})=>r("addWatermarkImage",{originalPath:e,watermarkUrl:t,opacity:o,fileName:i,watermarkWidth:a,watermarkHeight:s,positionWatermarkX:n,positionWatermarkY:p}),uploadFile:({path:e,url:t,headers:o,extraData:i,fieldName:a,method:s}={})=>r("uploadFile",{path:e,url:t,headers:o,extraData:i,fieldName:a,method:s}),requestPermission:(e,t)=>r("requestPermission",{permission:e,reason:t}),requestLocation:e=>i.requestPermission("location",e),requestCamera:e=>i.requestPermission("camera",e),requestMicrophone:e=>i.requestPermission("microphone",e),requestPhotos:e=>i.requestPermission("photos",e),requestContacts:e=>i.requestPermission("contacts",e),requestBluetooth:e=>i.requestPermission("bluetooth",e),requestNFC:e=>i.requestPermission("nfc",e),_listeners:{},on(e,t){i._listeners[e]||(i._listeners[e]=[]),i._listeners[e].push(t)},_emit(e,t){(i._listeners[e]||[]).forEach(e=>e(t))}};o&&window.addEventListener("miniapp_event",e=>{const{type:t,data:o}=e.detail||{};i._emit(t,o)});const a=i;return t})());