@vetc-miniapp/apis 0.0.20 → 0.0.22
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 +1 -1
- package/src/apis/index.d.ts +1 -1
- package/src/apis/index.js +10 -4
- package/src/dist/apis/index.js +1 -1
package/package.json
CHANGED
package/src/apis/index.d.ts
CHANGED
|
@@ -95,7 +95,7 @@ export interface MiniAppSDK {
|
|
|
95
95
|
|
|
96
96
|
chooseImage({ count?: number, includeBase64: boolean, sourceType?: ("camera" | "album")[], success?: Function, fail?: Function, complete?: Function }):Promise<IVETCMiniAppResponse<ChooseImageFile[]>
|
|
97
97
|
|
|
98
|
-
initPayment({ merchantOrderId: string, merchantService: string, amount: double, productName: string, midName: string, mid: string, tid
|
|
98
|
+
initPayment({ merchantOrderId: string, merchantService: string, amount: double, productName: string, midName: string, mid: string, tid?: string, orderDesc?: string, requestDate: string, serviceType: string, signature: string, ipnUrl?: string, callbackUrl?: string, extraData: {[key: string]: any;}, onResult: Function }): Promise<IVETCMiniAppResponse>;
|
|
99
99
|
|
|
100
100
|
requestPermission(
|
|
101
101
|
permission: MiniAppPermission,
|
package/src/apis/index.js
CHANGED
|
@@ -74,8 +74,14 @@ export const MiniApp = {
|
|
|
74
74
|
getBase64ByPath({ path } = {}) {
|
|
75
75
|
return callHost("getBase64ByPath", { path });
|
|
76
76
|
},
|
|
77
|
-
addWatermarkImage({ originalPath, watermarkUrl, opacity, fileName, watermarkWidth, watermarkHeight, positionWatermarkX, positionWatermarkY } = {}) {
|
|
78
|
-
return callHost("addWatermarkImage", { originalPath, watermarkUrl, opacity, fileName, watermarkWidth, watermarkHeight, positionWatermarkX, positionWatermarkY });
|
|
77
|
+
addWatermarkImage({ originalPath, watermarkUrl, opacity, fileName, watermarkWidth, watermarkHeight, positionWatermarkX, positionWatermarkY, scale } = {}) {
|
|
78
|
+
return callHost("addWatermarkImage", { originalPath, watermarkUrl, opacity, fileName, watermarkWidth, watermarkHeight, positionWatermarkX, positionWatermarkY, scale });
|
|
79
|
+
},
|
|
80
|
+
compressImage({ path, quality, minWidth, minHeight } = {}) {
|
|
81
|
+
return callHost("compressImage", { path, quality, minWidth, minHeight });
|
|
82
|
+
},
|
|
83
|
+
getImageInfo({ path } = {}) {
|
|
84
|
+
return callHost("getImageInfo", { path });
|
|
79
85
|
},
|
|
80
86
|
uploadFile({ path, url, headers, extraData, fieldName, method } = {}) {
|
|
81
87
|
return callHost("uploadFile", { path, url, headers, extraData, fieldName, method });
|
|
@@ -83,8 +89,8 @@ export const MiniApp = {
|
|
|
83
89
|
uploadFileMinio({ path, url, headers, extraData, fieldName, method } = {}) {
|
|
84
90
|
return callHost("uploadFileMinio", { path, url, headers, extraData, fieldName, method });
|
|
85
91
|
},
|
|
86
|
-
initPayment({ merchantOrderId, merchantService, amount, productName, midName, mid, tid, orderDesc, requestDate, serviceType, signature, extraData, onResult } = {}) {
|
|
87
|
-
return callHost("initPayment", { merchantOrderId, merchantService, amount, productName, midName, mid, tid, orderDesc, requestDate, serviceType, signature, extraData, onResult });
|
|
92
|
+
initPayment({ merchantOrderId, merchantService, amount, productName, midName, mid, tid, orderDesc, requestDate, serviceType, signature, extraData, onResult, ipnUrl, callbackUrl } = {}) {
|
|
93
|
+
return callHost("initPayment", { merchantOrderId, merchantService, amount, productName, midName, mid, tid, orderDesc, requestDate, serviceType, signature, extraData, onResult, ipnUrl, callbackUrl });
|
|
88
94
|
},
|
|
89
95
|
requestPermission(permission, reason) {
|
|
90
96
|
return callHost("requestPermission", { permission, reason });
|
package/src/dist/apis/index.js
CHANGED
|
@@ -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,
|
|
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,a)=>{for(var r in a)e.o(a,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[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:()=>o});const a="undefined"!=typeof window,r=async(e,t={})=>{const r=a&&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 a=await r.callHandler("MiniAppBridge",{action:e,payload:t});return console.log("Bridge response:",a),a}catch(e){return console.error("Bridge error:",e),{ok:!1,error:"BRIDGE_CALL_FAILED"}}},i={confirmBeforeExit:(e,t,a,i,o)=>r("confirmBeforeExit",{title:e,message:t,success:a,fail:i,complete:o}),exitMiniApp:(e,t,a)=>r("exitMiniApp",{success:e,fail:t,complete:a}),openAppSetting:(e,t,a)=>r("openAppSetting",{success:e,fail:t,complete:a}),openNativeAppStore:(e,t,a,i,o)=>r("openNativeAppStore",{appleStoreId:e,googlePlayId:t,success:a,fail:i,complete:o}),shareApp:(e,t,a,i,o,s,n)=>r("shareApp",{title:e,description:t,path:a,url:i,success:o,fail:s,complete:n}),getAuthCode:(e,t,a,i)=>r("getAuthCode",{scopes:e,success:t,fail:a,complete:i}),getUserInfo:(e,t,a)=>r("getUserInfo",{success:e,fail:t,complete:a}),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:a,success:i,fail:o,complete:s}={})=>r("chooseImage",{count:e,includeBase64:t,sourceType:a,success:i,fail:o,complete:s}),getBase64ByPath:({path:e}={})=>r("getBase64ByPath",{path:e}),addWatermarkImage:({originalPath:e,watermarkUrl:t,opacity:a,fileName:i,watermarkWidth:o,watermarkHeight:s,positionWatermarkX:n,positionWatermarkY:p,scale:l}={})=>r("addWatermarkImage",{originalPath:e,watermarkUrl:t,opacity:a,fileName:i,watermarkWidth:o,watermarkHeight:s,positionWatermarkX:n,positionWatermarkY:p,scale:l}),compressImage:({path:e,quality:t,minWidth:a,minHeight:i}={})=>r("compressImage",{path:e,quality:t,minWidth:a,minHeight:i}),getImageInfo:({path:e}={})=>r("getImageInfo",{path:e}),uploadFile:({path:e,url:t,headers:a,extraData:i,fieldName:o,method:s}={})=>r("uploadFile",{path:e,url:t,headers:a,extraData:i,fieldName:o,method:s}),uploadFileMinio:({path:e,url:t,headers:a,extraData:i,fieldName:o,method:s}={})=>r("uploadFileMinio",{path:e,url:t,headers:a,extraData:i,fieldName:o,method:s}),initPayment:({merchantOrderId:e,merchantService:t,amount:a,productName:i,midName:o,mid:s,tid:n,orderDesc:p,requestDate:l,serviceType:c,signature:m,extraData:u,onResult:d,ipnUrl:h,callbackUrl:f}={})=>r("initPayment",{merchantOrderId:e,merchantService:t,amount:a,productName:i,midName:o,mid:s,tid:n,orderDesc:p,requestDate:l,serviceType:c,signature:m,extraData:u,onResult:d,ipnUrl:h,callbackUrl:f}),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))}};a&&window.addEventListener("miniapp_event",e=>{const{type:t,data:a}=e.detail||{};i._emit(t,a)});const o=i;return t})());
|