@qxs-bns/utils 0.0.3 → 0.0.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qxs-bns/utils",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "main": "./index.cjs",
5
5
  "module": "./index.js",
6
6
  "types": "./types/index.d.ts",
@@ -11,9 +11,6 @@
11
11
  "require": "./index.cjs"
12
12
  }
13
13
  },
14
- "dependencies": {
15
- "axios": "^1.7.9"
16
- },
17
14
  "publishConfig": {
18
15
  "access": "public",
19
16
  "registry": "https://registry.npmjs.org/"
@@ -1 +1 @@
1
- "use strict";var h=Object.defineProperty;var y=(l,d,o)=>d in l?h(l,d,{enumerable:!0,configurable:!0,writable:!0,value:o}):l[d]=o;var w=(l,d,o)=>y(l,typeof d!="symbol"?d+"":d,o);var p=(l,d,o)=>new Promise((r,i)=>{var t=a=>{try{n(o.next(a))}catch(e){i(e)}},s=a=>{try{n(o.throw(a))}catch(e){i(e)}},n=a=>a.done?r(a.value):Promise.resolve(a.value).then(t,s);n((o=o.apply(l,d)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("../node_modules/.pnpm/ali-oss@6.22.0/node_modules/ali-oss/dist/aliyun-oss-sdk.cjs");let U;function f(){return p(this,null,function*(){window.OSS=S,yield import("../lib/aliyun-upload-sdk-1.5.6.min.js"),U=window.AliyunUpload})}class A{constructor(d){w(this,"uploader");this.initialize(d)}initialize(d){return p(this,null,function*(){if(typeof window=="undefined")throw new TypeError("VideoUploader 只能在浏览器环境中使用");U||(yield f()),this.uploader=new U.Vod({onUploadFailed:d.onUploadFailed,onUploadSucceed:d.onUploadSucceed,onUploadProgress:d.onUploadProgress,onUploadTokenExpired:d.onUploadTokenExpired||(()=>{}),onUploadstarted:o=>p(this,null,function*(){var s;const{uploadAuth:r,uploadAddress:i,videoId:t}=(yield(s=d.onUploadstarted)==null?void 0:s.call(d,o))||{};r&&i&&t&&this.uploader.setUploadAuthAndAddress(o,r,i,t)})})})}upload(d){return new Promise((o,r)=>{if(!this.uploader){r(new Error("请先调用 init 方法初始化上传器"));return}const i=JSON.stringify({Vod:{UserData:{IsShowWaterMark:"false",Priority:"7"}}});this.uploader.addFile(d,null,null,null,i),this.uploader.startUpload();const t=e=>{o({videoId:e.videoId})},s=(e,c,u)=>{r(new Error(u||"上传失败"))},n=this.uploader.onUploadSucceed,a=this.uploader.onUploadFailed;this.uploader.onUploadSucceed=e=>{t(e),n==null||n(e)},this.uploader.onUploadFailed=(e,c,u)=>{s(e,c,u),a==null||a(e,c,u)}})}}exports.VideoUploader=A;
1
+ "use strict";var h=Object.defineProperty;var y=(l,d,o)=>d in l?h(l,d,{enumerable:!0,configurable:!0,writable:!0,value:o}):l[d]=o;var w=(l,d,o)=>y(l,typeof d!="symbol"?d+"":d,o);var p=(l,d,o)=>new Promise((r,i)=>{var t=a=>{try{n(o.next(a))}catch(e){i(e)}},s=a=>{try{n(o.throw(a))}catch(e){i(e)}},n=a=>a.done?r(a.value):Promise.resolve(a.value).then(t,s);n((o=o.apply(l,d)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("../vendor/ali-oss/dist/aliyun-oss-sdk.js.cjs");let U;function f(){return p(this,null,function*(){window.OSS=S,yield import("../lib/aliyun-upload-sdk-1.5.6.min.js"),U=window.AliyunUpload})}class A{constructor(d){w(this,"uploader");this.initialize(d)}initialize(d){return p(this,null,function*(){if(typeof window=="undefined")throw new TypeError("VideoUploader 只能在浏览器环境中使用");U||(yield f()),this.uploader=new U.Vod({onUploadFailed:d.onUploadFailed,onUploadSucceed:d.onUploadSucceed,onUploadProgress:d.onUploadProgress,onUploadTokenExpired:d.onUploadTokenExpired||(()=>{}),onUploadstarted:o=>p(this,null,function*(){var s;const{uploadAuth:r,uploadAddress:i,videoId:t}=(yield(s=d.onUploadstarted)==null?void 0:s.call(d,o))||{};r&&i&&t&&this.uploader.setUploadAuthAndAddress(o,r,i,t)})})})}upload(d){return new Promise((o,r)=>{if(!this.uploader){r(new Error("请先调用 init 方法初始化上传器"));return}const i=JSON.stringify({Vod:{UserData:{IsShowWaterMark:"false",Priority:"7"}}});this.uploader.addFile(d,null,null,null,i),this.uploader.startUpload();const t=e=>{o({videoId:e.videoId})},s=(e,c,u)=>{r(new Error(u||"上传失败"))},n=this.uploader.onUploadSucceed,a=this.uploader.onUploadFailed;this.uploader.onUploadSucceed=e=>{t(e),n==null||n(e)},this.uploader.onUploadFailed=(e,c,u)=>{s(e,c,u),a==null||a(e,c,u)}})}}exports.VideoUploader=A;
@@ -17,7 +17,7 @@ var u = (l, d, o) => new Promise((r, i) => {
17
17
  }, n = (e) => e.done ? r(e.value) : Promise.resolve(e.value).then(t, s);
18
18
  n((o = o.apply(l, d)).next());
19
19
  });
20
- import S from "../node_modules/.pnpm/ali-oss@6.22.0/node_modules/ali-oss/dist/aliyun-oss-sdk.js";
20
+ import S from "../vendor/ali-oss/dist/aliyun-oss-sdk.js.js";
21
21
  let c;
22
22
  function f() {
23
23
  return u(this, null, function* () {