@vetc-miniapp/apis 0.0.25 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e="undefined"!=typeof window,t=async(t,r={})=>{const a=e&&window.flutter_inappwebview&&"function"==typeof window.flutter_inappwebview.callHandler?window.flutter_inappwebview:null;if(!a)return{ok:!1,error:"BRIDGE_CALL_FAILED"};try{const e=await a.callHandler("MiniAppBridge",{action:t,payload:r});return console.log("Bridge response:",e),e}catch(e){return console.error("Bridge error:",e),{ok:!1,error:"BRIDGE_CALL_FAILED"}}},r={confirmBeforeExit:(e,r)=>t("confirmBeforeExit",{title:e,message:r}),exitMiniApp:()=>t("exitMiniApp",{}),openAppSetting:()=>t("openAppSetting",{}),openNativeAppStore:(e,r)=>t("openNativeAppStore",{appleStoreId:e,googlePlayId:r}),shareApp:(e,r,a,i)=>t("shareApp",{title:e,description:r,path:a,url:i}),getAuthCode:e=>t("getAuthCode",{scopes:e}),getUserInfo:()=>t("getUserInfo",{}),scanQr:(e=[])=>t("scanQr",{patterns:e}),closeScanQr:()=>t("closeScanQr",{}),pushEvent:(e,r={})=>t("pushEvent",{eventName:e,properties:r}),navigate:(e,r={})=>t("navigate",{type:"native",screen:e,params:r}),close:(e={})=>t("close",{result:e}),openTel:e=>t("openTel",{phone:e}),chooseImage:({count:e,includeBase64:r,sourceType:a}={})=>t("chooseImage",{count:e,includeBase64:r,sourceType:a}),getBase64ByPath:({path:e})=>t("getBase64ByPath",{path:e}),addWatermarkImage:({originalPath:e,watermarkUrl:r,opacity:a,fileName:i,watermarkWidth:o,watermarkHeight:n,positionWatermarkX:s,positionWatermarkY:p,scale:l})=>t("addWatermarkImage",{originalPath:e,watermarkUrl:r,opacity:a,fileName:i,watermarkWidth:o,watermarkHeight:n,positionWatermarkX:s,positionWatermarkY:p,scale:l}),compressImage:({path:e,quality:r,minWidth:a,minHeight:i})=>t("compressImage",{path:e,quality:r,minWidth:a,minHeight:i}),getImageInfo:({path:e})=>t("getImageInfo",{path:e}),uploadFile:({path:e,url:r,headers:a,extraData:i,fieldName:o,method:n})=>t("uploadFile",{path:e,url:r,headers:a,extraData:i,fieldName:o,method:n}),uploadFileMinio:({path:e,url:r,headers:a,extraData:i,fieldName:o,method:n})=>t("uploadFileMinio",{path:e,url:r,headers:a,extraData:i,fieldName:o,method:n}),initPayment:({merchantOrderId:e,merchantService:r,amount:a,productName:i,midName:o,mid:n,tid:s,orderDesc:p,requestDate:l,serviceType:m,signature:c,extraData:u,onResult:d,ipnUrl:h,callbackUrl:g})=>t("initPayment",{merchantOrderId:e,merchantService:r,amount:a,productName:i,midName:o,mid:n,tid:s,orderDesc:p,requestDate:l,serviceType:m,signature:c,extraData:u,onResult:d,ipnUrl:h,callbackUrl:g}),getCurrentLocation:()=>t("getCurrentLocation",{}),requestPermission:(e,r)=>t("requestPermission",{permission:e,reason:r}),requestLocation:e=>r.requestPermission("location",e),requestCamera:e=>r.requestPermission("camera",e),requestMicrophone:e=>r.requestPermission("microphone",e),requestPhotos:e=>r.requestPermission("photos",e),requestContacts:e=>r.requestPermission("contacts",e),requestBluetooth:e=>r.requestPermission("bluetooth",e),requestNFC:e=>r.requestPermission("nfc",e),_listeners:{},on(e,t){r._listeners[e]||(r._listeners[e]=[]),r._listeners[e].push(t)},_emit(e,t){(r._listeners[e]||[]).forEach(e=>e(t))}};e&&window.addEventListener("miniapp_event",e=>{const{type:t,data:a}=e.detail||{};r._emit(t,a)}),exports.MiniApp=r,exports.callHost=t,exports.default=r;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e="undefined"!=typeof window,t=async(t,r={})=>{const a=e&&window.flutter_inappwebview&&"function"==typeof window.flutter_inappwebview.callHandler?window.flutter_inappwebview:null;if(!a)return{ok:!1,error:"BRIDGE_CALL_FAILED"};try{const e=await a.callHandler("MiniAppBridge",{action:t,payload:r});return console.log("Bridge response:",e),e}catch(e){return console.error("Bridge error:",e),{ok:!1,error:"BRIDGE_CALL_FAILED"}}},r={confirmBeforeExit:(e,r)=>t("confirmBeforeExit",{title:e,message:r}),exitMiniApp:()=>t("exitMiniApp",{}),openAppSetting:()=>t("openAppSetting",{}),openNativeAppStore:(e,r)=>t("openNativeAppStore",{appleStoreId:e,googlePlayId:r}),shareApp:(e,r,a,i)=>t("shareApp",{title:e,description:r,path:a,url:i}),getAuthCode:e=>t("getAuthCode",{scopes:e}),getUserInfo:()=>t("getUserInfo",{}),scanQr:(e=[])=>t("scanQr",{patterns:e}),closeScanQr:()=>t("closeScanQr",{}),pushEvent:(e,r={})=>t("pushEvent",{eventName:e,properties:r}),navigate:(e,r={})=>t("navigate",{type:"native",screen:e,params:r}),close:(e={})=>t("close",{result:e}),openTel:e=>t("openTel",{phone:e}),openGoogleMap:e=>t("openGoogleMap",{url:e}),chooseImage:({count:e,includeBase64:r,sourceType:a}={})=>t("chooseImage",{count:e,includeBase64:r,sourceType:a}),getBase64ByPath:({path:e})=>t("getBase64ByPath",{path:e}),addWatermarkImage:({originalPath:e,watermarkUrl:r,opacity:a,fileName:i,watermarkWidth:o,watermarkHeight:n,positionWatermarkX:s,positionWatermarkY:p,scale:l})=>t("addWatermarkImage",{originalPath:e,watermarkUrl:r,opacity:a,fileName:i,watermarkWidth:o,watermarkHeight:n,positionWatermarkX:s,positionWatermarkY:p,scale:l}),compressImage:({path:e,quality:r,minWidth:a,minHeight:i})=>t("compressImage",{path:e,quality:r,minWidth:a,minHeight:i}),getImageInfo:({path:e})=>t("getImageInfo",{path:e}),uploadFile:({path:e,url:r,headers:a,extraData:i,fieldName:o,method:n})=>t("uploadFile",{path:e,url:r,headers:a,extraData:i,fieldName:o,method:n}),uploadFileMinio:({path:e,url:r,headers:a,extraData:i,fieldName:o,method:n})=>t("uploadFileMinio",{path:e,url:r,headers:a,extraData:i,fieldName:o,method:n}),initPayment:({merchantOrderId:e,merchantService:r,amount:a,productName:i,midName:o,mid:n,tid:s,orderDesc:p,requestDate:l,serviceType:m,signature:c,extraData:u,onResult:d,ipnUrl:h,callbackUrl:g})=>t("initPayment",{merchantOrderId:e,merchantService:r,amount:a,productName:i,midName:o,mid:n,tid:s,orderDesc:p,requestDate:l,serviceType:m,signature:c,extraData:u,onResult:d,ipnUrl:h,callbackUrl:g}),getCurrentLocation:()=>t("getCurrentLocation",{}),requestPermission:(e,r)=>t("requestPermission",{permission:e,reason:r}),requestLocation:e=>r.requestPermission("location",e),requestCamera:e=>r.requestPermission("camera",e),requestMicrophone:e=>r.requestPermission("microphone",e),requestPhotos:e=>r.requestPermission("photos",e),requestContacts:e=>r.requestPermission("contacts",e),requestBluetooth:e=>r.requestPermission("bluetooth",e),requestNFC:e=>r.requestPermission("nfc",e),_listeners:{},on(e,t){r._listeners[e]||(r._listeners[e]=[]),r._listeners[e].push(t)},_emit(e,t){(r._listeners[e]||[]).forEach(e=>e(t))}};e&&window.addEventListener("miniapp_event",e=>{const{type:t,data:a}=e.detail||{};r._emit(t,a)}),exports.MiniApp=r,exports.callHost=t,exports.default=r;
|
package/dist/index.d.ts
CHANGED
|
@@ -85,6 +85,7 @@ export interface MiniAppSDK {
|
|
|
85
85
|
navigate(screen: string, params?: NavigateParams): Promise<IVETCMiniAppResponse>;
|
|
86
86
|
close(result?: any): Promise<IVETCMiniAppResponse>;
|
|
87
87
|
openTel(phone: string): Promise<IVETCMiniAppResponse>;
|
|
88
|
+
openGoogleMap(url: string): Promise<IVETCMiniAppResponse>;
|
|
88
89
|
chooseImage(options?: ChooseImageOptions): Promise<IVETCMiniAppResponse<ChooseImageFile[]>>;
|
|
89
90
|
getImageInfo(options: GetImageInfoOptions): Promise<IVETCMiniAppResponse<{
|
|
90
91
|
path: string;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e="undefined"!=typeof window,t=async(t,a={})=>{const r=e&&window.flutter_inappwebview&&"function"==typeof window.flutter_inappwebview.callHandler?window.flutter_inappwebview:null;if(!r)return{ok:!1,error:"BRIDGE_CALL_FAILED"};try{const e=await r.callHandler("MiniAppBridge",{action:t,payload:a});return console.log("Bridge response:",e),e}catch(e){return console.error("Bridge error:",e),{ok:!1,error:"BRIDGE_CALL_FAILED"}}},a={confirmBeforeExit:(e,a)=>t("confirmBeforeExit",{title:e,message:a}),exitMiniApp:()=>t("exitMiniApp",{}),openAppSetting:()=>t("openAppSetting",{}),openNativeAppStore:(e,a)=>t("openNativeAppStore",{appleStoreId:e,googlePlayId:a}),shareApp:(e,a,r,i)=>t("shareApp",{title:e,description:a,path:r,url:i}),getAuthCode:e=>t("getAuthCode",{scopes:e}),getUserInfo:()=>t("getUserInfo",{}),scanQr:(e=[])=>t("scanQr",{patterns:e}),closeScanQr:()=>t("closeScanQr",{}),pushEvent:(e,a={})=>t("pushEvent",{eventName:e,properties:a}),navigate:(e,a={})=>t("navigate",{type:"native",screen:e,params:a}),close:(e={})=>t("close",{result:e}),openTel:e=>t("openTel",{phone:e}),chooseImage:({count:e,includeBase64:a,sourceType:r}={})=>t("chooseImage",{count:e,includeBase64:a,sourceType:r}),getBase64ByPath:({path:e})=>t("getBase64ByPath",{path:e}),addWatermarkImage:({originalPath:e,watermarkUrl:a,opacity:r,fileName:i,watermarkWidth:o,watermarkHeight:n,positionWatermarkX:s,positionWatermarkY:p,scale:l})=>t("addWatermarkImage",{originalPath:e,watermarkUrl:a,opacity:r,fileName:i,watermarkWidth:o,watermarkHeight:n,positionWatermarkX:s,positionWatermarkY:p,scale:l}),compressImage:({path:e,quality:a,minWidth:r,minHeight:i})=>t("compressImage",{path:e,quality:a,minWidth:r,minHeight:i}),getImageInfo:({path:e})=>t("getImageInfo",{path:e}),uploadFile:({path:e,url:a,headers:r,extraData:i,fieldName:o,method:n})=>t("uploadFile",{path:e,url:a,headers:r,extraData:i,fieldName:o,method:n}),uploadFileMinio:({path:e,url:a,headers:r,extraData:i,fieldName:o,method:n})=>t("uploadFileMinio",{path:e,url:a,headers:r,extraData:i,fieldName:o,method:n}),initPayment:({merchantOrderId:e,merchantService:a,amount:r,productName:i,midName:o,mid:n,tid:s,orderDesc:p,requestDate:l,serviceType:m,signature:c,extraData:
|
|
1
|
+
const e="undefined"!=typeof window,t=async(t,a={})=>{const r=e&&window.flutter_inappwebview&&"function"==typeof window.flutter_inappwebview.callHandler?window.flutter_inappwebview:null;if(!r)return{ok:!1,error:"BRIDGE_CALL_FAILED"};try{const e=await r.callHandler("MiniAppBridge",{action:t,payload:a});return console.log("Bridge response:",e),e}catch(e){return console.error("Bridge error:",e),{ok:!1,error:"BRIDGE_CALL_FAILED"}}},a={confirmBeforeExit:(e,a)=>t("confirmBeforeExit",{title:e,message:a}),exitMiniApp:()=>t("exitMiniApp",{}),openAppSetting:()=>t("openAppSetting",{}),openNativeAppStore:(e,a)=>t("openNativeAppStore",{appleStoreId:e,googlePlayId:a}),shareApp:(e,a,r,i)=>t("shareApp",{title:e,description:a,path:r,url:i}),getAuthCode:e=>t("getAuthCode",{scopes:e}),getUserInfo:()=>t("getUserInfo",{}),scanQr:(e=[])=>t("scanQr",{patterns:e}),closeScanQr:()=>t("closeScanQr",{}),pushEvent:(e,a={})=>t("pushEvent",{eventName:e,properties:a}),navigate:(e,a={})=>t("navigate",{type:"native",screen:e,params:a}),close:(e={})=>t("close",{result:e}),openTel:e=>t("openTel",{phone:e}),openGoogleMap:e=>t("openGoogleMap",{url:e}),chooseImage:({count:e,includeBase64:a,sourceType:r}={})=>t("chooseImage",{count:e,includeBase64:a,sourceType:r}),getBase64ByPath:({path:e})=>t("getBase64ByPath",{path:e}),addWatermarkImage:({originalPath:e,watermarkUrl:a,opacity:r,fileName:i,watermarkWidth:o,watermarkHeight:n,positionWatermarkX:s,positionWatermarkY:p,scale:l})=>t("addWatermarkImage",{originalPath:e,watermarkUrl:a,opacity:r,fileName:i,watermarkWidth:o,watermarkHeight:n,positionWatermarkX:s,positionWatermarkY:p,scale:l}),compressImage:({path:e,quality:a,minWidth:r,minHeight:i})=>t("compressImage",{path:e,quality:a,minWidth:r,minHeight:i}),getImageInfo:({path:e})=>t("getImageInfo",{path:e}),uploadFile:({path:e,url:a,headers:r,extraData:i,fieldName:o,method:n})=>t("uploadFile",{path:e,url:a,headers:r,extraData:i,fieldName:o,method:n}),uploadFileMinio:({path:e,url:a,headers:r,extraData:i,fieldName:o,method:n})=>t("uploadFileMinio",{path:e,url:a,headers:r,extraData:i,fieldName:o,method:n}),initPayment:({merchantOrderId:e,merchantService:a,amount:r,productName:i,midName:o,mid:n,tid:s,orderDesc:p,requestDate:l,serviceType:m,signature:c,extraData:u,onResult:d,ipnUrl:h,callbackUrl:g})=>t("initPayment",{merchantOrderId:e,merchantService:a,amount:r,productName:i,midName:o,mid:n,tid:s,orderDesc:p,requestDate:l,serviceType:m,signature:c,extraData:u,onResult:d,ipnUrl:h,callbackUrl:g}),getCurrentLocation:()=>t("getCurrentLocation",{}),requestPermission:(e,a)=>t("requestPermission",{permission:e,reason:a}),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))}};e&&window.addEventListener("miniapp_event",e=>{const{type:t,data:r}=e.detail||{};a._emit(t,r)});export{a as MiniApp,t as callHost,a as default};
|