zmp-sdk 2.45.1 → 2.45.2
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/apis/common/eventEmitter.js +1 -1
- package/apis/index.d.ts +7 -7
- package/apis/package.json.js +1 -1
- package/browser.min.js +2 -2
- package/index.d.ts +7 -7
- package/index.es.js +2 -2
- package/index.js +2 -2
- package/index.umd.js +2 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from'./../external/@swc/helpers/src/_class_call_check.mjs.js';import t from'./../external/@swc/helpers/src/_get.mjs.js';import n from'./../external/@swc/helpers/src/_get_prototype_of.mjs.js';import a from'./../external/@swc/helpers/src/_inherits.mjs.js';import
|
|
1
|
+
import e from'./../external/@swc/helpers/src/_class_call_check.mjs.js';import t from'./../external/@swc/helpers/src/_get.mjs.js';import n from'./../external/@swc/helpers/src/_get_prototype_of.mjs.js';import a from'./../external/@swc/helpers/src/_inherits.mjs.js';import r from'./../external/@swc/helpers/src/_create_super.mjs.js';import o from'./../external/eventemitter3/index.js';import s from"../utils/debug.js";import{stringToData as c}from"../utils/common.js";import{APP_ID as i}from"../constants.js";import{transformPaymentDataFromOnDataCallback as l,transformPaymentDataFromPath as m,PaymentConfig as u}from"./apis/general/payment/utils.js";import{Events as p}from"../types/enum.js";var d="ACTION_CALLBACK";var f=function(o){a(i,o);var c=r(i);function i(){var t;return e(this,i),(t=c.apply(this,arguments)).debug=s("zmp:event-emitter"),t}var l=i.prototype;return l.h5ConfirmHandleEvent=function(e,t,n){ZaloJavaScriptInterface.jsH5EventCallback(e,t,n||"")},l.on=function(e,a,r){var o=this;if(e===d||e===p.PaymentCallback)return t(n(i.prototype),"on",this).call(this,e,a,r);this.debug("register ".concat(String(e),": ").concat(r));return t(n(i.prototype),"on",this).call(this,e,(function(t,n){o.h5ConfirmHandleEvent(t,e,r),a(n)}),r)},l.once=function(e,a,r){var o=this;if(e===d)return t(n(i.prototype),"once",this).call(this,e,a,r);this.debug("register once ".concat(String(e),": ").concat(r));return t(n(i.prototype),"once",this).call(this,e,(function(t,n){o.h5ConfirmHandleEvent(t,e,r),a(n)}),r)},i.getInstance=function(){return i.instance||(i.instance=new i),i.instance},i}(o);function v(e){f.getInstance().on(d,e)}function h(e){f.getInstance().emit(d,e)}window.onNativeMessage=function(e,t){return function(n){h({serialId:e,actionName:t,result:n})}},window.zaloJSV2={zalo_h5_event_handler:function(e,t,n){var a=s("zmp:zalo_h5_event_handler");a("eventId: ".concat(e,", eventName: ").concat(t,", eventData: ").concat(n));var r=c(n);a("stringToData",r);var o=function(e,t){if(!t||"string"==typeof t)return t;try{if(e===p.OpenApp){var n=t.url,a=new URL(n),r=a.pathname.split("/zapps/".concat(i))[1];return{path:"".concat(r||"/").concat(a.search)}}return t}catch(e){return t}}(t,r),d=function(e,t,n,a){switch(!0){case"string"==typeof n||null===n:return[{eventName:e,eventId:t,data:n}];case e===p.OpenApp&&(null==a?void 0:a.enablePaymentDone):var r=m(n.path);return[{eventName:p.PaymentDone,eventId:t,data:r}];case e===p.OnDataCallback:if(["PAY_BY_BANK","PAY_BY_CUSTOM_METHOD"].includes(null==n?void 0:n.eventType))return[{eventName:p.OnDataCallback,eventId:t,data:n},{eventName:p.PaymentDone,eventId:t,data:l(n)}];break;default:return[{eventName:e,eventId:t,data:n}]}}(t,e,o,u);d.forEach((function(e){f.getInstance().emit(e.eventName,e.eventId,e.data)}))}},window.zaloNative2JS={nativeCall:function(e,t,n){f.getInstance().emit(p.PaymentCallback,e,t,n)}};export{f as MPEEmitter,h as fireActionMessage,v as onActionMessage};
|
package/apis/index.d.ts
CHANGED
|
@@ -2169,10 +2169,10 @@ declare const getUserInfoArgs: ZodOptional<ZodObject<{
|
|
|
2169
2169
|
avatarType: ZodOptional<ZodEnum<["small", "normal", "large"]>>;
|
|
2170
2170
|
autoRequestPermission: ZodOptional<ZodDefault<ZodBoolean>>;
|
|
2171
2171
|
}, "strip", ZodTypeAny, {
|
|
2172
|
-
avatarType?: "
|
|
2172
|
+
avatarType?: "small" | "normal" | "large" | undefined;
|
|
2173
2173
|
autoRequestPermission?: boolean | undefined;
|
|
2174
2174
|
}, {
|
|
2175
|
-
avatarType?: "
|
|
2175
|
+
avatarType?: "small" | "normal" | "large" | undefined;
|
|
2176
2176
|
autoRequestPermission?: boolean | undefined;
|
|
2177
2177
|
}>>[];
|
|
2178
2178
|
declare function getUserInfo(args?: AsyncCallback<GetUserInfoReturns> & TypeOf<(typeof getUserInfoArgs)[0]>): Promise<GetUserInfoReturns>;
|
|
@@ -2609,28 +2609,28 @@ declare const openShareSheetArgs: ZodUnion<[ZodObject<{
|
|
|
2609
2609
|
path: ZodOptional<ZodString>;
|
|
2610
2610
|
description: ZodOptional<ZodDefault<ZodString>>;
|
|
2611
2611
|
}, "strip", ZodTypeAny, {
|
|
2612
|
-
description?: string | undefined;
|
|
2613
2612
|
path?: string | undefined;
|
|
2613
|
+
description?: string | undefined;
|
|
2614
2614
|
title: string;
|
|
2615
2615
|
thumbnail: string;
|
|
2616
2616
|
}, {
|
|
2617
|
-
description?: string | undefined;
|
|
2618
2617
|
path?: string | undefined;
|
|
2618
|
+
description?: string | undefined;
|
|
2619
2619
|
title: string;
|
|
2620
2620
|
thumbnail: string;
|
|
2621
2621
|
}>;
|
|
2622
2622
|
}, "strip", ZodTypeAny, {
|
|
2623
2623
|
data: {
|
|
2624
|
-
description?: string | undefined;
|
|
2625
2624
|
path?: string | undefined;
|
|
2625
|
+
description?: string | undefined;
|
|
2626
2626
|
title: string;
|
|
2627
2627
|
thumbnail: string;
|
|
2628
2628
|
};
|
|
2629
2629
|
type: "zmp" | "zmp_deep_link";
|
|
2630
2630
|
}, {
|
|
2631
2631
|
data: {
|
|
2632
|
-
description?: string | undefined;
|
|
2633
2632
|
path?: string | undefined;
|
|
2633
|
+
description?: string | undefined;
|
|
2634
2634
|
title: string;
|
|
2635
2635
|
thumbnail: string;
|
|
2636
2636
|
};
|
|
@@ -2907,8 +2907,8 @@ declare const getShareableLinkArgs: ZodObject<{
|
|
|
2907
2907
|
description: string;
|
|
2908
2908
|
title: string;
|
|
2909
2909
|
}, {
|
|
2910
|
-
description?: string | undefined;
|
|
2911
2910
|
path?: string | undefined;
|
|
2911
|
+
description?: string | undefined;
|
|
2912
2912
|
thumbnail?: string | undefined;
|
|
2913
2913
|
title: string;
|
|
2914
2914
|
}>[];
|
package/apis/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var r="2.45.
|
|
1
|
+
var r="2.45.2";export{r as version};
|