zmp-sdk 2.25.5 → 2.25.6
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/appEnv/getEnv.js +1 -1
- package/apis/common/apis/general/openShareSheet.js +1 -1
- package/apis/common/apis/general/storage/index.js +1 -1
- package/apis/common/logger.js +1 -1
- package/apis/package.json.js +1 -1
- package/apis/utils/common.js +1 -1
- package/browser.min.js +1 -1
- package/index.es.js +1 -1
- package/index.js +1 -1
- package/index.umd.js +2 -2
- package/package.json +1 -1
- package/zmp-sdk-v2.25.5.tgz +0 -0
package/apis/appEnv/getEnv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mpDomain as i,mpPath as o}from"../constants.js";import t from"../utils/silent.js";import{PlatformType as n}from"../types/enum.js";var e=function(i){return i.isAndroid?n.android:i.isIOS?n.iOS:n.unknown};function s(i){var o=i.split("zalo")[1];return o&&o.replace(" ","").split("/")[1]||""}function a(){var n=function(){var n=t((function(){return window.navigator.userAgent.toLowerCase()}))();if(n){var a=function(i){return{isAndroid:/android/i.test(i)&&!/iemobile/.test(i),isIOS:/iphone|ios|ipad|ipod/.test(i)&&!/iemobile/.test(i),isMobile:/android|iphone|ios|ipad|ipod|iemobile/.test(i),isZalo:/zalo/.test(i)}}(n);return{appEnv:(window.location.hostname.includes(i)&&window.location.pathname.startsWith(o),{isMp:window.location.hostname.includes(i)&&window.location.pathname.startsWith(o),isMpWeb:window.location.hostname.includes("localhost")}),platform:a,platformName:e(a),zaloVersion:s(n)}}}();if(n)return n}export{a as default};
|
|
1
|
+
import{mpDomain as i,mpPath as o}from"../constants.js";import t from"../utils/silent.js";import{PlatformType as n}from"../types/enum.js";var e=function(i){return i.isAndroid?n.android:i.isIOS?n.iOS:n.unknown};function s(i){var o=i.split("zalo")[1];return o&&o.replace(" ","").split("/")[1]||""}function a(){var n=function(){var n=t((function(){return window.navigator.userAgent.toLowerCase()}))();if(n){var a=function(i){return{isAndroid:/android/i.test(i)&&!/iemobile/.test(i),isIOS:/iphone|ios|ipad|ipod/.test(i)&&!/iemobile/.test(i),isMobile:/android|iphone|ios|ipad|ipod|iemobile/.test(i),isZalo:/zalo/.test(i)}}(n);return{appEnv:(window.location.hostname.includes(i)&&window.location.pathname.startsWith(o),{isMp:window.location.hostname.includes(i)&&window.location.pathname.startsWith(o),isMpWeb:window.location.hostname.includes("localhost")}),platform:a,platformName:e(a),zaloVersion:s(n).trim()}}}();if(n)return n}export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from'./../../../external/@swc/helpers/src/_async_to_generator.mjs.js';import n from'./../../../external/@swc/helpers/src/_object_spread.mjs.js';import t from'./../../../external/@swc/helpers/src/_object_spread_props.mjs.js';import
|
|
1
|
+
import e from'./../../../external/@swc/helpers/src/_async_to_generator.mjs.js';import n from'./../../../external/@swc/helpers/src/_object_spread.mjs.js';import t from'./../../../external/@swc/helpers/src/_object_spread_props.mjs.js';import r from"../../call/index.js";import i from"../../token.js";import{ZAPP_ID as o,APP_ID as l,ZALO_SUPPORT_SHARE_MULTI_IMAGE_VERSION as s}from"../../../constants.js";import a from"./getZMPShareInfo.js";import{__generator as u}from'./../../../external/tslib/tslib.es6.js';import{ShareSheetType as d}from"../../../types/enum.js";import c from"../../../appEnv/getEnv.js";var m,p=(m=e((function(e,m){var p,v,h,f,g,_,j,U,b;return u(this,(function(u){switch(u.label){case 0:switch(p={},v=e,e){case"image":return[3,1];case"gif":return[3,2];case"video":return[3,3];case"link":return[3,4];case"oa":return[3,5];case"zmp":return[3,6]}return[3,9];case 1:return g=[],_=(null===(h=c())||void 0===h?void 0:h.zaloVersion)||0,j=(null===(f=c())||void 0===f?void 0:f.platformName)||"unknown",Number(_)>=s[j]&&(v="multi_image"),Array.isArray(null==m?void 0:m.imageUrls)&&(null==m?void 0:m.imageUrls.length)>0?g=null==m?void 0:m.imageUrls:g.push(null==m?void 0:m.imageUrl),p={photoUrls:g,photoUrl:null==m?void 0:m.imageUrl,caption:null==m?void 0:m.caption},[3,10];case 2:return p={photoUrl:null==m?void 0:m.imageUrl,gifUrl:null==m?void 0:m.gifUrl,width:null==m?void 0:m.width,height:null==m?void 0:m.height},[3,10];case 3:return p={videoThumb:null==m?void 0:m.videoThumb,videoUrl:null==m?void 0:m.videoUrl,width:null==m?void 0:m.width,height:null==m?void 0:m.height},[3,10];case 4:return p={link:null==m?void 0:m.link,chatOnly:(null==m?void 0:m.chatOnly)?1:0},[3,10];case 5:return p={uid:null==m?void 0:m.id},[3,10];case 6:return[4,i.getAccessToken()];case 7:return U=u.sent(),[4,a(l,U||"",(null==m?void 0:m.title)||"",(null==m?void 0:m.description)||"",(null==m?void 0:m.thumbnail)||"",null==m?void 0:m.path)];case 8:b=u.sent(),p={data:{ZInstantAPIInfo:{url:"".concat(b.zinstantApi),zinstantdata_id:"templateId=".concat(b.ztemplateId,"&appId=").concat(l,"&shareId=").concat(b.shareId)},previewMsgText:{msg:{en:"Zalo Mini Program",vi:"Chương trình nhỏ"}},enableReactions:1}},u.label=9;case 9:return[3,10];case 10:return[2,new Promise((function(e,i){r("OPEN_SHARESHEET",t(n({type:d[v]},p),{zapp:o}),{success:function(n){e({status:null==n?void 0:n.status,shareType:null==n?void 0:n.share_type,numberOfUser:null==n?void 0:n.uid_to_size})},fail:function(e){i(e)}},{timeout:!1})}))]}}))})),function(e,n){return m.apply(this,arguments)});export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from'./../../../../external/@swc/helpers/src/_assert_this_initialized.mjs.js';import t from'./../../../../external/@swc/helpers/src/_async_to_generator.mjs.js';import r from'./../../../../external/@swc/helpers/src/_class_call_check.mjs.js';import s from'./../../../../external/@swc/helpers/src/_class_private_field_get.mjs.js';import n from'./../../../../external/@swc/helpers/src/_class_private_field_init.mjs.js';import o from'./../../../../external/@swc/helpers/src/_class_private_field_set.mjs.js';import i from'./../../../../external/@swc/helpers/src/_inherits.mjs.js';import a from'./../../../../external/@swc/helpers/src/_sliced_to_array.mjs.js';import c from'./../../../../external/@swc/helpers/src/_create_super.mjs.js';import u from"../../../../utils/lodash.js";import{LocalResourceStorage as l}from"./localStorage.js";import{NativeResourceStorage as m}from"./nativeStorage.js";import{stringToData as f,stringifyData as p}from"../../../../utils/common.js";import{APP_ID as h,ZALO_SUPPORT_STORAGE_VERSION as _}from"../../../../constants.js";import d from"../../../../appEnv/getEnv.js";import{__generator as v}from'./../../../../external/tslib/tslib.es6.js';var j,w,g=function(){function e(){r(this,e)}var s=e.prototype;return s.getDataFromStorage=function(e){var r=this;return t((function(){var t,s;return v(this,(function(n){switch(n.label){case 0:return[4,r.getInstance().get(e)];case 1:return t=n.sent(),s={},t.forEach((function(e,t){s[t]=f(e)})),[2,s]}}))}))()},s.putDataToStorage=function(e){var r=this;return t((function(){var t,s;return v(this,(function(n){switch(n.label){case 0:return t=r.getInstance(),s={},Object.entries(e).forEach((function(e){var t=a(e,2),r=t[0],n=t[1];u.isUndefined(n)||u.isNull(n)||(s[r]=p(n))})),[4,t.set(s)];case 1:return[2,n.sent()]}}))}))()},s.removeDataFromStorage=function(e){var r=this;return t((function(){return v(this,(function(t){switch(t.label){case 0:return[4,r.getInstance().remove(e)];case 1:return[2,t.sent()]}}))}))()},s.clearStorage=function(){var e=this;return t((function(){return v(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().clear()];case 1:return t.sent(),[2]}}))}))()},s.getStorageInfo=function(){var e=this;return t((function(){return v(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().getInfo()];case 1:return[2,t.sent()]}}))}))()},e}(),b=new WeakMap,I=function(t){i(u,t);var a=c(u);function u(t){var s;return r(this,u),s=a.call(this),n(e(s),b,{writable:!0,value:void 0}),o(e(s),b,t),s}return u.prototype.getInstance=function(){return new l(s(this,b))},u}(g),S=new WeakMap,y=function(t){i(u,t);var a=c(u);function u(t){var s;return r(this,u),s=a.call(this),n(e(s),S,{writable:!0,value:void 0}),o(e(s),S,t),s}return u.prototype.getInstance=function(){return new m(s(this,S))},u}(g),k=new I(h),E=null===(j=d())||void 0===j?void 0:j.zaloVersion,
|
|
1
|
+
import e from'./../../../../external/@swc/helpers/src/_assert_this_initialized.mjs.js';import t from'./../../../../external/@swc/helpers/src/_async_to_generator.mjs.js';import r from'./../../../../external/@swc/helpers/src/_class_call_check.mjs.js';import s from'./../../../../external/@swc/helpers/src/_class_private_field_get.mjs.js';import n from'./../../../../external/@swc/helpers/src/_class_private_field_init.mjs.js';import o from'./../../../../external/@swc/helpers/src/_class_private_field_set.mjs.js';import i from'./../../../../external/@swc/helpers/src/_inherits.mjs.js';import a from'./../../../../external/@swc/helpers/src/_sliced_to_array.mjs.js';import c from'./../../../../external/@swc/helpers/src/_create_super.mjs.js';import u from"../../../../utils/lodash.js";import{LocalResourceStorage as l}from"./localStorage.js";import{NativeResourceStorage as m}from"./nativeStorage.js";import{stringToData as f,stringifyData as p}from"../../../../utils/common.js";import{APP_ID as h,ZALO_SUPPORT_STORAGE_VERSION as _}from"../../../../constants.js";import d from"../../../../appEnv/getEnv.js";import{__generator as v}from'./../../../../external/tslib/tslib.es6.js';var j,w,g=function(){function e(){r(this,e)}var s=e.prototype;return s.getDataFromStorage=function(e){var r=this;return t((function(){var t,s;return v(this,(function(n){switch(n.label){case 0:return[4,r.getInstance().get(e)];case 1:return t=n.sent(),s={},t.forEach((function(e,t){s[t]=f(e)})),[2,s]}}))}))()},s.putDataToStorage=function(e){var r=this;return t((function(){var t,s;return v(this,(function(n){switch(n.label){case 0:return t=r.getInstance(),s={},Object.entries(e).forEach((function(e){var t=a(e,2),r=t[0],n=t[1];u.isUndefined(n)||u.isNull(n)||(s[r]=p(n))})),[4,t.set(s)];case 1:return[2,n.sent()]}}))}))()},s.removeDataFromStorage=function(e){var r=this;return t((function(){return v(this,(function(t){switch(t.label){case 0:return[4,r.getInstance().remove(e)];case 1:return[2,t.sent()]}}))}))()},s.clearStorage=function(){var e=this;return t((function(){return v(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().clear()];case 1:return t.sent(),[2]}}))}))()},s.getStorageInfo=function(){var e=this;return t((function(){return v(this,(function(t){switch(t.label){case 0:return[4,e.getInstance().getInfo()];case 1:return[2,t.sent()]}}))}))()},e}(),b=new WeakMap,I=function(t){i(u,t);var a=c(u);function u(t){var s;return r(this,u),s=a.call(this),n(e(s),b,{writable:!0,value:void 0}),o(e(s),b,t),s}return u.prototype.getInstance=function(){return new l(s(this,b))},u}(g),S=new WeakMap,y=function(t){i(u,t);var a=c(u);function u(t){var s;return r(this,u),s=a.call(this),n(e(s),S,{writable:!0,value:void 0}),o(e(s),S,t),s}return u.prototype.getInstance=function(){return new m(s(this,S))},u}(g),k=new I(h),E=null===(j=d())||void 0===j?void 0:j.zaloVersion,D=(null===(w=d())||void 0===w?void 0:w.platformName)||"unknown";!!u.isString(E)&&Number(E)>=_[D]&&(k=new y(h));var N=k;export{g as StorageCreator,N as default};
|
package/apis/common/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(n){e.on&&e.engine(n)}e.on=!
|
|
1
|
+
function e(n){e.on&&e.engine(n)}e.on=!1,e.engine=function(e){var n=e.name,o=e.type,t=e.state,i=e.request,r=e.response,s=e.stage;console[o]([n,s,t,i,r].filter(Boolean).map((function(e){return"object"==typeof e?JSON.stringify(e):e})).join("; "))};export{e as logger};
|
package/apis/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var r="2.25.
|
|
1
|
+
var r="2.25.6";export{r as version};
|
package/apis/utils/common.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import r from'./../external/@swc/helpers/src/_type_of.mjs.js';import{ACTION as n}from"../constants.js";import t from"./debug.js";import e from"./lodash.js";import{StatusBarType as o}from"../types/enum.js";import i from"../appEnv/getEnv.js";var a=t("zmp:utils:common"),u=function(r){if(e.isObject(JSON)&&JSON.stringify)return JSON.stringify(r);if(void 0===r)return"undefined";if(null===r)return"null";try{if("string"==typeof r||null!==r.constructor.toString().match(/string/i))return'"'+r.replace(/"/g,'\\"')+'"'}catch(r){console.log(r)}var n;if(null!==Object.prototype.toString.call(r).match(/array/i)){n=new Array;for(var t=r.length,o=0;o<t;o++)n.push(u(r[o]));return"["+n.join(",")+"]"}if("object"==typeof r){for(var i in n=new Array,r)n.push('"'+i+'":'+u(r[i]));return"{"+n.join(",")+"}"}return r.toString()},c=function(r){var t,e,o=n[r],a=(null===(t=i())||void 0===t?void 0:t.zaloVersion)||0,u="versionLive"in o&&(null==o||null===(e=o.versionLive)||void 0===e?void 0:e.iOS)||0;return!!(Array.isArray(window.ignoreCheckSupport)&&window.ignoreCheckSupport.length>0&&window.ignoreCheckSupport.includes(r))||a>=u},p=function(n){try{if(n){a(n);var t=n.replace(/\\/g,"").replace(/'/g,"'");return a("formattedValue",t,JSON.parse(t),r(JSON.parse(t))),JSON.parse(t)}return null}catch(r){return a("parse json error:",r),n}},s=function(r){if(e.isObject(JSON)&&JSON.parse&&e.isString(r)){var n=r.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\x00/g,"");return JSON.parse(n,(function(r,n){return n}))}return e.isObject(r)?r:new Function("return "+r)()},l=function(r){for(var n=document.getElementsByTagName("meta"),t=0;t<n.length;t++)if(n[t].getAttribute("name")===r||n[t].getAttribute("property")===r)return n[t].getAttribute("content");return""},f=function(r){return JSON.stringify(r).replace(/"/g,'\\"').replace(/'/g,"'")},g=function(r,n){var t,e=0;for(t in r){var o=t.split("_")[0];r.hasOwnProperty(t)&&(n&&o!==n||(e+=2*(r[t].length+t.length)))}return e};function m(r){return r.map((function(r,n){var t=r.path.length>0?r.path.map((function(r,n){return n>0?"[".concat(r,"]"):r})).join(""):"arg";return"Error ".concat(n+1,": Code: ").concat(r.code," ~ Path: ").concat(t," ~ Message: ").concat(r.message)})).join(" | ")}var d=function(r){return r===o.hidden?"hidden":r===o.transparent?"transparent":"normal"},h=function(r){return"hidden"===r?o.hidden:"transparent"===r?o.transparent:o.normal};export{g as calcLocalStorageSize,c as checkIOSSupportAction,h as convertStatusBarTypeToNumber,m as generateErrorMessage,l as getMetaValue,d as getStatusbarType,s as parseJSON,u as serialize,p as stringToData,f as stringifyData};
|
|
1
|
+
import r from'./../external/@swc/helpers/src/_type_of.mjs.js';import{ACTION as n}from"../constants.js";import t from"./debug.js";import e from"./lodash.js";import{StatusBarType as o}from"../types/enum.js";import i from"../appEnv/getEnv.js";var a=t("zmp:utils:common"),u=function(r){if(e.isObject(JSON)&&JSON.stringify)return JSON.stringify(r);if(void 0===r)return"undefined";if(null===r)return"null";try{if("string"==typeof r||null!==r.constructor.toString().match(/string/i))return'"'+r.replace(/"/g,'\\"')+'"'}catch(r){console.log(r)}var n;if(null!==Object.prototype.toString.call(r).match(/array/i)){n=new Array;for(var t=r.length,o=0;o<t;o++)n.push(u(r[o]));return"["+n.join(",")+"]"}if("object"==typeof r){for(var i in n=new Array,r)n.push('"'+i+'":'+u(r[i]));return"{"+n.join(",")+"}"}return r.toString()},c=function(r){var t,e,o=n[r],a=(null===(t=i())||void 0===t?void 0:t.zaloVersion)||0,u="versionLive"in o&&(null==o||null===(e=o.versionLive)||void 0===e?void 0:e.iOS)||0;return!!(Array.isArray(window.ignoreCheckSupport)&&window.ignoreCheckSupport.length>0&&window.ignoreCheckSupport.includes(r))||Number(a)>=u},p=function(n){try{if(n){a(n);var t=n.replace(/\\/g,"").replace(/'/g,"'");return a("formattedValue",t,JSON.parse(t),r(JSON.parse(t))),JSON.parse(t)}return null}catch(r){return a("parse json error:",r),n}},s=function(r){if(e.isObject(JSON)&&JSON.parse&&e.isString(r)){var n=r.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\x00/g,"");return JSON.parse(n,(function(r,n){return n}))}return e.isObject(r)?r:new Function("return "+r)()},l=function(r){for(var n=document.getElementsByTagName("meta"),t=0;t<n.length;t++)if(n[t].getAttribute("name")===r||n[t].getAttribute("property")===r)return n[t].getAttribute("content");return""},f=function(r){return JSON.stringify(r).replace(/"/g,'\\"').replace(/'/g,"'")},g=function(r,n){var t,e=0;for(t in r){var o=t.split("_")[0];r.hasOwnProperty(t)&&(n&&o!==n||(e+=2*(r[t].length+t.length)))}return e};function m(r){return r.map((function(r,n){var t=r.path.length>0?r.path.map((function(r,n){return n>0?"[".concat(r,"]"):r})).join(""):"arg";return"Error ".concat(n+1,": Code: ").concat(r.code," ~ Path: ").concat(t," ~ Message: ").concat(r.message)})).join(" | ")}var d=function(r){return r===o.hidden?"hidden":r===o.transparent?"transparent":"normal"},h=function(r){return"hidden"===r?o.hidden:"transparent"===r?o.transparent:o.normal};export{g as calcLocalStorageSize,c as checkIOSSupportAction,h as convertStatusBarTypeToNumber,m as generateErrorMessage,l as getMetaValue,d as getStatusbarType,s as parseJSON,u as serialize,p as stringToData,f as stringifyData};
|