zmp-sdk 2.29.0 → 2.30.0
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/apis/openWebview.js +1 -1
- package/apis/common/apis/general/openWebview.js +1 -1
- package/apis/common/utils.js +1 -1
- package/apis/index.d.ts +23 -4
- package/apis/package.json.js +1 -1
- package/apis/types/enum.js +1 -1
- package/browser.min.js +2 -2
- package/index.d.ts +23 -4
- package/index.es.js +2 -2
- package/index.js +2 -2
- package/index.umd.js +3 -3
- package/package.json +1 -1
- package/zmp-sdk-v2.28.8.tgz +0 -0
- package/zmp-sdk-v2.29.0.tgz +0 -0
- package/zmp-sdk-v2.28.6.tgz +0 -0
package/apis/apis/openWebview.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import t from'./../external/@swc/helpers/src/_async_to_generator.mjs.js';import o,{object as e,string as n}from'./../external/zod/lib/index.mjs.js';import{camelToSnakeCase as r}from"../common/utils.js";import s from"../appEnv/index.js";import i from"../common/notFound.js";import{functionHandler as l}from"../utils/decorator.js";import m from"../utils/lodash.js";import a from"../common/apis/general/openWebview.js";import{__generator as u}from'./../external/tslib/tslib.es6.js';var p=[e({url:n(),config:e({style:o.enum(["bottomSheet","normal"]).default("bottomSheet").optional(),leftButton:o.enum(["back","none"]).default("back").optional()}).optional()})];function c(t){return f.apply(this,arguments)}function f(){return f=t((function(o){return u(this,(function(e){return[2,l("openWebview",p,[o],(n=t((function(t){var o,e,n,l,p;return u(this,(function(u){switch(u.label){case 0:return s.isMp?(o=new URL(t.url),e=o.href.includes("vnpay"),n=o.searchParams.get("typeInapp"),l=t.config,p=m.isEmpty(l)?void 0:{modal_style:(null==l?void 0:l.style)?r(null==l?void 0:l.style):"bottom_sheet",left_button:(null==l?void 0:l.leftButton)?r(null==l?void 0:l.leftButton):"back"},!e&&m.isEmpty(n)&&o.searchParams.set("typeInapp","1"),[4,a(o.href,p)]):[3,2];case 1:return[2,u.sent()];case 2:return s.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(i("openWebview",{}))]}}))})),function(t){return n.apply(this,arguments)}))];var n}))})),f.apply(this,arguments)}export{c as openWebview};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import n from'./../../../external/@swc/helpers/src/_async_to_generator.mjs.js';import
|
|
1
|
+
import n from'./../../../external/@swc/helpers/src/_async_to_generator.mjs.js';import s from"../../call/index.js";import{__generator as t}from'./../../../external/tslib/tslib.es6.js';var o,r=(o=n((function(n,o){return t(this,(function(t){return[2,new Promise((function(t,r){s("OPEN_INAPP",{url:n,style:o},{success:function(n){t()},fail:function(n){r(n)}},{})}))]}))})),function(n,s){return o.apply(this,arguments)});export{r as default};
|
package/apis/common/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import r from'./../external/@swc/helpers/src/_async_to_generator.mjs.js';import t from"../utils/query-string.js";import{APIS as e}from"../constants.js";import
|
|
1
|
+
import r from'./../external/@swc/helpers/src/_async_to_generator.mjs.js';import t from"../utils/query-string.js";import{APIS as e}from"../constants.js";import n from"../utils/lodash.js";import o from"../utils/request.js";import{__generator as a}from'./../external/tslib/tslib.es6.js';var s,i=(s=r((function(r,o,s){var i,c,d,p;return a(this,(function(a){switch(a.label){case 0:return i={appId:r,versionStatus:o},n.isUndefined(s)||(i.currentVersion=s),c=t.appendToUrl(e.GET_APP_INFO,i),[4,fetch(c,{credentials:"include"})];case 1:return(d=a.sent()).ok?[4,d.json()]:[3,3];case 2:if((p=a.sent()).err<0||!p.data)throw new Error(p);return[2,{name:p.data.name,version:p.data.version,description:p.data.description,appUrl:p.data.appUrl,qrCodeUrl:p.data.qrCodeUrl,logoUrl:p.data.logoUrl}];case 3:throw new Error("Can't get app info")}}))})),function(r,t,e){return s.apply(this,arguments)});function c(r){try{var t=r.map((function(r){return{action:r.action,error:r.error,message:r.message,data:r.data}}));o.execute(e.SEND_ACTION_LOG,"post",{appId:window.APP_ID,data:JSON.stringify(t)},(function(r){})),window.zmpSentry&&window.zmpSentry.captureMessage("Result from native",{extra:{data:r}})}catch(r){}}var d=function(r){return r.replace(/[A-Z]/g,(function(r){return"_".concat(r.toLowerCase())}))};export{d as camelToSnakeCase,i as getAppInfo,c as sendLogData};
|
package/apis/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ declare enum Events {
|
|
|
16
16
|
AppResumed = "h5.event.resumed",
|
|
17
17
|
NetworkChanged = "h5.event.connection.changed",
|
|
18
18
|
OnDataCallback = "h5.event.webview.result",
|
|
19
|
+
WebviewClosed = "h5.event.webview.close",
|
|
19
20
|
OpenApp = "h5.event.open.mp",
|
|
20
21
|
AppClose = "h5.event.action.close",
|
|
21
22
|
PaymentCallback = "payment.callback",
|
|
@@ -1807,9 +1808,27 @@ declare function vibrate(args?: AsyncVoidCallback & TypeOf<typeof vibrateArgs[0]
|
|
|
1807
1808
|
|
|
1808
1809
|
declare const openWebviewArgs: ZodObject<{
|
|
1809
1810
|
url: ZodString;
|
|
1811
|
+
config: ZodOptional<ZodObject<{
|
|
1812
|
+
style: ZodOptional<ZodDefault<ZodEnum<["bottomSheet", "normal"]>>>;
|
|
1813
|
+
leftButton: ZodOptional<ZodDefault<ZodEnum<["back", "none"]>>>;
|
|
1814
|
+
}, "strip", ZodTypeAny, {
|
|
1815
|
+
style?: "normal" | "bottomSheet" | undefined;
|
|
1816
|
+
leftButton?: "none" | "back" | undefined;
|
|
1817
|
+
}, {
|
|
1818
|
+
style?: "normal" | "bottomSheet" | undefined;
|
|
1819
|
+
leftButton?: "none" | "back" | undefined;
|
|
1820
|
+
}>>;
|
|
1810
1821
|
}, "strip", ZodTypeAny, {
|
|
1822
|
+
config?: {
|
|
1823
|
+
style?: "normal" | "bottomSheet" | undefined;
|
|
1824
|
+
leftButton?: "none" | "back" | undefined;
|
|
1825
|
+
} | undefined;
|
|
1811
1826
|
url: string;
|
|
1812
1827
|
}, {
|
|
1828
|
+
config?: {
|
|
1829
|
+
style?: "normal" | "bottomSheet" | undefined;
|
|
1830
|
+
leftButton?: "none" | "back" | undefined;
|
|
1831
|
+
} | undefined;
|
|
1813
1832
|
url: string;
|
|
1814
1833
|
}>[];
|
|
1815
1834
|
declare function openWebview(args: AsyncCallback<OpenWebviewReturns> & TypeOf<typeof openWebviewArgs[0]>): Promise<void>;
|
|
@@ -2174,13 +2193,13 @@ declare const configAppViewArgs: ZodObject<{
|
|
|
2174
2193
|
textAlign: ZodOptional<ZodDefault<ZodEnum<["left", "center"]>>>;
|
|
2175
2194
|
}, "strip", ZodTypeAny, {
|
|
2176
2195
|
title?: string | undefined;
|
|
2177
|
-
hide?: boolean | undefined;
|
|
2178
2196
|
leftButton?: "none" | "back" | undefined;
|
|
2197
|
+
hide?: boolean | undefined;
|
|
2179
2198
|
textAlign?: "left" | "center" | undefined;
|
|
2180
2199
|
}, {
|
|
2181
2200
|
title?: string | undefined;
|
|
2182
|
-
hide?: boolean | undefined;
|
|
2183
2201
|
leftButton?: "none" | "back" | undefined;
|
|
2202
|
+
hide?: boolean | undefined;
|
|
2184
2203
|
textAlign?: "left" | "center" | undefined;
|
|
2185
2204
|
}>>;
|
|
2186
2205
|
statusBarType: ZodOptional<ZodEnum<["normal", "hidden", "transparent"]>>;
|
|
@@ -2191,8 +2210,8 @@ declare const configAppViewArgs: ZodObject<{
|
|
|
2191
2210
|
headerColor?: string | undefined;
|
|
2192
2211
|
actionBar?: {
|
|
2193
2212
|
title?: string | undefined;
|
|
2194
|
-
hide?: boolean | undefined;
|
|
2195
2213
|
leftButton?: "none" | "back" | undefined;
|
|
2214
|
+
hide?: boolean | undefined;
|
|
2196
2215
|
textAlign?: "left" | "center" | undefined;
|
|
2197
2216
|
} | undefined;
|
|
2198
2217
|
statusBarType?: "hidden" | "transparent" | "normal" | undefined;
|
|
@@ -2203,8 +2222,8 @@ declare const configAppViewArgs: ZodObject<{
|
|
|
2203
2222
|
headerColor?: string | undefined;
|
|
2204
2223
|
actionBar?: {
|
|
2205
2224
|
title?: string | undefined;
|
|
2206
|
-
hide?: boolean | undefined;
|
|
2207
2225
|
leftButton?: "none" | "back" | undefined;
|
|
2226
|
+
hide?: boolean | undefined;
|
|
2208
2227
|
textAlign?: "left" | "center" | undefined;
|
|
2209
2228
|
} | undefined;
|
|
2210
2229
|
statusBarType?: "hidden" | "transparent" | "normal" | undefined;
|
package/apis/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var r="2.
|
|
1
|
+
var r="2.30.0";export{r as version};
|
package/apis/types/enum.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var n,
|
|
1
|
+
var e,n,o,a,i,t,c,l,u,r,p,d,m,f,s,h,_;!function(e){e.none="none",e.wifi="wifi",e.cellular="cellular",e.unknown="unknown"}(e||(e={})),function(e){e.wp="wp",e.android="android",e.iOS="iOS",e.unknown="unknown"}(n||(n={})),function(e){e.AppPaused="h5.event.paused",e.AppResumed="h5.event.resumed",e.NetworkChanged="h5.event.connection.changed",e.OnDataCallback="h5.event.webview.result",e.WebviewClosed="h5.event.webview.close",e.OpenApp="h5.event.open.mp",e.AppClose="h5.event.action.close",e.PaymentCallback="payment.callback",e.PaymentResult="action.payment.result"}(o||(o={})),function(e){e.DOING="doing",e.DONE="done"}(a||(a={})),function(e){e[e.user=1]="user",e[e.oa=0]="oa",e[e.aliasOA=2]="aliasOA"}(i||(i={})),function(e){e[e.user=1]="user",e[e.oa=0]="oa"}(t||(t={})),function(e){e[e.image=1]="image",e[e.link=4]="link",e[e.profile=5]="profile"}(c||(c={})),function(e){e[e.image=1]="image",e[e.gif=11]="gif",e[e.video=12]="video",e[e.link=4]="link",e[e.oa=5]="oa",e[e.zmp=20]="zmp",e[e.multi_image=21]="multi_image",e[e.zmp_deep_link=4]="zmp_deep_link"}(l||(l={})),function(e){e[e.auto=1]="auto",e[e.portrait=2]="portrait",e[e.landscape=3]="landscape"}(u||(u={})),function(e){e[e.oneShot=0]="oneShot"}(r||(r={})),function(e){e[e.zcamera=3]="zcamera",e[e.zcamera_photo=1]="zcamera_photo",e[e.zcamera_video=2]="zcamera_video",e[e.zcamera_scan=7]="zcamera_scan",e[e.photo=4]="photo",e[e.video=5]="video",e[e.file=6]="file"}(p||(p={})),function(e){e.SUBSCRIPTION="SUBSCRIPTION",e.ONETIME="ONETIME"}(d||(d={})),function(e){e[e.UNKNOW=0]="UNKNOW",e[e.DEFERRED=1]="DEFERRED",e[e.IMMEDIATE_AND_CHARGE_FULL_PRICE=2]="IMMEDIATE_AND_CHARGE_FULL_PRICE"}(m||(m={})),function(e){e[e.normal=1]="normal",e[e.hidden=0]="hidden",e[e.transparent=2]="transparent"}(f||(f={})),function(e){e[e.show=1]="show",e[e.hide=0]="hide"}(s||(s={})),function(e){e[e.show=1]="show",e[e.hide=0]="hide"}(h||(h={})),function(e){e[e.left=0]="left",e[e.center=1]="center"}(_||(_={}));export{s as AndroidBottomNavigationBarType,t as ChatType,o as Events,d as IAPPayType,h as IOSSafeAreaBottomType,a as JumpStatus,p as MediaPickerType,e as NetworkType,u as OrientationType,n as PlatformType,c as PostFeedType,i as ProfileType,m as ProrationMode,l as ShareSheetType,f as StatusBarType,_ as TextAlignType,r as VibrateType};
|