zmp-sdk 2.38.2 → 2.39.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/openShareSheet.js +1 -1
- package/apis/apis/openWidget.js +1 -0
- package/apis/apis/showFunctionButtonWidget.js +1 -0
- package/apis/apis/showOAWidget.js +1 -1
- package/apis/common/apis/general/openShareSheet.js +1 -1
- package/apis/index.d.ts +267 -13
- package/apis/index.es.js +1 -1
- package/apis/index.js +1 -1
- package/apis/media/zmaCamera.js +1 -1
- package/apis/package.json.js +1 -1
- package/apis/types/enum.js +1 -1
- package/browser.min.js +2 -2
- package/index.d.ts +277 -14
- 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.39.0-beta.0.tgz +0 -0
- package/apis/apis/downloadFile.js +0 -1
- package/apis/apis/getFileInfo.js +0 -1
- package/apis/apis/getSavedFileList.js +0 -1
- package/apis/apis/removeSavedFile.js +0 -1
- package/apis/apis/saveFile.js +0 -1
- package/apis/common/apis/general/getFileInfo.js +0 -1
- package/apis/common/apis/general/getSavedFileList.js +0 -1
- package/apis/common/apis/general/lfsSaveFile.js +0 -1
- package/apis/common/apis/general/media/camera.js +0 -1
- package/apis/common/apis/general/removeSavedFile.js +0 -1
- package/apis/common/apis/general/saveFile.js +0 -1
- package/apis/media/camera.js +0 -1
package/package.json
CHANGED
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
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 n from"../common/notFound.js";import{functionHandler as s}from"../utils/decorator.js";import i from"../common/apis/general/saveFile.js";import{__generator as m}from'./../external/tslib/tslib.es6.js';var u=[e({url:o.string()}).optional()];function l(r){return a.apply(this,arguments)}function a(){return a=r((function(o){return m(this,(function(e){return[2,s("downloadFile",u,[o],(l=r((function(r){var o;return m(this,(function(e){switch(e.label){case 0:return t.isMp?(o=r.url,[4,i(o)]):[3,2];case 1:return[2,e.sent()];case 2:return t.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(n("saveFile",{}))]}}))})),function(r){return l.apply(this,arguments)}))];var l}))})),a.apply(this,arguments)}export{l as downloadFile};
|
package/apis/apis/getFileInfo.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from'./../external/@swc/helpers/src/_async_to_generator.mjs.js';import t,{object as o}from'./../external/zod/lib/index.mjs.js';import r from"../appEnv/index.js";import i from"../common/notFound.js";import{functionHandler as n}from"../utils/decorator.js";import s from"../common/apis/general/getFileInfo.js";import{__generator as m}from'./../external/tslib/tslib.es6.js';var l=[o({filePath:t.string(),digestAlgorithm:t.enum(["sha1","md5"])}).optional()];function p(e){return u.apply(this,arguments)}function u(){return u=e((function(t){return m(this,(function(o){return[2,n("getFileInfo",l,[t],(p=e((function(e){return m(this,(function(t){switch(t.label){case 0:return r.isMp?[4,s(e.filePath,e.digestAlgorithm)]:[3,2];case 1:return[2,t.sent()];case 2:return r.isMpWeb?[2,Promise.resolve({size:"",digest:"",type:""})]:[2,Promise.reject(i("getFileInfo",{}))]}}))})),function(e){return p.apply(this,arguments)}))];var p}))})),u.apply(this,arguments)}export{p as getFileInfo};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from'./../external/@swc/helpers/src/_async_to_generator.mjs.js';import t from"../appEnv/index.js";import r from"../common/notFound.js";import{functionHandler as o}from"../utils/decorator.js";import s from"../common/apis/general/getSavedFileList.js";import{__generator as n}from'./../external/tslib/tslib.es6.js';function i(e){return m.apply(this,arguments)}function m(){return m=e((function(i){return n(this,(function(m){return[2,o("getSavedFileList",[],[i],(u=e((function(e){return n(this,(function(e){switch(e.label){case 0:return t.isMp?[4,s()]:[3,2];case 1:return[2,e.sent()];case 2:return t.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(r("getSavedFileList",{}))]}}))})),function(e){return u.apply(this,arguments)}))];var u}))})),m.apply(this,arguments)}export{i as getSavedFileList};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from'./../external/@swc/helpers/src/_async_to_generator.mjs.js';import r,{object as o}from'./../external/zod/lib/index.mjs.js';import t from"../appEnv/index.js";import n from"../common/notFound.js";import{functionHandler as i}from"../utils/decorator.js";import s from"../common/apis/general/removeSavedFile.js";import{__generator as m}from'./../external/tslib/tslib.es6.js';var a=[o({filePath:r.string()}).optional()];function l(e){return p.apply(this,arguments)}function p(){return p=e((function(r){return m(this,(function(o){return[2,i("removeSavedFile",a,[r],(l=e((function(e){return m(this,(function(r){switch(r.label){case 0:return t.isMp?[4,s(e.filePath)]:[3,2];case 1:return[2,r.sent()];case 2:return t.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(n("removeSavedFile",{}))]}}))})),function(e){return l.apply(this,arguments)}))];var l}))})),p.apply(this,arguments)}export{l as removeSavedFile};
|
package/apis/apis/saveFile.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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 n}from"../utils/decorator.js";import i from"../common/apis/general/lfsSaveFile.js";import{__generator as m}from'./../external/tslib/tslib.es6.js';var a=[o({filePath:e.string()}).optional()];function l(r){return p.apply(this,arguments)}function p(){return p=r((function(e){return m(this,(function(o){return[2,n("saveFile",a,[e],(l=r((function(r){var e;return m(this,(function(o){switch(o.label){case 0:return t.isMp?(e=r.filePath,[4,i(e)]):[3,2];case 1:return[2,o.sent()];case 2:return t.isMpWeb?[2,Promise.resolve()]:[2,Promise.reject(s("saveFile",{}))]}}))})),function(r){return l.apply(this,arguments)}))];var l}))})),p.apply(this,arguments)}export{l as saveFile};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from'./../../../external/@swc/helpers/src/_async_to_generator.mjs.js';import n from"../../call/index.js";import{__generator as o}from'./../../../external/tslib/tslib.es6.js';var s,e=(s=t((function(t,s){return o(this,(function(o){return[2,new Promise((function(o,e){n("LFS_FILE_INFO",{file_path:t,digest_algorithm:s},{success:function(t){o(t)},fail:function(t){e(t)}},{})}))]}))})),function(t,n){return s.apply(this,arguments)});export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from'./../../../external/@swc/helpers/src/_async_to_generator.mjs.js';import t from'./../../../external/@swc/helpers/src/_object_spread.mjs.js';import r from"../../call/index.js";import{__generator as s}from'./../../../external/tslib/tslib.es6.js';var o=e((function(){return s(this,(function(e){return[2,new Promise((function(e,s){r("LFS_LIST",{},{success:function(r){var s=r.map((function(e){var r=t({},e);try{r.filePath=r.file_path,r.createTime=r.created_time,delete r.file_path,delete r.created_time}catch(e){}return r}));e({list:s})},fail:function(e){s(e)}},{})}))]}))}));export{o as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import t from'./../../../external/@swc/helpers/src/_async_to_generator.mjs.js';import n from"../../call/index.js";import{__generator as s}from'./../../../external/tslib/tslib.es6.js';var e,o=(e=t((function(t){return s(this,(function(s){return[2,new Promise((function(s,e){n("LFS_FILE_SAVE",{file_path:t},{success:function(t){s({savedPath:t})},fail:function(t){e(t)}},{})}))]}))})),function(t){return e.apply(this,arguments)});export{o as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from'./../../../../external/@swc/helpers/src/_async_to_generator.mjs.js';import t from'./../../../../external/@swc/helpers/src/_class_call_check.mjs.js';import i from'./../../../../external/@swc/helpers/src/_create_class.mjs.js';import{MPEEmitter as n}from"../../../eventEmitter.js";import{__generator as s}from'./../../../../external/tslib/tslib.es6.js';var a="image/png",o=function(){function o(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"user",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=this;t(this,o),this.tick=function(){if(console.log("DUNGNN tick",s._userRequestFrameCallback,s.haveVideoStream()),s.haveVideoStream()&&s._userRequestFrameCallback){var e=s.getCanvas();s.drawFrame(),e?(e.toDataURL("image/png"),requestAnimationFrame(s.tick)):console.log("canvas not found")}},console.log("DUNGNN constructor",e,i,n),this._videoElement=e,this._videoElement.width=this._videoElement.width||640,this._videoElement.height=this._videoElement.height||360,this._facingMode=null!=i?i:"user",this._cameraList=[],this._streamList=[],this._selectedDeviceId="",this._canvasElement=n,this._ctx=null,this._hasUserMedia=!1,this._userRequestFrameCallback=!1,console.log("DUNGNN end const")}var r=o.prototype;return r.on=function(e,t){console.log("DUNGNN on",n,e,t)},r.off=function(e){console.log("DUNGNN off",n,e)},r.getQualityNumber=function(e){switch(e){case"high":return.8;case"normal":default:return.5;case"low":return.2}},r.getVideoInputs=function(e){var t=this;return this._cameraList=[],e.forEach((function(e){"videoinput"===e.kind&&t._cameraList.push(e)})),1==this._cameraList.length&&(this._facingMode="user"),this._cameraList},r.getMediaConstraints=function(){var e={};return""==this._selectedDeviceId?e.facingMode=this._facingMode:e.deviceId={exact:this._selectedDeviceId},e.width={exact:this._videoElement.width},e.height={exact:this._videoElement.height},{video:e,audio:!1}},r.selectCamera=function(){var e=!0,t=!1,i=void 0;try{for(var n,s=this._cameraList[Symbol.iterator]();!(e=(n=s.next()).done);e=!0){var a=n.value;if("user"==this._facingMode&&a.label.toLowerCase().includes("front")||"environment"==this._facingMode&&a.label.toLowerCase().includes("back")){this._selectedDeviceId=a.deviceId;break}}}catch(e){t=!0,i=e}finally{try{e||null==s.return||s.return()}finally{if(t)throw i}}},r.flip=function(){this._facingMode="user"==this._facingMode?"environment":"user",this._videoElement.style.transform="",this.selectCamera()},r.start=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],i=this;return e((function(){return s(this,(function(e){return[2,new Promise((function(e,n){i.stop(),navigator.mediaDevices.getUserMedia(i.getMediaConstraints()).then((function(s){console.log("DUNGNN callback stream",s),i._streamList.push(s),i.info().then((function(s){console.log("DUNGNN info",s),i.selectCamera(),t?i.stream().then((function(t){e(i._facingMode)})).catch((function(e){n(e)})):e(i._selectedDeviceId)})).catch((function(e){n(e)}))})).catch((function(e){i._hasUserMedia=!1,n(e)}))}))]}))}))()},r.info=function(){var t=this;return e((function(){return s(this,(function(e){return[2,new Promise((function(e,i){navigator.mediaDevices.enumerateDevices().then((function(i){t.getVideoInputs(i),e(t._cameraList)})).catch((function(e){i(e)}))}))]}))}))()},r.stream=function(){var t=this;return e((function(){return s(this,(function(e){return[2,new Promise((function(e,i){navigator.mediaDevices.getUserMedia(t.getMediaConstraints()).then((function(i){t._streamList.push(i),t._videoElement.srcObject=i,"user"==t._facingMode&&(t._videoElement.style.transform="scale(-1,1)"),t._videoElement.play(),t._hasUserMedia=!0,t._userRequestFrameCallback&&t.tick(),e(t._facingMode)})).catch((function(e){t._hasUserMedia=!1,i(e)}))}))]}))}))()},r.stop=function(){this._streamList.forEach((function(e){e.getTracks().forEach((function(e){e.stop()}))})),this._hasUserMedia=!1},r.takePhoto=function(e){if(!this._hasUserMedia)return null;var t=e||{};console.log("DUNGNN takePhoto",t);var i,n=this.getCanvas(t);return this.drawFrame(t),n&&n.toDataURL(null!==(i=t.format)&&void 0!==i?i:a,this.getQualityNumber(t.quality))},r.haveVideoStream=function(){var e=this._videoElement;return e&&e.videoHeight>0&&this._hasUserMedia},r.getCanvas=function(e){var t=this._videoElement,i=e||{};if(!this.haveVideoStream())return null;if(!this._ctx){var n=t.videoWidth,s=t.videoHeight;if(!i.useVideoSourceSize){var a=n/s;s=(n=i.minScreenshotWidth||t.clientWidth)/a,i.minScreenshotHeight&&s<i.minScreenshotHeight&&(n=(s=i.minScreenshotHeight)*a)}this._canvasElement=document.createElement("canvas"),this._canvasElement.width=(null==i?void 0:i.width)||n,this._canvasElement.height=(null==i?void 0:i.height)||s,this._ctx=this._canvasElement.getContext("2d")}return this._canvasElement},r.drawFrame=function(e){var t=this._videoElement,i=e||{};if(t&&this._ctx&&this._canvasElement){var n=this._canvasElement,s=this._ctx;n.width=(null==i?void 0:i.width)||n.width,n.height=(null==i?void 0:i.height)||n.height,(null==i?void 0:i.mirrored)&&(s.translate(n.width,0),s.scale(-1,1)),s.clearRect(0,0,n.width,n.height),s.drawImage(t,0,0,n.width,n.height),(null==i?void 0:i.mirrored)&&(s.scale(-1,1),s.translate(-n.width,0))}},i(o,[{key:"facingMode",get:function(){return this._facingMode},set:function(e){this._facingMode=e}},{key:"cameraList",get:function(){return this._cameraList}},{key:"cameraCount",get:function(){return this._cameraList.length}},{key:"selectedDeviceId",get:function(){return this._selectedDeviceId}}]),o}();export{o as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import n from'./../../../external/@swc/helpers/src/_async_to_generator.mjs.js';import t from"../../call/index.js";import{__generator as o}from'./../../../external/tslib/tslib.es6.js';var s,e=(s=n((function(n){return o(this,(function(o){return[2,new Promise((function(o,s){t("LFS_FILE_REMOVE",{file_path:n},{success:function(n){o(n)},fail:function(n){s(n)}},{})}))]}))})),function(n){return s.apply(this,arguments)});export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
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 e,o=(e=n((function(n){return t(this,(function(t){return[2,new Promise((function(t,e){s("SAVE_FILE",{fileUrl:n},{success:function(n){t({saved_path:n})},fail:function(n){e(n)}},{})}))]}))})),function(n){return e.apply(this,arguments)});export{o as default};
|
package/apis/media/camera.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var o;!function(o){o.VIDEO="video",o.AUDIO="audio"}(o||(o={}));export{o as StreamType};
|