zmp-sdk 2.51.0-beta.1 → 2.51.0-beta.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/apis/lfs/getFileInfo.js +1 -1
- package/apis/apis/lfs/getSavedFileList.js +1 -1
- package/apis/apis/lfs/index.js +1 -1
- package/apis/apis/lfs/isSupportLFS.js +1 -0
- package/apis/apis/lfs/removeSavedFile.js +1 -1
- package/apis/apis/lfs/saveFile.js +1 -1
- package/apis/index.d.ts +19 -0
- package/apis/package.json.js +1 -1
- package/browser.min.js +2 -2
- package/index.d.ts +21 -1
- 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
|
|
1
|
+
import t from'./../../external/@swc/helpers/src/_async_to_generator.mjs.js';import r,{object as o}from'./../../external/zod/lib/index.mjs.js';import e from"../../appEnv/index.js";import s from"../../common/notFound.js";import{functionHandler as i}from"../../utils/decorator.js";import n from"../../common/apis/general/lfs/getFileInfo.js";import{apiResponse as m}from"../../utils/response.js";import{isSupportLFS as p}from"./isSupportLFS.js";import{__generator as l}from'./../../external/tslib/tslib.es6.js';var u=[o({filePath:r.string(),digestAlgorithm:r.enum(["sha1","md5"]).optional().default("md5")}).optional()];function a(t){return f.apply(this,arguments)}function f(){return f=t((function(r){return l(this,(function(o){return[2,i("getFileInfo",u,[r],(a=t((function(t){var r;return l(this,(function(o){switch(o.label){case 0:return e.isMp?[4,p()]:[3,4];case 1:return o.sent().support?(r=t.digestAlgorithm||"md5",[4,n(t.filePath,r)]):[3,3];case 2:return[2,o.sent()];case 3:throw m.error.clientNotSupport();case 4:return e.isMpWeb?[2,Promise.resolve({size:"",digest:"",type:""})]:[2,Promise.reject(s("getFileInfo",{}))]}}))})),function(t){return a.apply(this,arguments)}))];var a}))})),f.apply(this,arguments)}export{a as getFileInfo};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import r from'./../../external/@swc/helpers/src/_async_to_generator.mjs.js';import t from"../../appEnv/index.js";import e from"../../common/notFound.js";import{functionHandler as o}from"../../utils/decorator.js";import s from"../../common/apis/general/lfs/getSavedFileList.js";import{
|
|
1
|
+
import r from'./../../external/@swc/helpers/src/_async_to_generator.mjs.js';import t from"../../appEnv/index.js";import e from"../../common/notFound.js";import{functionHandler as o}from"../../utils/decorator.js";import s from"../../common/apis/general/lfs/getSavedFileList.js";import{apiResponse as i}from"../../utils/response.js";import{isSupportLFS as n}from"./isSupportLFS.js";import{__generator as p}from'./../../external/tslib/tslib.es6.js';function m(r){return u.apply(this,arguments)}function u(){return u=r((function(m){return p(this,(function(u){return[2,o("getSavedFileList",[],[m],(c=r((function(r){return p(this,(function(r){switch(r.label){case 0:return t.isMp?[4,n()]:[3,4];case 1:return r.sent().support?[4,s()]:[3,3];case 2:return[2,r.sent()];case 3:throw i.error.clientNotSupport();case 4:return t.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(e("getSavedFileList",{}))]}}))})),function(r){return c.apply(this,arguments)}))];var c}))})),u.apply(this,arguments)}export{m as getSavedFileList};
|
package/apis/apis/lfs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getFileInfo as e}from"./getFileInfo.js";import{getSavedFileList as i}from"./getSavedFileList.js";import{removeSavedFile as o}from"./removeSavedFile.js";import{saveFile as r}from"./saveFile.js";var
|
|
1
|
+
import{getFileInfo as e}from"./getFileInfo.js";import{getSavedFileList as i}from"./getSavedFileList.js";import{removeSavedFile as o}from"./removeSavedFile.js";import{saveFile as r}from"./saveFile.js";import{isSupportLFS as t}from"./isSupportLFS.js";var m={getFileInfo:e,getSavedFileList:i,removeSavedFile:o,saveFile:r,isSupportLFS:t};export{m as LFSStorage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import o from'./../../external/@swc/helpers/src/_async_to_generator.mjs.js';import r from"../../appEnv/index.js";import t from"../../common/notFound.js";import{functionHandler as s}from"../../utils/decorator.js";import{isAPISupport as e}from"../../common/utils.js";import{__generator as i}from'./../../external/tslib/tslib.es6.js';function n(){return p.apply(this,arguments)}function p(){return(p=o((function(){return i(this,(function(n){return[2,s("isSupportLFS",[],[],o((function(){return i(this,(function(o){return r.isMp?[2,Promise.resolve({support:e(25112868,692)})]:r.isMpWeb?[2,Promise.resolve({support:!1})]:[2,Promise.reject(t("isSupportLFS",{}))]}))})))]}))}))).apply(this,arguments)}export{n as isSupportLFS};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import r from'./../../external/@swc/helpers/src/_async_to_generator.mjs.js';import
|
|
1
|
+
import r from'./../../external/@swc/helpers/src/_async_to_generator.mjs.js';import e,{object as o}from'./../../external/zod/lib/index.mjs.js';import t from"../../appEnv/index.js";import s from"../../common/notFound.js";import{functionHandler as i}from"../../utils/decorator.js";import n from"../../common/apis/general/lfs/removeSavedFile.js";import{apiResponse as m}from"../../utils/response.js";import{isSupportLFS as p}from"./isSupportLFS.js";import{__generator as u}from'./../../external/tslib/tslib.es6.js';var a=[o({filePath:e.string()}).optional()];function l(r){return c.apply(this,arguments)}function c(){return c=r((function(e){return u(this,(function(o){return[2,i("removeSavedFile",a,[e],(l=r((function(r){return u(this,(function(e){switch(e.label){case 0:return t.isMp?[4,p()]:[3,4];case 1:return e.sent().support?[4,n(r.filePath)]:[3,3];case 2:return[2,e.sent()];case 3:throw m.error.clientNotSupport();case 4:return t.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(s("removeSavedFile",{}))]}}))})),function(r){return l.apply(this,arguments)}))];var l}))})),c.apply(this,arguments)}export{l as removeSavedFile};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import r from'./../../external/@swc/helpers/src/_async_to_generator.mjs.js';import o,{object as e}from'./../../external/zod/lib/index.mjs.js';import t from"../../appEnv/index.js";import s from"../../common/notFound.js";import{functionHandler as
|
|
1
|
+
import r from'./../../external/@swc/helpers/src/_async_to_generator.mjs.js';import o,{object as e}from'./../../external/zod/lib/index.mjs.js';import t from"../../appEnv/index.js";import s from"../../common/notFound.js";import{functionHandler as n}from"../../utils/decorator.js";import i from"../../common/apis/general/lfs/lfsSaveFile.js";import{apiResponse as p}from"../../utils/response.js";import{isSupportLFS as m}from"./isSupportLFS.js";import{__generator as u}from'./../../external/tslib/tslib.es6.js';var l=[e({filePath:o.string()}).optional()];function a(r){return c.apply(this,arguments)}function c(){return c=r((function(o){return u(this,(function(e){return[2,n("saveFile",l,[o],(a=r((function(r){return u(this,(function(o){switch(o.label){case 0:return t.isMp?[4,m()]:[3,4];case 1:return o.sent().support?[4,i(r.filePath,r.onProgress)]:[3,3];case 2:return[2,o.sent()];case 3:throw p.error.clientNotSupport();case 4:return t.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(s("saveFile",{}))]}}))})),function(r){return a.apply(this,arguments)}))];var a}))})),c.apply(this,arguments)}export{a as saveFile};
|
package/apis/index.d.ts
CHANGED
|
@@ -1359,6 +1359,9 @@ type FileInfo = {
|
|
|
1359
1359
|
type SaveFileReturns = {
|
|
1360
1360
|
savedPath: string;
|
|
1361
1361
|
};
|
|
1362
|
+
type IsSupportReturns = {
|
|
1363
|
+
support: boolean;
|
|
1364
|
+
};
|
|
1362
1365
|
|
|
1363
1366
|
declare enum CameraEvents {
|
|
1364
1367
|
OnFrameCallback = "h5.event.camera.frame",
|
|
@@ -5835,11 +5838,27 @@ declare const saveFileArgs: ZodOptional<ZodObject<{
|
|
|
5835
5838
|
*/
|
|
5836
5839
|
declare function saveFile(args: AsyncProgressCallback<SaveFileReturns> & TypeOf<(typeof saveFileArgs)[0]>): Promise<SaveFileReturns>;
|
|
5837
5840
|
|
|
5841
|
+
/**
|
|
5842
|
+
* Kiểm tra xem Mini App có hỗ trợ LFS (Lưu file cục bộ) hay không.
|
|
5843
|
+
*
|
|
5844
|
+
* @minimumVersion 2.51.0
|
|
5845
|
+
* @zaloOnly Chỉ hoạt động khi chạy bên trong ứng dụng Zalo mobile.
|
|
5846
|
+
*
|
|
5847
|
+
* @returns {IsSupportReturns}
|
|
5848
|
+
* @example Kiểm tra xem Mini App có hỗ trợ LFS hay không:
|
|
5849
|
+
* ```ts
|
|
5850
|
+
* const { support } = await isSupportLFS();
|
|
5851
|
+
* console.log(`Mini App hỗ trợ LFS: ${support}`);
|
|
5852
|
+
* ```
|
|
5853
|
+
*/
|
|
5854
|
+
declare function isSupportLFS(): Promise<IsSupportReturns>;
|
|
5855
|
+
|
|
5838
5856
|
declare const LFSStorage: {
|
|
5839
5857
|
getFileInfo: typeof getFileInfo;
|
|
5840
5858
|
getSavedFileList: typeof getSavedFileList;
|
|
5841
5859
|
removeSavedFile: typeof removeSavedFile;
|
|
5842
5860
|
saveFile: typeof saveFile;
|
|
5861
|
+
isSupportLFS: typeof isSupportLFS;
|
|
5843
5862
|
};
|
|
5844
5863
|
|
|
5845
5864
|
declare class AppError {
|
package/apis/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var a="2.51.0-beta.
|
|
1
|
+
var a="2.51.0-beta.2";export{a as version};
|