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.
@@ -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 o from'./../external/@swc/helpers/src/_create_super.mjs.js';import r from'./../external/eventemitter3/index.js';import c from"../utils/debug.js";import{stringToData as s}from"../utils/common.js";import{APP_ID as i}from"../constants.js";import{transformPaymentDataFromOnDataCallback as m,transformPaymentDataFromPath as l,PaymentConfig as p}from"./apis/general/payment/utils.js";import{Events as u}from"../types/enum.js";var d="ACTION_CALLBACK";var f=function(r){a(i,r);var s=o(i);function i(){var t;return e(this,i),(t=s.apply(this,arguments)).debug=c("zmp:event-emitter"),t}var m=i.prototype;return m.h5ConfirmHandleEvent=function(e,t,n){ZaloJavaScriptInterface.jsH5EventCallback(e,t,n||"")},m.on=function(e,a,o){var r=this;if(e===d||e===u.PaymentCallback)return t(n(i.prototype),"on",this).call(this,e,a,o);this.debug("register ".concat(String(e),": ").concat(o));return t(n(i.prototype),"on",this).call(this,e,(function(t,n){r.h5ConfirmHandleEvent(t,e,o),a(n)}),o)},m.once=function(e,a,o){var r=this;if(e===d)return t(n(i.prototype),"once",this).call(this,e,a,o);this.debug("register once ".concat(String(e),": ").concat(o));return t(n(i.prototype),"once",this).call(this,e,(function(t,n){r.h5ConfirmHandleEvent(t,e,o),a(n)}),o)},i.getInstance=function(){return i.instance||(i.instance=new i),i.instance},i}(r);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=c("zmp:zalo_h5_event_handler");a("eventId: ".concat(e,", eventName: ").concat(t,", eventData: ").concat(n));var o=s(n);a("stringToData",o);var r=function(e,t){try{if(e===u.OpenApp){var n=t.url,a=new URL(n),o=a.pathname.split("/zapps/".concat(i))[1];return{path:"".concat(o||"/").concat(a.search)}}return t}catch(e){return t}}(t,o),d=function(e,t,n,a){switch(!0){case e===u.OpenApp&&(null==a?void 0:a.enablePaymentDone):var o=l(n.path);return[{eventName:u.PaymentDone,eventId:t,data:o}];case e===u.OnDataCallback:if(["PAY_BY_BANK","PAY_BY_CUSTOM_METHOD"].includes(n.eventType))return[{eventName:u.OnDataCallback,eventId:t,data:n},{eventName:u.PaymentDone,eventId:t,data:m(n)}];default:return[{eventName:e,eventId:t,data:n}]}}(t,e,r,p);d.forEach((function(e){f.getInstance().emit(e.eventName,e.eventId,e.data)}))}},window.zaloNative2JS={nativeCall:function(e,t,n){f.getInstance().emit(u.PaymentCallback,e,t,n)}};export{f as MPEEmitter,h as fireActionMessage,v as onActionMessage};
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?: "normal" | "small" | "large" | undefined;
2172
+ avatarType?: "small" | "normal" | "large" | undefined;
2173
2173
  autoRequestPermission?: boolean | undefined;
2174
2174
  }, {
2175
- avatarType?: "normal" | "small" | "large" | undefined;
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
  }>[];
@@ -1 +1 @@
1
- var r="2.45.1";export{r as version};
1
+ var r="2.45.2";export{r as version};